Skip to content

Scatterplotgraph: Implement manual repositioning of points#7286

Open
janezd wants to merge 1 commit into
biolab:masterfrom
janezd:scatterplotgraph-manual-moving
Open

Scatterplotgraph: Implement manual repositioning of points#7286
janezd wants to merge 1 commit into
biolab:masterfrom
janezd:scatterplotgraph-manual-moving

Conversation

@janezd

@janezd janezd commented May 21, 2026

Copy link
Copy Markdown
Contributor
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
  • Code changes
  • Tests
  • Documentation

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mouseDragEvent to detect draggable points and apply a drag delta during mouse drags.
  • Add get_dragged_points / move_dragged_points to OWScatterPlotBase to 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.

Comment thread Orange/widgets/visualize/utils/plotutils.py Outdated
Comment thread Orange/widgets/visualize/utils/plotutils.py
Comment thread Orange/widgets/visualize/utils/plotutils.py
@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.90323% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.00%. Comparing base (f12c5c1) to head (072b16a).
⚠️ Report is 8 commits behind head on master.

❌ 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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@janezd janezd force-pushed the scatterplotgraph-manual-moving branch from bec6b64 to 7c74b94 Compare May 21, 2026 11:35
@janezd janezd force-pushed the scatterplotgraph-manual-moving branch from 7c74b94 to 072b16a Compare May 21, 2026 11:38
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

Successfully merging this pull request may close these issues.

2 participants