yScale/xScale on LinePath #1022
-
Hello, I'm new to this library and D3. I went through a demo https://github.com/hshoff/viewsource#1-bitcoin-price-chart, seems the LinePath component no longer accepts y/xScale. Is there any latest example for me as a reference? thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @kaisian97 thanks for checking out In any case, if you're on the latest <LinePath<Datum>
curve={...}
data={lineData}
x={(d: Datum) => xScale(getX(d)) ?? 0}
y={(d: Datum) => yScale(getY(d)) ?? 0}
{...
/> |
Beta Was this translation helpful? Give feedback.
Hey @kaisian97 thanks for checking out
visx
! I think that example was created before the project was re-written in TypeScript and we tightened up some APIs.In any case, if you're on the latest
@visx/*
versions, you can check out this/curves
example from the gallery (and the sandbox link on that page if you want to tinker). tl;dr currently onlyx/y
are valid props, and so you would just use the scale at that point: