Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Points property not generating for Area Chart in v2.12.6 #4480

Closed
1 task
Millian-22 opened this issue May 3, 2024 · 5 comments
Closed
1 task

Points property not generating for Area Chart in v2.12.6 #4480

Millian-22 opened this issue May 3, 2024 · 5 comments
Labels
bug General bug label

Comments

@Millian-22
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Navigate to provided link

  2. Open console and view a "props" log

  3. See that no points property is being generated

What is expected?

Points property is being generated by Area chart. Customized Dots appear on Area Chart

What is actually happening?

No points property is being generated by area chart. No dots appear.

Environment Info
Recharts v2.12.6
React 18.2.0
System MacOS
Browser Chrome Version 124.0.6367.119 (Official Build) (arm64)

This works in earlier releases of Recharts (tested up to version 2.1.15) but it stopped working sometime after that.

@ckifer
Copy link
Member

ckifer commented May 3, 2024

Looks like between 2.2.0 and 2.3.0 to me.

v2.2.0...v2.3.0
A lot to compare there

@ckifer
Copy link
Member

ckifer commented May 3, 2024

v2.2.0...v2.3.0#diff-7c3814605c4f31b9c5f5ac643fe72a97797b4f2d13230ea178089879c7e5429cL724

filterProps generally only happens when props are spread onto SVG elements meant to filter out props that are not applicable to those elements. Looks like there's a few cases in there where that isn't how it works

Here

const areaProps = filterProps(this.props, false);
is the issue.

I'll add points back in there

@Millian-22
Copy link
Author

@ckifer thanks for the quick response! Looking forward to the update

@ckifer
Copy link
Member

ckifer commented May 3, 2024

Cool, it'll be fixed in the next patch (undetermined eta, but at least a week or so)

ckifer added a commit that referenced this issue May 3, 2024
…4481)

<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->
`points` was accidentally filtered out between 2.2 and 2.3 due to silly
`filterProps`. It is an `Area` prop not an SVG prop (besides poly
elements that do not apply here), so it shouldn't be in `filterProps`.
Since it existed in the list of props previously, add it back in
explicitly.

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->
#4480

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
- add an assertion that it exists in an Area test

## Screenshots (if appropriate):

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [X] I have added tests to cover my changes.
- [ ] I have added a storybook story or extended an existing story to
show my changes

Co-authored-by: Coltin Kifer <ckifer@amazon.com>
@ckifer
Copy link
Member

ckifer commented May 8, 2024

Fixed in v2.12.7

@ckifer ckifer closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug General bug label
Projects
None yet
Development

No branches or pull requests

2 participants