Fix chart axis spacing, dynamic padding, and Uptime hover#116
Merged
Conversation
- Bump grid line opacity from 0.06 to 0.18 (SVG + canvas) - Replace hardcoded PAD_LEFT_AXIS (48px) with measurement-based padding via axisPadForLabels across all chart types - Dynamic Y-axis tick count based on chart height (axisTickTarget) - X-axis label thinning via thinIndices for all chart types - Dynamic horizontal BarChart value-axis spacing via measureLabelWidth - Dynamic right-axis padding for ComposedChart dual-axis charts - Remove dead PAD_LEFT_AXIS constant - Extract CHART_LABEL_FONT constant, use in LiveChart - Restore fadeLeft demos removed in prior refactor - Uptime: replace tooltip pop-in with always-visible label prop, replace opacity dimming with 4px height-based hover indicator - Add unit tests for axisPadForLabels, thinIndices, measureLabelWidth, dynamicTickTarget (88 chart tests total) Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
stroke-opacityfrom0.06to0.18across SVG and canvas chartsPAD_LEFT_AXIS = 48pxwith measurement-based padding (axisPadForLabels) that adapts to formatted label widths — applied to all chart types (LineChart, StackedAreaChart, BarChart, ComposedChart) for both left and right axesaxisTickTarget; horizontal BarChart value axis usesdynamicTickTargetwith canvas-measured label widthsthinIndicesutility prevents label overlap, applied consistently across all chart types including ComposedChart (which previously had none)labelprop that updates on hover; replaced opacity dimming with a subtle 4px height-based hover indicatorPAD_LEFT_AXISconstant, extractedCHART_LABEL_FONT, restoredfadeLeftdemos, stabilized memo references withEMPTY_TICKSconstantsBreaking changes
Chart.Uptime:tooltipprop removed, replaced bylabel(string | false) andlabelStatusprops. Grid does not consume Uptime yet.Test plan
tsc --noEmitpassesaxisPadForLabels,thinIndices,measureLabelWidth,dynamicTickTarget)Made with Cursor