@krainovsd/graph 0.10.0-rc6 → 0.10.0-rc8

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
@@ -30,7 +30,6 @@ const FORCE_SETTINGS = {
30
30
  collideIterations: 2,
31
31
  collideOffMax: { links: 0, nodes: 0 },
32
32
  chargeStrength: -40,
33
- chargeDistanceMax: Infinity,
34
33
  chargeDistanceMin: 1,
35
34
  xPosition: 0,
36
35
  xStrength: 0.1,
@@ -1212,6 +1211,10 @@ function getDrawLink() {
1212
1211
  !link.target.x ||
1213
1212
  !link.target.y)
1214
1213
  return;
1214
+ if ((link.visible != undefined && !link.visible) ||
1215
+ (link.source.visible != undefined && !link.source.visible) ||
1216
+ (link.target.visible != undefined && !link.target.visible))
1217
+ return;
1215
1218
  if (!link.source._visible && !link.target._visible)
1216
1219
  return;
1217
1220
  const id = `${link.target.id}${link.source.id}`;
@@ -1501,6 +1504,8 @@ function getDrawNode(nodeRenders, textRenders) {
1501
1504
  return function drawNode(node, index) {
1502
1505
  if (!this.context || !node.x || !node.y)
1503
1506
  return;
1507
+ if (node.visible != undefined && !node.visible)
1508
+ return;
1504
1509
  let nodeOptions;
1505
1510
  if (this.nodeSettings.cacheOptions && this.nodeOptionsCache[node.id]) {
1506
1511
  nodeOptions = this.nodeOptionsCache[node.id];
@@ -2297,7 +2302,7 @@ function initSimulationForces() {
2297
2302
  if (this.forceSettings.forces && this.forceSettings.chargeForce) {
2298
2303
  this.simulation.force("charge", d3Force.forceManyBody()
2299
2304
  .strength(this.forceSettings.chargeStrength)
2300
- .distanceMax(this.forceSettings.chargeDistanceMax)
2305
+ .distanceMax(Infinity)
2301
2306
  .distanceMin(this.forceSettings.chargeDistanceMin));
2302
2307
  }
2303
2308
  if (this.forceSettings.forces && this.forceSettings.centerForce) {