Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Commit

Permalink
Fix missing reference to Graph3D instance in DataGroup (#3255)
Browse files Browse the repository at this point in the history
* Fix missing reference to Graph3D instance in DataGroup

Fix for #3251

A reference was missed in DataGroup.reload() during refactoring.
Rather than fix this method, it has been removed and the logic moved to `Graph3d`.
This makes for somewhat cleaner code.

* Fixes due to review
  • Loading branch information
wimrijnders authored and yotamberk committed Jul 16, 2017
1 parent 843eb44 commit 979b53a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
10 changes: 0 additions & 10 deletions lib/graph3d/DataGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,4 @@ DataGroup.prototype.getDataSet = function() {
};


/**
* Reload the data
*/
DataGroup.prototype.reload = function() {
if (this.dataTable) {
this.setData(this.dataTable);
}
};


module.exports = DataGroup;
9 changes: 4 additions & 5 deletions lib/graph3d/Graph3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ function Graph3d(container, data, options) {
this.setOptions(options);

// apply data
if (data) {
this.setData(data);
}
this.setData(data);
}

// Extend Graph3d with an Emitter mixin
Expand Down Expand Up @@ -677,6 +675,8 @@ Graph3d.prototype._readData = function(data) {
* @param {Array | DataSet | DataView} data
*/
Graph3d.prototype.setData = function (data) {
if (data === undefined || data === null) return;

this._readData(data);
this.redraw();

Expand All @@ -701,8 +701,7 @@ Graph3d.prototype.setOptions = function (options) {
this.setPointDrawingMethod();
this._setSize(this.width, this.height);

// re-load the data
this.dataGroup.reload();
this.setData(this.dataGroup.getDataTable());

// start animation when option is true
if (this.animationAutoStart && this.dataFilter) {
Expand Down

0 comments on commit 979b53a

Please sign in to comment.