Skip to content

Add support for scatter plot tooltip on-hover#13642

Open
eqbech wants to merge 1 commit into
mainfrom
add-support-for-on-hover-tooltip-scatter-plots
Open

Add support for scatter plot tooltip on-hover#13642
eqbech wants to merge 1 commit into
mainfrom
add-support-for-on-hover-tooltip-scatter-plots

Conversation

@eqbech
Copy link
Copy Markdown
Contributor

@eqbech eqbech commented May 28, 2026

Issue
Resolves #13590

Approach
🧠 📜

image

@eqbech eqbech force-pushed the add-support-for-on-hover-tooltip-scatter-plots branch from 9ceb70d to f4a16f9 Compare May 28, 2026 11:36
Comment thread src/ert/gui/tools/plot/plottery/plots/everest_batch_objective_function_plot.py Outdated
@eqbech eqbech force-pushed the add-support-for-on-hover-tooltip-scatter-plots branch from 2c4b97a to 05b11fc Compare May 28, 2026 12:23
Comment thread src/ert/gui/tools/plot/plottery/plots/plot_tools.py Outdated
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds hover tooltips for scatter plot points in the Everest batch objective function plot and refactors plot hover handling into tooltip manager classes.

Changes:

  • Introduces ScatterTooltipManager and a tooltip manager factory.
  • Updates existing line/bar tooltip wiring to use the shared factory.
  • Adds detailed hover labels for rejected Everest batch objective points.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Adds shared tooltip manager plumbing and scatter tooltip support.
src/ert/gui/tools/plot/plottery/plots/plot_tools.py Delegates hover setup to the tooltip manager factory.
src/ert/gui/tools/plot/plottery/plots/everest_batch_objective_function_plot.py Adds scatter tooltip labels for rejected batch points.
src/ert/gui/tools/plot/plottery/plots/everest_objective_function_plot.py Updates line tooltip call signature.
src/ert/gui/tools/plot/plottery/plots/everest_controls_plot.py Updates line tooltip call signature.
src/ert/gui/tools/plot/plottery/plots/everest_gradients_plot.py Updates bar tooltip call signature.
src/ert/gui/tools/plot/plottery/plots/ensemble.py Updates line tooltip call signature.

Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 28, 2026

Codecov Report

❌ Patch coverage is 43.43434% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.17%. Comparing base (3d0f102) to head (89c4e09).
⚠️ Report is 30 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...t/gui/tools/plot/plottery/plots/tooltip_manager.py 41.46% 48 Missing ⚠️
...ery/plots/everest_batch_objective_function_plot.py 37.50% 5 Missing ⚠️
...tools/plot/plottery/plots/everest_controls_plot.py 0.00% 1 Missing ⚠️
...ools/plot/plottery/plots/everest_gradients_plot.py 0.00% 1 Missing ⚠️
.../plottery/plots/everest_objective_function_plot.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13642      +/-   ##
==========================================
- Coverage   89.54%   89.17%   -0.37%     
==========================================
  Files         464      469       +5     
  Lines       32778    33295     +517     
==========================================
+ Hits        29351    29692     +341     
- Misses       3427     3603     +176     
Flag Coverage Δ
cli-tests 35.49% <0.00%> (-0.28%) ⬇️
fuzz 43.52% <29.29%> (-0.44%) ⬇️
gui-tests 59.47% <43.43%> (-0.35%) ⬇️
performance-and-unit-tests 77.79% <43.43%> (-0.30%) ⬇️
test 45.08% <29.29%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/ert/gui/tools/plot/plottery/plots/ensemble.py 90.16% <ø> (-2.82%) ⬇️
...rc/ert/gui/tools/plot/plottery/plots/plot_tools.py 93.13% <100.00%> (+20.08%) ⬆️
src/ert/gui/utils.py 100.00% <100.00%> (ø)
...tools/plot/plottery/plots/everest_controls_plot.py 22.00% <0.00%> (ø)
...ools/plot/plottery/plots/everest_gradients_plot.py 15.38% <0.00%> (ø)
.../plottery/plots/everest_objective_function_plot.py 25.00% <0.00%> (ø)
...ery/plots/everest_batch_objective_function_plot.py 21.81% <37.50%> (+2.66%) ⬆️
...t/gui/tools/plot/plottery/plots/tooltip_manager.py 38.40% <41.46%> (-3.03%) ⬇️

... and 59 files with indirect coverage changes

@eqbech eqbech force-pushed the add-support-for-on-hover-tooltip-scatter-plots branch from 9c39a79 to 67394df Compare May 28, 2026 13:19
Comment thread src/ert/gui/tools/plot/plottery/plots/tooltip_manager.py Outdated
Comment thread src/ert/gui/utils.py
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 29, 2026

Merging this PR will not alter performance

✅ 36 untouched benchmarks


Comparing add-support-for-on-hover-tooltip-scatter-plots (89c4e09) with main (c1c643d)

Open in CodSpeed

@eqbech eqbech force-pushed the add-support-for-on-hover-tooltip-scatter-plots branch from 264dbd1 to 89c4e09 Compare May 29, 2026 09:04
Comment thread src/ert/gui/utils.py
LEGEND_THRESHOLD = 5

# Number of significant digits to show in plots
SIGNIFICANT_DIGITS = 4
Copy link
Copy Markdown
Contributor

@eilskra eilskra May 29, 2026

Choose a reason for hiding this comment

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

Would placing this in plot_tools.py be better? I assume its only the line-hover that will be using this?

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.

or in the tooltip_manager

rejected_data = data[~data["is_improvement"]]
if not rejected_data.empty:
axes.scatter(
scatter_data = axes.scatter(
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.

Should this be named rejected_scatter_data or something along those lines? When we remove Extended plot information we will plot the accepted as scatter points too

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.

Add support for tooltip on hover for scatter plots

6 participants