Compare Versions - recharts
npm / recharts / Compare Versions
What's Changed
We added generics to our data and dataKey props and now you can have your charts validated by TypeScript. See the full guide here: https://recharts.github.io/en-US/guide/typescript/
We are releasing new helper functions and hooks that will allow you to precisely target mouse interactions, and convert coordinates. See the guide here: https://recharts.github.io/en-US/guide/coordinateSystems/
And new functions and hooks:
getRelativeCoordinate - converts mouse events to pixel positions
Convert Data → Pixels:
useXAxisScale - returns a function to convert X data values to pixel positions useYAxisScale - returns a function to convert Y data values to pixel positions useCartesianScale - convenience hook for converting both at once
Pixels → Data:
useXAxisInverseScale - returns a function to convert pixel X to the closest data value useYAxisInverseScale - returns a function to convert pixel Y to the closest data value useXAxisInverseTickSnapScale - returns a function to convert pixel X to the closest axis tick useYAxisInverseTickSnapScale - returns a function to convert pixel Y to the closest axis tick
Accessing Ticks:
useXAxisTicks - returns the calculated ticks of an X-axis useYAxisTicks - returns the calculated ticks of a Y-axis
Feat
Hooks: New hooks (see above) by @PavelVanecek in https://github.com/recharts/recharts/pull/6960Annotations: exportgetRelativeCoordinatehelper function by @PavelVanecek in https://github.com/recharts/recharts/pull/6942Legend: Add label style prop in Legend by @devoldemar in https://github.com/recharts/recharts/pull/7012XAxis/YAxis: newniceTIcksprop - specify'none' | 'auto' | 'equidistant' | 'nice'for different behaviors by @MaxGhenis in https://github.com/recharts/recharts/pull/7009General: Add event throttling controls to chart props by @PavelVanecek in https://github.com/recharts/recharts/pull/6924
Fix
Pie: fix: enable tooltip synchronization for PieChart by @VIDHITTS in https://github.com/recharts/recharts/pull/6989Pie: fix: sync pie tooltip/legend color with per-sector fill by @2YH02 in https://github.com/recharts/recharts/pull/6977Bar: Fix activeBar highlighting with missing/null data by @Copilot in https://github.com/recharts/recharts/pull/7001Bar: Support Bar CSS transitions by @PavelVanecek in https://github.com/recharts/recharts/pull/6920XAxis/YAxis: respect user-provided textAnchor prop on XAxis/YAxis by @pierreeurope in https://github.com/recharts/recharts/pull/7028Tooltip: Close tooltip on blur by @gVguy in https://github.com/recharts/recharts/pull/6958General: fix error whenonMouseEnter/Leave={undefined}by @SvetlanaVesna in https://github.com/recharts/recharts/pull/6969Animation: [animations] auto disable primitives animations based on user system preferences by @cloud-walker in https://github.com/recharts/recharts/pull/6956Animation/Line: fix: prevent animated line flicker with round/square strokeLinecap by @roy7 in https://github.com/recharts/recharts/pull/7022Performance: filter zero-dimension rectangles early by @MendyLanda in https://github.com/recharts/recharts/pull/6800- Bump minimum @reduxjs/toolkit to 1.9.0 by @Copilot in https://github.com/recharts/recharts/pull/6934
Types
Bar: Add generics to Bar by @PavelVanecek in https://github.com/recharts/recharts/pull/7015RadialBar: shape type and selector stability by @PavelVanecek in https://github.com/recharts/recharts/pull/6917LabelList/Area: Enhance type definitions for LabelList and Area components by @PavelVanecek in https://github.com/recharts/recharts/pull/6936PieFix Pie event handlers type by @PavelVanecek in https://github.com/recharts/recharts/pull/6944Pie/RadialBar: Fix event types for Pie and RadialBar by @PavelVanecek in https://github.com/recharts/recharts/pull/6965PolarAngleAxis: Fix PolarAngleAxis event types, add tests for remaining components by @PavelVanecek in https://github.com/recharts/recharts/pull/7000Tooltip: payload type from any by @PavelVanecek in https://github.com/recharts/recharts/pull/6925XAxis/YAxis: update event types for XAxis and YAxis, add type tests by @PavelVanecek in https://github.com/recharts/recharts/pull/7004General: Add external generics to Area by @PavelVanecek in https://github.com/recharts/recharts/pull/6993General: Add optional explicit generics to graphical items and charts by @PavelVanecek in https://github.com/recharts/recharts/pull/7035General: New feature - typed charts helper by @PavelVanecek in https://github.com/recharts/recharts/pull/7071General: Fix mouse event type by @PavelVanecek in https://github.com/recharts/recharts/pull/6939
Docs
- Add tests, documentation, and website example for Treemap nesting (#4… by @VIDHITTS in https://github.com/recharts/recharts/pull/6971
- docs: add computeWaterfallData utility for waterfall charts by @MaxGhenis in https://github.com/recharts/recharts/pull/7011
- docs: add ErrorBar dataPointFormatter storybook examples by @mixelburg in https://github.com/recharts/recharts/pull/7026
- [dark mode] line chart examples by @cloud-walker in https://github.com/recharts/recharts/pull/6916
- fix(storybook): use flat dataset for Simple and WithTooltip Treemap stories (#6364) by @Harikrushn9118 in https://github.com/recharts/recharts/pull/7072
- docs: Dark mode homepage by @cloud-walker in https://github.com/recharts/recharts/pull/7063
New Contributors
- @gVguy made their first contribution in https://github.com/recharts/recharts/pull/6958
- @SvetlanaVesna made their first contribution in https://github.com/recharts/recharts/pull/6969
- @VIDHITTS made their first contribution in https://github.com/recharts/recharts/pull/6971
- @2YH02 made their first contribution in https://github.com/recharts/recharts/pull/6977
- @MaxGhenis made their first contribution in https://github.com/recharts/recharts/pull/7011
- @mixelburg made their first contribution in https://github.com/recharts/recharts/pull/7026
- @roy7 made their first contribution in https://github.com/recharts/recharts/pull/7022
- @devoldemar made their first contribution in https://github.com/recharts/recharts/pull/7012
- @MendyLanda made their first contribution in https://github.com/recharts/recharts/pull/6800
- @pierreeurope made their first contribution in https://github.com/recharts/recharts/pull/7028
- @haritamar made their first contribution in https://github.com/recharts/recharts/pull/7068
Full Changelog: https://github.com/recharts/recharts/compare/v3.7.0...v3.8.0
What's Changed
📢 Cell is now deprecated and will be removed in the next major version. Please migrate all Cell usage to use the shape prop of respective chart elements. ‼️
Feat
New Hooks
useIsTooltipActive: returns if the tooltip is active by @PavelVanecek in https://github.com/recharts/recharts/pull/6880useActiveTooltipCoordinate: returns current tooltip coordinate by @PavelVanecek in https://github.com/recharts/recharts/pull/6880
Other
Tooltip: allowoffsetprop to accept Coordinate object by @bigsaigon333 in https://github.com/recharts/recharts/pull/6868X/YAxisadd new axis type: "auto" by @PavelVanecek in https://github.com/recharts/recharts/pull/6823- sets the type to "category" for categorical axes, and "number" for numeric axis.
X/YAxis: replacetick: anywith explicit type by @PavelVanecek in https://github.com/recharts/recharts/pull/6911Bar/TypeScript: addBarShapePropstype to fixBar.shapetype by @PavelVanecek in https://github.com/recharts/recharts/pull/6900TypeScript: add missing useful type exports forcontent,shapefunctions, etc. @PavelVanecek in https://github.com/recharts/recharts/pull/6852
Fix
BarChart: fixstackOffset=signfor charts with 3 or more positive values in one series by @PavelVanecek in https://github.com/recharts/recharts/pull/6807BarStack: fix circular dependency when building with vite by @jkr2255 in https://github.com/recharts/recharts/pull/6777BarStack: fixBarStackclipPathin charts withstackOffset=signby @PavelVanecek in https://github.com/recharts/recharts/pull/6806BarStack: apply bar stack radius to active bars by @PavelVanecek in https://github.com/recharts/recharts/pull/6906
Chore
- Enabled
stricttsconfig by @PavelVanecek in https://github.com/recharts/recharts/pull/6842
Docs
We've started auto-generating our docs for the most part so you should see large improvements in accuracy of the docs between the code, the website, and the storybook. Huge shoutout to @PavelVanecek 🚀
- Dark mode 🕶️ by @cloud-walker in https://github.com/recharts/recharts/pull/6828
- Thanks @cloud-walker
- Recharts devtools has been added to all website examples for easier issue debugging
New Contributors
- @jkr2255 made their first contribution in https://github.com/recharts/recharts/pull/6777
- @cloud-walker made their first contribution in https://github.com/recharts/recharts/pull/6824
- @bigsaigon333 made their first contribution in https://github.com/recharts/recharts/pull/6868
- @huangkevin-apr made their first contribution in https://github.com/recharts/recharts/pull/6872
Full Changelog: https://github.com/recharts/recharts/compare/v3.6.0...v3.7.0
What's Changed
3.6 🚀 - check out BarStack and ranged stacked bars 📊
Feat
BarStack: new componentBarStackby @PavelVanecek in https://github.com/recharts/recharts/pull/6746- allows configuring settings for the whole stack of bars such as
radius
- allows configuring settings for the whole stack of bars such as
Bar: enable ranged stacked bars by @PavelVanecek in https://github.com/recharts/recharts/pull/6722Pie/Typescript: ExportPieSectorShapePropstype forshapefunction by @ramanverse in https://github.com/recharts/recharts/pull/6706XAxis/YAxis: Implement 'equidistantPreserveEnd' interval option for XAxis and YAxis (#6642) by @Om-Mishra09 in https://github.com/recharts/recharts/pull/6661Tooltip: AddgraphicalItemIdto tooltip payload object by @PavelVanecek in https://github.com/recharts/recharts/pull/6765TypeScript: ExportTooltipIndex,BarRectangleItem,TreemapNode,DataKey,AxisIntervalfrom public API by @Copilot in https://github.com/recharts/recharts/pull/6676
Fix
Scatter: fix bug where Tooltip payload data was duplicated or contained unrelated items when using multipleScatterelements in oneScatterChartby @PavelVanecek in https://github.com/recharts/recharts/pull/6773Label/LabelList:Fix crash whenLabelis passed as content toLabelListby @Harikrushn9118 in https://github.com/recharts/recharts/pull/6732General: Round numbers before putting them to DOM by @PavelVanecek in https://github.com/recharts/recharts/pull/6707General: Store refs instead of IDs to unblock shadow DOM usecases by @PavelVanecek in https://github.com/recharts/recharts/pull/6753
Chore
CartesianAxis: DeprecateCartesianAxis@PavelVanecek in https://github.com/recharts/recharts/pull/6774- Bump to Node 24
- Lots of
undefinedchecks for progress towards TSstrictmode
Docs
- Docs should be improving on the daily - comments in code + storybook + the website should all be coming closer to in sync thanks to @PavelVanecek pretty much writing his own documentation generator 🤖 🚀
New Contributors
- @Om-Mishra09 made their first contribution in https://github.com/recharts/recharts/pull/6661
- @taro-yanagiya made their first contribution in https://github.com/recharts/recharts/pull/6708
- @ramanverse made their first contribution in https://github.com/recharts/recharts/pull/6706
- @Advikkhandelwal made their first contribution in https://github.com/recharts/recharts/pull/6714
- @Harikrushn9118 made their first contribution in https://github.com/recharts/recharts/pull/6732
- @milanchahar made their first contribution in https://github.com/recharts/recharts/pull/6739
Full Changelog: https://github.com/recharts/recharts/compare/v3.5.1...v3.6.0
What's Changed
Fix
Pie: add missingSectorindex toPieshapeprop by @ckifer in https://github.com/recharts/recharts/pull/6683- This enables customization of specific slices of the
Piesimilar toactiveIndexin 2.x
- This enables customization of specific slices of the
Pie: prevent cross-Pie highlighting in multi-PiePieCharts with shared dataKeys by @shreedharbhat98 in https://github.com/recharts/recharts/pull/6678- Only marks a specific Sector as active when that sector is hovered
TypeScript/Tooltip: updateactiveLabeltype to be astring | numberby @ckifer in https://github.com/recharts/recharts/pull/6691- !! NOTE !!: This change may break your types if you relied on it as a string, but this is a bug fix
Accessibility/General: addtabIndex-1 on RechartsZIndexsvg portalgtags to prevent extraneous focusable surfaces by @ckifer in https://github.com/recharts/recharts/pull/6687General: Removed accidental eslint dependency from main dependencies which should remove it from installation with recharts
New Contributors
- @Ashish-rajput999 made their first contribution in https://github.com/recharts/recharts/pull/6694
Full Changelog: https://github.com/recharts/recharts/compare/v3.5.0...v3.5.1
What's Changed
Mostly fixes and performance improvements this release but check out the deprecation of Pie active/inactiveShape in favor of aligning with the shape prop of other chart elements.
Feat
Pie: addshapeto align custom Pie sector shapes to other Recharts components by @ckifer in https://github.com/recharts/recharts/pull/6482- This change deprecates
activeShapeandinactiveShape. Please use theisActiveprop passed from the callback toshapeto create active Pie sectors. - Note: forgot to include the current Sector index, will add in 3.5.1
- This change deprecates
Stacked Charts: implementreverseStackOrderprop in v3 - fixes a regression between recharts 2 and 3 by @j-shimizu111 in https://github.com/recharts/recharts/pull/6644Typescript/Dot: exportActiveDotPropsandDotItemDotPropstypes by @simaks in https://github.com/recharts/recharts/pull/6657
Fix
- Performance Improvements! https://recharts.github.io/en-US/guide/performance/
-
- Optimize
SetTooltipEntrySettingsto break infinite rendering loop by @PavelVanecek in https://github.com/recharts/recharts/pull/6616
- Optimize
- Various performance improvements by @PavelVanecek in https://github.com/recharts/recharts/pull/6634
- Some more performance improvements by @PavelVanecek in https://github.com/recharts/recharts/pull/6654
-
Line: fix animation when interrupted with non-data related changes by @PavelVanecek in https://github.com/recharts/recharts/pull/6641Line/Area: fix active dot appearing outside graph by @cameronm-orion in https://github.com/recharts/recharts/pull/6612Legend: aLegendwith aportalno longer adjusts the margin of the chart (which left an empty space) by @ckifer in https://github.com/recharts/recharts/pull/6609ErrorBar: remove duplicate key warning when error range has same values by @bas0N in https://github.com/recharts/recharts/pull/6660PolarAngleAxis: prevent overlapping "0" and "360" ticks by @PavelVanecek in https://github.com/recharts/recharts/pull/6611Typescript/Area: add specific type toArea.labelinstead ofanyby @PavelVanecek in https://github.com/recharts/recharts/pull/6621General: disable immutable check in production, removes console warnings by @tngwoerleij in https://github.com/recharts/recharts/pull/6619
Docs
- Add guide for performant charts by @PavelVanecek in https://github.com/recharts/recharts/pull/6659
- https://recharts.github.io/en-US/guide/performance/ please follow the guide for best results
- @PavelVanecek fixed and updated a lot of our documentation on both the storybook and website 📖 🚀
New Contributors (thanks everyone!)
- @Parth10P made their first contribution in https://github.com/recharts/recharts/pull/6623
- @j-shimizu111 made their first contribution in https://github.com/recharts/recharts/pull/6644
- @tngwoerleij made their first contribution in https://github.com/recharts/recharts/pull/6619
- @bas0N made their first contribution in https://github.com/recharts/recharts/pull/6660
- @cameronm-orion made their first contribution in https://github.com/recharts/recharts/pull/6612
- @simaks made their first contribution in https://github.com/recharts/recharts/pull/6657
Full Changelog: https://github.com/recharts/recharts/compare/v3.4.1...v3.4.2
What's Changed
Forgot some exports for Z Index in 3.4
- export
DefaultZIndexesandZIndexLayerby @ckifer in https://github.com/recharts/recharts/pull/6599
Full Changelog: https://github.com/recharts/recharts/compare/v3.4.0...v3.4.1
What's Changed
Added z-index support across most recharts surfaces + a few other features, lots of fixes, and some doc updates 🚀
Feat
- Z Index! - You can now add a z index to many chart components to order the position of recharts elements as you wish, mimicking CSS z-index. Big shout out to @PavelVanecek in https://github.com/recharts/recharts/pull/6479
- See the guide page - https://recharts.github.io/en-US/guide/zIndex/
Line: addshapeproperty to allow for custom shape implementations by @tarik02 in https://github.com/recharts/recharts/pull/6512Stacked Bar: improved stacked bar animationsSankey: support for left-aligned Sankey nodes via thealignprop by @dbnl-renaud in https://github.com/recharts/recharts/pull/6568Sankey: support for top-aligned Sankey nodes via theverticalAlignprop by @dbnl-kat https://github.com/recharts/recharts/pull/6576Label: allow overwriting thetextAnchorprop by @PavelVanecek in https://github.com/recharts/recharts/pull/6547
Fix
Stacked Bar / Brush: fix bug in stacked bar charts with a brush where the brush would remove elements from the wrong side of the chart by @37108 in https://github.com/recharts/recharts/pull/6481Area: fix regression in Area event handlers where the events were not firing correctly by @PavelVanecek in https://github.com/recharts/recharts/pull/6507Funnel: fix Funnel margin calculations by @PavelVanecek in https://github.com/recharts/recharts/pull/6453Funnel: fix label position issues from previous release by @PavelVanecek in https://github.com/recharts/recharts/pull/6473Label/Text: correctLabelandTexttypes to only what they can actually render by @PavelVanecek in https://github.com/recharts/recharts/pull/6467Misc: inline a few es-toolkit functions that were causing build errors by @daiboom in https://github.com/recharts/recharts/pull/6543Misc: remove circular dependency import that had potential to cause runtime errors by @ckifer in https://github.com/recharts/recharts/pull/6581
Chore
- Finished adding strict null checks and enabled
strictNullsin TSConfig for good 🚀- by @PavelVanecek in https://github.com/recharts/recharts/pull/6497
Docs
Lots of changes in recharts.github.io
- Switch code editor to codemirror by @PavelVanecek in https://github.com/recharts/recharts/pull/6531
- Added/removed missing/stale properties where applicable from storybook and website
- Few layout/visual changes and fixes on the website
- Much more
New Contributors
- @37108 made their first contribution in https://github.com/recharts/recharts/pull/6481
- @tarik02 made their first contribution in https://github.com/recharts/recharts/pull/6512
- @dbnl-renaud made their first contribution in https://github.com/recharts/recharts/pull/6568
- @coderabbitai[bot] made their first contribution in https://github.com/recharts/recharts/pull/6538
- @dbnl-kat made their first contribution in https://github.com/recharts/recharts/pull/6576
Full Changelog: https://github.com/recharts/recharts/compare/v3.3.0...v3.4.0
What's Changed
Feat
ResponsiveContaineris now built-in to all charts by @PavelVanecek in https://github.com/recharts/recharts/pull/6388- add the
responsiveprop to any chart along with a height and width as if you were usingResponsiveContainer. One less component to wrap things with.ResponsiveContainerwill continue to work for the life of 3.x
- add the
<BarChart data={data} responsive height={300} width="100%">
....
</BarChart>
Fix
YAxis: Only use the YAxiswidth="auto"oscillation detection if the difference is > 1 pixel by @PavelVanecek in https://github.com/recharts/recharts/pull/6450ResponsiveContainer: only shrinks in the dimensions where it needs to shrink by @PavelVanecek in https://github.com/recharts/recharts/pull/6367Treemap: fix animation stutters in Treemap by @PavelVanecek in https://github.com/recharts/recharts/pull/6326Sankey: fix unique key error by @daiboom in https://github.com/recharts/recharts/pull/6352
Website changes - https://recharts.github.io/
- Recharts website is now inlined in recharts/www as opposed to https://github.com/recharts/recharts.org
- NEW recharts website URL at https://recharts.github.io/
Unfortunately the current contributors and admins do not own recharts.org and the renewal of the domain remains up in the air. To remove that uncertainty we have deployed the website at our github pages URL instead.
New Contributors
- @kristiandueholm made their first contribution in https://github.com/recharts/recharts/pull/6344
- @daiboom made their first contribution in https://github.com/recharts/recharts/pull/6352
- @vmizg made their first contribution in https://github.com/recharts/recharts/pull/6387
Full Changelog: https://github.com/recharts/recharts/compare/v3.2.1...v3.3.0
What's Changed
Fix
X/YAxis, etc.: reduce re-renders to fix blinking line in Zoom & Highlight example by @PavelVanecek in https://github.com/recharts/recharts/pull/6315Bar: Remove redundantRectangleimport, fixes tsup builds with recharts in them by @guscost in https://github.com/recharts/recharts/pull/6305Pie: fix PieLabel types by @PavelVanecek in https://github.com/recharts/recharts/pull/6313Brush: fix index off by one error whenmarginis 0 by @ckifer in https://github.com/recharts/recharts/pull/6323- Enable dev tools via Global module instead of window by @uncaught in https://github.com/recharts/recharts/pull/6309
New Contributors
- @guscost made their first contribution in https://github.com/recharts/recharts/pull/6305
Full Changelog: https://github.com/recharts/recharts/compare/v3.2.0...v3.2.1
What's Changed
Quite a bit of 3.0 bug fixes in this release along with two new hooks. Thanks to all who've been reporting issues!
Feat
Pie: support string values in PieouterRadiuscallbacks by @rephaelberkooz in https://github.com/recharts/recharts/pull/6191PolarGrid: addfillcolor support to by @mindtraveller in https://github.com/recharts/recharts/pull/6287
Hooks
- New :
useXAxisDomainanduseYAxisDomainhooks by @PavelVanecek in https://github.com/recharts/recharts/pull/6201 - New:
useMarginhook by @PavelVanecek in https://github.com/recharts/recharts/pull/6224
Fix
Bar: fix unnecessary line breaks in Bar labels by @eino in https://github.com/recharts/recharts/pull/6214Bar: improveBarperformance whenactiveBaris turned off by @PavelVanecek in https://github.com/recharts/recharts/pull/6290Stacked Bar/Area: fix stacked charts with duplicate categorical data by @PavelVanecek in https://github.com/recharts/recharts/pull/6194Scatter: fix exception when Scatter data has non-stringtypeproperty by @PavelVanecek in https://github.com/recharts/recharts/pull/6248X/YAxis: fix blinking when changing props by @PavelVanecek in https://github.com/recharts/recharts/pull/6262PolarAngleAxis/Radar: fix polar angle axis ticks text positions by @mindtraveller in https://github.com/recharts/recharts/pull/6276Label: allow rendering Labels as nested children inXAxis,YAxisand Reference elements by @PavelVanecek in https://github.com/recharts/recharts/pull/6219LabelList: fix issue with LabelList not rendering inPiecharts by @PavelVanecek in https://github.com/recharts/recharts/pull/6246Text: fix exception whenText's children is empty and scaleToFit=true by @PavelVanecek in https://github.com/recharts/recharts/pull/6282Tooltip: bound Tooltip coordinates to the chart container in synchronized charts by @shreedharbhat98 in https://github.com/recharts/recharts/pull/6263Brush:allow brush travelers to be controlled by keys after mouse interaction by @ckifer in https://github.com/recharts/recharts/pull/6285useActiveTooltipDataPoints: fix infinite rendering loop by @PavelVanecek in https://github.com/recharts/recharts/pull/6247
Chore
- Upgrade to ESLint 9 by @NishargShah in https://github.com/recharts/recharts/pull/6284
- Add better storybook docs for Text component by @PavelVanecek in https://github.com/recharts/recharts/pull/6278
- Make Recharts Redux devTools registration opt-in (fixes #6250) by @uncaught in https://github.com/recharts/recharts/pull/6264
- Continued refactoring/improvements by @PavelVanecek 🚀
New Contributors (thanks everyone!)
- @rephaelberkooz made their first contribution in https://github.com/recharts/recharts/pull/6189
- @uncaught made their first contribution in https://github.com/recharts/recharts/pull/6264
- @mindtraveller made their first contribution in https://github.com/recharts/recharts/pull/6276
- @NishargShah made their first contribution in https://github.com/recharts/recharts/pull/6284
Full Changelog: https://github.com/recharts/recharts/compare/v3.1.2...v3.1.3
What's Changed
Fix
Label/Polar Charts:Labelviewbox should now be present in polar charts and address https://github.com/recharts/recharts/issues/6030 by @PavelVanecek in https://github.com/recharts/recharts/pull/6180- Add LRU cache for string size measurements (#3955) by @shreedharbhat98 in https://github.com/recharts/recharts/pull/6176
Full Changelog: https://github.com/recharts/recharts/compare/v3.1.1...v3.1.2
What's Changed
Fix
General: Don't apply duplicate IDs in the DOM by @PavelVanecek in https://github.com/recharts/recharts/pull/6111Stacked Area/Bar: give all graphical items their own unique identifier and use that to select stacked data. Fixes issue where stacked charts could not be created from the graphical itemdataprop https://github.com/recharts/recharts/issues/6073 by @PavelVanecekStacked Area/Bar: exclude stacked axis domain when not relevant for axis by @rinkstiekema in https://github.com/recharts/recharts/pull/6162 fixes issue where numeric stacked charts would not render correctlyArea Chart: ranged area chart - show active dot on both points instead of just the top one by @sroy8091 in https://github.com/recharts/recharts/pull/6116 fixes #6080Polar Charts/Label: fixLabelin polar charts by @PavelVanecek in https://github.com/recharts/recharts/pull/6126Scatter/ErrorBar: choose implicit Scatter ErrorBar direction based on chart layout (to be the same as 2.x) by @PavelVanecek in https://github.com/recharts/recharts/pull/6159X/YAxis/Reference Components: allow axis values and reference items to render when there is no data but there is a domain/explicit ticks set by @ethphan in https://github.com/recharts/recharts/pull/6161X/YAxis: pass axis padding info to custom tick components by @shreedharbhat98 in https://github.com/recharts/recharts/pull/6163
Chore / Testing
- good progress on our journey to enable
strictNullChecks - addition of playwright visual regression tests to CI
- split
AnimateintoJavascriptAnimateandCSSTransitionAnimateby @PavelVanecek in https://github.com/recharts/recharts/pull/6175
New Contributors
- @sroy8091 made their first contribution in https://github.com/recharts/recharts/pull/6116
- @ethphan made their first contribution in https://github.com/recharts/recharts/pull/6161
Full Changelog: https://github.com/recharts/recharts/compare/v3.1.0...v3.1.1
What's Changed
Bug fixes (old and new) and a few new hooks post 3.0 launch!
Feat
More hooks!
- Add
useOffsetandusePlotAreahooks by @PavelVanecek in https://github.com/recharts/recharts/pull/6057 - Add
useActiveTooltipDataPointshook by @PavelVanecek in https://github.com/recharts/recharts/pull/6067
Fix
Legend: After hiding and showing legend elements, keep them in the same order as before by @PavelVanecek in https://github.com/recharts/recharts/pull/6026Bar: addpayloadas a valid property onBarRectangleItemby @ckifer in https://github.com/recharts/recharts/pull/6029Accessibility: Removerole=applicationfrom recharts wrapper (this was removed in 2.x for accessibility reasons) by @PavelVanecek in https://github.com/recharts/recharts/pull/6060ResponsiveContainer: Addoverflow: visiblezero-size wrapper so that ResponsiveContainer can shrink by @PavelVanecek in https://github.com/recharts/recharts/pull/6068X/YAxis: FixtickCountandallowDecimalsif axis domain does not include the keyword 'auto' by @PavelVanecek in https://github.com/recharts/recharts/pull/6070Tooltip: Fix active tooltip and dots when there are multiple graphical items each with their own data by @PavelVanecek in https://github.com/recharts/recharts/pull/6074
Docs
- Our storybook stories can now open in stackblitz by @PavelVanecek in https://github.com/recharts/recharts/pull/6043
- Add hook inspector documentation by @PavelVanecek in https://github.com/recharts/recharts/pull/6059
Chore
- Remove duplicate 'square' from Pie component’s legendType summary by @davinahi in https://github.com/recharts/recharts/pull/6054
New Contributors
- @davinahi made their first contribution in https://github.com/recharts/recharts/pull/6054
Full Changelog: https://github.com/recharts/recharts/compare/v3.0.2...v3.1.0
What's Changed
Please skip 3.0.1 and go straight to 3.0.2 - https://github.com/recharts/recharts/issues/6022. In React.StrictMode charts in 3.0.1 were not rendering at all. This revert should resolve that.
revert: revert preserve legend order by @ckifer in https://github.com/recharts/recharts/pull/6023
Full Changelog: https://github.com/recharts/recharts/compare/v3.0.1...v3.0.2
⚠️ Version 3.0.1 has a bug where some charts will not render in React strict mode. Please use 3.0.2 or higher. ⚠️
What's Changed
Lots of fixes from the 3.0 release - thanks for the reports!
Edit: broke something https://github.com/recharts/recharts/issues/6022
Fix
Label: fix an issue which causedlabelRefto get passed to custom DOM elements which logged an error/warning by @saurabhraj123 in https://github.com/recharts/recharts/pull/6008Pie->Label: fix issue where pie labels were not rendering correctly when specified as a child ofPieby @PavelVanecek in https://github.com/recharts/recharts/pull/5987Legend: apply legenditemSorterfor customcontentas well as default content by @PavelVanecek in https://github.com/recharts/recharts/pull/6012*Legend: keep legend items in the same order when they are hidden and shown by @PavelVanecek in https://github.com/recharts/recharts/pull/6017Bar->Brush: fix undefined access error when usingBrushwith stacked bar charts by @PavelVanecek in https://github.com/recharts/recharts/pull/6009X/YAxis: fixDecimalErrorwhen creating vertical oriented charts with a single datapoint by @ckifer in https://github.com/recharts/recharts/pull/6016X/Y/PolarAngle/PolarRadius Axis:tickFormatteris no longer called with data indexes before the actual data by @PavelVanecek in https://github.com/recharts/recharts/pull/6019
Full Changelog: https://github.com/recharts/recharts/compare/v3.0.0...v3.0.1
🚀 Recharts 3 is here!
Huge shoutout to @PavelVanecek who wrote 95% of the code for this major version release. We re-wrote recharts state management, wrote some 3500 unit tests, fixed a bunch of bugs, and added a few well-requested features.
The intent with 3.0 is that it is now a better/easier place for the community to contribute to. Looking forward to what the future of recharts looks like in 3.x and beyond!
More details and the 3.0 migration guide
BREAKING CHANGES
Please see https://github.com/recharts/recharts/wiki/3.0-migration-guide#breaking-code-changes
tldr;
CategoricalChartState(which was access to recharts internal state) no longer exists in event handlers orCustomized, etc.<Customized />no longer receives recharts state/props- Removal of internal props that were always supposed to only be internal to recharts
- Remove previously deprecated props
- ...see full list linked above
New Features
- Custom Components - you can now render any react component in the recharts tree structure (but it must still be renderable within an SVG). Previously this was controlled and filtered by recharts
- Tooltip Portals - you can now use portals to position your tooltip data anywhere you'd like, including outside of your chart
- Legend Portals - similar to the above, you can now use portals to position your Legend anywhere you'd like, including outside of your chart
- Accessible by default -
accessibilityLayeris now on on all polar and cartesian charts by default. Tab into the chart and use the arrow keys to navigate. - Polar charts now support multiple axes (similar to cartesian charts)
- Tooltip: You can now select which axis your Tooltip belongs to using
axisId YAxis: auto width calculation for YAxes - setwidth="auto"X/YAxis: Addsymlogd3 scale type
Bug fixes and improvements
This release fixes some long standing issues in recharts, the easiest way to determine all of them is to take a look at the recharts 3.0 project board
- Animation improvements
- Typescript improvements
- Accessibility fixes/improvements
Pie: no more border around pie sectors on click, etc.CartesianGrid: background now renders below the grid lines instead of above- and more!
Our 3.0 storybook has a lot of updated examples!
What's Changed
Last 2.x patch - releasing since the @babel/runtime vulnerability is showing up in some security scans. Hoping to release 3.0 on 6/22 🚀
Fix
X/YAxis: fix issue where recharts class names did not get passed to custom tick components by @MyungAe in https://github.com/recharts/recharts/pull/5840Bar: allowminPointSizefunction to receive null and undefined values by @eino in https://github.com/recharts/recharts/pull/5947TypeScript: fix issue which caused build errors whenallowSyntheticDefaultImports: falseby @tfaller in https://github.com/recharts/recharts/pull/5810
Security
- resolve @babel/runtime ReDoS vulnerability (SNYK-JS-BABELRUNTIME-10044504) by @moehaje in https://github.com/recharts/recharts/pull/5969
- recharts isn't vulnerable to this per-se, but it does show up in security tooling like snyk
New Contributors
- @moehaje made their first contribution in https://github.com/recharts/recharts/pull/5969
Full Changelog: https://github.com/recharts/recharts/compare/v2.15.3...v2.15.4
Last patch release before 3.0 🚀
What's Changed
Fix
XAxis: fix padding calculation forpadding="gap"andpadding="no-gap"when XAxis is type number by @jackfletch in https://github.com/recharts/recharts/pull/5759
Full Changelog: https://github.com/recharts/recharts/compare/v2.15.2...v2.15.3
What's Changed
Few bugfixes and bug fix backports for 2.x
Fix
Bar/Rectangle: add index back to Bar Rectangle key to prevent duplicate key issues by @ckifer in https://github.com/recharts/recharts/pull/5561Dot: re-includepointsobject in dotProps by @brodriguezmilla in https://github.com/recharts/recharts/pull/5657Tooltip: addSVGPropsto Tooltip payload type to account for svg properties such as opacity passed by the user by @ally1002 in https://github.com/recharts/recharts/pull/5712Tooltip/Bar: fixactiveBarprop not working when tooltipshared={false}by @nizans in https://github.com/recharts/recharts/pull/5718General: allowdata-*props to be spread on svg elements and not be filtered out by @prtmwrkr in https://github.com/recharts/recharts/pull/5666
New Contributors
- @brodriguezmilla made their first contribution in https://github.com/recharts/recharts/pull/5657
- @nizans made their first contribution in https://github.com/recharts/recharts/pull/5718
Full Changelog: https://github.com/recharts/recharts/compare/v2.15.1...v2.15.2
What's Changed
Quick patch release, nothing crazy going on here.
In the meantime please help us test recharts 3.0 alpha https://github.com/recharts/recharts/issues/5445 🚀
Fix
Legend - Typescript: adddataKeytype to legend formatter props by @lucasassisrosa in https://github.com/recharts/recharts/pull/5511. Fixes https://github.com/recharts/recharts/issues/5508
Chore
- Make sure
react-smoothversion is up to date in package.json for R19 support by @acomanescu in https://github.com/recharts/recharts/pull/5422
New Contributors
- @acomanescu made their first contribution in https://github.com/recharts/recharts/pull/5422
- @lucasassisrosa made their first contribution in https://github.com/recharts/recharts/pull/5511
Full Changelog: https://github.com/recharts/recharts/compare/v2.15.0...v2.15.1
What's Changed
Final 2.x React 19 support
!!! You still need to override your react-is version to match react/react-dom for React 19 to work with recharts !!! - see thread here - this limitation will be alleviated in recharts 3.0
Feat
Add React 19 to peerDependencies - closes https://github.com/recharts/recharts/issues/4558
Fix
Bar: fix Bar mouse event types regression - closes https://github.com/recharts/recharts/issues/5308- Remove React19 deprecated
ReactTexttype
Full Changelog: https://github.com/recharts/recharts/compare/v2.14.1...v2.15.0
What's Changed
Fix
X/YAxis: omit unused/accidentally added (in 2.13)refprop from axis types in https://github.com/recharts/recharts/pull/5295. Resolves https://github.com/recharts/recharts/issues/5294
Full Changelog: https://github.com/recharts/recharts/compare/v2.14.0...v2.14.1
What's Changed
Small release to get new top level chart events out there. Still working on 3.x, a little slower right now because of the holidays.
Feat
Area/Line/Bar/Scatter/Pie/Radar/RadialBar/FunnelChart components: add support for top levelonContextMenuandonDoubleClickevents #5254 by @abarreau in https://github.com/recharts/recharts/pull/5255
Fix
Typescript fixes
LabelList:dataKeyprop for LabelList should accept any object by @ckifer in https://github.com/recharts/recharts/pull/5252Pie:PieSectorDataItem.payloadshould be an object rather than an array by @BTOdell in https://github.com/recharts/recharts/pull/5263
New Contributors
- @abarreau made their first contribution in https://github.com/recharts/recharts/pull/5255
- @BTOdell made their first contribution in https://github.com/recharts/recharts/pull/5263
Full Changelog: https://github.com/recharts/recharts/compare/v2.13.3...v2.14.0
What's Changed
Small change which may (or may not) help when using ResponsiveContainer with React 19. Worth a shot.
!! react-is override is still needed for React 19 to work correctly with recharts !! - see https://github.com/recharts/recharts/issues/4558
Fix
- https://github.com/recharts/recharts/commit/7a67b414bddaae93c263bfd918f9e552fc9b184f
ResponsiveContainer- swapisElementfromreact-iswithReact.isValidElement
Full Changelog: https://github.com/recharts/recharts/compare/v2.13.2...v2.13.3
What's Changed
- Another fix from 2.13. Categorical charts should have their
refprops back.
Fix
- fix: forwardRef to CategoricalChartWrapper from CategoricalChart by @ckifer in https://github.com/recharts/recharts/pull/5176 - fixes https://github.com/recharts/recharts/issues/5113
Full Changelog: https://github.com/recharts/recharts/compare/v2.13.1...v2.13.2
What's Changed
- Small bug fixes from the 2.13 release
Fix
ResponsiveContainer: fix internal bug from 2.13 which causes responsive container to render incorrectly by @ckifer in https://github.com/recharts/recharts/pull/5174Bar:radiusprop type fixed to match expected type by @lifeofpavs in https://github.com/recharts/recharts/pull/5116
New Contributors
- @lifeofpavs made their first contribution in https://github.com/recharts/recharts/pull/5116
Full Changelog: https://github.com/recharts/recharts/compare/v2.13.0...v2.13.1
What's Changed
React 19 compat, fix annoying defaultProps warnings, bug fixes
Feat
-
React 19 compatibility - see https://github.com/recharts/recharts/issues/4558
peerDependenciesstill cannot be updated until 3.0 release, but for now R19 beta/RC releases can be used with Recharts under the following conditions:- Your
react-isversion matches yourreactandreact-domversions: use your package manager'soverridefunctionality to match yourreact-isversion to your react version or else recharts elements will not show - see https://github.com/recharts/recharts/issues/4558#issuecomment-2135604065
- Your
-
CartesianGrid: add support forryprop to curve the corner of the grid background - progress on https://github.com/recharts/recharts/issues/3062
Fix
General: FixdefaultPropsusage in function components, removes warnings on all affected components - see https://github.com/recharts/recharts/issues/3615ReferenceLine: fix accidental removal of type annotation by @zackliscio in https://github.com/recharts/recharts/pull/4610Line/Area: fix issue whereclipDotwould not take effect if it was the only property indotProps@ckifer in https://github.com/recharts/recharts/pull/4674Tooltip: fix issue where tooltip would not show in certain cases ifdatawas set on the graphical item by @HHongSeungWoo in https://github.com/recharts/recharts/pull/4718X/YAxis: use correct, adapted event types by @ckifer in https://github.com/recharts/recharts/pull/4967Tooltip:defaultIndexout of range error by @ckifer in https://github.com/recharts/recharts/pull/5054Pie: fix duplicate key error @ckifer in https://github.com/recharts/recharts/pull/4958Text: fix duplicate key error by @ckifer in https://github.com/recharts/recharts/pull/5088 closes https://github.com/recharts/recharts/issues/5072
Typescript
- JSDoc comments will now be preserved in TypeScript definitions by @mxdvl in https://github.com/recharts/recharts/pull/5071
New Contributors
- @zackliscio made their first contribution in https://github.com/recharts/recharts/pull/4610
Full Changelog: https://github.com/recharts/recharts/compare/v2.12.7...v2.13.0
Whats changed
Fix
Area: re-add calculated areapointsto theareaDotcallback props when it is a function. This was accidentally removed in v2.3. Fixes #4480Brush: guard against undefined property access error when anariaLabelis not specified. Follow up from https://github.com/recharts/recharts/issues/2093#issuecomment-2098161840
Full Changelog: https://github.com/recharts/recharts/compare/v2.12.6...v2.12.7
What's Changed
Fix
Tooltip: fix glitch where Tooltip always rendered in the top left even if animation was disabled by @HHongSeungWoo in https://github.com/recharts/recharts/pull/4425 fixes https://github.com/recharts/recharts/issues/4424
Chore
CI/Build fix: Added proper.jssuffixes to main module and jsnext:main paths in package.json by @dobosalparbc in https://github.com/recharts/recharts/pull/4431 fixes https://github.com/recharts/recharts/issues/2858
Full Changelog: https://github.com/recharts/recharts/compare/v2.12.5...v2.12.6
Small fixes while working on v3 continued...
What's Changed
Feat
BarChart: support percentage (of chart) forbarSize. Helps set size of bar when there are few datapoints Fixes #3640 by @graup in https://github.com/recharts/recharts/pull/4407
Fix
Address https://github.com/recharts/recharts/issues/4382
A recent release of @types/react broke some builds because they removed certain (unused) events from common event handler attributes. recharts was unknowingly enumerating keys of SVGProps in the Layer component with the old types and causing a type error on tsc with skipLibCheck: false
typescript - Layer: useSVGAttributesinstead ofSVGPropsin forwardRef components by @ckifer in https://github.com/recharts/recharts/pull/4413typescript - Pie: fix Pierefwhich was cast toHTMLElementwhen therefis actually referring toSVGGElement. This gave false information to whoever is usingrefon thePiecomponent
Full Changelog: https://github.com/recharts/recharts/compare/v2.12.4...v2.12.5
What's Changed
Small fixes while working on v3 continued...
Fix
Accessibility: remove role attribute from recharts-wrapper which caused an accessibility violation with > 1 chart on the same page by @julianna-langston in https://github.com/recharts/recharts/pull/4386, fixes #4384X/YAxis: fix incorrect padding calculation when there is 1 datapoint or less by @graup in https://github.com/recharts/recharts/pull/4314 closes #4313
className fixes - helps slowly address https://github.com/recharts/recharts/issues/2169:
Tooltip: allow customclassNameoncursorby @108yen in https://github.com/recharts/recharts/pull/4306RadarChart/RadialBarChart: allow customclassNameonPolarRadiusAxis,PolarAngleAxis, andRadardot by @108yen in https://github.com/recharts/recharts/pull/4335Pie: allow customclassNameonlabelandlabelLineofPieby @108yen in https://github.com/recharts/recharts/pull/4381
Full Changelog: https://github.com/recharts/recharts/compare/v2.12.3...v2.12.4
Some more small changes/fixes while working on 3.x
What's Changed
Fix
Legend: fix issue where Legend was not taken into account when scaling the chart container by @zhonglin94 in https://github.com/recharts/recharts/pull/4272 closes https://github.com/recharts/recharts/issues/4246Area: fixed a bug where className was not assigned to areaDot by @108yen in https://github.com/recharts/recharts/pull/4294 closes https://github.com/recharts/recharts/issues/4290RadialBar: address regression where radial bar and its background were off from eachother because of rounding by @ckifer in https://github.com/recharts/recharts/pull/4295 closes https://github.com/recharts/recharts/issues/4264ErrorBar: do not countnullas 0 in error bar domain by @rinkstiekema in https://github.com/recharts/recharts/pull/4297
New Contributors
- @zhonglin94 made their first contribution in https://github.com/recharts/recharts/pull/4272
Full Changelog: https://github.com/recharts/recharts/compare/v2.12.2...v2.12.3
What's Changed
Some more small fixes while working on 3.x
Fix
Pie: pie label keys are not unique when data is 0 by @ckifer in https://github.com/recharts/recharts/pull/4224ResponsiveContainer: Remove incorrectly timed console.warn call, only log when using soon-to-be deprecated feature by @HHongSeungWoo in https://github.com/recharts/recharts/pull/4249
Full Changelog: https://github.com/recharts/recharts/compare/v2.12.1...v2.12.2
What's Changed
Unintentional regression broke panoramic/compact Brush in 2.11.0 and 2.12.0, backport the fix to 2.x as we work on 3.x
Fix
- fix: compact render should read from context, fixes brush panorama by @ckifer in https://github.com/recharts/recharts/pull/4194 fixes https://github.com/recharts/recharts/issues/4193
Full Changelog: https://github.com/recharts/recharts/compare/v2.12.0...v2.12.1
What's Changed
Bug fixes and a few small new features.
Releasing 2.12.0 to create a "clean slate" as contributors are discussing next moves for recharts.
We will try to focus on upgrades, architectural changes, and long-pending breaking changes so we can release a recharts v3. This will not be a large major version, or one hard to upgrade to, but rather a major version bump to prevent us from breaking people with library upgrades, large refactors, etc. Feature parity should hold. Thanks!
Features
Bar: Accept a callback function forminPointSizeso it can be determined by data by @ckifer in https://github.com/recharts/recharts/pull/4099 closes https://github.com/recharts/recharts/issues/2819Accessibility: Enable screen reader support with accessibilityLayer and default tooltip by @julianna-langston in https://github.com/recharts/recharts/pull/4077
Fix
Bar:activeBarshould not be true by default, fixes a breaking change from 2.9.0 by @ckifer in https://github.com/recharts/recharts/pull/4139 - fixes https://github.com/recharts/recharts/issues/4103 and https://github.com/recharts/recharts/issues/4101Scatter: fix non-unique key errors by @imagineLife in https://github.com/recharts/recharts/pull/4087 - fixes https://github.com/recharts/recharts/issues/4151 and https://github.com/recharts/recharts/issues/4060Pie: fix non-unique key errors by @imagineLife in https://github.com/recharts/recharts/pull/4106Tooltip: fix bug that caused throttled tooltip to stay active when moving mouse quickly by @HHongSeungWoo in https://github.com/recharts/recharts/pull/4100 fixes https://github.com/recharts/recharts/issues/4093
Chore
- Cleanup, tests, and refactoring work. Thanks @PavelVanecek
- Upgrade react smooth, remove
translateStyle, remove prop-types as a peerDep- NOTE: animations will no longer have browser prefixes on them. Browsers have good support for this (https://caniuse.com/?search=transforms)
- Upgrade dev dependencies
- Upgrade TypeScript to 4.9.5 (no definition changes from upgrade)
Storybook
- New storybook stories and doc updates
New Contributors
- @TRFielder made their first contribution in https://github.com/recharts/recharts/pull/4088
Full Changelog: https://github.com/recharts/recharts/compare/v2.11...v2.12.0
What's Changed
Fix some older bugs annoying bugs, TS typings, update to the storybook theme, and more
Fix
ResponsiveContainer: fixref.current.currentwithout breaking users using current implementation by @HHongSeungWoo in https://github.com/recharts/recharts/pull/4008 - closes https://github.com/recharts/recharts/issues/3718Brush: Allow Brush to be controlled with start and end index via state by @ckifer in https://github.com/recharts/recharts/pull/4034 - closes https://github.com/recharts/recharts/issues/2404Legend: TypeScript - Add the dataKey type to legend props by @HHongSeungWoo in https://github.com/recharts/recharts/pull/4035 - closes https://github.com/recharts/recharts/issues/2909Pie: TypeScript - addedpayloadtoPieSectorDataItemtype by @PavelVanecek in https://github.com/recharts/recharts/pull/4030Pie: unique sector keys fix by @imagineLife in https://github.com/recharts/recharts/pull/4009 closes https://github.com/recharts/recharts/issues/3273RadialBar: allow className to be passed to Radial Bar background by @ckifer in https://github.com/recharts/recharts/pull/4027 - closes https://github.com/recharts/recharts/issues/4011
Storybook
- Storybook: Added Legend component story! by @AnujSharma141 in https://github.com/recharts/recharts/pull/4039
- Storybook: add controlled brush storybook entry by @ckifer in https://github.com/recharts/recharts/pull/4032
- Storybook: Custom Storybook theme for Recharts brand by @csdiehl in https://github.com/recharts/recharts/pull/4016
New Contributors
- @csdiehl made their first contribution in https://github.com/recharts/recharts/pull/4016
- @AnujSharma141 made their first contribution in https://github.com/recharts/recharts/pull/4039
Full Changelog: https://github.com/recharts/recharts/compare/v2.10.3...v2.10.4
What's Changed
- Fix non-unique react
keybug(s) by @imagineLife in https://github.com/recharts/recharts/pull/4006 - closes https://github.com/recharts/recharts/issues/4004
New Contributors
- @hkmarques made their first contribution in https://github.com/recharts/recharts/pull/4002
Full Changelog: https://github.com/recharts/recharts/compare/v2.10.2...v2.10.3
What's Changed
Patch some bugs from 2.9 / 2.10
Fix
Tooltip: Fix tooltip rendering crash when activeItem is undefined by @tran-simon in https://github.com/recharts/recharts/pull/3982Cursor: should no longer show gray background on hover where there was none previously @HHongSeungWoo in https://github.com/recharts/recharts/pull/3992Tooltip: show tooltip whendataprop is on individual cartesian component by @HHongSeungWoo in https://github.com/recharts/recharts/pull/3988LabelList- TypeScript: LabelList offset prop issue by @ckifer in https://github.com/recharts/recharts/pull/3999
Accessibility
Brush: set default aria-label and allow value override by @enriquetamames-cpi in https://github.com/recharts/recharts/pull/3950
Refactor / Cleanup
- Removing some eslint errors for "no array index key" by @imagineLife
New Contributors
- @tran-simon made their first contribution in https://github.com/recharts/recharts/pull/3982
- @enriquetamames-cpi made their first contribution in https://github.com/recharts/recharts/pull/3950
Full Changelog: https://github.com/recharts/recharts/compare/v2.10.1...v2.10.2
Fix
Brush: Fix an issue where after 2.9 Brush does not correctly slice data when using Line components - fixes https://github.com/recharts/recharts/issues/3929 - thank you @HHongSeungWoo
Fix another TS issue from 2.9.
Fix
Line/ActiveDot: Fix breaking type change for theonClickfunction ofactiveDotonLine- this resolves https://github.com/recharts/recharts/issues/3922 - thank you @andrewangelle for the quick turnaround
Bug fixes following 2.9.0
Fix
TypeScript: fix breaking change inActiveShapetypes - fixes https://github.com/recharts/recharts/issues/3911 - thanks @andrewangelleCartesianGrid: fix breaking change where you could no longer renderCartesianGridwithout a y-axis - fixes https://github.com/recharts/recharts/issues/3907 - thanks @akamfoadLine: fix infinite loop whenstrokeDasharrayis'0'onLine- fixes https://github.com/recharts/recharts/issues/3899 (and maybe others)
Full Changelog: https://github.com/recharts/recharts/compare/v2.9.0...v2.9.1
What's Changed
Quite a lot this minor release! We sent out a cry for help and many answered - thank you so much for that 🙌🏼
This release aims at internal maintainability, long lingering bugs, and needed improvements. Highlights include equidistant tick improvements, an active bar feature, and an ~85k/~9kb (gzipped) bundle size reduction 🚀
Feat
Bar: Implement activeBar for Bar component by @andrewangelle in https://github.com/recharts/recharts/pull/3756CartesianGrid: addsyncWithticks,horizonalValues, andverticalValuesprops to allow more grid line customization by @morozovkirill in https://github.com/recharts/recharts/pull/3746 solves https://github.com/recharts/recharts/issues/2153CartesianAxis: Improve interval option 'equidistantPreserveStart' by @nikolasrieble in https://github.com/recharts/recharts/pull/3768CartesianAxis: Throw an invariant when axisIds do not match between chart and axis components by @ckiferBrush: add onDragEnd event to Brush component by @simkesd in https://github.com/recharts/recharts/pull/3774
Fix
- Active Shape improvements
Funnel: activeShape should work with Tooltip by @andrewangelle in https://github.com/recharts/recharts/pull/3772Scatter: activeShape should work with Tooltip by @andrewangelle in https://github.com/recharts/recharts/pull/3839Pie: activeShape should work with Tooltip by @andrewangelle in https://github.com/recharts/recharts/pull/3818RadialBar: activeShape should work with Tooltip by @andrewangelle in https://github.com/recharts/recharts/pull/3803
CartesianGrid: Remove offset attribute from lines by @branberry in https://github.com/recharts/recharts/pull/3854 solves https://github.com/recharts/recharts/issues/3810ResponsiveContainer: style prop is now passed down correctly by @d-gottlieb in https://github.com/recharts/recharts/pull/3726Legend: "Functions are not valid as a React child" error inTooltip: Fix tooltip position when container uses transform scale by @MateuszTrN in https://github.com/recharts/recharts/pull/3748Tooltip: Tooltip does not include data from all charts when a separate dataset is passed to chart prop data and specified on Line/Area/etc prop data by @andrewangelle in https://github.com/recharts/recharts/pull/3733 fixes https://github.com/recharts/recharts/issues/3669
Refactor
Impossible to mention all of the great refactoring done this release thanks to @PavelVanecek (33 PRs in one month!!) and others! Notable improvements include (non-breaking) type safety enhancements and source code file size reductions, and unit test improvements that will help reduce regressions.
Chore
- Upgrade react-smooth to 2.0.5 - potentially fixes https://github.com/recharts/recharts/issues/1135 (edit: this was already fixed)
- Add performance testing tool by @PavelVanecek in https://github.com/recharts/recharts/pull/3829
- remove reduceCSSCalc by @HHongSeungWoo in https://github.com/recharts/recharts/pull/3820
Storybook
- Add storybook-addon-performance by @PavelVanecek in https://github.com/recharts/recharts/pull/3826
- many storybook improvements and fixes
🚀 New Contributors (!!) 🚀
- @d-gottlieb made their first contribution in https://github.com/recharts/recharts/pull/3726
- @andrewangelle made their first contribution in https://github.com/recharts/recharts/pull/3733
- @wanisramdani made their first contribution in https://github.com/recharts/recharts/pull/3751
- @MateuszTrN made their first contribution in https://github.com/recharts/recharts/pull/3748
- @chris-mcdonald-dev made their first contribution in https://github.com/recharts/recharts/pull/3750
- @PavelVanecek made their first contribution in https://github.com/recharts/recharts/pull/3759
- @simkesd made their first contribution in https://github.com/recharts/recharts/pull/3774
- @samtmorgan made their first contribution in https://github.com/recharts/recharts/pull/3778
- @Shashangbhagat made their first contribution in https://github.com/recharts/recharts/pull/3786
- @morozovkirill made their first contribution in https://github.com/recharts/recharts/pull/3746
- @branberry made their first contribution in https://github.com/recharts/recharts/pull/3854
- @HHongSeungWoo made their first contribution in https://github.com/recharts/recharts/pull/3820
Full Changelog: https://github.com/recharts/recharts/compare/v2.8.0...v2.9.0
What's Changed
Minor changes - mostly focused on resolving errors from https://github.com/recharts/recharts/issues/3615
Feat
Pie: default tabIndex and accept it as prop by @akamfoad in https://github.com/recharts/recharts/pull/3700Sankey: add prop to control sankey sorting by @daformat in https://github.com/recharts/recharts/pull/3690- [a11y]
Brush: Add basic keyboard accessibility support for the Brush component by @julianna-langston in https://github.com/recharts/recharts/pull/3633 RadialBarChart: support className prop by @victorgare in https://github.com/recharts/recharts/pull/3654
Fix
- defaultProps errros on function components in newer versions of react - fixes https://github.com/recharts/recharts/issues/3615
- TS: Add value type to legend Formatter event by @daryl-sf in https://github.com/recharts/recharts/pull/3668
- Switch useLayoutEffect to useEffect in Rectangle for SSR by @sieroaoj in https://github.com/recharts/recharts/pull/3657
Refactor
- refactor function components to use default params, revert Tooltip to class based component - resolves console errors about defaultProps
Docs
- Some storybook example additions/changes
New Contributors
- @victorgare made their first contribution in https://github.com/recharts/recharts/pull/3654
- @gcallaghan-nd made their first contribution in https://github.com/recharts/recharts/pull/3662
- @sieroaoj made their first contribution in https://github.com/recharts/recharts/pull/3657
- @daryl-sf made their first contribution in https://github.com/recharts/recharts/pull/3668
- @daformat made their first contribution in https://github.com/recharts/recharts/pull/3690
Full Changelog: https://github.com/recharts/recharts/compare/v2.7.2...v2.8.0
tiny 1 change patch release that merges https://github.com/recharts/recharts/pull/3662 to fix an accessibility issue
- Fixes an ADA compliance issue by removing the
imgrole from line dots
What's Changed
Fix
- Allow
accessibilityLayerwhen there is no tooltip (fixes undefined access bug) by @julianna-langston in https://github.com/recharts/recharts/pull/3627 - Fix regression when
nullis passed into Linedot(fixes undefined access bug althoughnullis not a supported type fordot) by @ckifer in https://github.com/recharts/recharts/pull/3637
Other
- Few minor storybook changes and dev chore items
Full Changelog: https://github.com/recharts/recharts/compare/v2.7.1...v2.7.2
What's Changed
Fix
- Move @storybook/addon-storysource to dev dependencies by @DmitryMarkov in https://github.com/recharts/recharts/pull/3623
- Moves dev dependency to correct location to prevent bundle size increase, etc.
- Fix defaults for r and strokeWidth when they aren't provided by the user by @ckifer in https://github.com/recharts/recharts/pull/3624
- Bug where if only
clipDotis provided withindotof Area and Line then dots disappear andNaNis errors appear in the DOM
- Bug where if only
New Contributors
- @DmitryMarkov made their first contribution in https://github.com/recharts/recharts/pull/3623
Full Changelog: https://github.com/recharts/recharts/compare/v2.7.0...v2.7.1
What's Changed
Storybook updates, a few new features, bug fixes.
Note: This release may cause more reports of this defaultProps warning - we are aware of this and trying to come up with a feasible solution.
Feat
- Allow adding initial dimensions to ResponsiveContainer by @akamfoad in https://github.com/recharts/recharts/pull/3596
- Extend clip path configuration with
clipDotprop by @tylerben @ckifer in https://github.com/recharts/recharts/pull/3602 - Support "bumpX" and "bumpY" curve types by @jacknevitt in https://github.com/recharts/recharts/pull/3617
Fix
- Account for
angleprop on XAxis visibility calculation by @bernardobelchior in https://github.com/recharts/recharts/pull/3576 - Propagate className to CartesianAxis by @mitrotasios in https://github.com/recharts/recharts/pull/3592
- Add SVGProps to PieLabel type by @timbonicus in https://github.com/recharts/recharts/pull/3594
- Export default tooltip and legend content components by @oschwede in https://github.com/recharts/recharts/pull/3604
- Fix error bars not working in stacked bar charts by @ckifer in https://github.com/recharts/recharts/pull/3612
- Remove role="img" attribute from bar to prevent accessibility issues by using incorrect role by @rhuangabrielsantos in https://github.com/recharts/recharts/pull/3614
Docs
- lots of storybook changes - go check it out!
Refactor
- refactor:
Dotto function component by @akamfoad in https://github.com/recharts/recharts/pull/3478 - refactor:
Polygonto function component by @akamfoad in https://github.com/recharts/recharts/pull/3479 - refactor:
Reactangleto function component by @akamfoad in https://github.com/recharts/recharts/pull/3480 - refactor:
Sectorto function component by @akamfoad in https://github.com/recharts/recharts/pull/3481 - refactor:
Trapezoidto function component by @akamfoad in https://github.com/recharts/recharts/pull/3482 - refactor: change
Symbolsto functional component by @Yilun-Sun in https://github.com/recharts/recharts/pull/3485 - refactor:
DefaultTooltipContentto be functional component by @akamfoad in https://github.com/recharts/recharts/pull/3618
New Contributors
- @CoffeeGeek101 made their first contribution in https://github.com/recharts/recharts/pull/3561
- @bernardobelchior made their first contribution in https://github.com/recharts/recharts/pull/3576
- @mitrotasios made their first contribution in https://github.com/recharts/recharts/pull/3592
- @timbonicus made their first contribution in https://github.com/recharts/recharts/pull/3594
- @oschwede made their first contribution in https://github.com/recharts/recharts/pull/3604
- @rhuangabrielsantos made their first contribution in https://github.com/recharts/recharts/pull/3614
- @jacknevitt made their first contribution in https://github.com/recharts/recharts/pull/3617
Full Changelog: https://github.com/recharts/recharts/compare/v2.6.2...v2.7.0
fix bug where ts types error and cannot be generated when exporting in a consuming package. Fixes https://github.com/recharts/recharts/pull/3581
What's Changed
- fix: sankey types - add explicitly return type for renderTooltip by @ckifer in https://github.com/recharts/recharts/pull/3581
Full Changelog: https://github.com/recharts/recharts/compare/v2.6.1...v2.6.2
What's Changed
Quick fix for a bug crashing treemaps with tooltips in 2.6.0
- Fix treemap tooltip crash by @ckifer in https://github.com/recharts/recharts/pull/3579
Full Changelog: https://github.com/recharts/recharts/compare/v2.6.0...v2.6.1
What's Changed
Storybook documentation updates as well as our first accessibility feature thanks to @julianna-langston and some refactoring to function components!
Feat
- [a11y] Keyboard navigation support for categorical charts by @julianna-langston in https://github.com/recharts/recharts/pull/3546
- See docs here
Fix
- Update type for
equidistantPreserveStartaxis interval by @frontier159 in https://github.com/recharts/recharts/pull/3511 - Stop focusing on tooltip when displayed - use event listeners instead by @ArkaFred in https://github.com/recharts/recharts/pull/3515
Docs
- lots of storybook changes - go check it out!
- Getting close to parity with existing docs on recharts.org
- Added accessibility add-on
- Added accessibility docs to go with the keyboard navigation support
- Storybook 7 stable
- Much more!
Refactor
- refactor:
Curveto function component by @akamfoad in https://github.com/recharts/recharts/pull/3477 - refactor:
PolarGridto function component by @akamfoad in https://github.com/recharts/recharts/pull/3471 - refactor:
Crossto component function by @akamfoad in https://github.com/recharts/recharts/pull/3475 - refactor: tooltip to function component by @ckifer in https://github.com/recharts/recharts/pull/3336
- fix: defaultProps of tooltip, fix viewBox by @ckifer in https://github.com/recharts/recharts/pull/3554
- refactor:
Textto function component by @akamfoad in https://github.com/recharts/recharts/pull/3463
New Contributors
- @akamfoad made their first contribution in https://github.com/recharts/recharts/pull/3466
- @nicholasgcoles made their first contribution in https://github.com/recharts/recharts/pull/3467
- @linhuiw made their first contribution in https://github.com/recharts/recharts/pull/3508
- @frontier159 made their first contribution in https://github.com/recharts/recharts/pull/3511
- @ArkaFred made their first contribution in https://github.com/recharts/recharts/pull/3515
- @julianna-langston made their first contribution in https://github.com/recharts/recharts/pull/3540
Full Changelog: https://github.com/recharts/recharts/compare/v2.5.0...v2.6.0
What's Changed
Feat
ResponsiveContainer:onResizecallback function by @ckifer in https://github.com/recharts/recharts/pull/3361XAxis,YAxis:includeHiddenprop - include all datapoints in domain calculation even when hidden by @neefrehman in https://github.com/recharts/recharts/pull/3103XAxis,YAxis: new interval optionequidistantPreserveStartby @nikolasrieble in https://github.com/recharts/recharts/pull/3392
Fix
ResponsiveContainer: default min-width to 0 to override default auto behavior that breaks flexbox layouts by @ckifer in https://github.com/recharts/recharts/pull/3391Area: Add missing 'data' type to Area component by @ondrejvelisek in https://github.com/recharts/recharts/pull/3443Brush/XAxis: fix NaN regression wheninterval={0}by @nikolasrieble in https://github.com/recharts/recharts/pull/3454ReferenceArea/ReferenceLine: revert regression whereifOverflowprop is not obeyed due to missing defaultProps by @ckifer in https://github.com/recharts/recharts/pull/3455
Docs
- lots of storybook changes - go check it out!
Dependencies
- chore: explicitly upgrade minor version of react-smooth by @ckifer in https://github.com/recharts/recharts/pull/3397
- chore: upgrade react-resize-detector to 8.x by @ckifer in https://github.com/recharts/recharts/pull/3418
Refactor
- Refactoring: Adapt getTicks to increase reusability of code by @nikolasrieble in https://github.com/recharts/recharts/pull/3393
- Refactoring: Extract TicksUtils from CartesianAxis and add unit tests by @nikolasrieble in https://github.com/recharts/recharts/pull/3386
New Contributors
- @ondrejvelisek made their first contribution in https://github.com/recharts/recharts/pull/3443
Full Changelog: https://github.com/recharts/recharts/compare/v2.4.3...v2.5.0
v2.4.3
cherry-picked commit 7925fd7d6e76812fe680df9844656feca21ebde9 to not pollute patch release with other changes
fix
- ensure
originalDomainis defaulted if no domain is provided - broketickCountcalculation - https://github.com/recharts/recharts/issues/3377- assign default to
originalDomainfor re-use in generateCategoricalChart - add unit tests so this doesn't happen again
- assign default to
Full Changelog: https://github.com/recharts/recharts/compare/v2.4.2...v2.4.3
v2.4.2
cherry-picked commit b625f7236d776f4942b3a70d9225ca4ec5d47a94 to not pollute patch release with other changes
fix
- fix broken zoom functionality in 2.4 - https://github.com/recharts/recharts/issues/3369
- if chart is categorical we still need to calculate categorical domain even if the domain is given by the user
Full Changelog: https://github.com/recharts/recharts/compare/v2.4.1...v2.4.2
Accidentally added storybook types as a subfolder to types so the package.json is no longer referencing the correct types key.
- Add a tsconfig specifically for storybook with
noEmit: true - Don't include
storybook/*in tsc emit
What's Changed
- hotfix: remove storybook types build and add its own tsconfig by @ckifer in https://github.com/recharts/recharts/pull/3354
Full Changelog: https://github.com/recharts/recharts/compare/v2.4.0...v2.4.1
This release marks the completion of recharts Milestone to migrate to Jest and React Testing Library. Thanks to all involved!
Check out the new storybook we're working on here
What's Changed
Trying to squish some bugs 🐛
feat
- feat: Short-circuiting axis map creation with specified domain to improve performance by @bennettdams in https://github.com/recharts/recharts/pull/3293
fix
- ResponsiveContainer – memoize responsive container by @marcalexiei in https://github.com/recharts/recharts/pull/3169
- ResponsiveContainer - debounce updating early by @GreenGremlin in https://github.com/recharts/recharts/pull/3175 - fixes #3029
- Treemap - Non boolean attribute z error by @proke03 in https://github.com/recharts/recharts/pull/3228 - fixes #2952
- ErrorBar - overflowing chart area by @Yilun-Sun in https://github.com/recharts/recharts/pull/3300 - fixes #2978
- Bar - default
yandheightvalues correctly fornulldata points by @ckifer in https://github.com/recharts/recharts/pull/3346 - fixes #3344 - fix: remove axis domain default prop and calculate it dynamically by @lukask-proxora in https://github.com/recharts/recharts/pull/3328 - fixes #2593
- fix: functions are no longer spread onto SVG elements if an SVG attribute name conflcits with a recharts prop by @ckifer in https://github.com/recharts/recharts/pull/3327 - fixes #3310
type fixes
- Area - remove
pointsfrom SVGProps by @Yilun-Sun in https://github.com/recharts/recharts/pull/3182 - Radar - remove
pointsattribute from SVGProps by @ckifer in https://github.com/recharts/recharts/pull/3265 - refactor(Label & LabelList): refine types and disable react/no-array-index-key to avoid warnings by @marcalexiei in https://github.com/recharts/recharts/pull/3270
refactor
- ReferenceArea, ReferenceLine: added default values in params by @aushwin in https://github.com/recharts/recharts/pull/3283
- Bar- align code style by using destructuring for XAxis by @proke03 in https://github.com/recharts/recharts/pull/3349
- fix: typos by @Yilun-Sun in https://github.com/recharts/recharts/pull/3309
New Contributors
- @akib22 made their first contribution in https://github.com/recharts/recharts/pull/3179
- @proke03 made their first contribution in https://github.com/recharts/recharts/pull/3199
- @james2hey made their first contribution in https://github.com/recharts/recharts/pull/3229
- @nanguer made their first contribution in https://github.com/recharts/recharts/pull/3254
- @aushwin made their first contribution in https://github.com/recharts/recharts/pull/3283
- @bennettdams made their first contribution in https://github.com/recharts/recharts/pull/3293
Full Changelog: https://github.com/recharts/recharts/compare/v2.3.2...v2.4.0
What's Changed
fix
- fix bug introduced here - https://github.com/recharts/recharts/commit/9b8339992e0a55bb9cc565e7db67a830a4df3532#diff-9313d3857a9589abfe0113b9e0549e22b18b5f94c145c8908260f36be0d80c02R69 that causes accessing items out of index due to incorrect early return
Full Changelog: https://github.com/recharts/recharts/compare/v2.3.1...v2.3.2
What's Changed
fix
- revert https://github.com/recharts/recharts/commit/3214d1405d13d5ddcd3931d870634bcb80a52b22 due to unwanted behavior in responsive container. This change causes animation behavior to change in an undesirable way.
Full Changelog: https://github.com/recharts/recharts/compare/v2.3.0...v2.3.1
What's Changed
For the full list of changes between v2.2.0 and v2.3.0 please see the v2.3.0-alpha.0 and the v2.3.0-alpha.1 release notes.
fix
- fix: patch d3 libraries with victory-vendor to fix security vulnerability, failing test by @ckifer in https://github.com/recharts/recharts/pull/3167
- SECURITY VULNERABILITY FIX 🎉: used
victory-vendorto replace esm only versions ofd3withcjscompatible versions from victory. We will introduce a breaking change in 3.0 to move back toesmonly d3 libraries. - closes #3012
- SECURITY VULNERABILITY FIX 🎉: used
memoize responsive container functions and fix bug using previous values in- reverted in 2.3.1setState- https://github.com/recharts/recharts/commit/3214d1405d13d5ddcd3931d870634bcb80a52b22
refactor
- ReactUtils – find by type – refactor using generic by @marcalexiei in https://github.com/recharts/recharts/pull/3152
chore
- chore: add npm publish action by @ckifer in https://github.com/recharts/recharts/pull/3166
jest migration
- fix: migrate area chart test to typescript by @Yilun-Sun in https://github.com/recharts/recharts/pull/3151
- Jest Migration: util/DataUtils (#3134) by @marcalexiei in https://github.com/recharts/recharts/pull/3147
- Jest Migration: Cell by @nikolasrieble in https://github.com/recharts/recharts/pull/3150
- test(JestMigration): convert FunnelChart (closes #3127) by @marcalexiei in https://github.com/recharts/recharts/pull/3153
- Jest Migration: ChartUtils by @nikolasrieble in https://github.com/recharts/recharts/pull/3148
- JestMigration: Label and LabelList by @nikolasrieble in https://github.com/recharts/recharts/pull/3154
- test(JestMigration): convert ResponsiveContainer by @marcalexiei in https://github.com/recharts/recharts/pull/3157
- LineChart.spec jest migration by @turculaurentiu91 in https://github.com/recharts/recharts/pull/3141
- fix: area chart test migration follow up by @Yilun-Sun in https://github.com/recharts/recharts/pull/3161
- fix: area chart test part3 by @Yilun-Sun in https://github.com/recharts/recharts/pull/3163
- test: add jest coverage, differentiate jest and karma envs to fix errors by @ckifer in https://github.com/recharts/recharts/pull/3164
New Contributors
- @Yilun-Sun made their first contribution in https://github.com/recharts/recharts/pull/3151
Full Changelog:
Back filling GH releases. See CHANGELOG for release notes.
Back filling GH releases. See CHANGELOG for release notes.
Back filling GH releases. See CHANGELOG for release notes.
Back filling GH releases. See CHANGELOG for release notes.
Back filling GH releases. See CHANGELOG for release notes.
Back filling GH releases. See CHANGELOG for release notes.
Please see changelog for 2.1 patch releases prior to this version.
Back filling GH releases. See CHANGELOG for release notes.
Please see changelog for 2.0 patch releases prior to this version.
Back filling GH releases. See CHANGELOG for release notes.
Update recharts 1.x to be even with the 1.x branch by releasing 1.8.6
What's Changed
chore
- chore: update core-js by @G07cha in https://github.com/recharts/recharts/pull/1954
fix
- Fixed issue: Vertical layout throws [DecimalError] #1920 by @reachtokish in https://github.com/recharts/recharts/pull/1949
- Fixed tooltip flickering in 1.x branch by @ritwickdey in https://github.com/recharts/recharts/pull/2254
- Fix PropType typo in Tooltip by @mlh758 in https://github.com/recharts/recharts/pull/2775
New Contributors
- @reachtokish made their first contribution in https://github.com/recharts/recharts/pull/1949
- @ritwickdey made their first contribution in https://github.com/recharts/recharts/pull/2254
- @mlh758 made their first contribution in https://github.com/recharts/recharts/pull/2775
Full Changelog: https://github.com/recharts/recharts/compare/v1.8.5...v1.8.6
Back filling GH releases. See CHANGELOG for release notes.
Please see changelog for releases prior to this version.