Skip to content

yScale/xScale on LinePath #1022

Answered by williaster
kaisiant asked this question in Q&A
Discussion options

You must be logged in to vote

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 only x/y are valid props, and so you would just use the scale at that point:

<LinePath<Datum>
  curve={...}
  data={lineData}
  x={(d: Datum) => xScale(getX(d)) ?? 0}
  y={(d: Datum) => yScale(getY(d)) ?? 0}
  {...
/>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kaisiant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants