Repository navigation
Add visual highlighting for overloaded lines and action targets - #9
Merged
Merged
Conversation
Use SVG metadata edge mappings to find overloaded line elements by equipmentId and apply a .nad-overloaded CSS class (orange stroke) to their SVG edge groups. Applied in both the standalone interface (N-1 + Action tabs) and the React frontend (Action tab). https://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1
For N-1 tab, all initially overloaded lines stay orange. For the Action tab, filter to lines whose rho_after > 1.0, and include max_rho_line if it is a new line above 100%. https://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1
For line disconnection/reconnection actions, detect the target lines from the action topology (lines_ex_bus/lines_or_bus with no gen/load changes) and highlight their edges in yellow fluo (#ccff00). Backend: extract action_topology (lines_ex_bus, lines_or_bus, gens_bus, loads_bus) from the action object and send to frontend. Frontend: detect line-only actions and apply .nad-action-target class to SVG edge elements in both standalone and React interfaces. https://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1
Replace stroke override with drop-shadow filter so the line keeps its original color and gains a yellow glow around it. https://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1
For nodal actions (not line-only), extract the voltage level name from the last single-quoted string in description_unitaire and apply the yellow fluo halo to the VL node's outer circle via .nad-action-target. Also extends the CSS selector to include circle elements for the drop-shadow filter. https://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1
Three fixes for nodal action highlighting:
1. Couplers (e.g. COUCHP6_COUCH6COUPL) appear in lines_*_bus but are
not diagram edges. Now verify topology line keys exist as actual
edges in metadata before treating as a line action; otherwise fall
through to VL node detection.
2. Parse unquoted "dans le poste VLNAME" in addition to quoted format.
3. When description is missing ("No description available"), fall back
to extracting VL name from the action ID suffix (last _-segment),
validated against metadata nodes.
https://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1
Couplers (e.g. COUCHP6_COUCH6COUPL) exist as edges in the NAD metadata, so the previous "verify against edges" check passed and highlighted them instead of the VL node. Fix: always try VL detection first (from description or action ID suffix). Only fall back to topology-based edge highlighting if no VL node is found. This ensures coupler/nodal actions always get the halo on the VL circle. https://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1
Temporary console.log to debug why COUCHP6/PYMONP3/VIELMP6 halos are not rendering correctly. Logs VL candidates, metadata lookups, and SVG element hits. https://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1
… existing in it, to be able to manually add and simulate them
Add manual action
Delta flows mode
Voltage filters
…tab back to Flow Tab
… inbetween before and after the action to make it the primary direction for delta flow
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
This PR adds visual highlighting to network diagrams to help users identify overloaded transmission lines and the specific assets affected by selected actions. Overloaded lines are highlighted in orange, while assets targeted by actions receive a yellow fluorescent halo effect.
Key Changes
.nad-overloadedand.nad-action-targetclasses tostandalone_interface.htmlandApp.cssfor orange highlighting and yellow halo effects respectivelybuildMetadataIndex()function to create efficient lookups from equipment IDs to SVG element IDs for both nodes and edgesapplyOverloadedHighlights()function to highlight lines exceeding 100% capacity in orange on N-1 and action diagramsgetActionTargetLines()to identify line-only actions (disconnections/reconnections) andgetActionTargetVoltageLevel()to extract voltage level names from action descriptions for nodal actionsapplyActionTargetHighlights()function to apply yellow halo to either line edges (for line actions) or voltage level nodes (for nodal actions)useEffecthook inVisualizationPanel.tsxto apply highlights based on selected action and overloaded lines datarecommender_service.pyto extract and include action topology (lines_ex_bus, lines_or_bus, gens_bus, loads_bus) in the enriched action dataActionTopologyinterface totypes.tsand extendedActionDetailto include topology informationImplementation Details
max_rhoandmax_rho_line)standalone_interface.htmlby keeping bothpolylineandrectselectors in the vector-effect rulehttps://claude.ai/code/session_01SWK3HZHgMPeghUrSmmjpV1