mitchmindtree / egui_graph

A graph editor widget for the egui library.
MIT License
12 stars 5 forks source link

Graph widget doesn't respect existing layout #14

Open tychedelia opened 9 months ago

tychedelia commented 9 months ago

In egui, an element like CentralPanel is defined by the space that remains after panels have been allocated. In the below screenshot, you can see how the graph config moves to respect the panel width, but the graph widget takes up the entire available screen. The graph widget should properly respect it's place in the widget "hierarchy".

image

tychedelia commented 9 months ago

I think this may actually be more subtle. Obviously the above image is buggy, but I'm also noticing a behavior when a side panel is conditionally rendered, which causes the graph to jump around. I do think we want the graph to maintain it's position regardless of other content but:

  1. It needs to center itself in the "initial" available space of the center panel.
  2. Other ui elements need to block clicks interactions.
  3. The graph should retain it's absolute position once rendered (or support some kind of kind of trigger to recenter it within the new available space).