Commit bb900664 authored by Joshua Gould's avatar Joshua Gould

fixed display when no options are specified

parent 987d95c1
This diff is collapsed.
...@@ -329,7 +329,7 @@ morpheus.Grid.prototype = { ...@@ -329,7 +329,7 @@ morpheus.Grid.prototype = {
var gridWidth = this.options.$el.width() - 30; var gridWidth = this.options.$el.width() - 30;
var maxWidth = Math.min(parseInt(gridWidth / 2), 400); var maxWidth = Math.min(parseInt(gridWidth / 2), 400);
var getColumnWidth = function (column) { var getColumnWidth = function (column) {
var w = $header.html(column.name).outerWidth() + 12; var w = $header.html(column.name).outerWidth() + 13; // leave space for sort indicator
if (column.prototypeValue) { if (column.prototypeValue) {
$cell.html(column.prototypeValue); $cell.html(column.prototypeValue);
......
...@@ -1411,7 +1411,6 @@ morpheus.HeatMap.prototype = { ...@@ -1411,7 +1411,6 @@ morpheus.HeatMap.prototype = {
: dataset.getRowMetadata(); : dataset.getRowMetadata();
// see if default fields found // see if default fields found
if (!displaySpecified) { if (!displaySpecified) {
var defaultFieldsToShow = new morpheus.Set(); var defaultFieldsToShow = new morpheus.Set();
['pert_iname', 'moa', 'target', 'description'] ['pert_iname', 'moa', 'target', 'description']
.forEach(function (field) { .forEach(function (field) {
...@@ -1424,10 +1423,10 @@ morpheus.HeatMap.prototype = { ...@@ -1424,10 +1423,10 @@ morpheus.HeatMap.prototype = {
nameToOption.set(v.getName(), { nameToOption.set(v.getName(), {
display: 'text' display: 'text'
}); });
displaySpecified = true;
} }
} }
displaySpecified = true;
} }
var isFirst = true; var isFirst = true;
...@@ -2979,7 +2978,7 @@ morpheus.HeatMap.prototype = { ...@@ -2979,7 +2978,7 @@ morpheus.HeatMap.prototype = {
var legendHeight = this.heatmap.getColorScheme().getNames() != null ? this.heatmap var legendHeight = this.heatmap.getColorScheme().getNames() != null ? this.heatmap
.getColorScheme().getNames().length * 14 .getColorScheme().getNames().length * 14
: 40; : 40;
totalSize.height += legendHeight; totalSize.height += legendHeight + morpheus.HeatMap.SPACE_BETWEEN_HEAT_MAP_AND_ANNOTATIONS;
} }
var trackLegendSize = new morpheus.HeatMapTrackColorLegend( var trackLegendSize = new morpheus.HeatMapTrackColorLegend(
_ _
...@@ -3005,8 +3004,8 @@ morpheus.HeatMap.prototype = { ...@@ -3005,8 +3004,8 @@ morpheus.HeatMap.prototype = {
.isRenderAs(morpheus.VectorTrack.RENDER.TEXT_AND_COLOR)); .isRenderAs(morpheus.VectorTrack.RENDER.TEXT_AND_COLOR));
}), this.getProject().getRowColorModel()) }), this.getProject().getRowColorModel())
.getPreferredSize(); .getPreferredSize();
totalSize.height += trackLegendSize.height; totalSize.height += morpheus.HeatMap.SPACE_BETWEEN_HEAT_MAP_AND_ANNOTATIONS + trackLegendSize.height;
totalSize.width = 10 + Math.max(totalSize.width, trackLegendSize.width); totalSize.width = morpheus.HeatMap.SPACE_BETWEEN_HEAT_MAP_AND_ANNOTATIONS + Math.max(totalSize.width, trackLegendSize.width);
return totalSize; return totalSize;
} }
, ,
...@@ -3067,10 +3066,12 @@ morpheus.HeatMap.prototype = { ...@@ -3067,10 +3066,12 @@ morpheus.HeatMap.prototype = {
columnTrackLegendSize.height); columnTrackLegendSize.height);
var heatmapY = this.isDendrogramVisible(true) ? this.columnDendrogram var heatmapY = this.isDendrogramVisible(true) ? this.columnDendrogram
.getUnscaledHeight() : 0; .getUnscaledHeight() : 0;
heatmapY += legendHeight + 10; // 10 pixels after track if (legendHeight > 0) {
heatmapY += legendHeight + morpheus.HeatMap.SPACE_BETWEEN_HEAT_MAP_AND_ANNOTATIONS;
}
var columnTrackY = heatmapY;
var heatmapX = this.isDendrogramVisible(false) ? this.rowDendrogram var heatmapX = this.isDendrogramVisible(false) ? this.rowDendrogram
.getUnscaledWidth() : 0; .getUnscaledWidth() : 0;
var totalColumnTrackHeight = 0;
for (var i = 0, length = this.columnTracks.length; i < length; i++) { for (var i = 0, length = this.columnTracks.length; i < length; i++) {
var track = this.columnTracks[i]; var track = this.columnTracks[i];
if (track.isVisible()) { if (track.isVisible()) {
...@@ -3078,10 +3079,9 @@ morpheus.HeatMap.prototype = { ...@@ -3078,10 +3079,9 @@ morpheus.HeatMap.prototype = {
heatmapX = Math.max(heatmapX, header.getPrintSize().width); heatmapX = Math.max(heatmapX, header.getPrintSize().width);
var height = track.getPrintSize().height; var height = track.getPrintSize().height;
heatmapY += height; heatmapY += height;
totalColumnTrackHeight += height;
} }
} }
heatmapX += 10; // space between column track header and heat map
for (var i = 0, length = this.rowTracks.length; i < length; i++) { for (var i = 0, length = this.rowTracks.length; i < length; i++) {
var track = this.rowTracks[i]; var track = this.rowTracks[i];
if (track.isVisible()) { if (track.isVisible()) {
...@@ -3115,14 +3115,12 @@ morpheus.HeatMap.prototype = { ...@@ -3115,14 +3115,12 @@ morpheus.HeatMap.prototype = {
this.columnDendrogram.draw(columnDendrogramClip, context); this.columnDendrogram.draw(columnDendrogramClip, context);
context.restore(); context.restore();
} }
var columnTrackY = heatmapY - 10 - totalColumnTrackHeight;
for (var i = 0, length = this.columnTracks.length; i < length; i++) { for (var i = 0, length = this.columnTracks.length; i < length; i++) {
var track = this.columnTracks[i]; var track = this.columnTracks[i];
if (track.isVisible()) { if (track.isVisible()) {
context.save(); context.save();
var tx = heatmapX; context.translate(heatmapX, columnTrackY);
context.translate(tx, columnTrackY);
var trackClip = { var trackClip = {
x: 0, x: 0,
y: 0, y: 0,
...@@ -3142,7 +3140,7 @@ morpheus.HeatMap.prototype = { ...@@ -3142,7 +3140,7 @@ morpheus.HeatMap.prototype = {
width: headerSize.width, width: headerSize.width,
height: headerSize.height height: headerSize.height
}; };
context.translate(tx - 10, columnTrackY + trackClip.height); context.translate(heatmapX - 10, columnTrackY + trackClip.height);
header.print(headerClip, context); header.print(headerClip, context);
context.restore(); context.restore();
columnTrackY += Math.max(headerClip.height, trackClip.height); columnTrackY += Math.max(headerClip.height, trackClip.height);
...@@ -3157,12 +3155,12 @@ morpheus.HeatMap.prototype = { ...@@ -3157,12 +3155,12 @@ morpheus.HeatMap.prototype = {
height: heatmapPrefSize.height height: heatmapPrefSize.height
}, context); }, context);
context.restore(); context.restore();
var sum = 0; var rowTrackWidthSum = 0;
for (var i = 0, length = this.rowTracks.length; i < length; i++) { for (var i = 0, length = this.rowTracks.length; i < length; i++) {
var track = this.rowTracks[i]; var track = this.rowTracks[i];
if (track.isVisible()) { if (track.isVisible()) {
context.save(); context.save();
var tx = 10 + heatmapX + heatmapPrefSize.width + sum; var tx = morpheus.HeatMap.SPACE_BETWEEN_HEAT_MAP_AND_ANNOTATIONS + heatmapX + heatmapPrefSize.width + rowTrackWidthSum;
var ty = heatmapY; var ty = heatmapY;
var trackClip = { var trackClip = {
x: 0, x: 0,
...@@ -3192,7 +3190,7 @@ morpheus.HeatMap.prototype = { ...@@ -3192,7 +3190,7 @@ morpheus.HeatMap.prototype = {
context.translate(tx, ty - 4); context.translate(tx, ty - 4);
header.print(headerClip, context); header.print(headerClip, context);
context.restore(); context.restore();
sum += Math.max(headerSize.width, trackClip.width); rowTrackWidthSum += Math.max(headerSize.width, trackClip.width);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment