@krainovsd/graph 0.14.0-beta.2 → 0.14.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.cjs CHANGED
@@ -2900,16 +2900,16 @@ class GraphCanvas {
2900
2900
  }
2901
2901
  this.animateZoom(area, target, this.areaTransform, duration);
2902
2902
  };
2903
- changeData = (options, alpha = 0.5, clearCache = true) => {
2903
+ changeData = (options, alpha = 0.5, clearCache = true, precompute = false) => {
2904
2904
  if (options.links != undefined)
2905
2905
  this.links = options.links;
2906
2906
  if (options.nodes != undefined)
2907
2907
  this.nodes = options.nodes;
2908
2908
  if (options.nodes != undefined || options.links != undefined) {
2909
- this.updateData(alpha, clearCache);
2909
+ this.updateData(alpha, clearCache, precompute);
2910
2910
  }
2911
2911
  };
2912
- changeSettings = (options, clearCache = true) => {
2912
+ changeSettings = (options, clearCache = true, precompute = false) => {
2913
2913
  if (options.graphSettings) {
2914
2914
  this.graphSettings = graphSettingsGetter(options.graphSettings, this.graphSettings);
2915
2915
  this.draw = initDraw.call(this);
@@ -2956,7 +2956,7 @@ class GraphCanvas {
2956
2956
  initCollideForce.call(this, true);
2957
2957
  }
2958
2958
  if (options.forceSettings) {
2959
- return void this.updateSimulation();
2959
+ return void this.updateSimulation(precompute);
2960
2960
  }
2961
2961
  this.tick();
2962
2962
  };
@@ -3085,10 +3085,10 @@ class GraphCanvas {
3085
3085
  this.eventAbortController.abort();
3086
3086
  this.eventAbortController = new AbortController();
3087
3087
  };
3088
- updateSimulation = () => {
3088
+ updateSimulation = (precompute = false) => {
3089
3089
  if (this.simulation) {
3090
3090
  initSimulationForces.call(this);
3091
- this.restart(1);
3091
+ this.restart(1, { precompute });
3092
3092
  }
3093
3093
  };
3094
3094
  clearState = () => {
@@ -3114,7 +3114,7 @@ class GraphCanvas {
3114
3114
  updateLinkCache.call(this);
3115
3115
  this.tick();
3116
3116
  };
3117
- updateData = (alpha = 0.5, clearCache = true) => {
3117
+ updateData = (alpha = 0.5, clearCache = true, precompute = false) => {
3118
3118
  if (clearCache) {
3119
3119
  this.clearCache(clearCache);
3120
3120
  }
@@ -3131,7 +3131,7 @@ class GraphCanvas {
3131
3131
  .iterations(this.forceSettings.forces && this.forceSettings.linkForce
3132
3132
  ? this.forceSettings.linkIterations
3133
3133
  : 0));
3134
- this.restart(alpha);
3134
+ this.restart(alpha, { precompute });
3135
3135
  initZoom.call(this, this.areaTransform);
3136
3136
  }
3137
3137
  };