You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking to create a graph with draggable points. But I do not see an easy way to customize how draggable elements are defined.
For now, there are:
useMovablePoint(initialPoint, props) which deal with saving position and constraint, and memorize the movable point
<MovablePoint /> which add the drag interaction, and render the component
What about adding a props Component to <MovablePoint /> the expect a React element with props{ ref, displayX, displayY, dragging } Such that if Component is defined, the <MovablePoint /> renders this component. Otherwise it renders the default one
I think having a higher order "draggable" abstraction would be useful! It would basically be a wrapper around @use-gesture/react, but which takes into account view and user transforms.
Before all, thanks for this inspiring library 🤓
I was looking to create a graph with draggable points. But I do not see an easy way to customize how draggable elements are defined.
For now, there are:
useMovablePoint(initialPoint, props)
which deal with saving position and constraint, and memorize the movable point<MovablePoint />
which add the drag interaction, and render the componentWhat about adding a props
Component
to<MovablePoint />
the expect a React element with props{ ref, displayX, displayY, dragging }
Such that ifComponent
is defined, the<MovablePoint />
renders this component. Otherwise it renders the default oneDefaultComponent example
The text was updated successfully, but these errors were encountered: