Skip to content

馃悰 fix: apply Y minRange absolute floor only for zero spans - #21

Open
itsdiay wants to merge 1 commit into
benjitaylor:mainfrom
itsdiay:fix/minrange-floor-tiny-spans
Open

馃悰 fix: apply Y minRange absolute floor only for zero spans#21
itsdiay wants to merge 1 commit into
benjitaylor:mainfrom
itsdiay:fix/minrange-floor-tiny-spans

Conversation

@itsdiay

@itsdiay itsdiay commented Aug 7, 2026

Copy link
Copy Markdown

Summary

  • Replace rawRange * k || floor with an explicit finite/positive check in computeRange and the candle range helper
  • Absolute Y floor applies only for zero / non-finite spans; tiny nonzero spans keep a relative domain (avoid over-padding micro vol)
  • Add regression tests for zero-span floor vs tiny nonzero margin behavior

Fixes #18

Test plan

  • pnpm test / npm test (math tests including new cases)
  • Manually: flat series still gets a usable Y domain; micro-priced series is not forced to a 0.4-tall domain

Made with Cursor

`rawRange * k || floor` only fell through when the product was exactly 0,
so the absolute floor was easy to misread and did not express the intended
zero-span semantics. Use an explicit finite/positive check in computeRange
and the candle range helper. Fixes benjitaylor#18.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

馃悰 Y-axis minRange floor skipped for tiny nonzero spans (can freeze tab)

1 participant