Whatif live jack#5
Merged
Merged
Conversation
…hat-if Visualization redesign (ForceGraph.tsx) - Each node is now a 52×52 rounded-square tile holding a sector emoji (chosen by sector field with a label-keyword fallback). Uniform tile size — the n_reachable signal lives in the right-rail Ranking table. - A 5-segment energy bar sits below each tile and encodes impact percentile with a discrete red → orange → yellow → lime → green palette. Pure sinks render as an empty 5-segment bar. The bar mirrors the level shown in the Ranking table so the two views stay visually consistent. - Edges show animated green footprints walking source → target with a L/R perpendicular offset for a gait look. Each edge has a midpoint capsule showing the weight as a percentage, colored on the same red→green scale (so heavy dependencies pop in red even when the line is thin). - Layout: barycenter (Sugiyama) sweep within tiers to cut edge crossings. - Layout: dropped the MIN_*_SPACING floors so the bbox always fits the canvas; added a zoomToFit safety net via fgRef so first paint shows the whole pyramid without requiring a manual zoom-out. - Focal company keeps the white tile border + amber ★ label. - Cascade animation: red glow behind tiles, scaled by per-round disruption probability — bar stays static (impact is intrinsic), glow is dynamic. Live What-If (4 files) - WhatIfPanel becomes a debounced live slider (220ms): drag weight, no Compute button. AbortController cancels in-flight /whatif when the slider moves so requests don't stack. - WhatIfState lifted to AnalysisPage so the Ranking table can render modified EPT inline as "1.31→2.40 (+1.09)" with green for improvement and red for worsening. Slider reset clears the modification atomically. - whatif() in lib/api.ts now accepts an AbortSignal.
…sum>1.05 Before this change, pushing one edge's weight up in the What-If panel could make the target's incoming weights exceed the §7.2 tolerance (sum > 1.05), which the validator rejects with NormalizationError — bubbling up as a generic HTTP 500 in the UI. Real business semantics: if Apple shifts more orders TO one assembler, the share given to the others necessarily shrinks. run_whatif now treats the user-specified edges as authoritative and proportionally rescales the other incoming edges to the same target so the sum stays at 1.0. Edge cases: - Modified edges saturating ≥100% combined: clamp them to 1.0 (preserving ratio) and zero the others. - Other siblings all originally zero but there is leftover capacity: distribute the remainder evenly. - Inputs are clamped to [0,1] on entry as a safety guard. The validator pass is kept as a no-op safety net. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.