Skip to main content

Module graph_split

Module graph_split 

Source
Expand description

A graph under its header, with a drag bar between — once, for every tab that shows content above a graph (the Coderoom’s connections, the Explorer’s live unit graph, …).

The owner (loki): “the graph works but is only visible in the lower part of the window, and no drag bar exists”. A pane that lays out its lists / layer lines / pane headers first and hands the graph whatever height is left gives the graph the LEAST of the window exactly when there is the most to read above it.

header_above: the header goes in a top region that scrolls when it is longer than its share — by default a quarter of the height, never more than HEADER_MAX — and the graph takes ALL the rest. Between them is a draggable bar; where the viewer leaves it is remembered in the UI’s memory under the region’s id (egui’s own panel state), so it survives a rebuild of the pane.

Constants§

HEADER_DEFAULT
The header’s default share of the height.
HEADER_MAX
The most of the height the header may be dragged to.

Functions§

header_above
Draw header (scrolling when long) in a top region with a draggable divider remembered under id; everything drawn into ui AFTER this call — the graph — gets all the remaining height.