holtzy / react-graph-gallery

A set of graph examples showing how to make react and d3.js work together
https://www.react-graph-gallery.com
ISC License
292 stars 23 forks source link

Scatter plot example appears to plot points in the wrong order #9

Closed bjorn2404 closed 1 year ago

bjorn2404 commented 1 year ago

https://github.com/holtzy/react-graph-gallery/blob/bbb59038ca328772f6d3f08160d1a4fe4aff8f8b/pages/scatter-plot.tsx#L615

The points in the data appear to be plotted y,x vs. x,y.

Shouldn't this be the following?

cx={xScale(d.x)}
cy={yScale(d.y)}
holtzy commented 1 year ago

Good catch! Thanks just fixed it. 🙏