Scatterplotgraph: Implement manual repositioning of points#7286
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for manually repositioning points in scatterplot-based visualizations by dragging (single point or current selection), gated by the widget providing a set_coordinates hook.
Changes:
- Extend
InteractiveViewBox.mouseDragEventto detect draggable points and apply a drag delta during mouse drags. - Add
get_dragged_points/move_dragged_pointstoOWScatterPlotBaseto support dragging a point or the full current selection.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
Orange/widgets/visualize/utils/plotutils.py |
Adds drag-handling branch to InteractiveViewBox.mouseDragEvent to initiate/track point dragging. |
Orange/widgets/visualize/owscatterplotgraph.py |
Implements scatterplot-specific point hit-testing and coordinate updates via set_coordinates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (12.90%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #7286 +/- ##
==========================================
- Coverage 89.01% 89.00% -0.02%
==========================================
Files 336 336
Lines 74417 74464 +47
==========================================
+ Hits 66242 66275 +33
- Misses 8175 8189 +14 🚀 New features to boost your workflow:
|
bec6b64 to
7c74b94
Compare
7c74b94 to
072b16a
Compare
Description of changes
Implement moving of points (a single point or selection) by dragging them.
The functionality is enabled if the widget (not graph!) implements a method
set_coordinates.I don't know how to write reasonable tests for this. Test on biolab/orange3-network#293.
This functionality would also be useful for other widgets that position points using some local optimization, for instance MDS, tSNE, FreeViz.
Includes