Skip to content

Histogram Plots: Implement Show Plot Data - #14359

Merged
magnesj merged 1 commit into
devfrom
histogram-show-plot-data
Jul 27, 2026
Merged

Histogram Plots: Implement Show Plot Data#14359
magnesj merged 1 commit into
devfrom
histogram-show-plot-data

Conversation

@magnesj

@magnesj magnesj commented Jul 27, 2026

Copy link
Copy Markdown
Member

Fixes #14360

"Show Plot Data" for histogram plots opened an empty text window, as RimHistogramPlot::asciiDataForPlotExport() was an unimplemented stub. In addition, the command was not available when right-clicking inside the plot widget.

Changes:

  • Implement asciiDataForPlotExport() for histogram plots. For each visible curve, the export contains the curve name, a header row and one tab-separated row per bin (bin center and frequency). The values are computed from the curve's data source with the plot's current frequency type, so the exported numbers match what is plotted.
  • Export one row per bin independent of graph type. Computing with the bar graph type would emit the step outline where every bin edge appears twice.
  • Remove the unused asciiDataForHistogramPlotExport( DateTimePeriod, bool ) helper. The parameters were copied from the summary plot equivalent and have no meaning for histograms.
  • Add a RiuContextMenuLauncher with RicShowPlotDataFeature to the histogram plot widget, following the same pattern as correlation, analysis and VFP plots.
  • Format the table with RifCsvDataTableFormatter using tab as field separator, so the text can be pasted into Excel with bin centers and frequencies in separate columns.

Example output:

Histogram Plot

SOIL, NORNE_ATW2013_RFTPLT_V2, All Time Steps
Bin Center	Relative Frequency [%]
0.02797	55.97580
0.08950	0.23812
...

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

This PR completes the “Show Plot Data” functionality for histogram plots by implementing RimHistogramPlot::asciiDataForPlotExport() (previously a stub) and making the command available from the histogram plot widget’s context menu.

Changes:

  • Implemented histogram ASCII export by recomputing each visible curve with the current frequency type and emitting one tab-separated row per bin (bin center + frequency).
  • Ensured export output is independent of render graph type by computing with LINE_GRAPH to avoid duplicated edge values from bar/step outlines.
  • Added RiuContextMenuLauncher to the histogram plot widget and removed the unused histogram-export helper declaration.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ApplicationLibCode/ProjectDataModel/Histogram/RimHistogramPlot.h Removes unused histogram-export helper declaration and an unused include.
ApplicationLibCode/ProjectDataModel/Histogram/RimHistogramPlot.cpp Implements histogram plot ASCII export and adds “Show Plot Data” to the plot widget context menu.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ApplicationLibCode/ProjectDataModel/Histogram/RimHistogramPlot.cpp
@magnesj
magnesj force-pushed the histogram-show-plot-data branch from 1407f49 to 8e3ee05 Compare July 27, 2026 08:51
@magnesj
magnesj merged commit 2ebefe7 into dev Jul 27, 2026
18 of 19 checks passed
@magnesj
magnesj deleted the histogram-show-plot-data branch July 27, 2026 08:56
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.

Histogram Plots: Show Plot Data shows empty text window

2 participants