Commit 4e78af68 authored by jgould's avatar jgould

changed color to light blue to match selection

parent 0321103a
...@@ -38,6 +38,7 @@ morpheus.ScentedSearch = function(model, positions, isVertical, scrollbar, ...@@ -38,6 +38,7 @@ morpheus.ScentedSearch = function(model, positions, isVertical, scrollbar,
$(scrollbar.canvas).on('mousemove', mouseMove).on('mouseexit', mouseExit); $(scrollbar.canvas).on('mousemove', mouseMove).on('mouseexit', mouseExit);
}; };
morpheus.ScentedSearch.LINE_HEIGHT = 3.5;
morpheus.ScentedSearch.prototype = { morpheus.ScentedSearch.prototype = {
mouseMovedIndex : -1, mouseMovedIndex : -1,
getIndex : function(event) { getIndex : function(event) {
...@@ -50,7 +51,7 @@ morpheus.ScentedSearch.prototype = { ...@@ -50,7 +51,7 @@ morpheus.ScentedSearch.prototype = {
if (indices == null) { if (indices == null) {
return -1; return -1;
} }
var tolerance = 1.2; var tolerance = morpheus.ScentedSearch.LINE_HEIGHT;
if (this.mouseMovedIndex > 0) { if (this.mouseMovedIndex > 0) {
var midVal = this.positions var midVal = this.positions
.getPosition(indices[this.mouseMovedIndex]) .getPosition(indices[this.mouseMovedIndex])
...@@ -109,19 +110,18 @@ morpheus.ScentedSearch.prototype = { ...@@ -109,19 +110,18 @@ morpheus.ScentedSearch.prototype = {
draw : function(clip, context) { draw : function(clip, context) {
var width = this.scrollbar.getUnscaledWidth(); var width = this.scrollbar.getUnscaledWidth();
var height = this.scrollbar.getUnscaledHeight(); var height = this.scrollbar.getUnscaledHeight();
this.scale = (this.isVertical ? height : width) var availableLength = ((this.isVertical ? height : width))
- morpheus.ScentedSearch.LINE_HEIGHT;
this.scale = availableLength
/ (this.positions.getPosition(this.positions.getLength() - 1) + this.positions / (this.positions.getPosition(this.positions.getLength() - 1) + this.positions
.getItemSize(this.positions.getLength() - 1)); .getItemSize(this.positions.getLength() - 1));
var innerColor = '#FFDD00'; context.strokeStyle = 'rgb(106,137,177)';
var outerColor = '#CCAA00'; context.fillStyle = 'rgb(182,213,253)';
context.strokeStyle = outerColor;
context.fillStyle = innerColor;
context.lineWidth = 1; context.lineWidth = 1;
this.drawIndices(context, this.searchIndices); this.drawIndices(context, this.searchIndices);
this.drawHoverIndices(context); this.drawHoverMatchingValues(context);
}, },
drawHoverMatchingValues : function(context) {
drawHoverIndices : function(context) {
var heatmap = this.controller; var heatmap = this.controller;
context.fillStyle = 'black'; context.fillStyle = 'black';
if (heatmap.mousePositionOptions if (heatmap.mousePositionOptions
...@@ -174,9 +174,11 @@ morpheus.ScentedSearch.prototype = { ...@@ -174,9 +174,11 @@ morpheus.ScentedSearch.prototype = {
} }
var pix = positions.getPosition(index) * scale; var pix = positions.getPosition(index) * scale;
if (isVertical) { if (isVertical) {
context.fillRect(0, pix, lineLength, 2); context.fillRect(0, pix, lineLength,
morpheus.ScentedSearch.LINE_HEIGHT);
} else { } else {
context.fillRect(pix, 0, 2, lineLength); context.fillRect(pix, 0,
morpheus.ScentedSearch.LINE_HEIGHT, lineLength);
} }
} }
...@@ -188,18 +190,25 @@ morpheus.ScentedSearch.prototype = { ...@@ -188,18 +190,25 @@ morpheus.ScentedSearch.prototype = {
var scale = this.scale; var scale = this.scale;
var lineLength = !this.isVertical ? this.scrollbar.getUnscaledHeight() var lineLength = !this.isVertical ? this.scrollbar.getUnscaledHeight()
: this.scrollbar.getUnscaledWidth(); : this.scrollbar.getUnscaledWidth();
var isVertical = this.isVertical; var isVertical = this.isVertical;
var positions = this.positions; var positions = this.positions;
for (var i = 0, length = highlightedIndices.length; i < length; i++) { for (var i = 0, length = highlightedIndices.length; i < length; i++) {
var index = highlightedIndices[i]; var index = highlightedIndices[i];
var pix = positions.getPosition(index) * scale; var pix = positions.getPosition(index) * scale;
if (isVertical) { if (isVertical) {
context.fillRect(0, pix, lineLength, 2); context.beginPath();
context.strokeRect(0, pix, lineLength, 2); context.rect(0, pix, lineLength,
morpheus.ScentedSearch.LINE_HEIGHT);
context.fill();
context.stroke();
} else { } else {
context.fillRect(pix, 0, 2, lineLength); context.beginPath();
context.strokeRect(pix, 0, 2, lineLength); context.rect(pix, 0, morpheus.ScentedSearch.LINE_HEIGHT,
lineLength);
context.fill();
context.stroke();
} }
} }
......
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