Skip to content

Conversation

@jesspagan
Copy link
Contributor

@jesspagan jesspagan commented Nov 11, 2025

Problem

The Sparkline component had width, height, and valueTextWidth props defined in the SparklineProps type, but these props were not being used in the implementation.

Solution

  • Updated Sparkline.tsx to use props.width, props.height, and props.valueTextWidth with fallback defaults
  • Added comprehensive unit tests to verify dimension props work correctly
  • Created Storybook documentation showing dimension variations

Testing

  • Added 3 focused unit tests for dimension props in Sparkline.test.tsx
  • Verified in Storybook that dimension changes are now visible
  • All existing tests continue to pass

Files Changed

  • packages/charts/react-charts/library/src/components/Sparkline/Sparkline.tsx
  • packages/charts/react-charts/library/src/components/Sparkline/Sparkline.test.tsx
  • packages/charts/react-charts/stories/src/Sparkline/SparklineDimensions.stories.tsx
  • packages/charts/react-charts/stories/src/Sparkline/index.stories.tsx

Change File

  • Included beachball change file for proper version management

- Fix hardcoded width, and height values that ignored custom values from props
- Update useEffect dependencies to recalculate scales when dimensions change
- Add comprehensive tests for dimension props functionality
- Create SparklineDimensions story demonstrating customizable dimensions

Fixes issue where Sparkline dimension props were defined but not functional
@jesspagan jesspagan requested a review from a team as a code owner November 11, 2025 21:50
@github-actions
Copy link

github-actions bot commented Nov 11, 2025

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-charts
Sparkline
91.253 kB
28.726 kB
91.385 kB
28.704 kB
132 B
-22 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-charts
AreaChart
401.451 kB
122.847 kB
react-charts
DeclarativeChart
719.091 kB
208.156 kB
react-charts
DonutChart
297.339 kB
88.898 kB
react-charts
FunnelChart
288.594 kB
85.727 kB
react-charts
GanttChart
383.208 kB
116.015 kB
react-charts
GaugeChart
312.216 kB
92.539 kB
react-charts
GroupedVerticalBarChart
390.996 kB
118.557 kB
react-charts
HeatMapChart
385.288 kB
117.724 kB
react-charts
HorizontalBarChart
294.96 kB
86.77 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
Legends
234.066 kB
69.154 kB
react-charts
LineChart
410.721 kB
124.268 kB
react-charts
SankeyChart
199.518 kB
61.371 kB
react-charts
ScatterChart
390.503 kB
118.5 kB
react-charts
VerticalBarChart
425.562 kB
123.604 kB
react-charts
VerticalStackedBarChart
397.348 kB
119.51 kB
🤖 This report was generated against 6d57e5794b973704e165c47de2c5e569127622ae

@github-actions
Copy link

Pull request demo site: URL

@jesspagan jesspagan force-pushed the fix/sparkline-dimension-props branch from d74f060 to e1c43ac Compare November 11, 2025 23:06
Copy link
Contributor

@AtishayMsft AtishayMsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jesspagan
Copy link
Contributor Author

:shipit:

@AtishayMsft Thanks for the approval! Could you please merge this PR since I don't have merge permissions to the master branch?

@AtishayMsft AtishayMsft merged commit a82a2d2 into microsoft:master Nov 20, 2025
12 checks passed
@AtishayMsft
Copy link
Contributor

@jesspagan Thanks for your contribution. This PR is merged now.

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.

2 participants