feat(app): give data lines a fine default width and presets - #23
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mddocuments "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-figureexportsDEFAULT_DATA_LINE_WIDTH_PT = 0.5, andLineEncoding,ContourStyle,Series::lineand bothAxisTraceconstructors 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_widthmoves from
AdvancedtoEssential, so it sits beside Lowest level as thesecond control that decides what dense data looks like. Both width rows now
declare
ptand a 0.05 pt drag notch, carry a tooltip explaining what theyaffect, 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.rsandnavigation_tests.rsto 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).
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 buildindocs/— 69 pages built clean.