Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,14 @@
<input id="showactive" type="checkbox" />
Active
</label>
<div style="float:right {% if tiledImage %}; color:#bbb{%endif%}"
{% if tiledImage or share %}
<div style="float:right {% if share %}; color:#bbb{%endif%}"
{% if share %}
title="Histogram not supported for tiled images or in share"
{%else%}
title="Show histogram of pixel intensities for selected channel"
{% endif %} >
<!-- histogram (not supported for Big images) -->
<input id="showhistogram" type="checkbox" {% if tiledImage or share %}disabled{% endif %}/>
<input id="showhistogram" type="checkbox" {% if share %}disabled{% endif %}/>
<label for="showhistogram">Show Histogram</label>
</div>
<div id="histogram" style="display:none; width: 100%; height: 125px; background:white; border: solid #ccc 1px; margin-bottom: 6px"></div>
Expand Down
4 changes: 4 additions & 0 deletions omeroweb/webgateway/static/webgateway/js/ome.histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ window.OME.Histogram = function(element, webgatewayUrl, graphWidth, graphHeight)
url += "&p=" + proj;
}
$.getJSON(url, function(data){
if (data.error) {
alert("Error loading histogram: " + data.error);
return;
}
plotJson(data.data, color);
this.plotStartEnd(window, color);
}.bind(this));
Expand Down
4 changes: 1 addition & 3 deletions omeroweb/webgateway/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2908,9 +2908,7 @@ def histogram_json(request, iid, theC, conn=None, **kwargs):
except omero.ApiUsageException as ex:
logger.warn(ex)
resObj = {"error": ex.message}
return HttpResponseBadRequest(
json.dumps(resObj), content_type="application/json"
)
return JsonResponse(resObj, content_type="application/json")
return JsonResponse({"data": histogram})


Expand Down
Loading