This is the largest piece of front-end work in the CR. Read the three constraints first — they explain why the design looks the way it does — then the two views, which explain why one elevation is not enough.
Every span renders at exactly 140 px wide regardless of real length. Every pier is exactly 140 px tall regardless of real height. length_of_span is captured on the form but never read by the diagram. Real pier height is used only for the partial-fill ratio.
single_pier, portal_pier, double_pier, double_portal_pier — each ~100 KB of inline JS with the same helpers redefined. No shared module. The last SVG bugfix was applied identically four times. A fifth variant makes it five.
There's no viewBox. A past commit explicitly removed max-width:100% because it shrank the diagram instead of letting it overflow. That was a deliberate product decision — keep it. The cable-stayed canvas gets wider and taller and scrolls.
Stand at the side of the bridge and the second pylon leg is directly behind the first, with its whole cable plane hidden. No amount of detail in the side view recovers that — it needs a second view. Both views are live in the diagram below and are driven by the same four controls: cable arrangement, span width, legs and pylon type. Switch VIEW to Front to cut a transverse section at every pylon.
What the diagram draws today. Supports keep the boxed tag below the ground line — A1 · P1 … P8 · A2 — from the same addBoxedLabel(px, baseY + 70, 'P' + n) call the four existing partials use. Each pylon is one shaft: from the side the two legs coincide, so the far one is drawn as a dashed hidden line.
One section per pylon, drawn from the same seed data. Two legs, two cable planes, the deck passing between them — and the pylon shape is finally unambiguous, because you are no longer sighting along the legs.
Picking LHS or RHS renders a single elevation band for that cable plane. Both stacks the two. Superimposed collapses them and falls back to the lesser of the two stages — safe, but it hides real progress.
At a pylon, P3 resolves to two progress locations — pl_3 and pr_3 — exactly as portal_pier.blade.php already does. No new key format, no schema change.
Changing this redraws the pylons in VIEW 2. A true longitudinal elevation sights along the legs, so every pylon type looks like the same vertical tower from the side — which is why VIEW 1 now draws a plain shaft with the far leg as a dashed hidden line, and the silhouette appears only in VIEW 2. Earlier drafts drew the transverse silhouette in elevation to make the type visible; that was the right call before a front view existed, and the wrong one now — it made the side view read as a front view. The type still changes VIEW 1 in one real way: the anchorage zone, and therefore where the fan starts.
Toggle "Equal (today)" above. With fixed 140 px spans, Mindhola's three 150 m main spans render the same width as its 35 m approach spans — and the cable fans collide because there's no room between pylons. On a girder bridge nobody noticed. On a cable-stayed bridge it's unreadable.
Scope this to the new partial only. Don't retrofit proportional width onto the four existing partials in this CR — that changes how every live bridge looks and needs its own client sign-off.
Mindhola has two cable planes, one carried by each pylon leg. BMS already keys the legs of a portal pier separately — pl_n and pr_n — and stay cables follow that exactly, because the cable plane is the leg.
Cables are stressed one plane at a time. If leg L cable 5 at P3 is finally stressed but leg R cable 5 is only installed, a superimposed view has one line and two different truths. Whatever colour you pick is wrong for one of them.
Switch the VIEW · LEGS control to "Superimposed" above — the diagram falls back to showing the lesser of the two stages, which is safe but silently hides real progress from the client.
Each leg gets its own 82 cables and its own colours — 164 in total, matching the component plan quantity exactly. No arithmetic to explain, no hidden state.
This follows the portal pier pattern already in BMS, not the dual-carriageway one. Portal legs are keyed pl_n/pr_n with their own heights and their own progress — a pylon is simply a taller version. See the two views at the top of this page.
pl_2 + item a1_cable_1, and pr_2 + the same item name. No schema change, no invented prefix. Single Mast is the exception — one central tower, so there is no L/R split and the toggle collapses to a single band automatically.
In a semi-fan the anchorages sit on the upper part of the pylon, spread over a short length rather than concentrated at one point — spacing them avoids the stress concentration a pure fan creates and leaves room to re-tension each cable later.
The New Panama Canal Bridge is a documented example: an anchorage zone roughly 45 m tall at 2.5 m vertical spacing between adjacent anchor points.
Every existing component uses #fff9d9 for "not started" — which also happens to be the canvas background. That's fine for a filled rect with a black stroke around it. A 1–2 px line in that colour on that background is invisible.
#fff9d9 → invisible#C9CBD0 dashed → reads as "planned"This is a genuine new rule, not a style preference — the existing palette simply has no case for line-shaped components.
One pylon, one direction. Every cable is a straight line from a point on the pylon to a point on the deck — the arrangement only changes how those two point-sets are distributed.
// ---- LAYOUT CONSTANTS (cable_stayed variant) ---- const PYLON_HEADROOM = 240; // NEW: room above deck const baseY = 320 + PYLON_HEADROOM; // ground line const deckY = 180 + PYLON_HEADROOM; // deck top const MAX_UPPER_PX = 200; // tallest mast on screen // every existing y-constant shifts down by PYLON_HEADROOM; // svg height grows 950 -> 1190 (common carriageway) // ---- PYLON ---- upperPx = MAX_UPPER_PX * (upperH / maxUpperH); pylonTopY = deckY - upperPx; // lower pylon: deckY..baseY, fills UP from baseY // upper pylon: pylonTopY..deckY, fills UP from deckY // both reuse drawPier()'s partial-fill algorithm verbatim: h = fullPx * Math.min(done, total) / total; color = done >= total ? '#7ED321' : '#D9A526'; // ---- CABLE FAN ---- dir = -1 (A1 side) | +1 (A2 side) const nearX = 26; const farX = adjacentSpanPx * 0.45; const fanTopY = pylonTopY + 10; const fanBotY = pylonTopY + upperPx * 0.50; for (let i = 0; i < n; i++) { const t = (n === 1) ? 0 : i / (n - 1); let ay, ax; if (arrangement === 'semi_fan') { ay = fanBotY - t * (fanBotY - fanTopY); ax = px + dir * (nearX + t * (farX - nearX)); } else if (arrangement === 'fan') { ay = fanTopY; // all from one point ax = px + dir * (nearX + t * (farX - nearX)); } else /* harp — parallel, equal slopes */ { const k = farX / upperPx; ay = pylonTopY + t * upperPx * 0.85; ax = px + dir * k * (deckY - ay); } drawCable(px, ay, ax, deckY, stageColor(cableStage(i))); }
In a strict longitudinal elevation, an H-frame, an A-frame and an inverted-Y all look like the same single tower — you're sighting along the line of the legs, so one hides the other. The shape is only visible looking across or down.
pylon_shape resolves to a small set of line segments in normalised space (see shapeSegments() in this page's source — it's about 10 lines and can be lifted directly). Those segments scale into the pylon's box in VIEW 2 and drive the plan view. VIEW 1 doesn't touch them at all — it draws a plain rect, so the elevation renderer stays shape-agnostic and needs no per-shape branching. The one thing shape changes in VIEW 1 is the anchorage zone (fanFrom / fanTo), which is two numbers, not a path.
cable_count_a1 + cable_count_a2 per pylon (82 total); the component plan still counts × planes (164). Both numbers are correct — they answer different questions. Worth a code comment, or someone will "fix" it.
A 2 px diagonal line is almost impossible to click. Draw each cable twice: a transparent fat line for hit-testing, then the visible thin one on top.
// hit area first (underneath)
hit = line(x1,y1,x2,y2);
hit.setAttribute('stroke','transparent');
hit.setAttribute('stroke-width','12');
hit.addEventListener('click', () =>
loadComponentData(STAY_CABLE_ID, 'p_2'));
// visible cable on top
vis = line(x1,y1,x2,y2);
vis.setAttribute('stroke', stageColor);
vis.setAttribute('stroke-width','2');
Keep the existing convention: click handlers are attached only to components with progress. A not-started cable stays non-clickable, same as every other component today.
Tooltips use a <title> child, as today — hover a cable in the diagram above to see it.
@else fallback to both dispatch sites first. Five minutes, and it stops an unknown pier type silently rendering a blank box.2d-image/cable_stayed.blade.php by copying single_pier.blade.php — it's the closest base (common carriageway, one pier per support).PYLON_HEADROOM and switch the horizontal loop to proportional span widths.drawPylon() — literally drawPier() with a taller box, called twice (lower, upper).drawCableFan() and the stage colour map.pylon_shape for 1 vs 2 legs.Step 2 above says "copy single_pier.blade.php" because that's what the codebase does today. It's also how we got to four near-identical 100 KB files where every bugfix has to be applied four times.
Fastest to ship, zero risk to existing bridges. Cost: every future SVG fix becomes a 5× edit, and the cable-stayed file will drift from the others.
Pull the common helpers into one JS module, then add cable-stayed as a variant. Costs maybe a week up front and needs regression testing on all four existing pier types — but it's the last cheap moment to do it.
This is a PM/client decision about paying down debt, not a technical unknown. Flagging it here because it's the single biggest hidden cost in the CR and it gets more expensive with every variant added.