@xeonr/platform-ui 1.12.3 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/kit/Badge.d.ts.map +1 -1
- package/dist/kit/Badge.js +3 -1
- package/dist/kit/Badge.js.map +1 -1
- package/dist/kit/Blocks.js +1 -1
- package/dist/kit/Blocks.js.map +1 -1
- package/dist/kit/Button.d.ts +4 -0
- package/dist/kit/Button.d.ts.map +1 -1
- package/dist/kit/Button.js +5 -0
- package/dist/kit/Button.js.map +1 -1
- package/dist/kit/Card.d.ts.map +1 -1
- package/dist/kit/Card.js +2 -0
- package/dist/kit/Card.js.map +1 -1
- package/dist/kit/ChartFrame.d.ts.map +1 -1
- package/dist/kit/ChartFrame.js +96 -13
- package/dist/kit/ChartFrame.js.map +1 -1
- package/dist/kit/ChartTypes.d.ts.map +1 -1
- package/dist/kit/ChartTypes.js +73 -13
- package/dist/kit/ChartTypes.js.map +1 -1
- package/dist/kit/Charts.d.ts +9 -1
- package/dist/kit/Charts.d.ts.map +1 -1
- package/dist/kit/Charts.js +185 -22
- package/dist/kit/Charts.js.map +1 -1
- package/dist/kit/DatePicker.js +1 -1
- package/dist/kit/DatePicker.js.map +1 -1
- package/dist/kit/Graph.d.ts.map +1 -1
- package/dist/kit/Graph.js +104 -18
- package/dist/kit/Graph.js.map +1 -1
- package/dist/kit/Sparkline.d.ts +7 -1
- package/dist/kit/Sparkline.d.ts.map +1 -1
- package/dist/kit/Sparkline.js +6 -3
- package/dist/kit/Sparkline.js.map +1 -1
- package/dist/kit/Stepper.js +1 -1
- package/dist/kit/Stepper.js.map +1 -1
- package/dist/kit/chartScale.d.ts.map +1 -1
- package/dist/kit/chartScale.js +9 -6
- package/dist/kit/chartScale.js.map +1 -1
- package/dist/kit/graphCircuit.d.ts +138 -0
- package/dist/kit/graphCircuit.d.ts.map +1 -0
- package/dist/kit/graphCircuit.js +313 -0
- package/dist/kit/graphCircuit.js.map +1 -0
- package/dist/kit/graphLayout.d.ts +82 -0
- package/dist/kit/graphLayout.d.ts.map +1 -1
- package/dist/kit/graphLayout.js +314 -0
- package/dist/kit/graphLayout.js.map +1 -1
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +2 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/ThemeScope.d.ts.map +1 -1
- package/dist/theme/ThemeScope.js +2 -1
- package/dist/theme/ThemeScope.js.map +1 -1
- package/dist/theme/brand.d.ts +8 -0
- package/dist/theme/brand.d.ts.map +1 -1
- package/dist/theme/brand.js +27 -0
- package/dist/theme/brand.js.map +1 -1
- package/dist/theme/language.d.ts +5 -0
- package/dist/theme/language.d.ts.map +1 -0
- package/dist/theme/language.js +20 -0
- package/dist/theme/language.js.map +1 -0
- package/dist/theme/paint.d.ts.map +1 -1
- package/dist/theme/paint.js +6 -1
- package/dist/theme/paint.js.map +1 -1
- package/dist/theme/tokens.d.ts +17 -0
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +101 -7
- package/dist/theme/tokens.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import styled, { css, keyframes } from "styled-components";
|
|
3
|
+
import { v } from "../theme/tokens.js";
|
|
4
|
+
import { arrowhead, channelXs, longestRun, planGap, simplify, sourcePad, trace } from "./graphLayout.js";
|
|
5
|
+
/** Each tone's ink in Circuit: the same as Classic's, so a toned edge keeps its colour. */
|
|
6
|
+
export const INK = {
|
|
7
|
+
brand: v.brand, ok: v.success, warn: v.warning, crit: v.danger, info: v.info, run: v.running, mut: v.faint, data: v.data
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The chip's inner cut: the tile's 8 px cut (--x-clip-tile) half a pixel
|
|
11
|
+
* shallower one pixel in, so the edge reads one pixel wide on the diagonal as
|
|
12
|
+
* it does along the sides.
|
|
13
|
+
*/
|
|
14
|
+
const CHIP_IN = "polygon(7.5px 0, 100% 0, 100% calc(100% - 7.5px), calc(100% - 7.5px) 100%, 0 100%, 0 7.5px)";
|
|
15
|
+
/** The column caption's band above a layered graph. */
|
|
16
|
+
export const CAPTION_H = 18;
|
|
17
|
+
/** The gap between a layered graph's columns, before it widens for channels. */
|
|
18
|
+
export const SIGNAL_COL_GAP = 56;
|
|
19
|
+
/** How far below the row the first under-row lane runs (Classic: 10): clear of a group's frame. */
|
|
20
|
+
export const SIGNAL_LANE_DROP = 14;
|
|
21
|
+
const tint = (ink, pct) => `color-mix(in srgb, ${ink} ${pct}%, ${v.surface})`;
|
|
22
|
+
/** The chip's edge: the selection's gradient, a state's colour, or the neutral line. */
|
|
23
|
+
function chipEdge(p) {
|
|
24
|
+
if (p.$selected)
|
|
25
|
+
return v.graphSelected;
|
|
26
|
+
if (p.$dim)
|
|
27
|
+
return v.line;
|
|
28
|
+
return p.$tone === "ok" || p.$tone === "mut" ? v.line2 : INK[p.$tone];
|
|
29
|
+
}
|
|
30
|
+
/** The chip's body: a failure, a run or a warning tints it; a dim node sits back. */
|
|
31
|
+
function chipFill(p) {
|
|
32
|
+
if (p.$dim)
|
|
33
|
+
return v.surface2;
|
|
34
|
+
return p.$tone === "crit" ? tint(v.danger, 10) : p.$tone === "run" ? tint(v.running, 7) : p.$tone === "warn" ? tint(v.warning, 8) : v.surface;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A node as a chip. The edge and the body are two clipped layers under the
|
|
38
|
+
* content, not the node's own border and background, so a port's dot can sit
|
|
39
|
+
* across the edge without the cut clipping it.
|
|
40
|
+
*/
|
|
41
|
+
export const chipCss = (p) => css`
|
|
42
|
+
padding: 1px;
|
|
43
|
+
border: none;
|
|
44
|
+
border-radius: 0;
|
|
45
|
+
background: transparent;
|
|
46
|
+
box-shadow: none;
|
|
47
|
+
isolation: isolate;
|
|
48
|
+
color: ${p.$dim ? v.muted : v.text};
|
|
49
|
+
&::before, &::after { content: ""; position: absolute; pointer-events: none; }
|
|
50
|
+
&::before { inset: 0; z-index: -2; clip-path: ${v.clipTile}; background: ${chipEdge(p)}; }
|
|
51
|
+
&::after { inset: 1px; z-index: -1; clip-path: ${CHIP_IN}; background: ${chipFill(p)}; }
|
|
52
|
+
${p.$selectable && !p.$selected ? css`&:hover::before { background: ${v.brand}; }` : ""}
|
|
53
|
+
/* the ring would sit under the body: the edge turns --x-info and two pixels wide instead */
|
|
54
|
+
&:focus-visible { box-shadow: none; }
|
|
55
|
+
&:focus-visible::before { background: ${v.info}; }
|
|
56
|
+
&:focus-visible::after { inset: 2px; }
|
|
57
|
+
`;
|
|
58
|
+
/** The full node's header: no tone wash (the edge and the lamp carry the state); the lamp or icon before the title. */
|
|
59
|
+
export const headCss = css`
|
|
60
|
+
background: transparent;
|
|
61
|
+
border-radius: 0;
|
|
62
|
+
& > .mark { flex: none; display: inline-flex; margin-right: 3px; }
|
|
63
|
+
`;
|
|
64
|
+
/** The compact node: name over a mono sub, the failure in the danger ink. */
|
|
65
|
+
export const compactCss = (p) => css`
|
|
66
|
+
background: transparent;
|
|
67
|
+
border-radius: 0;
|
|
68
|
+
min-height: 42px;
|
|
69
|
+
padding: 5px 10px 5px 11px;
|
|
70
|
+
column-gap: 9px;
|
|
71
|
+
& > .sub { font-family: ${v.mono}; font-size: 10.5px; line-height: 14px; color: ${p.$tone === "crit" ? v.danger : v.faint}; }
|
|
72
|
+
`;
|
|
73
|
+
/** A port as a square pad: neutral to look at, the brand where it can be wired. */
|
|
74
|
+
export const dotCss = (p) => css`
|
|
75
|
+
border-radius: 1px;
|
|
76
|
+
background: ${p.$target ? v.success : p.$live ? v.brand : v.graphEdge};
|
|
77
|
+
`;
|
|
78
|
+
/** The surface takes a panel's cut corners and lit hairline, drawn as backgrounds so they stay put when it scrolls. */
|
|
79
|
+
export const surfaceCss = css`
|
|
80
|
+
clip-path: ${v.clipPanel};
|
|
81
|
+
background-image: ${v.edgePanel}, radial-gradient(${v.line} 1px, transparent 1px);
|
|
82
|
+
background-size: auto, auto, 16px 16px;
|
|
83
|
+
background-repeat: no-repeat, no-repeat, repeat;
|
|
84
|
+
background-origin: border-box, border-box, padding-box;
|
|
85
|
+
`;
|
|
86
|
+
export const removeCss = css`
|
|
87
|
+
border-radius: ${v.rCtl};
|
|
88
|
+
`;
|
|
89
|
+
/**
|
|
90
|
+
* An edge's label sits on its trace: its tint over the chip surface, so the
|
|
91
|
+
* trace does not show through the words (over --x-surface-2 the danger ink in
|
|
92
|
+
* light falls to 4.4:1; over --x-surface it is 4.9:1).
|
|
93
|
+
*/
|
|
94
|
+
export const labelCss = (wash) => css`
|
|
95
|
+
background: linear-gradient(${wash}, ${wash}), ${v.surface};
|
|
96
|
+
`;
|
|
97
|
+
/** The square lamp that stands in for an icon: the tone's colour, lit; hollow when dim. */
|
|
98
|
+
export const Lamp = styled.span.withConfig({ componentId: "sc-qaqhn8-0" })`
|
|
99
|
+
flex: none;
|
|
100
|
+
display: inline-block;
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
width: 8px;
|
|
103
|
+
height: 8px;
|
|
104
|
+
background: ${(p) => p.$dim ? "transparent" : INK[p.$tone]};
|
|
105
|
+
border: ${(p) => p.$dim ? `1px solid ${v.faint}` : "none"};
|
|
106
|
+
box-shadow: ${(p) => p.$dim || p.$tone === "mut" ? "none" : `0 0 8px ${INK[p.$tone]}`};
|
|
107
|
+
`;
|
|
108
|
+
/** The selected chip's glow, behind it. */
|
|
109
|
+
export const ChipGlow = styled.span.withConfig({ componentId: "sc-qaqhn8-1" })`
|
|
110
|
+
position: absolute;
|
|
111
|
+
inset: -1px;
|
|
112
|
+
z-index: -3;
|
|
113
|
+
background: ${v.graphSelected};
|
|
114
|
+
filter: blur(11px);
|
|
115
|
+
opacity: ${v.graphGlow};
|
|
116
|
+
pointer-events: none;
|
|
117
|
+
`;
|
|
118
|
+
const sweep = keyframes`
|
|
119
|
+
from { transform: translateX(-100%); }
|
|
120
|
+
to { transform: translateX(250%); }
|
|
121
|
+
`;
|
|
122
|
+
/** A running node's indeterminate bar along its bottom edge, inside the chip's cut. */
|
|
123
|
+
export const RunTrack = styled.span.withConfig({ componentId: "sc-qaqhn8-2" })`
|
|
124
|
+
position: absolute;
|
|
125
|
+
inset: 1px;
|
|
126
|
+
clip-path: ${CHIP_IN};
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
& > i {
|
|
130
|
+
position: absolute;
|
|
131
|
+
left: 0;
|
|
132
|
+
bottom: 0;
|
|
133
|
+
width: 40%;
|
|
134
|
+
height: 2px;
|
|
135
|
+
background: linear-gradient(90deg, transparent, ${v.running});
|
|
136
|
+
transform: translateX(-100%);
|
|
137
|
+
animation: ${sweep} 1.6s linear infinite;
|
|
138
|
+
}
|
|
139
|
+
@media (prefers-reduced-motion: reduce) {
|
|
140
|
+
& > i { animation: none; transform: translateX(60%); }
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
/** A group: a dashed frame round its nodes, faintly the brand, its name in a tab on the top edge. */
|
|
144
|
+
export const GroupFrame = styled.div.withConfig({ componentId: "sc-qaqhn8-3" })`
|
|
145
|
+
position: absolute;
|
|
146
|
+
border: 1px dashed ${v.line2};
|
|
147
|
+
background: color-mix(in srgb, ${v.brand} 5%, transparent);
|
|
148
|
+
pointer-events: none;
|
|
149
|
+
& > span {
|
|
150
|
+
position: absolute;
|
|
151
|
+
left: 8px;
|
|
152
|
+
top: -8px;
|
|
153
|
+
padding: 0 6px;
|
|
154
|
+
background: ${v.surface2};
|
|
155
|
+
color: ${v.faint};
|
|
156
|
+
font-family: ${v.label};
|
|
157
|
+
font-size: 10.5px;
|
|
158
|
+
line-height: 14px;
|
|
159
|
+
letter-spacing: ${v.labelTracking};
|
|
160
|
+
text-transform: ${v.labelCase};
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
}
|
|
163
|
+
/* the group's name is an identifier: as typed */
|
|
164
|
+
& code { font-family: inherit; text-transform: none; }
|
|
165
|
+
`;
|
|
166
|
+
/** A layered graph's column number, along the top. */
|
|
167
|
+
export const ColCaption = styled.span.withConfig({ componentId: "sc-qaqhn8-4" })`
|
|
168
|
+
position: absolute;
|
|
169
|
+
top: 10px;
|
|
170
|
+
color: ${v.faint};
|
|
171
|
+
font-family: ${v.label};
|
|
172
|
+
font-size: 10.5px;
|
|
173
|
+
line-height: 14px;
|
|
174
|
+
letter-spacing: ${v.labelTracking};
|
|
175
|
+
text-transform: ${v.labelCase};
|
|
176
|
+
white-space: nowrap;
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
`;
|
|
179
|
+
// ---------------------------------------------------------------------------
|
|
180
|
+
// Traces
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
const march = keyframes`to { stroke-dashoffset: -22; }`;
|
|
183
|
+
export const CircuitOverlay = styled.svg.withConfig({ componentId: "sc-qaqhn8-5" })`
|
|
184
|
+
position: absolute;
|
|
185
|
+
top: 0;
|
|
186
|
+
left: 0;
|
|
187
|
+
pointer-events: none;
|
|
188
|
+
overflow: visible;
|
|
189
|
+
.wire { transition: opacity 120ms ease; }
|
|
190
|
+
.wire.faded { opacity: 0.18; }
|
|
191
|
+
.trace, .glow { fill: none; stroke-linejoin: round; stroke-linecap: butt; }
|
|
192
|
+
.trace.animated { stroke-dasharray: 7 4; animation: ${march} 0.9s linear infinite; }
|
|
193
|
+
.trace.dotted { stroke-dasharray: 2 4; }
|
|
194
|
+
.glow { opacity: ${v.graphGlow}; }
|
|
195
|
+
.hit { fill: none; stroke: transparent; stroke-width: 14px; pointer-events: stroke; cursor: pointer; }
|
|
196
|
+
.hit.static { pointer-events: none; cursor: default; }
|
|
197
|
+
.draft { fill: none; stroke: ${v.brand}; stroke-width: 1.5px; stroke-dasharray: 4 3; }
|
|
198
|
+
@media (prefers-reduced-motion: reduce) {
|
|
199
|
+
.trace.animated { animation: none; }
|
|
200
|
+
}
|
|
201
|
+
`;
|
|
202
|
+
/** What a wire's look is, in order of how far forward it is drawn. */
|
|
203
|
+
function rank(w) {
|
|
204
|
+
if (w.faded)
|
|
205
|
+
return 0;
|
|
206
|
+
if (w.flow)
|
|
207
|
+
return 1;
|
|
208
|
+
if (w.lit)
|
|
209
|
+
return 5;
|
|
210
|
+
if (w.animated)
|
|
211
|
+
return 4;
|
|
212
|
+
return w.tone ? 3 : 2;
|
|
213
|
+
}
|
|
214
|
+
/** The ink a wire is drawn in: its tone if it has one, else lit, moving or merely there. */
|
|
215
|
+
export function wireInk(w) {
|
|
216
|
+
if (w.flow)
|
|
217
|
+
return v.graphEdge;
|
|
218
|
+
if (w.tone)
|
|
219
|
+
return INK[w.tone];
|
|
220
|
+
if (w.lit)
|
|
221
|
+
return v.info;
|
|
222
|
+
return w.animated ? v.running : v.graphEdge;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Every wire, quiet ones first, inside an overlay svg. `filter` is the id of
|
|
226
|
+
* the blur the glow under a lit or moving wire uses (Wires draws it; it must
|
|
227
|
+
* be unique on the page).
|
|
228
|
+
*/
|
|
229
|
+
export function Wires({ wires, filter, w, h }) {
|
|
230
|
+
const sorted = [...wires].sort((a, b) => rank(a) - rank(b));
|
|
231
|
+
return _jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("filter", { id: filter, filterUnits: "userSpaceOnUse", x: -24, y: -24, width: w + 48, height: h + 48, children: _jsx("feGaussianBlur", { stdDeviation: "3.5" }) }) }), sorted.map((wire) => {
|
|
232
|
+
const ink = wireInk(wire);
|
|
233
|
+
const d = trace(wire.points, 7, 5);
|
|
234
|
+
if (!d)
|
|
235
|
+
return null;
|
|
236
|
+
const width = wire.lit || wire.animated ? 1.75 : wire.tone === "crit" ? 1.5 : 1.25;
|
|
237
|
+
const dotted = !wire.animated && (wire.flow || wire.tone === "mut");
|
|
238
|
+
const glow = wire.lit ? v.brand : wire.animated ? ink : null;
|
|
239
|
+
const cls = `trace${wire.animated ? " animated" : ""}${dotted ? " dotted" : ""}${wire.lit ? " lit" : ""}${wire.faded ? " faded" : ""}`;
|
|
240
|
+
return _jsxs("g", { className: `wire${wire.faded ? " faded" : ""}`, children: [glow ? _jsx("path", { className: "glow", d: d, style: { stroke: glow, strokeWidth: wire.lit ? 5 : 4 }, filter: `url(#${filter})` }) : null, _jsx("path", { className: cls, d: d, style: { stroke: ink, strokeWidth: width }, ...(wire.data ? { "data-edge": wire.id } : {}) }), _jsx("path", { d: arrowhead(wire.points), style: { fill: ink } }), wire.pad ? _jsx("path", { d: sourcePad(wire.points), style: { fill: ink } }) : null, wire.tone === "crit" && !wire.labelled ? _jsx(Blocked, { at: longestRun(wire.points) }) : null] }, wire.id);
|
|
241
|
+
})] });
|
|
242
|
+
}
|
|
243
|
+
/** The crossed box on a blocking edge: blocked, said without colour. */
|
|
244
|
+
function Blocked({ at }) {
|
|
245
|
+
const x = Math.round(at.x);
|
|
246
|
+
const y = Math.round(at.y);
|
|
247
|
+
return _jsxs("g", { "data-blocked": "", children: [_jsx("rect", { x: x - 5.5, y: y - 5.5, width: 11, height: 11, style: { fill: v.surface2, stroke: v.danger, strokeWidth: 1 } }), _jsx("path", { d: `M${x - 3},${y - 3} L${x + 3},${y + 3} M${x + 3},${y - 3} L${x - 3},${y + 3}`, style: { fill: "none", stroke: v.danger, strokeWidth: 1.3 } })] });
|
|
248
|
+
}
|
|
249
|
+
/** A trace from a dragged port to the pointer, across the middle. */
|
|
250
|
+
export function draftTrace(a, b) {
|
|
251
|
+
const mx = Math.round((a.x + b.x) / 2);
|
|
252
|
+
return trace([a, { x: mx, y: a.y }, { x: mx, y: b.y }, b], 7, 0);
|
|
253
|
+
}
|
|
254
|
+
// ---------------------------------------------------------------------------
|
|
255
|
+
// Row layout routing
|
|
256
|
+
// ---------------------------------------------------------------------------
|
|
257
|
+
/**
|
|
258
|
+
* The traces of a row graph's edges, given where its ports and nodes measured.
|
|
259
|
+
* An edge between neighbours takes a channel of its own in the gap between
|
|
260
|
+
* them (shared only by edges into the same port); an edge between nodes that
|
|
261
|
+
* are not neighbours keeps Classic's lane under the row, with cut corners.
|
|
262
|
+
*/
|
|
263
|
+
export function rowRoutes(o) {
|
|
264
|
+
const at = new Map(o.order.map((id, i) => [id, i]));
|
|
265
|
+
const ends = new Map();
|
|
266
|
+
const gaps = new Map();
|
|
267
|
+
for (const e of o.edges) {
|
|
268
|
+
const a = o.ports(e.from.node, e.from.port, "out");
|
|
269
|
+
const b = o.ports(e.to.node, e.to.port, "in");
|
|
270
|
+
if (!a || !b)
|
|
271
|
+
continue;
|
|
272
|
+
ends.set(e.id, { a, b });
|
|
273
|
+
if (o.lanes.has(e.id))
|
|
274
|
+
continue;
|
|
275
|
+
const i = at.get(e.from.node);
|
|
276
|
+
if (i === undefined)
|
|
277
|
+
continue;
|
|
278
|
+
(gaps.get(i) ?? gaps.set(i, []).get(i)).push({
|
|
279
|
+
edge: e.id, from: `${e.from.node}|${e.from.port}`, to: `${e.to.node}|${e.to.port}`, y1: a.y, y2: b.y, style: `${e.tone ?? ""}|${e.animated ? "a" : ""}`
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
const routes = new Map();
|
|
283
|
+
for (const [i, segs] of gaps) {
|
|
284
|
+
const left = o.boxes[o.order[i]];
|
|
285
|
+
const right = o.boxes[o.order[i + 1] ?? ""];
|
|
286
|
+
const plan = planGap(segs, 0);
|
|
287
|
+
const xs = left && right ? channelXs(plan.channels.length, left.x + left.w, right.x) : [];
|
|
288
|
+
plan.channels.forEach((ids, k) => {
|
|
289
|
+
for (const id of ids) {
|
|
290
|
+
const { a, b } = ends.get(id);
|
|
291
|
+
const x = xs[k] ?? (a.x + b.x) / 2;
|
|
292
|
+
routes.set(id, simplify([a, { x, y: a.y }, { x, y: b.y }, b]));
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
for (const s of segs)
|
|
296
|
+
if (!routes.has(s.edge)) {
|
|
297
|
+
const { a, b } = ends.get(s.edge);
|
|
298
|
+
routes.set(s.edge, [a, b]);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
for (const [id, lane] of o.lanes) {
|
|
302
|
+
const en = ends.get(id);
|
|
303
|
+
if (!en)
|
|
304
|
+
continue;
|
|
305
|
+
const { a, b } = en;
|
|
306
|
+
const y = o.laneY(lane);
|
|
307
|
+
const x1 = a.x + o.stub;
|
|
308
|
+
const x2 = b.x - o.stub;
|
|
309
|
+
routes.set(id, [a, { x: x1, y: a.y }, { x: x1, y }, { x: x2, y }, { x: x2, y: b.y }, b]);
|
|
310
|
+
}
|
|
311
|
+
return routes;
|
|
312
|
+
}
|
|
313
|
+
//# sourceMappingURL=graphCircuit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/kit/graphCircuit.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,MAAM,IAAI,GAAG,EAAE,SAAS,QAAQ,mBAAmB;AAC1D,SAAS,CAAC,QAAQ,oBAAoB;AAEtC,SAAS,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,QAAkC,kBAAkB;AAoBlI;AACA,OAAO,MAAM,GAAG,GAA8B;EAC5C,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;CACrH;AAED;;;;;AAKA,MAAM,OAAO,GAAG,6FAA6F;AAE7G;AACA,OAAO,MAAM,SAAS,GAAG,EAAE;AAC3B;AACA,O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AAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;EAC1F;EACA,OAAO,MAAM;AACf","ignoreList":[]}
|
|
@@ -29,4 +29,86 @@ export interface LayeredLayout {
|
|
|
29
29
|
* implied by a longer path (a→c when a→b→c) is not drawn.
|
|
30
30
|
*/
|
|
31
31
|
export declare function layeredLayout(nodes: readonly string[], edgesIn: readonly LayoutEdge[], reduce: boolean): LayeredLayout;
|
|
32
|
+
export interface Pt {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
}
|
|
36
|
+
/** One edge's crossing of one gap between columns. */
|
|
37
|
+
export interface GapSegment {
|
|
38
|
+
edge: string;
|
|
39
|
+
/** what it leaves: a node, or the slot a long edge passes through (segments leaving one source share its stub) */
|
|
40
|
+
from: string;
|
|
41
|
+
/** what it enters */
|
|
42
|
+
to: string;
|
|
43
|
+
/** the height it leaves at */
|
|
44
|
+
y1: number;
|
|
45
|
+
/** the height of what it enters */
|
|
46
|
+
y2: number;
|
|
47
|
+
/** edges of different styles never share a channel */
|
|
48
|
+
style: string;
|
|
49
|
+
}
|
|
50
|
+
export interface GapPlan {
|
|
51
|
+
/** the channels, left to right: the edges each carries */
|
|
52
|
+
channels: string[][];
|
|
53
|
+
/** the height each edge enters its target at (its target's, spread when more than one style enters it) */
|
|
54
|
+
entry: Map<string, number>;
|
|
55
|
+
}
|
|
56
|
+
/** Room either side of a gap's channels: a source pad and a cut corner on the left, a cut corner and an arrowhead on the right. */
|
|
57
|
+
export declare const CHANNEL_MARGIN: {
|
|
58
|
+
readonly left: 12;
|
|
59
|
+
readonly right: 14;
|
|
60
|
+
};
|
|
61
|
+
/** The closest two channels sit, and the farthest apart they are spread. */
|
|
62
|
+
export declare const CHANNEL_PITCH: {
|
|
63
|
+
readonly min: 8;
|
|
64
|
+
readonly max: 16;
|
|
65
|
+
};
|
|
66
|
+
/** How wide a gap must be to carry `n` channels: at least `base`. */
|
|
67
|
+
export declare function gapWidth(n: number, base: number): number;
|
|
68
|
+
/** Where `n` channels sit in a gap from `left` to `right`: one in the middle, more spread evenly about it. */
|
|
69
|
+
export declare function channelXs(n: number, left: number, right: number): number[];
|
|
70
|
+
/**
|
|
71
|
+
* Plan one gap: which edges share a channel, the channels' order, and the
|
|
72
|
+
* height each edge enters its target at. `spread` is the step between the
|
|
73
|
+
* heights edges of different styles enter one target at (0 to keep them all at
|
|
74
|
+
* the target's own).
|
|
75
|
+
*/
|
|
76
|
+
export declare function planGap(segs: readonly GapSegment[], spread?: number): GapPlan;
|
|
77
|
+
export interface CircuitLayout {
|
|
78
|
+
/** each column's left edge */
|
|
79
|
+
colX: number[];
|
|
80
|
+
/** each drawn edge as the corners of its trace, from its source's right side to its target's left side */
|
|
81
|
+
routes: Map<string, Pt[]>;
|
|
82
|
+
/** how many channels each gap between columns carries */
|
|
83
|
+
channels: number[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Route a layered layout's edges as traces. The heights come from the caller
|
|
87
|
+
* (`slotY`: the middle of each slot, which is a node's middle); the columns'
|
|
88
|
+
* left edges come from here, since a gap grows when it carries more channels
|
|
89
|
+
* than `baseGap` holds.
|
|
90
|
+
*/
|
|
91
|
+
export declare function circuitLayered(layout: LayeredLayout, o: {
|
|
92
|
+
pad: number;
|
|
93
|
+
colW: readonly number[];
|
|
94
|
+
baseGap: number;
|
|
95
|
+
nodeW: (id: string) => number;
|
|
96
|
+
slotY: (column: number, index: number) => number;
|
|
97
|
+
style: (edge: string) => string;
|
|
98
|
+
}): CircuitLayout;
|
|
99
|
+
/** Drop repeated points and the middle one of three on a line. */
|
|
100
|
+
export declare function simplify(points: readonly Pt[]): Pt[];
|
|
101
|
+
/**
|
|
102
|
+
* A trace through orthogonal points as an SVG path: straight runs, every
|
|
103
|
+
* corner cut at 45 degrees `cut` deep (less where a run is short: a cut takes
|
|
104
|
+
* at most half a run, and never eats into the `endInset` the trace stops short
|
|
105
|
+
* of its last point by, where an arrowhead sits).
|
|
106
|
+
*/
|
|
107
|
+
export declare function trace(points: readonly Pt[], cut?: number, endInset?: number): string;
|
|
108
|
+
/** The middle of a trace's longest run: where a mark on the edge (a label, a blocked box) goes. */
|
|
109
|
+
export declare function longestRun(points: readonly Pt[]): Pt;
|
|
110
|
+
/** The filled head at a trace's end, `long` deep and `wide` across, pointing along its last run. */
|
|
111
|
+
export declare function arrowhead(points: readonly Pt[], long?: number, wide?: number): string;
|
|
112
|
+
/** The small pad a trace leaves its source from, `long` along its first run and `wide` across. */
|
|
113
|
+
export declare function sourcePad(points: readonly Pt[], long?: number, wide?: number): string;
|
|
32
114
|
//# sourceMappingURL=graphLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphLayout.d.ts","sourceRoot":"","sources":["../../src/kit/graphLayout.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvF,MAAM,WAAW,aAAa;IAC5B,yEAAyE;IACzE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,qDAAqD;IACrD,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC;IACxB,sHAAsH;IACtH,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,oHAAoH;IACpH,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9B,0HAA0H;IAC1H,OAAO,EAAE,CAAC,EAAE,EAAE,M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