Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a image to rect? #27

Closed
stogefei opened this issue Apr 17, 2018 · 1 comment
Closed

add a image to rect? #27

stogefei opened this issue Apr 17, 2018 · 1 comment
Labels

Comments

@stogefei
Copy link

how can i add a image or icon to the rect? i used D3.js but failed
thank you

@iangilman
Copy link
Member

Here's how you would do it with d3:

d3.select(overlay.node()).append('svg:image')
    .attr('x', 0.5)
    .attr('y', 0.5)
    .attr('width', 0.25)
    .attr('height', 0.25)
    .attr('xlink:href', 'http://simpleicon.com/wp-content/uploads/smile.png')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants