lucid
lucid copied to clipboard
Make a new component for a draggable line chart
Utilize some d3 functionality to have a line chart where the points are draggable and the lines will update in real-time.
This seems good to me. Are you planning on making a variant of the LineChart
? I'd be curious to see how you're thinking of designing the props roughly. Would a callback fire when the user moves the data?
I also threw this together a few weeks back that should help you see how it could be done: https://codesandbox.io/s/example-line-chart-with-mouse-handler-h70hy
@jondlm we had talked about using a variant of LineChart
but I believe Lance recommended a completely new component, I will confirm with him, however. ~~A callback would fire to adjust the d3 data object/path svg object, yeah.~~ (I should be a bit more explicit here. I am not sure that it's a callback exactly, right now what I have is .join
and .call
methods from d3 which are providing the functionality). I have a little thing working now but am curious to see what the best approach will be.
Yeah definitely, I did take a look at that actually a few weeks back, thanks. I think our use case requires a bit different functionality, but it's helpful to see a working example with pre-existing lucid components.