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

Abillity to Mutate Node Graph of simulation? #6

Open
codecnotsupported opened this issue Feb 15, 2025 · 1 comment
Open

Abillity to Mutate Node Graph of simulation? #6

codecnotsupported opened this issue Feb 15, 2025 · 1 comment

Comments

@codecnotsupported
Copy link

codecnotsupported commented Feb 15, 2025

I was wondering if there was a reason why there isn't some functionality to add/remove nodes or link/unlink nodes of a existing Simulation.

@codecnotsupported codecnotsupported changed the title Abillity to add new nodes to simulation? Abillity to Mutate Node Graph of simulation? Feb 15, 2025
@grtlr
Copy link
Owner

grtlr commented Feb 17, 2025

Thank you for comment! The main reason for not having that functionality in the code yet, is because I couldn't come up with a good API yet—but it would be very nice to have something similar to d3.select (selection joins, with enter, exit, and update sets).

An option to emulate this behavior even now, is to rebuild the simulation (with the previous node positions as initial positions). We use that currently in Rerun and it seems sufficiently fast for our use cases, you can take a look here: https://github.com/rerun-io/rerun/blob/main/crates/viewer/re_view_graph/src/layout/provider.rs. Note that this requires keeping track of the nodes in your application code, though.

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