From f69c94297de4168175d02e9ead985b7420cb0bfc Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Sat, 16 Oct 2021 22:41:27 +0200 Subject: feat(labels): better defaults --- components/Tweaks/NodesNLinksPanel.tsx | 2 +- components/Tweaks/PhysicsPanel.tsx | 56 +++++++++++++++++----------------- components/config.ts | 8 ++--- 3 files changed, 33 insertions(+), 33 deletions(-) (limited to 'components') diff --git a/components/Tweaks/NodesNLinksPanel.tsx b/components/Tweaks/NodesNLinksPanel.tsx index dba927c..3321ae3 100644 --- a/components/Tweaks/NodesNLinksPanel.tsx +++ b/components/Tweaks/NodesNLinksPanel.tsx @@ -28,7 +28,7 @@ export const NodesNLinksPanel = (props: NodesNLinksPanelProps) => { onChange={(value) => setVisuals({ ...visuals, nodeRel: value })} /> { onChange={(v) => setPhysicsCallback(v, 'charge', -1 / 100)} label="Repulsive Force" /> - setPhysics({ ...physics, collision: !physics.collision })} - > - setPhysicsCallback(v, 'collisionStrength', 1 / 5)} - label="Collision Radius" - infoText="Easy with this one, high values can lead to a real jiggly mess" - /> - setPhysicsCallback(v, 'linkStrength', 5)} label="Link Force" /> setPhysicsCallback(v, 'linkIts', 1)} - min={0} - max={6} - step={1} - infoText="How many links down the line the physics of a single node affects (Slow)" - /> - setPhysicsCallback(v, 'velocityDecay', 10)} + label="Stabilization rate" + value={physics.alphaDecay * 50} + onChange={(v) => setPhysicsCallback(v, 'alphaDecay', 50)} /> @@ -114,10 +92,32 @@ export const PhysicsPanel = (props: PhysicsPanelProps) => { paddingLeft={3} color="gray.800" > + setPhysics({ ...physics, collision: !physics.collision })} + > + setPhysicsCallback(v, 'collisionStrength', 1 / 5)} + label="Collision Radius" + infoText="Easy with this one, high values can lead to a real jiggly mess" + /> + + setPhysicsCallback(v, 'linkIts', 1)} + min={0} + max={6} + step={1} + infoText="How many links down the line the physics of a single node affects (Slow)" + /> setPhysicsCallback(v, 'alphaDecay', 50)} + label="Viscosity" + value={physics.velocityDecay * 10} + onChange={(v) => setPhysicsCallback(v, 'velocityDecay', 10)} />