Skip to content

Scatterplotgraph: Implement manual repositioning of points#7286

Open
janezd wants to merge 5 commits into
biolab:masterfrom
janezd:scatterplotgraph-manual-moving
Open

Scatterplotgraph: Implement manual repositioning of points#7286
janezd wants to merge 5 commits 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.

  • 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
  • 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 44.56522% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.98%. Comparing base (99bb865) to head (a0ee8b2).

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

@janezd janezd force-pushed the scatterplotgraph-manual-moving branch 2 times, most recently from 7c74b94 to 072b16a Compare May 21, 2026 11:38
@janezd janezd force-pushed the scatterplotgraph-manual-moving branch 2 times, most recently from 8525ad9 to 49216a9 Compare June 15, 2026 17:21
@janezd janezd requested a review from Copilot June 15, 2026 17:21

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread Orange/widgets/visualize/utils/plotutils.py
Comment thread Orange/widgets/visualize/owscatterplotgraph.py Outdated
Comment thread Orange/widgets/unsupervised/owmds.py
Comment thread Orange/widgets/unsupervised/owmds.py Outdated
Comment thread Orange/widgets/visualize/owscatterplotgraph.py
@janezd janezd force-pushed the scatterplotgraph-manual-moving branch 2 times, most recently from 5f62f51 to 1061ebb Compare June 15, 2026 18:08

@VesnaT VesnaT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On point(s) move the output should be updated.

@janezd janezd force-pushed the scatterplotgraph-manual-moving branch 2 times, most recently from 96ac04d to 2dd2399 Compare June 20, 2026 10:05
@janezd

janezd commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

On point(s) move the output should be updated.

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.

@janezd janezd force-pushed the scatterplotgraph-manual-moving branch from 2dd2399 to a0ee8b2 Compare June 20, 2026 10:12
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.

3 participants