recharts / recharts

Redefined chart library built with React and D3
http://recharts.org
MIT License
22.95k stars 1.67k forks source link

Preparing for Tooltip payload refactor #4517

Closed PavelVanecek closed 3 weeks ago

PavelVanecek commented 3 weeks ago

Description

Okay this is a little bit all over the place. Basically I am trying to refactor the Tooltip payload functions into Redux store, and it's a fairly big change. Here I identified and committed few isolated changes that are not quite enough to move the tooltip yet but they pass tests so I think we can merge. See the commit messages for individual changes.

Let me know if you want me to split this into individual pull requests instead.

Related Issue

https://github.com/recharts/recharts/discussions/3717

Motivation and Context

The tooltip refactor must happen first before we can remove formattedGraphicalItems which must happen before we can remove renderGraphicChild which we need to do before we can remove the element cloning.

How Has This Been Tested?

npm test, storybook

Screenshots (if appropriate):

Types of changes

Checklist:

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 92.96875% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 95.42%. Comparing base (d41c336) to head (6341e1e). Report is 1 commits behind head on 3.x.

Files Patch % Lines
src/chart/generateCategoricalChart.tsx 87.17% 5 Missing :warning:
src/state/chartDataSlice.ts 91.83% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## 3.x #4517 +/- ## ========================================== - Coverage 95.43% 95.42% -0.01% ========================================== Files 111 112 +1 Lines 21603 21679 +76 Branches 2979 2991 +12 ========================================== + Hits 20616 20688 +72 - Misses 981 985 +4 Partials 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.