teodosin / karta

16 stars 1 forks source link

Make ui module reactive to graph changes #65

Closed teodosin closed 9 months ago

teodosin commented 9 months ago

Currently the graph has to send events like "NodeSpawnedEvent" and "EdgeSpawnedEvent" that the ui module listens for and then inserts the appropriate components to those entities. This could instead be accomplished by a query for "Added" where T is a marker component for an entity that should have a graph representation.

Also, the ui nodes should become separate entities from the underlying data they are referencing. But that is a more complex task that requires systems to keep the two in sync, so it is a separate issue. #67.

These changes will also be necessary when the graph eventually becomes a standalone crate. Then users will just be able to add the marker component to the entities that they want to be displayed in the graph and it would work out of the box. And since they are separate entities they can have separate instances of components like Transform, which is obviously important for any entity that exists in 3D space.