Browse Source

fixed graph2d not updating on animation correctly

v3_develop
Alex de Mulder 9 years ago
parent
commit
ac74e826b0
3 changed files with 26192 additions and 26190 deletions
  1. +26188
    -26187
      dist/vis.js
  2. +1
    -1
      examples/graph2d/01_basic.html
  3. +3
    -2
      lib/timeline/component/LineGraph.js

+ 26188
- 26187
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
examples/graph2d/01_basic.html View File

@ -47,7 +47,7 @@
end: '2014-06-18'
};
var graph2d = new vis.Graph2d(container, dataset, options);
graph2d.fit();
</script>
</body>
</html>

+ 3
- 2
lib/timeline/component/LineGraph.js View File

@ -549,7 +549,7 @@ LineGraph.prototype.redraw = function(forceGraphUpdate) {
resized = this._isResized() || resized;
// check whether zoomed (in that case we need to re-stack everything)
var visibleInterval = this.body.range.end - this.body.range.start;
//var zoomed = (visibleInterval != this.lastVisibleInterval) || (this.width != this.lastWidth); // we get this from the range changed event
var zoomed = (visibleInterval != this.lastVisibleInterval) || (this.width != this.lastWidth); // we get this from the range changed event
this.lastVisibleInterval = visibleInterval;
this.lastWidth = this.width;
@ -563,7 +563,8 @@ LineGraph.prototype.redraw = function(forceGraphUpdate) {
this.svg.style.left = util.option.asSize(-this.width);
}
if (this.abortedGraphUpdate == true || forceGraphUpdate == true) {
// zoomed is here to ensure that animations are shown correctly.
if (zoomed == true || this.abortedGraphUpdate == true || forceGraphUpdate == true) {
resized = resized || this._updateGraph();
}
else {

Loading…
Cancel
Save