Skip to content

feat(chart): add a logarithmic y axis per pen (#72) - #113

Merged
mrcsin merged 1 commit into
masterfrom
log10-y-axis
Oct 7, 2026
Merged

mrcsin merged 1 commit into
masterfrom
log10-y-axis

Conversation

@mrcsin

@mrcsin mrcsin commented Oct 7, 2026

Copy link
Copy Markdown
Member

Problem

Pressure spans several decades and shares a screen with pens that do not; on a linear axis one of them
is unreadable. PenScaleSettings.IsLogarithmic existed in the model but nothing set it and the render
ignored it.

Change

  • Log axis at the render edge. Core keeps data units. ChartAxisBinder sets decade limits and swaps
    in a LogTickGenerator; EnvelopeLine projects through log10; the generator is the axis type's one
    home and switches under Plot.Sync. LogAxis.Ticks picks 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.
  • Stored start value. semiplot_tags.log_scale_on_start (SemiBase v0.5.0) reaches
    Pen.LogScaleOnStart and PenScaleSettings.InitialFor; the pen editor edits it as «Начальная шкала,
    логарифмическая». A changed stored value never changes a chart already open; Restore initial scale
    brings it back.
  • Axis scale panel. «Логарифмическая шкала» switches the type for the session. The Apply button is
    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.
  • Bench. Pressure 01 is a vacuum pen: mbar, 1e-6..1e-1, mask 0.0E+0, logarithmic on start.
  • Docs in docs/architecture, AGENTS.md and readme.md; both plans move to docs/plans/completed/.

Closes #72

Verification

  • SemiPlot.Tests.Unit 1800/1800, including LogAxisRenderTests (the 1e-4 plateau at the plot's
    middle, a zero plateau 2 px above the frame), LogAxisTests (tick families, degenerate and
    float-noise ranges in bounded time) and the axis scale panel's view tests.
  • Container tests (PenCatalogueEditorTests, PostgresCatalogReadTests, TagCatalogWriterTests)
    against SemiBase v0.5.0.
  • Manual test on the demo stand: the stored flag is written and read at start, the panel flows work.
Per-task commits before collapse
3973b7f docs(plans): record the axis panel run and checks
a293213 refactor(chart): drop the axis scale panel summary
c715cd1 refactor(chart): tidy the axis scale panel
9a3b655 feat(chart): use industry wording for the log scale
efaadc4 docs(chart): describe panel focus and toggle order
7b8546e refactor(chart): slim the axis scale panel model
d2636f0 fix(chart): keep Escape after an empty-area press
7ece9ba docs(plans): verify axis panel acceptance checks
fa996bc docs(chart): describe axis bound commit on focus
ec67e6a feat(chart): name the log10 base in the scale texts
6e10c39 feat(chart): end the axis bound edit on focus loss
a32abc9 feat(chart): commit axis bounds without apply
2b17eba docs(plans): add axis panel commit-on-focus plan
d9add3e docs(repo): drop the start-value note from the readme
9a76654 docs(plans): record the log10 run and its checks
1c33ec4 docs(chart): point log axis comments at the docs
a193f2d docs(chart): state non-finite pair, rewrap log docs
abb84ec test(chart): share log test helpers and fill gaps
82d51f6 refactor(bench): move the log walk into SyntheticValueWalk
9fa6353 refactor(chart): give each log axis rule one home
8c0beac fix(chart): default a non-finite manual scale pair
937e37e fix(chart): bound log minor tick loops
7a3ecd3 docs(chart): state SemiBase floor and open items
13c389f fix(pens): fit the log column and its message
a9d1c0b fix(chart): harden log labels, floor and padding
06cc170 docs(chart): document the log10 y axis
2537a5d test(chart): drop scale pair names from log test
43013c4 feat(bench): seed a decade-spanning log pen
f51174e feat(pens): edit log_scale_on_start in the pen editor
d88fad8 feat(chart): switch the log axis in the scale panel
5e1f8cc feat(chart): render the log10 y axis
ac6c0c1 feat(pens): read and write log_scale_on_start
b4e74ae feat(chart): add log10 projection and tick choice
16399be refactor(pens): suffix the start scale pair _on_start  (shipped as #112)

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).
@mrcsin
mrcsin marked this pull request as ready for review October 7, 2026 11:32
@mrcsin
mrcsin merged commit 823c687 into master Oct 7, 2026
2 checks passed
@mrcsin
mrcsin deleted the log10-y-axis branch October 7, 2026 11:36
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.

Chart: log10 Y axis

1 participant