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

[Feature Request] Foreign object, Vertex and Edge property generation #25

Open
ekinimo opened this issue May 16, 2024 · 2 comments
Open

Comments

@ekinimo
Copy link
Contributor

ekinimo commented May 16, 2024

Hello! Ive been using your library to create interactive graphs via wasm. Its been a great experience so far!
Ive bodged your svg writer a bit to support foreign objects however its a horrible hack.

It would be really useful if there was an element kind like Box(impl ForeignObejct) where foreign object trait dictates how it would be rendered.

Another thing that would be really nice is to generate ids for vertices and edges. Currently i do that via requiring a queue of edges in the svg writer constructor , dequeue it at each draw_arrow/line call to generate edge ids and
creating an empty stack, pushing vertex names into the stack and generating an id string based on the vertex counts replacing it at the finalize call from the stack. Although it works mechanism is really flimsy. it would be really nice if RenderBackend trait supported that natively.

Here is what ive done so far. You can click on edges to remove them and click two vertices in row to bind them .Dont judge the code ive been messing with it for couple of days purely explotarily

@nadavrot
Copy link
Owner

I would love to see a patch implementing this feature. Can you give it a try?

@ekinimo
Copy link
Contributor Author

ekinimo commented May 17, 2024

I can give it a try this week :)

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

2 participants