npm recharts 3.9.0
v3.9.0

5 hours ago

What's Changed

Animations

3.9 comes with new animations! There are several bug fixes and what's best, all animations are now fully customizable.

See the animations guide on https://recharts.github.io/en-US/guide/animations/

New features other than animations

  • Expose and document chart layout hooks and layout types in public API by @Copilot in #7265
  • feat: allow HTML attributes passthrough on ResponsiveContainer by @techcodie in #7168
  • feat: add nodeInset and nodeGap properties to Treemap for better la… by @MaximSrour in #7044
  • feat(PieChart): add dataKey to Legend payload by @Harikrushn9118 in #7137

Bugfixes

  • fix: preserve valid falsy custom names (0, "") in tooltips by @vamsi2246 in #7175
  • fix(ResponsiveContainer): Fix erroneous console warning on init by @andypoorman in #7174
  • fix(DataUtils): improve isPercent validation to exclude invalid formats by @vamsi2246 in #7178
  • fix(BarChart): render stacked bars when all values are 0 (#6235) by @andypoorman in #7199
  • fix(Sankey): prevent NaN node positions when link values sum to zero by @Mridul012 in #7185
  • fix(Funnel): prevent NaN coordinate layout crash when all values are zero by @Mridul012 in #7184
  • fixes an issue where XAxis and YAxis padding were ignored by the clipping mask when allowDataOverflow={true} was used alongside a restricted domain by @emiedonmokumo in #7232
  • fix: use originalDataIndex for tooltip dispatch in Bar by @mayrang in #7273
  • fix: resolve TypeScript 6 deprecation errors in tsconfig files by @shreedharbhat98 in #7285
  • fix(bar): use Math.round instead of bitwise truncation for bar positioning by @EduardF1 in #7297
  • fix(types): propagate Tooltip types in chart helper contexts by @mixelburg in #7125
  • fix(Legend): prevent overlap with chart on container resize by @maroKanatani in #7201
  • test(YAxis): failing repro for #7362 — function domain doesn't render ticks on empty/all-null data by @nlenepveu in #7384

Tree-shaking

We now have focused tree-shaking tests that allow us to observe exactly which components end up in the final bundle and why. I have also removed some unnecessary loops and you should see the final bundle size decrease somewhat as a result.

There are also two new examples on the website, showing real bundle size:

Documentation updates

New Contributors

Full Changelog: v3.8.1...v3.9.0-canary.0

Don't miss a new recharts release

NewReleases is sending notifications on new releases.