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

Does this work with generic non-SVG components? #262

Open
Aditya94A opened this issue Aug 27, 2020 · 2 comments
Open

Does this work with generic non-SVG components? #262

Aditya94A opened this issue Aug 27, 2020 · 2 comments

Comments

@Aditya94A
Copy link

I would like to use my own react components as graph nodes instead of SVGs. Is this supported?

@ajbogh
Copy link
Contributor

ajbogh commented Aug 28, 2020

You can pass a renderNode function that returns a react component. These components must be SVGs, but you can use the foreignObject element to wrap HTML data as well. A few people have used this method for their projects.

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject

@tony-garcia
Copy link

Yes I've used foreignObject to render HTML nodes using React and it works quite well.

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

No branches or pull requests

3 participants