-
Notifications
You must be signed in to change notification settings - Fork 950
[WIP] Implement drag and drop feature for widgets #2363
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
Conversation
ae56cde
to
aa394c3
Compare
Here is another example with draggable columns to create plot: And notebook to generate this example (based on this PR): https://nbviewer.jupyter.org/gist/btel/e271d8788f674536b9c077520452e344 |
here is another package that could serve as inspiration (from the React community) |
We have a similar issue open in ipyvuetify: widgetti/ipyvuetify#2 |
This is a PoC implementation of a drag and drop feature for widgets. So far we enable the dragging for Label widget and define a drop area in Box.
Features
This PR implements:
Examples
All examples can be found in this notebook:
https://nbviewer.jupyter.org/github/jupyter-widgets/ipywidgets/blob/71cf58c6beafaafd98c7af92bf21c830236e0209/docs/source/examples/Drag%20and%20Drop%20examples.ipynb
Here is a basic example (note that the draggable Label is now called
DraggableLabel
):Here is a more advance example:
Theory
Here is a pure JS demo of drag and drop feature: https://jsfiddle.net/q935mp27/1/
and mozilla tutorial: https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API#The_basics