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

Fix missing reference to Graph3D instance in DataGroup #3255

Merged
merged 3 commits into from
Jul 16, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
8 changes: 4 additions & 4 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 @@ -702,7 +702,7 @@ Graph3d.prototype.setOptions = function (options) {
this._setSize(this.width, this.height);

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab vs space?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space of course. Spaces rule!


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