egui_graphs icon indicating copy to clipboard operation
egui_graphs copied to clipboard

Set/unset color of node and edge programmatically?

Open oscargus opened this issue 3 months ago • 1 comments

I'd like to be able to unset the color of a node (basically doing self.props.color = None). reset_color? Or is it possible in some other way?

pub fn reset_color(&mut self, color: Color32) {
    self.props.color = None;
}

Similarly, is it possible to programmatically set/unset the color of an edge? Seems slightly more complicated than the above since there is no support for colors as far as I can tell.

Context: I have a graph representing something else and when I select something in the other view, I would like to highlight which node/edge this corresponds to. I can currently set the color of the node, but only unset it to e.g. WHITE which will mess up a light mode display.

oscargus avatar Aug 29 '25 19:08 oscargus

Hi Oscar, sorry for the late response. Good point, will implement it.

blitzarx1 avatar Sep 08 '25 09:09 blitzarx1