Custom object for a graph-like structure

Hi there. I am looking to implement (C# plugin) a custom object that looks like a graph composed of nodes and edges. Both nodes and edges should be selectable, and moving a node should update the position of attached edges (and vice versa)

Is this possible? My guess is I would need to listen to some sort of event on the object or document, but I’m new to the Rhino API and interested in hearing any other ideas.



I don’t have much experience with custom Rhino plugins but something like a Kd-Tree or similar would help with the topology recalculations, to he honest I’ve had great results from simply using a grid as an acceleration structure for this kinds of problems.
Someone with more experience might point you in the right direction for moving the nodes around, but a ray picking strategy seems appropiate, you cast a ray and do a circle-ray intersection to see what node you are going to move, once you found which node you are moving just follow the intersection of the ray that you shoot from the mouse coord with the user selected plane (probably XY plane would suffice).