viewer: label the merge plot over the range it is drawn on
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 9m11s
Build Packages / build:windows:nocuda (push) Successful in 16m58s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 19m38s
Build Packages / build:windows:cuda (push) Successful in 19m52s
Build Packages / build:viewer-tgz:cpu (push) Successful in 21m15s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 22m55s
Build Packages / build:viewer-tgz:cuda (push) Successful in 23m26s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 27m44s
Build Packages / build:rugnux:windows (push) Successful in 11m1s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 28m7s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 19m49s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 23m23s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 26m16s
Build Packages / build:rpm (rocky9) (push) Successful in 23m21s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 22m45s
Build Packages / Generate python client (push) Successful in 29s
Build Packages / build:rpm (rocky8) (push) Successful in 28m58s
Build Packages / Create release (push) Skipped
Build Packages / Build documentation (push) Successful in 1m34s
Build Packages / DIALS test (push) Successful in 26m3s
Build Packages / XDS test (durin plugin) (push) Successful in 10m42s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 28m4s
Build Packages / XDS test (neggia plugin) (push) Successful in 9m59s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 11m1s
Build Packages / Unit tests (push) Successful in 2h8m52s
Build Packages / Unit tests (pull_request) Successful in 1h26m12s
Build Packages / build:windows:nocuda (pull_request) Successful in 16m5s
Build Packages / build:viewer-tgz:cpu (pull_request) Successful in 15m31s
Build Packages / build:viewer-tgz:cuda (pull_request) Successful in 17m5s
Build Packages / build:rugnux-tgz (x86_64) (pull_request) Successful in 15m7s
Build Packages / build:rugnux:windows (pull_request) Successful in 9m47s
Build Packages / build:rugnux:aarch64 (cross) (pull_request) Successful in 9m26s
Build Packages / build:rpm (rocky8_nocuda) (pull_request) Successful in 20m18s
Build Packages / build:rpm (rocky9_nocuda) (pull_request) Successful in 18m34s
Build Packages / build:rpm (ubuntu2204_nocuda) (pull_request) Successful in 24m53s
Build Packages / build:rpm (ubuntu2404_nocuda) (pull_request) Successful in 17m31s
Build Packages / build:rpm (rocky8_sls9) (pull_request) Successful in 26m29s
Build Packages / build:rpm (rocky9_sls9) (pull_request) Successful in 22m26s
Build Packages / build:rpm (rocky8) (pull_request) Successful in 25m4s
Build Packages / build:rpm (rocky9) (pull_request) Successful in 21m42s
Build Packages / build:rpm (ubuntu2204) (pull_request) Successful in 23m24s
Build Packages / build:rpm (ubuntu2404) (pull_request) Successful in 19m14s
Build Packages / DIALS test (pull_request) Successful in 18m12s
Build Packages / XDS test (durin plugin) (pull_request) Successful in 11m23s
Build Packages / XDS test (JFJoch plugin) (pull_request) Successful in 11m9s
Build Packages / XDS test (neggia plugin) (pull_request) Successful in 9m51s
Build Packages / Generate python client (pull_request) Successful in 33s
Build Packages / Build documentation (pull_request) Successful in 42s
Build Packages / Create release (pull_request) Skipped
Build Packages / build:windows:cuda (pull_request) Successful in 14m44s

The merge-statistics window asked for an absolute y-axis - CC1/2 and CCref on
0..100, everything else from 0 - by setting the range on the chart's value axis
after JFJochSimpleChartView::UpdateData had already built the chart. The visible
tick labels are a separate QCategoryAxis whose entries UpdateData had generated
from the range of the data, and those entries were not rebuilt. So the plot was
drawn over 0..100 while the labels down its left edge covered only 91.5..100 and
crowded into the top tenth; the numbers matching the drawn range appeared only
on the right-hand grid axis, which the same call had made visible. CC1/2 showed
it worst because its range is the narrowest, but every metric was affected.

Give UpdateData the range instead, so the ticks and both axes come from one
number. The side-panel azimuthal-integration chart passes no range and renders
pixel-identically.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
2026-09-02 09:23:02 +02:00
co-authored by Claude Opus 5
parent 34e1ec8fb9
commit 4bb3d44983
4 changed files with 22 additions and 13 deletions
+1
View File
@@ -24,6 +24,7 @@
* `jfjoch_broker` sends `direct_beam_x`/`direct_beam_y` on the CBOR start message.
* `jfjoch_viewer` reads PILATUS miniCBF sweeps natively, and draws grid scan cells in the proportion of the scan steps.
* The rugnux manual is reorganised into task pages with a run overview, and gains worked phenix / REFMAC5 / POINTLESS-AIMLESS / careless examples.
* `jfjoch_viewer` labels the merge-statistics plot over the range the axis is drawn on, so the CC1/2 curve is no longer read against tick labels covering only part of it.
### 1.0.0-rc.165
This is an UNSTABLE release. It includes many experimental features, as well as many AI generated fixes. We recommend using rc.152 for production use.
+9 -1
View File
@@ -22,7 +22,8 @@ JFJochSimpleChartView::JFJochSimpleChartView(QWidget *parent)
}
void JFJochSimpleChartView::UpdateData(const std::vector<float> &in_x, const std::vector<float> &in_y,
QString legend_x, QString legend_y, bool in_one_over_d) {
QString legend_x, QString legend_y, bool in_one_over_d,
std::optional<std::pair<double, double>> y_range) {
one_over_d = in_one_over_d;
x = in_x;
y = in_y;
@@ -71,6 +72,13 @@ void JFJochSimpleChartView::UpdateData(const std::vector<float> &in_x, const std
ymax += eps;
}
// A range asked for by the caller replaces the one taken from the data. Everything below - both
// axes and the tick labels - is built from ymin/ymax, so the drawn range stays the labelled one.
if (y_range && y_range->second > y_range->first) {
ymin = y_range->first;
ymax = y_range->second;
}
// Hidden value axis (left): range + grid
auto *axYvalue = new QValueAxis();
axYvalue->setTitleText(legend_y);
+7 -1
View File
@@ -3,6 +3,9 @@
#pragma once
#include <optional>
#include <utility>
#include <QtCharts/QChartView>
#include <QtCharts/QValueAxis>
#include <QtCharts/QLineSeries>
@@ -24,8 +27,11 @@ protected:
public:
JFJochSimpleChartView(QWidget *parent = nullptr);
// y_range fixes the value range of the Y axis instead of taking it from the data - the tick
// labels are built from it, so a caller must not change the range afterwards.
virtual void UpdateData(const std::vector<float> &in_x, const std::vector<float> &in_y,
QString legend_x, QString legend_y, bool one_over_d);
QString legend_x, QString legend_y, bool one_over_d,
std::optional<std::pair<double, double>> y_range = std::nullopt);
void ClearData();
};
+5 -11
View File
@@ -322,23 +322,17 @@ void JFJochMergeStatsWindow::updatePlot() {
if (std::isfinite(v))
dmax = std::max(dmax, v);
}
chart_->UpdateData(x, y, "Resolution [Å]", metric_->currentText(), true);
// Absolute y-axis so positions are comparable: CC1/2 + CCref are 0..100, completeness 0..(>=100),
// multiplicity / R-meas / I-sigma start at 0. Show the labels (UpdateData hides them by default).
double ymin = 0.0, ymax = 1.0;
// multiplicity / R-meas / I-sigma start at 0. It has to be given to UpdateData rather than set
// on the axis afterwards, or the tick labels still describe the range of the data.
double ymax = 1.0;
switch (metric) {
case 0: case 5: ymax = 100.0; break; // CC1/2, CCref
case 3: ymax = std::max(100.0, dmax * 1.05); break; // Completeness
default: ymax = dmax > 0.0 ? dmax * 1.05 : 1.0; break; // R-meas, I/sigma, multiplicity
}
const auto axes = chart_->chart()->axes(Qt::Vertical);
if (!axes.isEmpty()) {
if (auto *vax = qobject_cast<QValueAxis *>(axes.first())) {
vax->setRange(ymin, ymax);
vax->setLabelsVisible(true);
}
}
chart_->UpdateData(x, y, "Resolution [Å]", metric_->currentText(), true,
std::make_pair(0.0, ymax));
}
void JFJochMergeStatsWindow::buildTable() {