-
-
Notifications
You must be signed in to change notification settings - Fork 31
fix(graph): widen the flow-speed slider range and stop at zero in the compat engine #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9320,10 +9320,17 @@ | |
| fg.linkDirectionalArrowLength(dense ? 0 : 0.625).linkDirectionalArrowRelPos(1); | ||
| applyLinkLabels(); | ||
| if (fg.linkDirectionalParticles) { | ||
| const flowSpeed = Number(state.settings.flowSpeed); | ||
| /* flowSpeed=0 means "stop" — particles must not render at all. The every-node engine | ||
| already enforces this via a `moving = speed > 0` check; the compat engine must do | ||
| the same. Otherwise the slider visibly does nothing at the low end (particles keep | ||
| crawling at the residual 0.002 floor). */ | ||
| const flowActive = Number.isFinite(flowSpeed) ? flowSpeed > 0 : true; | ||
| const flowing = !fullGraph | ||
| && state.settings.flow !== false | ||
| && motion | ||
| && !reducedMotion | ||
| && flowActive | ||
| && data.links.length <= PARTICLE_LINK_LIMIT; | ||
| const particles = !flowing | ||
| ? 0 | ||
|
|
@@ -9332,7 +9339,10 @@ | |
| .linkDirectionalParticleWidth(1) | ||
| .linkDirectionalParticleCanvasObject(paintFlowArrow) | ||
| .linkDirectionalParticleColor(l => alpha(layerColor(l.layer), 0.95)) | ||
| .linkDirectionalParticleSpeed(l => 0.002 + ((state.settings.flowSpeed || 45) / 100) * 0.008); | ||
| /* Widened from `0.002 + (flowSpeed/100)*0.008` (a 5x range, 0.002..0.01) to | ||
| `0.0005 + (flowSpeed/100)*0.025` (a ~34x range, 0.00075..0.0255) so the slider | ||
| is visibly responsive end-to-end. */ | ||
| .linkDirectionalParticleSpeed(l => flowActive ? (0.0005 + (flowSpeed / 100) * 0.025) : 0); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a standalone caller uses the exported Useful? React with 👍 / 👎. |
||
| } | ||
| if (!galaxyMode && reheat && motion && !staticFullLayout && !state.settings.frozen) { | ||
| prepareReheat(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the dashboard, visible slider values 1 through 22 are transformed to an engine value of 0 by
ledger.js:2453-2462, because the 2x response is centered at 45 and clamped at the minimum. This new guard therefore removes particles throughout roughly the lower quarter of the control, not just when the user selects zero, making that portion of the slider inert. The zero-stop decision needs to preserve the visible endpoint separately or avoid applying the centered response mapping to flow speed.Useful? React with 👍 / 👎.