summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/config.ts4
-rw-r--r--components/tweaks.tsx32
2 files changed, 23 insertions, 13 deletions
diff --git a/components/config.ts b/components/config.ts
index 3331288..d6c2296 100644
--- a/components/config.ts
+++ b/components/config.ts
@@ -16,7 +16,9 @@ export const initialPhysics = {
enabled: true,
charge: -350,
collision: true,
- collisionStrength: 0,
+ collisionStrength: 20,
+ centering: true,
+ centeringStrength: 0.05,
linkStrength: 0.1,
linkIts: 1,
particles: false,
diff --git a/components/tweaks.tsx b/components/tweaks.tsx
index bfb932c..f9c58a1 100644
--- a/components/tweaks.tsx
+++ b/components/tweaks.tsx
@@ -207,11 +207,12 @@ export const Tweaks = (props: TweakProps) => {
onChange={() => setPhysics({ ...physics, collision: !physics.collision })}
>
<SliderWithInfo
- value={physics.collisionStrength * 10}
+ value={physics.collisionStrength / 5}
onChange={(value) =>
- setPhysics({ ...physics, collisionStrength: value / 10 })
+ setPhysics({ ...physics, collisionStrength: value * 5 })
}
- label="Strength"
+ label="Collision Radius"
+ infoText="Easy with this one, high values can lead to a real jiggly mess"
/>
</EnableSection>
<SliderWithInfo
@@ -251,21 +252,28 @@ export const Tweaks = (props: TweakProps) => {
color="gray.800"
>
<SliderWithInfo
- label="Iterations per tick"
- min={1}
- max={10}
- step={1}
- value={physics.iterations}
- onChange={(v) => setPhysics({ ...physics, iterations: v })}
- infoText="Number of times the physics simulation iterates per simulation step"
- />
- <SliderWithInfo
label="Stabilization rate"
value={physics.alphaDecay * 50}
onChange={(value) =>
setPhysics({ ...physics, alphaDecay: value / 50 })
}
/>
+ <EnableSection
+ label="Keeps nodes centered"
+ value={physics.centering}
+ onChange={() =>
+ setPhysics({ ...physics, centering: !physics.centering })
+ }
+ infoText="Keeps the nodes in the center of the viewport. If disabled you can drag the nodes anywhere you want."
+ >
+ <SliderWithInfo
+ label="Centering Strength"
+ value={physics.centeringStrength}
+ max={2}
+ step={0.1}
+ onChange={(v) => setPhysics({ ...physics, centeringStrength: v })}
+ />
+ </EnableSection>
</VStack>
</AccordionPanel>
</AccordionItem>