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 (44.56%) 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.02% 88.98% -0.05%
==========================================
Files 336 336
Lines 74427 74513 +86
==========================================
+ Hits 66257 66302 +45
- Misses 8170 8211 +41 🚀 New features to boost your workflow:
|
7c74b94 to
072b16a
Compare
8525ad9 to
49216a9
Compare
5f62f51 to
1061ebb
Compare
VesnaT
left a comment
There was a problem hiding this comment.
On point(s) move the output should be updated.
96ac04d to
2dd2399
Compare
I admire your ability to catch such things. My first fix was to call commit on all drag events, which looked nice in a trivial workflow -- I dragged a point in the MDS and it instantly updated in the scatter plot. In reality, it could cause too many updates and redraws; now the new coordinates are committed when dragging is finished. |
…int belongs to the selection
2dd2399 to
a0ee8b2
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.Implement this in MDS.
Also, implement saving of coordinate hints in MDS.
I don't know how to write reasonable tests for this. Test on biolab/orange3-network#293.
Includes