vasturiano / force-graph

Force-directed graph rendered on HTML5 canvas
https://vasturiano.github.io/force-graph/example/directional-links-particles/
MIT License
1.55k stars 246 forks source link

Conditional in linkDirectionalParticles does not use correct return value #341

Open kohlerpop1 opened 9 months ago

kohlerpop1 commented 9 months ago

Describe the bug Conditional in linkDirectionalParticles seems to be using the first return value for all nodes instead of the return value within the specific conditional.

To Reproduce Steps to reproduce the behavior:

  1. Create linkDirectionalParticles conditional that evaluates to false first/once, returning 1.
  2. Have conditional return > 1 for other nodes.

Expected behavior It should used the returned value for each link to determine how many particles are on it at each time.

Screenshots image This is confirmed to be false on the first conditional and true on some others.

Desktop (please complete the following information): image

Smartphone (please complete the following information): NA - Not tested!

Disclaimer: I did check out Dynamically Update linkDirectionalParticles and this does not seem to be exactly what I am trying to do.

vasturiano commented 8 months ago

@kohlerpop1 thanks for reaching out.

I'm unable to reproduce your issue. Also because I don't have insight into your data. In my case it does respect the return value of the linkDirectionalParticles method for each independent link.

If you're still having issues, could you make a simple reproducing example on https://codepen.io/ ?