Browse Source

Fix missing reference to Graph3D instance in DataGroup (#3255)

* 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
revert-3409-performance
wimrijnders 7 years ago
committed by yotamberk
parent
commit
979b53a16f
2 changed files with 4 additions and 15 deletions
  1. +0
    -10
      lib/graph3d/DataGroup.js
  2. +4
    -5
      lib/graph3d/Graph3d.js

+ 0
- 10
lib/graph3d/DataGroup.js View File

@ -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;

+ 4
- 5
lib/graph3d/Graph3d.js View File

@ -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
@ -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();
@ -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) {

Loading…
Cancel
Save