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

Number id value on Scatter plot #943

Closed
hubertokf opened this issue May 4, 2020 · 1 comment · Fixed by #1147
Closed

Number id value on Scatter plot #943

hubertokf opened this issue May 4, 2020 · 1 comment · Fixed by #1147
Labels
🆕 feature request scatterplot @nivo/scatterplot package

Comments

@hubertokf
Copy link

hubertokf commented May 4, 2020

I have data like the following:

const data =[
{
    id: 30464,
    data: [
        {
            x: "2009-01-31",
            y: 471.2, z: 471.2
        }
    ]
}
]

And I am rendering chart:

<ResponsiveScatterPlot
    data={data}
/>

Chart renders OK, but I get a warning on the console:

Warning: Failed prop type: Invalid prop `data[0].id` of type `number` supplied to `ScatterPlot`, expected `string`.
Warning: Failed prop type: Invalid prop `nodes[0].data.serieId` of type `number` supplied to `AnimatedNodes`, expected `string`.
Warning: Failed prop type: Invalid prop `node.data.serieId` of type `number` supplied to `NodeWrapper`, expected `string`.
Warning: Failed prop type: Invalid prop `nodes[0].data.serieId` of type `number` supplied to `Mesh`, expected `string`.

Warnings goes away when I use strings for id but the document says id can be a number, too.

@plouc plouc added 🆕 feature request scatterplot @nivo/scatterplot package labels Jun 17, 2020
@plouc
Copy link
Owner

plouc commented Jun 17, 2020

@hubertokf, by default it's expecting a string, but the PropTypes should be adjusted, there's no reason to force this, a number is completely fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 feature request scatterplot @nivo/scatterplot package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants