Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/components/ArchitectureDiagram.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "./ArchitectureDiagram.css";

const VW = 1120;
const VH = 648;
const CROSS_ROUTE_OFFSET = 210;

const byId = Object.fromEntries(NODES.map((n) => [n.id, n]));
const anchors = (n) => ({
Expand Down Expand Up @@ -37,7 +38,7 @@ function edgePath(e) {
if (e.route === "cross") {
const [ax, ay] = a.right;
const [bx, by] = b.left;
return `M ${ax} ${ay} C ${ax + 210} ${ay} ${bx - 210} ${by} ${bx} ${by}`;
return `M ${ax} ${ay} C ${ax + CROSS_ROUTE_OFFSET} ${ay} ${bx - CROSS_ROUTE_OFFSET} ${by} ${bx} ${by}`;
}
// node → observability card
if (e.route === "tap") {
Expand All @@ -46,8 +47,13 @@ function edgePath(e) {
const [ax, ay] = a.bottom;
// reasoner sits directly above obs with skills between — bow left around the skills box
if (e.from === "reasoner") {
const bow = byId.skills.x - 33;
return `M ${byId.reasoner.x + 55} ${ay} C ${bow} ${ay + 86} ${bow} ${top - 36} ${o.x + 25} ${top}`;
const REASONER_START_X_INSET = 55;
const SKILLS_BOW_LEFT_OFFSET = 33;
const BOW_CTRL1_Y_OFFSET = 86;
const BOW_CTRL2_Y_OFFSET = 36;
const OBS_ENTRY_X_INSET = 25;
const bow = byId.skills.x - SKILLS_BOW_LEFT_OFFSET;
return `M ${byId.reasoner.x + REASONER_START_X_INSET} ${ay} C ${bow} ${ay + BOW_CTRL1_Y_OFFSET} ${bow} ${top - BOW_CTRL2_Y_OFFSET} ${o.x + OBS_ENTRY_X_INSET} ${top}`;
}
// safety taps in from the right, curving down past obs's right edge
if (e.from === "safety") return `M ${ax} ${ay} C ${ax} ${ay + 118} ${o.x + o.w + 12} ${top - 16} ${o.x + o.w - 25} ${top}`;
Expand Down