Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unidirectional Dragging #116

Open
mstone121 opened this issue Feb 3, 2021 · 0 comments
Open

Unidirectional Dragging #116

mstone121 opened this issue Feb 3, 2021 · 0 comments

Comments

@mstone121
Copy link

Describe the solution you'd like
I'm creating a data import tool that will allow users to import CSV data from somewhere else that might not necessarily have the same headers, or that might need to transform their data somehow before it can be imported. I'm using beautiful-react-digrams to create a visual interface for defining the mapping of the source data fields to the destination data fields. The source and destination fields should be fixed on the left and right side of the Diagram Canvas respecitvely, but their vertical order can be changed.

For this I'd like to be able to restrict the dragging on the node objects to the 'Y' axis.

Describe alternatives you've considered
I could re-implement the drag functionality in my custom node render components, but then I'd have to import the internal_hook useDrag which seems sort of hackish. Also, since I'm copying the code pretty much directly from DiagramNode.js, it seems redundant.

Additional context
I forked this repo and created a PR in the forked repo with the implementation of this feature: https://github.com/mstone121/beautiful-react-diagrams/pull/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant