Repository navigation
feat(chart): add a logarithmic y axis per pen (#72) - #113
Merged
Merged
Conversation
Pressure spans several decades and shares a screen with pens that do not; on a linear axis one of them is unreadable. A pen can now be drawn on a base-10 logarithmic Y axis. The axis type is a start value like the start scale pair: stored as semiplot_tags.log_scale_on_start (SemiBase v0.5.0), edited in the pen editor as «Начальная шкала, логарифмическая», applied when a pen opens in a window and by Restore initial scale. A changed stored value never changes a chart already open. The axis scale panel switches the type for the session with a «Логарифмическая шкала» box. The transform lives at the render edge and Core keeps data units: ChartAxisBinder sets decade limits and swaps in a LogTickGenerator, EnvelopeLine projects through log10, and the axis's tick generator is the one home of the type, switched under Plot.Sync. Core's LogAxis chooses the ticks (decades, 1-2-5 mantissas or linear steps, whichever readable family has the most majors, bounded per call so no range can hang the render thread) and PenScaleModel pads a log range in log space. Samples at or below zero, and positive samples under the axis minimum, are pinned 2 px above the bottom; readouts show the true value. Major labels use the pen's mask and are demoted when the mask cannot show them. A manual pair with a non-finite bound falls back to the default range. The axis scale panel loses its Apply button: the bound pair is written when focus leaves both fields, on Enter, on a press on the panel's empty area or on a dismiss, and the panel stays open; Escape writes nothing. The log box writes a pending pair before it switches the axis on, so a typed positive minimum is admitted in one pass, and refuses over a pair that does not read or a manual minimum at or below zero. The bench seeds Pressure 01 as a vacuum pen (mbar, 1e-6..1e-1, mask 0.0E+0, logarithmic on start).
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Pressure spans several decades and shares a screen with pens that do not; on a linear axis one of them
is unreadable.
PenScaleSettings.IsLogarithmicexisted in the model but nothing set it and the renderignored it.
Change
ChartAxisBindersets decade limits and swapsin a
LogTickGenerator;EnvelopeLineprojects through log10; the generator is the axis type's onehome and switches under
Plot.Sync.LogAxis.Tickspicks decades, 1-2-5 mantissas or linear steps,bounded per call so no range can hang the render thread. Non-positive samples, and positive ones
under the axis minimum, are pinned 2 px above the bottom; readouts show the true value. Major labels
use the pen's mask and are demoted when the mask cannot show them.
semiplot_tags.log_scale_on_start(SemiBase v0.5.0) reachesPen.LogScaleOnStartandPenScaleSettings.InitialFor; the pen editor edits it as «Начальная шкала,логарифмическая». A changed stored value never changes a chart already open; Restore initial scale
brings it back.
gone: the bound pair is written when focus leaves both fields, on Enter, on a press on the panel's
empty area or on a dismiss, and the panel stays open; Escape writes nothing. The box writes a pending
pair before switching on, so "type 1, tick" works in one pass.
Pressure 01is a vacuum pen: mbar, 1e-6..1e-1, mask0.0E+0, logarithmic on start.docs/architecture,AGENTS.mdandreadme.md; both plans move todocs/plans/completed/.Closes #72
Verification
SemiPlot.Tests.Unit1800/1800, includingLogAxisRenderTests(the 1e-4 plateau at the plot'smiddle, a zero plateau 2 px above the frame),
LogAxisTests(tick families, degenerate andfloat-noise ranges in bounded time) and the axis scale panel's view tests.
PenCatalogueEditorTests,PostgresCatalogReadTests,TagCatalogWriterTests)against SemiBase v0.5.0.
Per-task commits before collapse