Context
Per CONTRIBUTING, new props need to earn their place — opening this as a discussion before any PR.
Today computeRange hard-codes vertical margin:
const marginFactor = exaggerate ? 0.01 : 0.12
Consumers who want more breathing room (e.g. keep series min/max around the middle 50% of the plot so there is room for growth/decline) currently have to scale or fabricate domain in app code.
Proposal (for discussion)
An optional prop such as rangePadding?: number (fraction of data span added on each side; default stays 0.12 when unset) so apps can choose TradingView-like tight fill vs mid-plot padding without changing their data.
Example: rangePadding={0.5} → data occupies roughly the middle half of the Y-axis (min ≈ 25%, max ≈ 75%).
Why it might earn a prop
- Common charting need (auto-scale fill factor).
- Small API surface: one number, default preserves current behavior.
- Avoids each consumer reinventing Y padding.
Why it might not
- API surface is intentionally small.
- Opinionated defaults over flexibility.
- Apps can already pre-scale values (with tradeoffs for axis labels / formatters).
Happy to adjust or drop this if you’d rather keep padding fixed.
Context
Per CONTRIBUTING, new props need to earn their place — opening this as a discussion before any PR.
Today
computeRangehard-codes vertical margin:Consumers who want more breathing room (e.g. keep series min/max around the middle 50% of the plot so there is room for growth/decline) currently have to scale or fabricate domain in app code.
Proposal (for discussion)
An optional prop such as
rangePadding?: number(fraction of data span added on each side; default stays0.12when unset) so apps can choose TradingView-like tight fill vs mid-plot padding without changing their data.Example:
rangePadding={0.5}→ data occupies roughly the middle half of the Y-axis (min ≈ 25%, max ≈ 75%).Why it might earn a prop
Why it might not
Happy to adjust or drop this if you’d rather keep padding fixed.