ExpertOp4Grid v0.3.2 — Semantic overflow-graph layers
Highlights
This release elevates the interactive overflow-graph viewer from
colour / shape heuristics to semantic, source-of-truth layer
toggles. The recommender now propagates explicit boolean flags on
graph nodes and edges, and the viewer surfaces them through three
labelled checkbox sections with a dim-instead-of-hide model.
- Semantic node / edge tags —
is_hub,in_red_loop,
on_constrained_pathon nodes;is_overload,is_monitored,
in_red_loop,on_constrained_pathon edges.is_overloadis a
strict subset ofis_monitored(every overloaded contingency line
is also a low-margin line). - New public taggers on
OverflowGraph—
tag_red_loops(lines, nodes)and
tag_constrained_path(lines, nodes)consume the recommender's
pre-computed lists.set_hubs_shapenow also marks hubs with
in_red_loopANDon_constrained_pathso they always appear
under those layers. highlight_significant_line_loadingreworked — now tags every
monitored line withis_monitored=Trueand the strict
contingency-overloaded subset withis_overload=True.- Grouped layer sidebar in the interactive viewer — three
labelled sections (Structural Paths / Individual entities
properties / Flow redispatch values) ordered via
_LAYER_SECTIONSand_SECTION_ORDER. - Membership-based dim model — opacity drops to
0.12for
unchecked elements; nodisplay:none, so click / hover stay
live. An element is visible iff at least one of its claiming
layers is currently checked. - Endpoint-node inclusion — edge-only layers also dim /
highlight the bbox-endpoint nodes of their claimed edges, so
toggling "Overloads" alone keeps the substations the overload
connects visible (no floating edges in dimmed space). - Select-all / Unselect-all link row above the layer list,
dispatching the samechangeevent individual checkboxes do. _align_edge_ids_with_svg()regression guard — graphviz's
SVG and JSON edge orderings drift independently; we now re-key
the JSON edge model from the SVG<title>endpoints so
data-source/data-targetalways match the title content.
What's Changed
PR #75 — Add semantic source-of-truth tagging + grouped layer toggles
OverflowGraph.set_hubs_shapeaddsis_hub=True(plus
in_red_loopandon_constrained_path) on every hub.- New
OverflowGraph.tag_red_loops(lines, nodes)and
OverflowGraph.tag_constrained_path(lines, nodes)helpers. OverflowGraph.highlight_significant_line_loadingreworked to
tagis_monitored⊃is_overloadsemantics.interactive_html._build_layer_indexscansdata-attr-*on
both nodes and edges and emits five new semantic layers.- Layers are grouped into three sections via
_LAYER_SECTIONS
rendered in_SECTION_ORDERwith section-header markers. - Membership-based dim model + endpoint-node inclusion + Select-
all / Unselect-all controls. _align_edge_ids_with_svg()regression guard for graphviz
SVG-vs-JSON edge-id misalignment.- Comprehensive coverage in
tests/test_overflow_graph.pyand
tests/test_interactive_html.py.
Companion releases
expert_op4grid_recommenderv0.2.1
wires the constrained-path / red-loop / overloads lists into the
new taggers.- The Co-Study4Grid
v0.7+overflow-analysis tab embeds the
resulting interactive HTML viewer with an action-pin overlay.
Compatibility
Backwards compatible. Existing callers see no behaviour change —
the new tags are additive, and the new public taggers are no-ops
when not invoked. Any existing serialised overflow graphs continue
to render correctly with the upgraded viewer.
🤖 Generated with Claude Code