Fix final-review findings: unit-label baseline, sqrt minor-tick math, dead code, edge cases
- Unit label was vertical-centered on a box derived from a baseline coordinate, shifting it 3.34mm too low and making the generated deliverables inconsistent with E440-Scale_template.svg. UNIT_Y is now used directly as the baseline; regenerated E440-Scale_paths.svg and E440-Scale_text.svg accordingly. - sqrt scale's minor-tick angle formula double-applied the square-root mapping, badly misplacing minor ticks. Removed the special case so sqrt falls through to the already-correct generic value-interpolation branch. Corrected README's sqrt row (crowds toward the high end, not low). - Removed dead code: unused _has_markup(), identity-transform wrapper and _UNIT_SCALE_X in _markup_unit_svg, unreachable max_val<=0 check, redundant math.isinf() in the minor-tick condition. - Linear scale with min==max now raises ValueError like the other three mappings, instead of silently producing a degenerate dial. - Form numeric parsing moved inside the try/except so bad input returns 400 instead of crashing with 500. - left_label/right_label now split on splitlines() to handle CRLF from browser textareas correctly. - Formatting consistency: PIVOT_CIRCLE_R/R0 use :.5f like other constants; font_face indentation matches its sibling elements. - LICENSE and CLAUDE.md: last M1730-Scale references and a doc inaccuracy about which labels are live text vs. outlined paths. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,7 @@ Fonts are loaded at startup from the `fonts/` directory in the repo root.
|
||||
| Mapping | Major tick values | Minor tick placement | Constraints |
|
||||
|---|---|---|---|
|
||||
| Linear | Evenly spaced | Uniform | None |
|
||||
| √ | Quadratic (0, 1, 4, 9 … × max) — compresses low values | Crowded toward the low end of each interval | Min ≥ 0 |
|
||||
| √ | Quadratic (0, 1, 4, 9 … × max) — compresses low values | Crowded toward the high end of each interval | Min ≥ 0 |
|
||||
| Log | Geometric (min × r⁰, r¹, r² …) — each interval spans the same ratio | Crowded toward the high end of each interval | Min and Max > 0 |
|
||||
| 1/x | Harmonic (values decrease left → right, e.g. ∞, 10, 5, 2, 1) — compresses high values | Uniform (in angle space, i.e. proportional to 1/v) | Min and Max > 0; Max may be ∞ |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user