|
@ -121,17 +121,6 @@ function LineGraph(body, options) { |
|
|
this.setOptions(options); |
|
|
this.setOptions(options); |
|
|
this.groupsUsingDefaultStyles = [0]; |
|
|
this.groupsUsingDefaultStyles = [0]; |
|
|
|
|
|
|
|
|
this.body.emitter.on("rangechange",function() { |
|
|
|
|
|
if (me.lastStart != 0) { |
|
|
|
|
|
var offset = me.body.range.start - me.lastStart; |
|
|
|
|
|
var range = me.body.range.end - me.body.range.start; |
|
|
|
|
|
if (me.width != 0) { |
|
|
|
|
|
var rangePerPixelInv = me.width/range; |
|
|
|
|
|
var xOffset = offset * rangePerPixelInv; |
|
|
|
|
|
me.svg.style.left = (-me.width - xOffset) + "px"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
this.body.emitter.on("rangechanged", function() { |
|
|
this.body.emitter.on("rangechanged", function() { |
|
|
me.lastStart = me.body.range.start; |
|
|
me.lastStart = me.body.range.start; |
|
|
me.svg.style.left = util.option.asSize(-me.width); |
|
|
me.svg.style.left = util.option.asSize(-me.width); |
|
@ -502,6 +491,7 @@ LineGraph.prototype._updateUngrouped = function() { |
|
|
* @return {boolean} Returns true if the component is resized |
|
|
* @return {boolean} Returns true if the component is resized |
|
|
*/ |
|
|
*/ |
|
|
LineGraph.prototype.redraw = function() { |
|
|
LineGraph.prototype.redraw = function() { |
|
|
|
|
|
console.log('redraw') |
|
|
var resized = false; |
|
|
var resized = false; |
|
|
|
|
|
|
|
|
this.svg.style.height = ('' + this.options.graphHeight).replace('px','') + 'px'; |
|
|
this.svg.style.height = ('' + this.options.graphHeight).replace('px','') + 'px'; |
|
@ -525,9 +515,23 @@ LineGraph.prototype.redraw = function() { |
|
|
this.svg.style.width = util.option.asSize(3*this.width); |
|
|
this.svg.style.width = util.option.asSize(3*this.width); |
|
|
this.svg.style.left = util.option.asSize(-this.width); |
|
|
this.svg.style.left = util.option.asSize(-this.width); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (zoomed == true || this.abortedGraphUpdate == true) { |
|
|
if (zoomed == true || this.abortedGraphUpdate == true) { |
|
|
this._updateGraph(); |
|
|
this._updateGraph(); |
|
|
} |
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
// move the whole svg while dragging
|
|
|
|
|
|
if (this.lastStart != 0) { |
|
|
|
|
|
var offset = this.body.range.start - this.lastStart; |
|
|
|
|
|
var range = this.body.range.end - this.body.range.start; |
|
|
|
|
|
if (this.width != 0) { |
|
|
|
|
|
var rangePerPixelInv = this.width/range; |
|
|
|
|
|
var xOffset = offset * rangePerPixelInv; |
|
|
|
|
|
this.svg.style.left = (-this.width - xOffset) + "px"; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.legendLeft.redraw(); |
|
|
this.legendLeft.redraw(); |
|
|
this.legendRight.redraw(); |
|
|
this.legendRight.redraw(); |
|
|