Skip to content

Adding images into a shape while mapping through data #1307

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

You must be logged in to vote

Hey @hyfydistro 👋 thanks for checking out visx. I think to do this you'd just need to lean on the SVG api for using an image as a fill. One way to do this is to create a <pattern /> for each image within a <defs /> tag, then use those patterns as the fill for the circle. Note that pattern id's that you define should be unique on the page else you will have overlap/non-determinant behavior.

Here's a sandbox demo, hope it helps!

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@williaster
Comment options

@hyfydistro
Comment options

@hyfydistro
Comment options

@williaster
Comment options

@hyfydistro
Comment options

Answer selected by hyfydistro
Comment options

You must be logged in to vote
1 reply
@hyfydistro
Comment options

Comment options

You must be logged in to vote
0 replies
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