Skip to content

feat(app): give data lines a fine default width and presets - #23

Merged
nmrtist merged 1 commit into
mainfrom
feat/fine-data-line-widths
Jul 27, 2026
Merged

nmrtist merged 1 commit into
mainfrom
feat/fine-data-line-widths

Conversation

@nmrtist

@nmrtist nmrtist commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Context

Three code paths authored data strokes at three different widths — 1.0 pt for
spectra and line series, 0.7 pt for contours. On a dense 2D plane those strokes
are thick enough to merge neighbouring contour rings, and the width control that
would fix it sat behind Advanced with no unit and no drag notch.

Double-click-to-reset had a second, unrelated problem. docs/reference/shortcuts.md
documents "Double-click a plot → Reset both axes to full range", but the second
press of the double-click starts a zero-distance box or axis zoom, and the
zoom-completion path consumed the release before the reset could run. Under
Browse Zoom, Alt+drag or on an axis strip the documented shortcut did nothing.

Changes

One default width for every data stroke. plotx-figure exports
DEFAULT_DATA_LINE_WIDTH_PT = 0.5, and LineEncoding, ContourStyle,
Series::line and both AxisTrace constructors adopt it. Point-marker radius,
error bars and the integral overlay keep their own widths — the overlay stays at
1.0 pt so it reads against the finer trace.

Width becomes a setting you can find and use. series.contour.line_width
moves from Advanced to Essential, so it sits beside Lowest level as the
second control that decides what dense data looks like. Both width rows now
declare pt and a 0.05 pt drag notch, carry a tooltip explaining what they
affect, and offer Fine (0.5), Medium (0.75) and Bold (1.25) presets next to the
drag field.

Double-click reset runs on the release that reports it, ahead of the
zoom-completion path, so it works under every tool and on the axis strips. A pan
in flight is committed rather than cancelled, keeping it a separate undo record.

Docs (English and Simplified Chinese) state the new default and unit, describe
the presets, and move contour Line width out of the Advanced list into its own
section.

Test modules were extracted to sibling control_tests.rs and navigation_tests.rs
to stay under the repository's 800-line source limit.

Testing

  • cargo pr-check — all 7 stages pass (fmt, source sizes, dependency policy,
    default-frontend build, clippy with warnings denied, tests in both backend
    configurations).
  • New coverage: line and contour widths share the fine point schema and the
    Essential tier; both encoding defaults resolve to DEFAULT_DATA_LINE_WIDTH_PT;
    the contour section exposes exactly lowest level and line width as Essential;
    the preset list is pinned. Three navigation tests cover a double-click beating
    a zero-distance box zoom, axis strips resetting only their own axis, and a
    double-click during a pan producing two undo records.
  • npm run build in docs/ — 69 pages built clean.

Spectra, line series and contours each carried their own authored
stroke width — 1.0, 1.0 and 0.7 pt — so a plot's strokes were both
inconsistent and, on dense 2D data, thick enough to close up the gaps
between contour rings. One shared DEFAULT_DATA_LINE_WIDTH_PT of 0.5 pt
now backs every data stroke.

Width is also a setting users reach for, not one they should have to go
hunting for. Contour line width moves from Advanced to Essential, both
width rows declare their unit as pt and a 0.05 pt drag notch, and each
offers Fine, Medium and Bold presets alongside the drag field.

Separately, double-clicking a plot to reset its axes did nothing under
Browse Zoom, Alt+drag or on an axis strip: the second press began a
zero-distance zoom whose release the zoom-completion path consumed. The
reset is now handled on that release first, so it matches the behavior
the shortcut reference already documents.

Marker radius, error bars and the integral overlay keep their own
widths; the overlay stays at 1.0 pt to read against the finer trace.
@nmrtist
nmrtist merged commit f0c7b90 into main Jul 27, 2026
11 checks passed
@nmrtist
nmrtist deleted the feat/fine-data-line-widths branch July 27, 2026 09:09
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant