Repository navigation
Loading % view, readable flow labels and branch hover on the network diagrams + consigned twin on the Context map - #230
Merged
Conversation
The N, N-1 and action NADs get an MW / Loading % toggle beside Flows / Impacts, scoped the same way (per tab, per window). In Loading % the branches read their loading rate - max(|i1|, |i2|) in % of the permanent limit, as the overload scan - instead of their active power: grey below 50 %, five pale yellow -> orange steps up to the monitoring factor, vivid orange at or above it; an open branch is greyed too, one without a limit reads a dash. In Impacts, the loading change vs the reference state (N for the N-1, N-1 for an action) in percentage points, coloured like the flow deltas. Backend: every NAD response (full and patch) carries branch_loading and loading_deltas. Frontend: utils/svg/loadingVisuals.ts, FlowViewToggles (extracted from VisualizationPanel, at its size ceiling), the legend, and the flow_metric_changed interaction event. Fix on the way: the svgPatch clone of the N diagram, and the action overview's clone of the N-1, drop the source tab's decoration - otherwise a decorated N restored its own labels over the N-1 / action flows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
…rcuit A consignation whose ends are those of the contingency or of an overload (parallel transformers, one consigned, the other overloaded - CANTEY762 / CANTEY761 on the RTE grid) was drawn under the highlight and hidden. It now joins the lens that already separates twin contingency / overload circuits: the contingency keeps the middle, then the overloads, and a consignation moves only beside a highlighted twin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
On a large grid pypowsybl's flow values are user-unit specks until the operator zooms far in. A BranchLabelLayer now writes them in CSS px over the N, N-1 and action NADs (pypowsybl's text hidden, its arrows kept): one label at the middle of a branch short on screen - its larger end - and one beside each arrow once the branch is long enough. Coloured branches (loaded from 50 %, a significant Impacts change) are labelled first and always, a grey / MW one once long enough on screen, none over another. Laid out when the view settles, hidden during a gesture; for MW, Loading % and Impacts alike. Hovering a branch (within 8 px, a grid lookup, no hit test of the diagram) shows both its ends - voltage level, active power, loading - and its Impacts change; parallel circuits drawn over each other are all listed, the most loaded first. branch_loading becomes a pair per branch: each end's current against its own side's permanent limit (a line's single-side limit holds for both ends; a transformer's unlimited side has none - RTE grids limit most transformers on side 2 only). Colour, label and delta use the more loaded end. The limits are read once per network object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
Below the colouring threshold (50 %, or an insignificant change in Impacts) a branch's loading only crowds the reading: the Loading % view labels the coloured branches only, the hover still tells the others. MW keeps its labels on the branches long enough on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
Beside the VL names toggle, `🏷 Values` hides the values the label layer
writes at the middle of the branches short on screen - the zoomed-out
reading - for a lighter view: the colours stay, a branch long enough on
screen still shows its ends' values, and the hover tells any branch. Every
tab and window alike, logged as value_labels_toggled { show }. Both
toggles move to DiagramLabelToggles (VisualizationPanel at its ceiling).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Antoine Marot <amarot91@gmail.com>
- 🏷 Values off now hides every value label, not just the zoomed-out
mid-branch ones: a light reading at any zoom, the colours and the hover
stay.
- The N tab has no Flows / Impacts: it is the state the Impacts compare
against. viewModeForTab('n') is always 'network' and a change for it is
ignored.
- The two top-right toggles stack one under the other (MW / Loading %,
then Flows / Impacts) instead of side by side, clear of the panel edge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Antoine Marot <amarot91@gmail.com>
Like the Loading % view, the MW Impacts view now labels the significant changes only (orange / blue): the grey ones, below 5 % of the largest change, only crowded the reading - the hover still tells them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
In MW Flows the branches keep pypowsybl's voltage colours, so their value labels now read in the same colour (text and outline): each half's `--nad-vl-color`, read once per voltage class from the mounted diagram, a transformer's two ends each in their own, the middle label in its larger end's. The Loading % and Impacts labels keep their scale's colours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
The kV filter strip on the diagram's right edge (24 px folded, 62 px open) covered the right end of the MW / Loading % and Flows / Impacts toggles and of the legend pill. The diagram area now sets `--kv-filter-w` to the strip's width, from the same CSS values as the strip, and those controls offset their right edge by it; in a detached window, where there is no strip, it is unset and they keep their margin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
So the voltage still reads in the Loading % and Impacts views, where the lines are recoloured by the scale, each value pill is now outlined in its line's voltage colour (a transformer's ends each in theirs; a middle label in the colour of the end it reads). MW Flows, where the lines keep their voltage colours, also writes the value in it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
The Impacts labels on the map now read rounded, their sign alone telling up from down (+40%, -58 instead of Δ +40.2%, Δ -58.0); the hover tooltip keeps the decimal. The voltage-coloured outline of every label goes from 1.5 to 2.5 px. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
…tch copy - Backend: the N diagram, the N-1 patch and the action patch each carry branch_loading / loading_deltas (the patch paths are the frontend's default, not only the helpers were covered). - Frontend: the N-1 and action svgPatch paths copied the patch's data fields by hand, each its own list; patchDiagramFields is now the one copy, tested field by field, so a field the patch gains cannot reach one path and miss the other. - DiagramLegend: the Loading % scale rows, and their absence in MW. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
- docs/features/loading-view-and-flow-labels.md: the reference - views and toggles, colour scale, label rules (where, which, order, format, voltage colours, when), hover, the branch_loading / loading_deltas contract and its per-end limits, the frontend pieces, measured costs, the tests, the limits and next levers. Indexed in docs/README.md and the root CLAUDE.md (docs table, API rows, source tree). - CHANGELOG: the section rewritten as one current description (the first bullets still said max(|i1|, |i2|) over one limit). - expert_backend/CLAUDE.md + state-reset doc: the Loading view data and _side_limits_cache, now initialised in __init__ and cleared by reset() like every per-study cache (test_reset_clears_all_caches covers it). - frontend/CLAUDE.md and canvas-gesture-proxy.md: the label layer, and why the proxy no longer draws the NAD tabs' flow values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
…ng-rate-view CHANGELOG: both sides add sections under [Unreleased]; kept both, this branch's (Loading view, Context twin consignation) first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
mypy (gating in CI) read the attribute's type off DiagramMixin's assignment (a tuple) and refused the None that RecommenderService's __init__ / reset() give it. Declared in RecommenderState with the rest of the cross-mixin state, as Any, like its siblings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Network diagrams (N, N-1, action): a Loading % view, readable flow labels, a branch hover
--kv-filter-w).[—, 109.1 %].BranchLabelLayer,utils/svg/branchLabels.ts).88%); changes rounded with their sign alone (+40%,-58).🏷 Valuestoggle beside🏷 VL: off, no value label at all; the colours and the hover stay.branch_loading({branch: [end1 %, end2 %]}) and, for N-1 / action,loading_deltas._side_limits_cache, cleared byreset().flow_metric_changed { metric, tab, scope }andvalue_labels_toggled { show }.patchDiagramFields).Context tab: a consignation twin of the contingency or of an overload (parallel transformers CANTEY762 / CANTEY761) is pulled aside into the same lens as twin contingency / overload circuits, instead of hiding under the highlight.
Reference doc:
docs/features/loading-view-and-flow-labels.md. CHANGELOG, root / frontend / backend CLAUDE.md, the state-reset and canvas-proxy docs are updated. Merged withmainafter #231, conflict in CHANGELOG resolved by keeping both sections.Test plan
pytest expert_backend/tests: 1448 passed; the 2 failures are the ones already onmain(test_independent_actions_simulation,test_stream_pdf_integration).npx vitest run: 2284 passed.tsc -b,eslint(no errors),npm run build,scripts/check_code_quality.pyandscripts/check_openapi_contract.pyare clean.patchDiagramFieldsand the clone reset.pypsa_eur_fr225_400(contingencyway_121500507-225):🤖 Generated with Claude Code