I’m trying to make an example of a a draggable circle with D3 where users can directly drag on the svg circle, or they can use 2 Input sliders to set the x and y position of the circle.
Example code here:
I’m having trouble synchronizing the sliders values with the directly dragged position.
In the version published at the link above dragging the circle directly does update the sliders, but the values of viewof centX.value and centX don’t match the sliders even after manually refreshing them. It is easy to get ‘viewof centX.value’ and centX to produce different results after multiple drags.
Commenting in the Input Dispatches makes it so the y position of hte circle jumps when the drag is started.