Closed tomvaillant closed 1 month ago
the reason why it's re-rendering is because this statement will re-run every time a variable within it changes
So since step
is changing, it's re-running stepHandler and generating a new array for newValues
that's identical to the one before it.
we can probably debug this later, but my gut is that you pre-render/calculate everything at the start and then store those positions somewhere, passing them to the components as neccessary.
This sounds like a larger structural change, happy to wait until later to look into it!
I'm currently running the step logic in Index.svelte, calling a specific function containing this logic as a prop in the corresponding Section component lower down.
I'd like to avoid the force simulation re-rendering and re-positioning circles if the renderedData values do not change.