layout icon indicating copy to clipboard operation
layout copied to clipboard

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

Open ekinimo opened this issue 9 months ago • 2 comments

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

ekinimo avatar May 16 '24 15:05 ekinimo