Skip to content

Image as custom shape for scatter dots #3928

Closed Answered by jeadys
jeadys asked this question in Q&A
Discussion options

You must be logged in to vote

This works indeed, thanks for the help. Here is the result

// cx and cy for correct coordinates
const CustomScatterShape = ({ cx, cy }: DotProps) => {
  return (
    <svg width="50" height="50" x={cx} y={cy}>
      <image href="/images/dummy.webp" width="50" height="50" />
    </svg>
  )
}

// Passing CustomScatterShape in shape property
<Scatter data={trackAudioFeatures} shape={<CustomScatterShape />} />

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@jeadys
Comment options

@ckifer
Comment options

@jeadys
Comment options

Answer selected by jeadys
@ckifer
Comment options

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