@loadmap/react 0.7.0 → 0.9.0
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/README.md +16 -2
- package/dist/Loadmap-CZbpcpNc.js +3715 -0
- package/dist/Loadmap-DIqhwkgn.d.ts +285 -0
- package/dist/index.d.ts +14 -203
- package/dist/index.js +4 -3076
- package/dist/source.d.ts +16 -0
- package/dist/source.js +54 -0
- package/package.json +9 -4
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { Evaluation, Model, Scenario, Values } from "@loadmap/core";
|
|
2
|
+
import { Direction, ElkEngine, Scene, View, labelsAt } from "@loadmap/layout";
|
|
3
|
+
import { ReactNode, Ref } from "react";
|
|
4
|
+
import { Particle, Sim, SimOptions } from "@loadmap/sim";
|
|
5
|
+
/** A part of the scene the board shows, in scene units. */
|
|
6
|
+
interface Rect {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
w: number;
|
|
10
|
+
h: number;
|
|
11
|
+
}
|
|
12
|
+
/** Each box's shape by id and the edges drawn, as `shapesOf` gives them: what a change of values reshapes. */
|
|
13
|
+
interface Shapes {
|
|
14
|
+
nodes: Record<string, string>;
|
|
15
|
+
edges: {
|
|
16
|
+
id: string;
|
|
17
|
+
from: string;
|
|
18
|
+
to: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
/** A dot as it is drawn now, in scene units. */
|
|
22
|
+
interface Dot {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
r: number;
|
|
26
|
+
color: string;
|
|
27
|
+
alpha: number;
|
|
28
|
+
/** A retry: drawn as a ring of this stroke width, inside r. */
|
|
29
|
+
ring?: number;
|
|
30
|
+
}
|
|
31
|
+
/** What the diagram says while the story plays a step: its title, and what the boxes framed show. */
|
|
32
|
+
interface Cue {
|
|
33
|
+
step: number;
|
|
34
|
+
title: string;
|
|
35
|
+
detail: string;
|
|
36
|
+
/** The step's values are shown. */
|
|
37
|
+
after: boolean;
|
|
38
|
+
/** The boxes framed are low on the board: the title sits at its top. */
|
|
39
|
+
top: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** How the story player reaches the page: it starts and stops, shows a step's values and says what it is at. */
|
|
42
|
+
interface StoryHost {
|
|
43
|
+
playing(on: boolean): void;
|
|
44
|
+
show(i: number): void;
|
|
45
|
+
cue(c: Cue | null): void;
|
|
46
|
+
/** Each box's shape and the edges drawn at these values (`shapesOf`, with the page's direction and fonts). */
|
|
47
|
+
shapes(ev: Evaluation): Shapes;
|
|
48
|
+
}
|
|
49
|
+
type Shot = 'establish' | 'in' | 'close' | 'change' | 'out' | 'wide' | 'back';
|
|
50
|
+
/**
|
|
51
|
+
* Everything that moves, without React: the sim, the dots on the canvas, the worker fills in the SVG, and the move from
|
|
52
|
+
* one structure to the next. React renders the structure once per scene, and once per frame while it moves; the engine
|
|
53
|
+
* updates the moving parts every frame, and export drives it frame by frame instead of the animation loop.
|
|
54
|
+
*/
|
|
55
|
+
declare class Engine {
|
|
56
|
+
#private;
|
|
57
|
+
readonly model: Model;
|
|
58
|
+
readonly view: View;
|
|
59
|
+
sim: Sim;
|
|
60
|
+
ev: Evaluation;
|
|
61
|
+
scene: Scene | null;
|
|
62
|
+
/** What the diagram draws now: the scene, or a frame of the move to it. */
|
|
63
|
+
frame: Scene | null;
|
|
64
|
+
/** Counts the frames: export waits until the diagram drew this one. */
|
|
65
|
+
frameId: number;
|
|
66
|
+
drawnFrame: number;
|
|
67
|
+
/** Seconds a new structure takes to move in; 0 cuts. */
|
|
68
|
+
transition: number;
|
|
69
|
+
/** The structure key the current values want; `scene.key` catches up once the layout is done. */
|
|
70
|
+
wantKey: string;
|
|
71
|
+
/** The values React last drew labels and colours for; a frame is complete once they match `ev.values`. */
|
|
72
|
+
drawnValues: string;
|
|
73
|
+
/** The component a story step points at, and the one the diagram last outlined: export waits for them to match. */
|
|
74
|
+
wantFocus: string | null;
|
|
75
|
+
/** The story step shown, set as soon as one is chosen: a recorder holding an old handle still reads it. */
|
|
76
|
+
storyStep: number | null;
|
|
77
|
+
drawnFocus: string | null;
|
|
78
|
+
paused: boolean;
|
|
79
|
+
/** Flights cut and the first limit holds still. */
|
|
80
|
+
reducedMotion: boolean;
|
|
81
|
+
/** The part of the scene the board shows while the story plays; null for all of it. */
|
|
82
|
+
camera: Rect | null;
|
|
83
|
+
/** What the diagram says about the step the story plays; null when it does not play. */
|
|
84
|
+
cue: Cue | null;
|
|
85
|
+
host: StoryHost | null;
|
|
86
|
+
colors: Record<string, string>;
|
|
87
|
+
svg: SVGSVGElement | null;
|
|
88
|
+
canvas: HTMLCanvasElement | null;
|
|
89
|
+
constructor(model: Model, view: View, ev: Evaluation, o?: SimOptions);
|
|
90
|
+
setEvaluation(ev: Evaluation): void;
|
|
91
|
+
/**
|
|
92
|
+
* Takes a new scene. A new structure moves in from what is drawn now, unless `cut`, the diagram turned (a new
|
|
93
|
+
* direction is a new screen size, not a new design), or it is paused with nothing stepping it; the first scene just
|
|
94
|
+
* shows.
|
|
95
|
+
*/
|
|
96
|
+
setScene(scene: Scene, o?: {
|
|
97
|
+
cut?: boolean;
|
|
98
|
+
}): void;
|
|
99
|
+
/** Calls `f` whenever the frame changes; returns a function that stops it. */
|
|
100
|
+
subscribe: (f: () => void) => (() => void);
|
|
101
|
+
/** Starts the sim over from empty queues, with this seed (default: the original one), and ends a move. */
|
|
102
|
+
reset(seed?: number): void;
|
|
103
|
+
bind(svg: SVGSVGElement | null, canvas: HTMLCanvasElement | null): void;
|
|
104
|
+
/** Reads the theme tokens from the element that carries them. Call again when the theme changes. */
|
|
105
|
+
readColors(root: Element): void;
|
|
106
|
+
flowColor(flow: string): string;
|
|
107
|
+
outcomeColor(outcome: Particle['outcome']): string;
|
|
108
|
+
resize(): void;
|
|
109
|
+
/** Advances the sim, the move to a new structure and the story played, by `dtReal` seconds. */
|
|
110
|
+
step(dtReal: number, o?: {
|
|
111
|
+
particles?: boolean;
|
|
112
|
+
}): void;
|
|
113
|
+
/** The story plays: from the whole diagram, step `from` and the ones after it. */
|
|
114
|
+
get playing(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Plays the story from step `from` on the engine's clock: the whole diagram, then for each step a flight in to what it
|
|
117
|
+
* changes, the change, a flight out and the whole diagram for its seconds. The host shows each step's values. False
|
|
118
|
+
* when it cannot: nothing is drawn yet, or there is no such step.
|
|
119
|
+
*/
|
|
120
|
+
playStory(from: number): boolean;
|
|
121
|
+
/** Stops the story: the camera flies back to the whole diagram (cuts with `cut`), and the step shown stays. */
|
|
122
|
+
stopStory(o?: {
|
|
123
|
+
cut?: boolean;
|
|
124
|
+
}): void;
|
|
125
|
+
/** For tests and recordings: the shot the story is at. */
|
|
126
|
+
get story(): {
|
|
127
|
+
i: number;
|
|
128
|
+
shot: Shot;
|
|
129
|
+
t: number;
|
|
130
|
+
} | null;
|
|
131
|
+
/** Points the SVG at the camera: React draws the whole scene's viewBox, the camera replaces it after each render. */
|
|
132
|
+
applyCamera(): void;
|
|
133
|
+
/** Draws the dots on the overlay canvas and the worker fills in the SVG. */
|
|
134
|
+
draw(o?: {
|
|
135
|
+
particles?: boolean;
|
|
136
|
+
}): void;
|
|
137
|
+
drawFills(): void;
|
|
138
|
+
/** Every dot as it is drawn now, in scene units: for the canvas, and for an SVG export. */
|
|
139
|
+
dots(): Dot[];
|
|
140
|
+
/**
|
|
141
|
+
* Paints the dots onto any 2D context, scene units × `scale`: the overlay, or an export frame. Under the camera they
|
|
142
|
+
* go where the SVG shows their places (its viewBox, centred where its shape differs), so they keep matching the bars.
|
|
143
|
+
*/
|
|
144
|
+
paintParticles(ctx: CanvasRenderingContext2D, scale: number): void;
|
|
145
|
+
}
|
|
146
|
+
interface LoadmapOptions<P> extends SimOptions {
|
|
147
|
+
/** Values to start from instead of the model's defaults. */
|
|
148
|
+
initial?: Partial<Values<P>>;
|
|
149
|
+
/** Where ELK lays the diagram out. Default: one worker shared by the page, or the main thread if it cannot start. */
|
|
150
|
+
elk?: ElkEngine;
|
|
151
|
+
/** Below this container width the diagram is laid out top to bottom. Default 640. */
|
|
152
|
+
narrowBelow?: number;
|
|
153
|
+
/** Which way the diagram runs where there is room. Default RIGHT; below `narrowBelow` it is always DOWN. */
|
|
154
|
+
direction?: Direction;
|
|
155
|
+
/** What full screen opens with: the panels around the diagram, or mainly the diagram and the story. Default panels. */
|
|
156
|
+
fullScreenMode?: FullScreenMode;
|
|
157
|
+
/**
|
|
158
|
+
* Seconds the diagram takes to move to a new structure (a scenario, a story step or a control that adds pods): what
|
|
159
|
+
* stays moves, what is new fades in. 0 cuts. Default 0.8; with reduced motion it always cuts. The load never moves it.
|
|
160
|
+
*/
|
|
161
|
+
transition?: number;
|
|
162
|
+
}
|
|
163
|
+
/** Full screen with every panel it lists in a compact form, or mainly the diagram and the story. */
|
|
164
|
+
type FullScreenMode = 'panels' | 'focus';
|
|
165
|
+
interface LoadmapController<P = any> {
|
|
166
|
+
model: Model<P>;
|
|
167
|
+
view: View;
|
|
168
|
+
values: Values<P>;
|
|
169
|
+
setValues: (v: Partial<Values<P>>) => void;
|
|
170
|
+
/** The scenario the values match, load aside; null for values of the reader's own. */
|
|
171
|
+
scenario: Scenario<P> | null;
|
|
172
|
+
/** Takes a scenario's values; the load stays. */
|
|
173
|
+
setScenario: (label: string) => void;
|
|
174
|
+
/** The story step shown, by index; null outside the story. */
|
|
175
|
+
step: number | null;
|
|
176
|
+
/** The reader changed a value since the step was shown: its outline is gone. */
|
|
177
|
+
stepChanged: boolean;
|
|
178
|
+
/** Shows a story step (its values, its focus), or leaves the story with null. */
|
|
179
|
+
setStep: (i: number | null) => void;
|
|
180
|
+
/** The component the story points at now. */
|
|
181
|
+
focus: string | null;
|
|
182
|
+
/**
|
|
183
|
+
* The story plays: the whole diagram, then for each step a close-up on what it changes, the change, and the whole
|
|
184
|
+
* diagram again for its seconds, until the last.
|
|
185
|
+
*/
|
|
186
|
+
storyPlaying: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Plays the story from the step after the one shown (from the first outside the story or at its end), or pauses it.
|
|
189
|
+
* A value the reader changes, a scenario or a step they pick stops it.
|
|
190
|
+
*/
|
|
191
|
+
setStoryPlaying: (on: boolean) => void;
|
|
192
|
+
/** What the diagram says about the step the story plays; null when it does not play. */
|
|
193
|
+
cue: Cue | null;
|
|
194
|
+
/** The root is full screen: the browser's, or an overlay where the browser has none or refuses. */
|
|
195
|
+
fullScreen: boolean;
|
|
196
|
+
toggleFullScreen: () => void;
|
|
197
|
+
/** What full screen shows. The reader switches it; the page picks where it starts. */
|
|
198
|
+
fullScreenMode: FullScreenMode;
|
|
199
|
+
setFullScreenMode: (m: FullScreenMode) => void;
|
|
200
|
+
ev: Evaluation<P>;
|
|
201
|
+
/** null until the first layout is done. */
|
|
202
|
+
scene: Scene | null;
|
|
203
|
+
labels: ReturnType<typeof labelsAt>;
|
|
204
|
+
direction: Direction;
|
|
205
|
+
reducedMotion: boolean;
|
|
206
|
+
engine: Engine;
|
|
207
|
+
/** Attach to the element that carries the `.lm` class: its width picks the direction, its tokens the colours. */
|
|
208
|
+
rootRef: (el: HTMLElement | null) => void;
|
|
209
|
+
root: HTMLElement | null;
|
|
210
|
+
}
|
|
211
|
+
/** The state behind a loadmap: values, the model's evaluation, the layout and the engine. */
|
|
212
|
+
declare function useLoadmap<P>(model: Model<P>, view: View, o?: LoadmapOptions<P>): LoadmapController<P>;
|
|
213
|
+
/** `auto` follows the system's light or dark; `inherit` the page's own switch (`data-theme`, or a `dark` or `light` class, on `<html>`). */
|
|
214
|
+
type Theme = 'auto' | 'light' | 'dark' | 'inherit';
|
|
215
|
+
/**
|
|
216
|
+
* The theme to draw: `theme` itself; with `inherit`, what the page's own switch says, followed as it changes, and the
|
|
217
|
+
* system's (`auto`) while it says nothing, as on the server.
|
|
218
|
+
*/
|
|
219
|
+
declare function usePageTheme(theme?: Theme): 'auto' | 'light' | 'dark';
|
|
220
|
+
/** What a page (or `@loadmap/export`) can drive from outside. */
|
|
221
|
+
interface LoadmapHandle {
|
|
222
|
+
/** Resolves once the current values are laid out and drawn, and the frame of a move to a new structure with them. */
|
|
223
|
+
ready(timeoutMs?: number): Promise<void>;
|
|
224
|
+
pause(): void;
|
|
225
|
+
resume(): void;
|
|
226
|
+
values(): Values<any>;
|
|
227
|
+
setValues(v: Partial<Values<any>>): void;
|
|
228
|
+
/** Empties the queues and dots and starts over with this seed; a move to a new structure ends where it goes. */
|
|
229
|
+
reset(seed?: number): void;
|
|
230
|
+
/** Advances the sim, and a move to a new structure, by `dtReal` seconds and draws the frame: the deterministic way to animate. */
|
|
231
|
+
step(dtReal: number): void;
|
|
232
|
+
/** Shows a story step (its values and the box it points at), or leaves the story with null. */
|
|
233
|
+
setStoryStep(i: number | null): void;
|
|
234
|
+
/** The story step shown; null outside the story. */
|
|
235
|
+
storyStep(): number | null;
|
|
236
|
+
/**
|
|
237
|
+
* Plays the story from its first step on the engine's clock, as Play does: the whole diagram, then for each step a
|
|
238
|
+
* close-up on what it changes, the change, and the whole diagram for its seconds. `step()` advances it; returns its
|
|
239
|
+
* length in seconds. Picking a step or a value stops it.
|
|
240
|
+
*/
|
|
241
|
+
playStory(): number;
|
|
242
|
+
/** The drawn board, for capturing frames: while the structure moves, `scene` is the frame drawn. */
|
|
243
|
+
board(): {
|
|
244
|
+
svg: SVGSVGElement;
|
|
245
|
+
canvas: HTMLCanvasElement;
|
|
246
|
+
scene: Scene;
|
|
247
|
+
} | null;
|
|
248
|
+
engine: Engine;
|
|
249
|
+
}
|
|
250
|
+
/** The root element: theme tokens, styles, and the size the layout direction follows. */
|
|
251
|
+
declare function LoadmapRoot({ lm, theme, children }: {
|
|
252
|
+
lm: LoadmapController;
|
|
253
|
+
theme?: Theme;
|
|
254
|
+
children: ReactNode;
|
|
255
|
+
}): import("react").JSX.Element;
|
|
256
|
+
/** The panels full screen shows with the diagram, compact: the verdict and the assumptions in a line under it. */
|
|
257
|
+
declare const LOADMAP_PANELS: readonly ['verdict', 'live', 'limits', 'controls', 'headroom', 'compare', 'assumptions'];
|
|
258
|
+
type LoadmapPanel = (typeof LOADMAP_PANELS)[number];
|
|
259
|
+
interface LoadmapProps<P> extends LoadmapOptions<P> {
|
|
260
|
+
model: Model<P>;
|
|
261
|
+
view: View;
|
|
262
|
+
theme?: Theme;
|
|
263
|
+
/** Defaults to the model's title; false hides it. */
|
|
264
|
+
title?: ReactNode | false;
|
|
265
|
+
/** Lines added before the generated assumptions. */
|
|
266
|
+
assumptions?: readonly ReactNode[];
|
|
267
|
+
/** The headroom chart. Default true. */
|
|
268
|
+
headroom?: boolean;
|
|
269
|
+
/** The scenarios side by side, when the model declares two or more. Default true. */
|
|
270
|
+
compare?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* The panels full screen shows, compact, below the diagram. Default every one the page shows. Focus mode shows the
|
|
273
|
+
* verdict and the load slider of these.
|
|
274
|
+
*/
|
|
275
|
+
fullScreen?: readonly LoadmapPanel[];
|
|
276
|
+
/** A click (or Enter) on a box of the diagram, by its id: every box is a button then. */
|
|
277
|
+
onNodeClick?: (id: string) => void;
|
|
278
|
+
/** The box drawn as selected, by its id. */
|
|
279
|
+
selected?: string | null;
|
|
280
|
+
ref?: Ref<LoadmapHandle>;
|
|
281
|
+
}
|
|
282
|
+
/** The whole page piece: scenarios, diagram, verdict, headroom, live meters, limits, controls and assumptions. */
|
|
283
|
+
declare function Loadmap<P>({ model, view, theme, title, assumptions, headroom, compare, fullScreen, onNodeClick, selected, ref, ...o }: LoadmapProps<P>): import("react").JSX.Element;
|
|
284
|
+
declare function handleOf(lm: LoadmapController): LoadmapHandle;
|
|
285
|
+
export { LoadmapProps as a, handleOf as c, LoadmapController as d, LoadmapOptions as f, Engine as g, Dot as h, LoadmapPanel as i, usePageTheme as l, Cue as m, Loadmap as n, LoadmapRoot as o, useLoadmap as p, LoadmapHandle as r, Theme as s, LOADMAP_PANELS as t, FullScreenMode as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,145 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as LoadmapProps, c as handleOf, d as LoadmapController, f as LoadmapOptions, g as Engine, h as Dot, i as LoadmapPanel, l as usePageTheme, m as Cue, n as Loadmap, o as LoadmapRoot, p as useLoadmap, r as LoadmapHandle, s as Theme, t as LOADMAP_PANELS, u as FullScreenMode } from "./Loadmap-DIqhwkgn.js";
|
|
2
|
+
import { Comparison, Model } from "@loadmap/core";
|
|
2
3
|
import { fitLinear } from "@loadmap/core/calibrate";
|
|
3
4
|
import { compact, fmt, multiple, pct, secs } from "@loadmap/core/format";
|
|
4
|
-
import { AnyNodeDef, ClusterDef,
|
|
5
|
-
import { ReactNode
|
|
6
|
-
import { Particle, Sim, SimOptions } from "@loadmap/sim";
|
|
5
|
+
import { AnyNodeDef, ClusterDef, EdgeDef, ElkEngine, ElkEngine as ElkEngine$1, FlowColor, FlowView, Label, NodeDef, PoolDef, View, ViewDef, cluster, defineView, edge, node, pool } from "@loadmap/layout";
|
|
6
|
+
import { ReactNode } from "react";
|
|
7
7
|
export * from "@loadmap/core";
|
|
8
|
-
/** A dot as it is drawn now, in scene units. */
|
|
9
|
-
interface Dot {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
r: number;
|
|
13
|
-
color: string;
|
|
14
|
-
alpha: number;
|
|
15
|
-
/** A retry: drawn as a ring of this stroke width, inside r. */
|
|
16
|
-
ring?: number;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Everything that moves, without React: the sim, the dots on the canvas, the worker fills in the SVG, and the move from
|
|
20
|
-
* one structure to the next. React renders the structure once per scene, and once per frame while it moves; the engine
|
|
21
|
-
* updates the moving parts every frame, and export drives it frame by frame instead of the animation loop.
|
|
22
|
-
*/
|
|
23
|
-
declare class Engine {
|
|
24
|
-
#private;
|
|
25
|
-
readonly model: Model;
|
|
26
|
-
readonly view: View$1;
|
|
27
|
-
sim: Sim;
|
|
28
|
-
ev: Evaluation;
|
|
29
|
-
scene: Scene | null;
|
|
30
|
-
/** What the diagram draws now: the scene, or a frame of the move to it. */
|
|
31
|
-
frame: Scene | null;
|
|
32
|
-
/** Counts the frames: export waits until the diagram drew this one. */
|
|
33
|
-
frameId: number;
|
|
34
|
-
drawnFrame: number;
|
|
35
|
-
/** Seconds a new structure takes to move in; 0 cuts. */
|
|
36
|
-
transition: number;
|
|
37
|
-
/** The structure key the current values want; `scene.key` catches up once the layout is done. */
|
|
38
|
-
wantKey: string;
|
|
39
|
-
/** The values React last drew labels and colours for; a frame is complete once they match `ev.values`. */
|
|
40
|
-
drawnValues: string;
|
|
41
|
-
/** The component a story step points at, and the one the diagram last outlined: export waits for them to match. */
|
|
42
|
-
wantFocus: string | null;
|
|
43
|
-
/** The story step shown, set as soon as one is chosen: a recorder holding an old handle still reads it. */
|
|
44
|
-
storyStep: number | null;
|
|
45
|
-
drawnFocus: string | null;
|
|
46
|
-
paused: boolean;
|
|
47
|
-
colors: Record<string, string>;
|
|
48
|
-
svg: SVGSVGElement | null;
|
|
49
|
-
canvas: HTMLCanvasElement | null;
|
|
50
|
-
constructor(model: Model, view: View$1, ev: Evaluation, o?: SimOptions);
|
|
51
|
-
setEvaluation(ev: Evaluation): void;
|
|
52
|
-
/**
|
|
53
|
-
* Takes a new scene. A new structure moves in from what is drawn now, unless `cut`, the diagram turned (a new
|
|
54
|
-
* direction is a new screen size, not a new design), or it is paused with nothing stepping it; the first scene just
|
|
55
|
-
* shows.
|
|
56
|
-
*/
|
|
57
|
-
setScene(scene: Scene, o?: {
|
|
58
|
-
cut?: boolean;
|
|
59
|
-
}): void;
|
|
60
|
-
/** Calls `f` whenever the frame changes; returns a function that stops it. */
|
|
61
|
-
subscribe: (f: () => void) => (() => void);
|
|
62
|
-
/** Starts the sim over from empty queues, with this seed (default: the original one), and ends a move. */
|
|
63
|
-
reset(seed?: number): void;
|
|
64
|
-
bind(svg: SVGSVGElement | null, canvas: HTMLCanvasElement | null): void;
|
|
65
|
-
/** Reads the theme tokens from the element that carries them. Call again when the theme changes. */
|
|
66
|
-
readColors(root: Element): void;
|
|
67
|
-
flowColor(flow: string): string;
|
|
68
|
-
outcomeColor(outcome: Particle['outcome']): string;
|
|
69
|
-
resize(): void;
|
|
70
|
-
/** Advances the sim, and the move to a new structure, by `dtReal` seconds. */
|
|
71
|
-
step(dtReal: number, o?: {
|
|
72
|
-
particles?: boolean;
|
|
73
|
-
}): void;
|
|
74
|
-
/** Draws the dots on the overlay canvas and the worker fills in the SVG. */
|
|
75
|
-
draw(o?: {
|
|
76
|
-
particles?: boolean;
|
|
77
|
-
}): void;
|
|
78
|
-
drawFills(): void;
|
|
79
|
-
/** Every dot as it is drawn now, in scene units: for the canvas, and for an SVG export. */
|
|
80
|
-
dots(): Dot[];
|
|
81
|
-
/** Paints the dots onto any 2D context, scene units × `scale`: the overlay, or an export frame. */
|
|
82
|
-
paintParticles(ctx: CanvasRenderingContext2D, scale: number): void;
|
|
83
|
-
}
|
|
84
|
-
interface LoadmapOptions<P> extends SimOptions {
|
|
85
|
-
/** Values to start from instead of the model's defaults. */
|
|
86
|
-
initial?: Partial<Values<P>>;
|
|
87
|
-
/** Where ELK lays the diagram out. Default: one worker shared by the page, or the main thread if it cannot start. */
|
|
88
|
-
elk?: ElkEngine$1;
|
|
89
|
-
/** Below this container width the diagram is laid out top to bottom. Default 640. */
|
|
90
|
-
narrowBelow?: number;
|
|
91
|
-
/** Which way the diagram runs where there is room. Default RIGHT; below `narrowBelow` it is always DOWN. */
|
|
92
|
-
direction?: Direction;
|
|
93
|
-
/** What full screen opens with: the panels around the diagram, or mainly the diagram and the story. Default panels. */
|
|
94
|
-
fullScreenMode?: FullScreenMode;
|
|
95
|
-
/**
|
|
96
|
-
* Seconds the diagram takes to move to a new structure (a scenario, a story step or a control that adds pods): what
|
|
97
|
-
* stays moves, what is new fades in. 0 cuts. Default 0.8; with reduced motion it always cuts. The load never moves it.
|
|
98
|
-
*/
|
|
99
|
-
transition?: number;
|
|
100
|
-
}
|
|
101
|
-
/** Full screen with every panel it lists in a compact form, or mainly the diagram and the story. */
|
|
102
|
-
type FullScreenMode = 'panels' | 'focus';
|
|
103
|
-
interface LoadmapController<P = any> {
|
|
104
|
-
model: Model<P>;
|
|
105
|
-
view: View$1;
|
|
106
|
-
values: Values<P>;
|
|
107
|
-
setValues: (v: Partial<Values<P>>) => void;
|
|
108
|
-
/** The scenario the values match, load aside; null for values of the reader's own. */
|
|
109
|
-
scenario: Scenario<P> | null;
|
|
110
|
-
/** Takes a scenario's values; the load stays. */
|
|
111
|
-
setScenario: (label: string) => void;
|
|
112
|
-
/** The story step shown, by index; null outside the story. */
|
|
113
|
-
step: number | null;
|
|
114
|
-
/** The reader changed a value since the step was shown: its outline is gone. */
|
|
115
|
-
stepChanged: boolean;
|
|
116
|
-
/** Shows a story step (its values, its focus), or leaves the story with null. */
|
|
117
|
-
setStep: (i: number | null) => void;
|
|
118
|
-
/** The component the story points at now. */
|
|
119
|
-
focus: string | null;
|
|
120
|
-
/** The story plays: each step for its seconds, then the next, until the last. */
|
|
121
|
-
storyPlaying: boolean;
|
|
122
|
-
/** Plays the story from the step shown (from the first outside the story or at its end), or pauses it. */
|
|
123
|
-
setStoryPlaying: (on: boolean) => void;
|
|
124
|
-
/** The root is full screen: the browser's, or an overlay where the browser has none or refuses. */
|
|
125
|
-
fullScreen: boolean;
|
|
126
|
-
toggleFullScreen: () => void;
|
|
127
|
-
/** What full screen shows. The reader switches it; the page picks where it starts. */
|
|
128
|
-
fullScreenMode: FullScreenMode;
|
|
129
|
-
setFullScreenMode: (m: FullScreenMode) => void;
|
|
130
|
-
ev: Evaluation<P>;
|
|
131
|
-
/** null until the first layout is done. */
|
|
132
|
-
scene: Scene | null;
|
|
133
|
-
labels: ReturnType<typeof labelsAt>;
|
|
134
|
-
direction: Direction;
|
|
135
|
-
reducedMotion: boolean;
|
|
136
|
-
engine: Engine;
|
|
137
|
-
/** Attach to the element that carries the `.lm` class: its width picks the direction, its tokens the colours. */
|
|
138
|
-
rootRef: (el: HTMLElement | null) => void;
|
|
139
|
-
root: HTMLElement | null;
|
|
140
|
-
}
|
|
141
|
-
/** The state behind a loadmap: values, the model's evaluation, the layout and the engine. */
|
|
142
|
-
export declare function useLoadmap<P>(model: Model<P>, view: View$1, o?: LoadmapOptions<P>): LoadmapController<P>;
|
|
143
8
|
/** The architecture: SVG for the structure, a canvas on top for the dots. Expands to full screen. */
|
|
144
9
|
interface DiagramProps {
|
|
145
10
|
lm: LoadmapController;
|
|
@@ -156,66 +21,6 @@ export declare function Diagram({ lm, legend, onNodeClick, selected }: DiagramPr
|
|
|
156
21
|
* outside a component: each engine starts its own worker.
|
|
157
22
|
*/
|
|
158
23
|
export declare function workerElk(make: () => Worker): ElkEngine$1;
|
|
159
|
-
type Theme = 'auto' | 'light' | 'dark';
|
|
160
|
-
/** What a page (or `@loadmap/export`) can drive from outside. */
|
|
161
|
-
interface LoadmapHandle {
|
|
162
|
-
/** Resolves once the current values are laid out and drawn, and the frame of a move to a new structure with them. */
|
|
163
|
-
ready(timeoutMs?: number): Promise<void>;
|
|
164
|
-
pause(): void;
|
|
165
|
-
resume(): void;
|
|
166
|
-
values(): Values<any>;
|
|
167
|
-
setValues(v: Partial<Values<any>>): void;
|
|
168
|
-
/** Empties the queues and dots and starts over with this seed; a move to a new structure ends where it goes. */
|
|
169
|
-
reset(seed?: number): void;
|
|
170
|
-
/** Advances the sim, and a move to a new structure, by `dtReal` seconds and draws the frame: the deterministic way to animate. */
|
|
171
|
-
step(dtReal: number): void;
|
|
172
|
-
/** Shows a story step (its values and the box it points at), or leaves the story with null. */
|
|
173
|
-
setStoryStep(i: number | null): void;
|
|
174
|
-
/** The story step shown; null outside the story. */
|
|
175
|
-
storyStep(): number | null;
|
|
176
|
-
/** The drawn board, for capturing frames: while the structure moves, `scene` is the frame drawn. */
|
|
177
|
-
board(): {
|
|
178
|
-
svg: SVGSVGElement;
|
|
179
|
-
canvas: HTMLCanvasElement;
|
|
180
|
-
scene: Scene;
|
|
181
|
-
} | null;
|
|
182
|
-
engine: Engine;
|
|
183
|
-
}
|
|
184
|
-
/** The root element: theme tokens, styles, and the size the layout direction follows. */
|
|
185
|
-
export declare function LoadmapRoot({ lm, theme, children }: {
|
|
186
|
-
lm: LoadmapController;
|
|
187
|
-
theme?: Theme;
|
|
188
|
-
children: ReactNode;
|
|
189
|
-
}): import("react").JSX.Element;
|
|
190
|
-
/** The panels full screen shows with the diagram, compact: the verdict and the assumptions in a line under it. */
|
|
191
|
-
export declare const LOADMAP_PANELS: readonly ['verdict', 'live', 'limits', 'controls', 'headroom', 'compare', 'assumptions'];
|
|
192
|
-
type LoadmapPanel = (typeof LOADMAP_PANELS)[number];
|
|
193
|
-
interface LoadmapProps<P> extends LoadmapOptions<P> {
|
|
194
|
-
model: Model<P>;
|
|
195
|
-
view: View$1;
|
|
196
|
-
theme?: Theme;
|
|
197
|
-
/** Defaults to the model's title; false hides it. */
|
|
198
|
-
title?: ReactNode | false;
|
|
199
|
-
/** Lines added before the generated assumptions. */
|
|
200
|
-
assumptions?: readonly ReactNode[];
|
|
201
|
-
/** The headroom chart. Default true. */
|
|
202
|
-
headroom?: boolean;
|
|
203
|
-
/** The scenarios side by side, when the model declares two or more. Default true. */
|
|
204
|
-
compare?: boolean;
|
|
205
|
-
/**
|
|
206
|
-
* The panels full screen shows, compact, below the diagram. Default every one the page shows. Focus mode shows the
|
|
207
|
-
* verdict and the load slider of these.
|
|
208
|
-
*/
|
|
209
|
-
fullScreen?: readonly LoadmapPanel[];
|
|
210
|
-
/** A click (or Enter) on a box of the diagram, by its id: every box is a button then. */
|
|
211
|
-
onNodeClick?: (id: string) => void;
|
|
212
|
-
/** The box drawn as selected, by its id. */
|
|
213
|
-
selected?: string | null;
|
|
214
|
-
ref?: Ref<LoadmapHandle>;
|
|
215
|
-
}
|
|
216
|
-
/** The whole page piece: scenarios, diagram, verdict, headroom, live meters, limits, controls and assumptions. */
|
|
217
|
-
export declare function Loadmap<P>({ model, view, theme, title, assumptions, headroom, compare, fullScreen, onNodeClick, selected, ref, ...o }: LoadmapProps<P>): import("react").JSX.Element;
|
|
218
|
-
export declare function handleOf(lm: LoadmapController): LoadmapHandle;
|
|
219
24
|
/** The model's one-sentence answer for the current values, and which capacity to measure when it is unsure. */
|
|
220
25
|
export declare function Verdict({ lm }: {
|
|
221
26
|
lm: LoadmapController;
|
|
@@ -268,13 +73,19 @@ export declare function HeadroomChart({ lm, title }: {
|
|
|
268
73
|
/**
|
|
269
74
|
* The model's story, a step at a time: the step's text, where it is, play, back and next. ← and → move through it
|
|
270
75
|
* while the bar has the keyboard focus (the sliders keep their own arrows). The text keeps the room of the longest
|
|
271
|
-
* step, so stepping through it never moves what is below.
|
|
76
|
+
* step, so stepping through it never moves what is below. While it plays, the bar shows the step played from the
|
|
77
|
+
* moment the camera heads for it, before its values change.
|
|
272
78
|
*/
|
|
273
79
|
export declare function Story({ lm }: {
|
|
274
80
|
lm: LoadmapController;
|
|
275
81
|
}): import("react").JSX.Element | null;
|
|
276
|
-
/**
|
|
277
|
-
export declare const LOADMAP_CSS = "\n.lm { \n --lm-bg: #eef2f5; --lm-surface: #ffffff; --lm-fg: #17212b; --lm-muted: #5d6d7c; --lm-line: #c6d0da;\n --lm-accent: #0b6b8f; --lm-accent-soft: #d6e9f0; --lm-alt: #7a4f9a; --lm-alt-soft: #efe5f6;\n --lm-ok: #2a7f5a; --lm-warn: #b86e00; --lm-drop: #b7392e; --lm-lane: #e3e9ee;\n --lm-s1: #2a78d6; --lm-s2: #eb6834; --lm-s3: #6250d6; --lm-s4: #eda100; color-scheme: light;\n --lm-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --lm-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font: 14px/1.45 var(--lm-font); color: var(--lm-fg); background: var(--lm-bg);\n display: grid; gap: 14px; padding: 16px; min-width: 0; box-sizing: border-box; }\n@media (prefers-color-scheme: dark) { .lm:not([data-theme=\"light\"]) { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; } }\n.lm[data-theme=\"dark\"] { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; }\n.lm *, .lm *::before, .lm *::after { box-sizing: border-box; }\n.lm h2 { font-size: 1.3rem; font-weight: 600; margin: 0; text-wrap: balance; }\n.lm h3 { font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin: 0; }\n.lm button:focus-visible, .lm input:focus-visible, .lm select:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-card { background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; padding: 14px 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }\n\n.lm-wrap { display: grid; gap: 8px; min-width: 0; position: relative; }\n.lm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }\n.lm-btn { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }\n.lm-board { position: relative; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; overflow: hidden; margin: 0 auto; width: 100%; }\n.lm-board svg { display: block; width: 100%; height: auto; font-family: var(--lm-font); }\n.lm-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }\n.lm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--lm-muted); }\n.lm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }\n\n/* full screen (the browser's, or a fixed overlay): a column that never scrolls. The diagram as wide as the screen on\n top; under it the verdict in a line and the panels, compact, in a dock the screen sizes. The load changes what is\n in them, never their size, so it never moves the board. Focus: the diagram, the story, the verdict and the load */\n.lm-side, .lm-card > .lm-panel { display: contents; }\n.lm-panel { display: grid; gap: 14px; min-width: 0; }\n.lm[data-full] { height: 100vh; height: 100dvh; padding: 16px; overflow: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; position: relative; }\n.lm[data-full=\"overlay\"] { position: fixed; inset: 0; z-index: 2147483000; width: auto; max-width: none; max-height: none; margin: 0; border: 0; }\n.lm[data-full] > * { flex: none; }\n/* a page of its own keeps the rest outside full screen, as <Loadmap> does */\n.lm[data-full] > :not(.lm-head, h2, .lm-scenarios, .lm-story, .lm-wrap, .lm-line, .lm-dock, .lm-side) { display: none; }\n.lm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-width: 0; }\n.lm-head h2 { font-size: 1.1rem; }\n.lm[data-full] .lm-wrap { gap: 6px; }\n/* the board as large as fits (--lm-fit, from Diagram), left under the bar, so the legend starts where the board does */\n.lm[data-full] .lm-board { width: var(--lm-fit, 100%); margin: 0; align-self: start; justify-self: start; }\n.lm-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }\n.lm-modes { display: inline-flex; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--lm-line); border-radius: 6px; overflow: hidden; }\n.lm-modes button { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 0; padding: 6px 12px; cursor: pointer; }\n.lm-modes button[aria-pressed=\"true\"] { background: var(--lm-fg); color: var(--lm-surface); }\n.lm[data-full] .lm-story { padding: 6px 12px; }\n.lm[data-full] [data-out] { display: none; }\n\n.lm-line { display: flex; align-items: center; gap: 6px 14px; min-width: 0; padding: 6px 12px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-line[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-line[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-headline { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-num { font: 600 .95em var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-link { font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: none; border: 0; padding: 2px 4px; cursor: pointer; white-space: nowrap; }\n.lm-line .lm-range { flex: 0 1 380px; display: grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 10px; font-size: .84rem; }\n.lm-line output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-line input[type=range] { width: 100%; accent-color: var(--lm-accent); }\n\n.lm-dock { display: flex; gap: 10px; min-width: 0; }\n.lm[data-full] > .lm-dock { flex: 1 1 0; min-height: clamp(200px, 26dvh, 340px); }\n.lm-tabs { display: none; margin: 0; padding: 0; border: 0; min-width: 0; }\n.lm-mini { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; display: grid; container-type: inline-size; }\n.lm-mini[data-mini=\"controls\"] { flex-grow: 1.25; }\n.lm-mini[data-mini=\"limits\"] { flex-grow: 1.45; }\n.lm-mini[data-mini=\"live\"] { flex-grow: .8; }\n.lm-mini[data-mini=\"headroom\"] { flex-grow: .9; }\n.lm-mini[data-mini=\"compare\"] { flex-grow: 1.3; }\n.lm-mini > .lm-card { min-height: 0; overflow: hidden; padding: 10px 12px; gap: 6px; align-content: start; }\n.lm-mini [data-clip] { visibility: hidden; }\n.lm-more { position: absolute; top: 6px; right: 6px; font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: var(--lm-surface); border: 0; border-radius: 4px; padding: 2px 6px; cursor: pointer; }\n.lm-more[data-more]:not([data-more=\"\"])::before { content: attr(data-more) \" \"; }\n.lm-mini .lm-meters { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; }\n.lm-mini .lm-meter { display: flex; align-items: baseline; gap: 8px; padding: 3px 8px; }\n.lm-mini .lm-meter b { flex: none; font-size: .9rem; }\n.lm-mini .lm-meter span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n/* one grid for every row, so the bars line up whatever the names */\n.lm-mini-limits { display: grid; grid-template-columns: minmax(0, max-content) minmax(48px, 1fr) auto auto; gap: 6px 10px; }\n.lm-mini-lim { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; font-size: .8rem; }\n.lm-mini-lim .lm-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-mini-lim .lm-tag { margin-left: 5px; }\n.lm-mini-lim .lm-track { height: 9px; }\n.lm-mini-lim .lm-val { white-space: nowrap; }\n.lm-mini-lim .lm-sub { font: 400 .74rem var(--lm-mono); color: var(--lm-muted); }\n.lm-mini .lm-controls { gap: 6px; column-gap: 16px; }\n.lm-mini .lm-controls small, .lm-mini .lm-controls > h3:not(:first-child) { display: none; }\n.lm-mini .lm-controls label.lm-range { grid-template-columns: minmax(0, 1fr) minmax(90px, 1.2fr); align-items: center; gap: 10px; font-size: .8rem; }\n.lm-mini .lm-select { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .8rem; }\n.lm-mini .lm-select select { width: auto; padding: 1px 6px; font-size: .78rem; }\n.lm-mini .lm-switch { font-size: .8rem; }\n.lm-mini .lm-switch input { margin-top: 2px; }\n.lm-mini .lm-presets { gap: 4px; }\n.lm-mini .lm-presets button { padding: 2px 8px; font-size: .72rem; }\n@container (min-width: 420px) {\n .lm-mini .lm-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n .lm-mini .lm-controls > :is(h3, .lm-presets), .lm-mini .lm-controls > h3 + .lm-range { grid-column: 1 / -1; }\n}\n.lm-mini .lm-compare > :not(h3:first-child, .lm-table-wrap:nth-child(3)) { display: none; }\n.lm-mini .lm-table { font-size: .76rem; }\n.lm-mini .lm-table th, .lm-mini .lm-table td { padding: 3px 8px 3px 0; }\n.lm-mini .lm-table small { display: none; }\n.lm-mini .lm-table thead th { white-space: nowrap; font-size: .6rem; }\n.lm-mini > .lm-card:has(> .lm-spark) { grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; }\n.lm-spark { position: relative; min-height: 0; }\n.lm-spark svg { position: absolute; inset: 0; display: block; overflow: visible; }\n.lm-spark-th { stroke: var(--lm-muted); stroke-dasharray: 4 3; }\n.lm-spark-load { stroke: var(--lm-fg); opacity: .45; }\n.lm-spark-text { margin: 0; font-size: .76rem; color: var(--lm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n\n/* the drawer: the page's own panel, alone, over the right of the board */\n.lm[data-full] > .lm-drawer:not([data-drawer]) { display: none; }\n.lm[data-full] > .lm-drawer[data-drawer] { display: grid; gap: 14px; align-content: start; position: absolute; top: 16px; right: 16px; bottom: 16px; z-index: 4; width: min(640px, calc(100% - 32px)); overflow: auto; overscroll-behavior: contain; padding: 14px; background: var(--lm-bg); border: 1px solid var(--lm-line); border-radius: 10px; box-shadow: -8px 0 30px rgb(0 0 0 / .2); container-type: inline-size; }\n.lm-side[data-drawer] :is(.lm-panel, .lm-strip, .lm-charts, .lm-card):not([data-drawn]):not(.lm-panel *) { display: none; }\n.lm-side[data-drawer] .lm-strip { grid-template-columns: minmax(0, 1fr); }\n.lm-drawer-bar { display: flex; justify-content: flex-end; }\n\n/* a page of its own: its .lm-side is a box under the board that scrolls on its own, the board as large as leaves it a\n third of the screen */\n.lm[data-full] > .lm-side:not(.lm-drawer) { display: grid; gap: 14px; align-content: start; flex: 1 1 0; min-height: 33dvh; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }\n\n/* focus: the board and what runs on it in the middle of the screen */\n.lm[data-mode=\"focus\"] .lm-scenarios, .lm[data-mode=\"focus\"] > .lm-side:not(.lm-drawer) { display: none; }\n.lm[data-mode=\"focus\"] > .lm-wrap { margin-top: auto; }\n.lm[data-mode=\"focus\"] > :is(.lm-story, .lm-line) { order: 1; }\n.lm[data-mode=\"focus\"]::after { content: \"\"; order: 2; margin-top: auto; }\n.lm[data-mode=\"focus\"] > .lm-story { border-left-width: 4px; padding: 10px 14px; }\n.lm[data-mode=\"focus\"] > .lm-story p { font-size: 1.1rem; }\n\n@media (max-width: 760px) {\n .lm[data-full] { padding: 10px; gap: 8px; }\n /* the page has the title, and the legend: here they would leave the diagram no room */\n .lm[data-full] > h2, .lm[data-full] :is(.lm-head h2, .lm-legend, .lm-story legend) { display: none; }\n /* the one exception: here the diagram runs top to bottom, and shrunk to the screen it is too small to read, so it\n pans in a box of its own with the bar on top. The page never scrolls */\n .lm[data-full] .lm-board { width: 100%; }\n .lm[data-full] > .lm-wrap { height: 40dvh; overflow: auto; row-gap: 0; overscroll-behavior: contain; }\n .lm[data-mode=\"focus\"] > .lm-wrap { height: auto; flex: 1 1 0; min-height: 0; margin-top: 0; }\n .lm[data-full] .lm-bar { position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: var(--lm-bg); }\n .lm[data-full] .lm-line { flex-wrap: wrap; }\n .lm[data-full] > .lm-story { padding: 6px 10px; gap: 6px 10px; }\n .lm[data-full] > .lm-story p { font-size: .84rem; }\n .lm[data-full] .lm-story button { padding: 4px 10px; }\n .lm[data-full] .lm-headline { flex-basis: 100%; }\n .lm-dock { flex-direction: column; min-height: 0; gap: 6px; }\n .lm-tabs { display: flex; flex: none; gap: 2px; border-bottom: 1px solid var(--lm-line); overflow: hidden; }\n .lm-tabs button { font: 500 .78rem var(--lm-font); color: var(--lm-muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 8px; cursor: pointer; white-space: nowrap; }\n .lm-tabs button[aria-pressed=\"true\"] { color: var(--lm-fg); border-color: var(--lm-fg); }\n .lm-mini:not([data-active]) { display: none; }\n .lm[data-full] > .lm-side[data-drawer] { inset: 8px; width: auto; }\n}\n\n.lm-verdict { margin: 0; padding: 10px 14px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-verdict[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-verdict[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-measure { margin: 6px 0 0; padding: 0 14px; font-size: .86rem; color: var(--lm-muted); }\n\n.lm-strip { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 14px; align-items: start; }\n@container (max-width: 860px) { .lm-strip { grid-template-columns: minmax(0, 1fr); } }\n.lm { container-type: inline-size; }\n\n.lm-meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }\n.lm-meter { padding: 8px 10px; border-radius: 6px; background: var(--lm-bg); min-width: 0; }\n.lm-meter b { display: block; font: 500 1.15rem var(--lm-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-meter span { font-size: .74rem; color: var(--lm-muted); }\n.lm-meter[data-state=\"warn\"] b { color: var(--lm-warn); } .lm-meter[data-state=\"over\"] b { color: var(--lm-drop); }\n\n.lm-limits { display: grid; gap: 10px; }\n.lm-lim, .lm-scale { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 10rem; gap: 4px 14px; align-items: center; }\n@container (max-width: 640px) { .lm-lim, .lm-scale { grid-template-columns: minmax(0, 1fr); } .lm-scale > :first-child, .lm-scale > :last-child { display: none; } }\n.lm-lim b { display: block; font-weight: 600; font-size: .88rem; }\n.lm-lim .lm-sub { display: block; font-size: .74rem; color: var(--lm-muted); }\n.lm-tag { font: 600 .64rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }\n.lm-tag[data-kind=\"first\"] { color: var(--lm-surface); background: var(--lm-drop); }\n.lm-tag[data-kind=\"estimated\"] { color: var(--lm-warn); border: 1px solid currentColor; }\n.lm-tag[data-kind=\"range\"] { color: var(--lm-muted); border: 1px solid currentColor; }\n.lm-track { position: relative; height: 16px; background: var(--lm-bg); border-radius: 3px; overflow: hidden; }\n.lm-fill { position: absolute; inset: 0 auto 0 0; background: var(--lm-ok); transition: width .25s ease; }\n.lm-fill[data-state=\"warn\"] { background: var(--lm-warn); } .lm-fill[data-state=\"over\"] { background: var(--lm-drop); }\n.lm-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lm-fg); opacity: .55; }\n.lm-val { font: 500 .8rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-val small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-scale { font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-scale div { position: relative; height: 12px; }\n.lm-scale div span { position: absolute; transform: translateX(-50%); white-space: nowrap; }\n\n.lm-controls label.lm-range { display: grid; gap: 4px; font-size: .84rem; }\n.lm-controls label.lm-range > span { display: flex; justify-content: space-between; gap: 8px; }\n.lm-controls output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-controls input[type=range] { width: 100%; accent-color: var(--lm-accent); }\n.lm-presets { display: flex; flex-wrap: wrap; gap: 6px; }\n.lm-presets button { font: 500 .76rem var(--lm-font); background: var(--lm-accent-soft); color: var(--lm-fg); border: 1px solid transparent; border-radius: 5px; padding: 5px 10px; cursor: pointer; }\n.lm-presets button[aria-pressed=\"true\"] { border-color: var(--lm-accent); }\n.lm-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: start; font-size: .84rem; cursor: pointer; }\n.lm-switch input { margin: 3px 0 0; accent-color: var(--lm-accent); }\n.lm-switch small, .lm-select small { grid-column: 2; color: var(--lm-muted); font-size: .74rem; line-height: 1.3; }\n.lm-select { display: grid; gap: 4px; font-size: .84rem; }\n.lm-select select { width: 100%; min-width: 0; font: 400 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 5px; padding: 5px 8px; }\n.lm-off { opacity: .45; cursor: default; }\n\n.lm-facts { margin: 0; padding-left: 1.1em; font-size: .88rem; columns: 2; column-gap: 28px; }\n@container (max-width: 860px) { .lm-facts { columns: 1; } }\n.lm-facts li { margin-bottom: 8px; break-inside: avoid; }\n.lm-prov { font: 600 .66rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; }\n.lm-prov[data-kind=\"measured\"] { color: var(--lm-ok); } .lm-prov[data-kind=\"estimated\"] { color: var(--lm-warn); }\n.lm-prov[data-kind=\"configured\"] { color: var(--lm-accent); }\n\n/* scenario identity colours (s1–s4) are checked for colour-blind separation on both surfaces; text never wears them */\n.lm-scenarios { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }\n.lm-scenarios legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin-right: 6px; padding: 0; }\n.lm-scenarios button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-scenarios button[aria-pressed=\"true\"] { border-color: var(--lm-fg); box-shadow: inset 0 0 0 1px var(--lm-fg); }\n.lm-scenarios i, .lm-table i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }\n.lm-story { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; min-width: 0; padding: 8px 12px; border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-accent); border-radius: 6px; background: var(--lm-surface); }\n.lm-story legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); padding: 0; }\n.lm-story p { flex: 1 1 240px; display: grid; margin: 0; font: 400 .9rem/1.4 var(--lm-font); color: var(--lm-fg); }\n.lm-story p > span { grid-area: 1 / 1; }\n.lm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.lm-story p > span:not([data-shown]), .lm-story em:not([data-shown]) { visibility: hidden; }\n.lm-story-progress { display: flex; align-items: center; gap: 4px; }\n.lm-story-progress i { position: relative; width: 28px; height: 4px; border-radius: 2px; background: var(--lm-line); overflow: hidden; }\n.lm-story-progress i[data-state=\"done\"], .lm-story:not([data-playing]) .lm-story-progress i[data-state=\"now\"] { background: var(--lm-accent); }\n.lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { content: \"\"; position: absolute; inset: 0; background: var(--lm-accent); transform-origin: left; animation: lm-step var(--lm-step) linear both; }\n@keyframes lm-step { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n.lm-story b { font-weight: 600; color: var(--lm-muted); margin-right: 4px; white-space: nowrap; }\n.lm-story-nav { display: flex; gap: 6px; }\n.lm-story em { color: var(--lm-muted); }\n.lm-story button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-story button[aria-disabled=\"true\"] { opacity: .45; cursor: default; }\n.lm-own { font-size: .78rem; color: var(--lm-muted); }\n.lm-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; margin-right: 6px; }\n\n.lm-compare-text { margin: 0; }\n.lm-table-wrap { overflow-x: auto; }\n.lm-table { border-collapse: collapse; width: 100%; font-size: .84rem; }\n.lm-table th, .lm-table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--lm-line); vertical-align: top; }\n.lm-table thead th { font: 600 .7rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; color: var(--lm-muted); }\n.lm-table tbody th { font-weight: 600; white-space: nowrap; }\n.lm-table td { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-table td.lm-text { font-family: var(--lm-font); }\n.lm-table td small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-table tr[aria-current] th { text-decoration: underline; text-underline-offset: 3px; }\n\n.lm-chart { position: relative; min-width: 0; }\n.lm-chart svg { display: block; overflow: visible; }\n.lm-chart:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-axis, .lm-axis text { font: 400 11px var(--lm-mono); fill: var(--lm-muted); }\n.lm-mark { font: 600 11px var(--lm-mono); fill: var(--lm-fg); }\n.lm-tip { position: absolute; z-index: 2; display: grid; gap: 2px; width: max-content; max-width: 17rem; padding: 8px 10px; font-size: .78rem; background: var(--lm-surface); color: var(--lm-fg); border: 1px solid var(--lm-line); border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / .14); pointer-events: none; }\n.lm-tip strong { font: 600 .82rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-tip .lm-sub { color: var(--lm-muted); }\n.lm-nowrap { white-space: nowrap; }\n.lm-node { cursor: pointer; outline: none; }\n.lm-node:focus-visible > :first-child { stroke-width: 3; }\n\n@media (prefers-reduced-motion: reduce) {\n .lm-fill { transition: none; }\n .lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { animation: none; transform: none; }\n}\n";
|
|
82
|
+
/**
|
|
83
|
+
* Theme tokens and the layout of every piece. Scoped to `.lm`; override any `--lm-*` token to restyle. Two are for the
|
|
84
|
+
* page around it: `--lm-pad` (the root's padding, 16px) and `--lm-root-bg` (its background, `--lm-bg`), for a card
|
|
85
|
+
* that has its own, set on the root (`.card > .lm`) so they resolve there and reach no nested board; full screen
|
|
86
|
+
* keeps both.
|
|
87
|
+
*/
|
|
88
|
+
export declare const LOADMAP_CSS = "\n.lm { \n --lm-bg: #eef2f5; --lm-surface: #ffffff; --lm-fg: #17212b; --lm-muted: #5d6d7c; --lm-line: #c6d0da;\n --lm-accent: #0b6b8f; --lm-accent-soft: #d6e9f0; --lm-alt: #7a4f9a; --lm-alt-soft: #efe5f6;\n --lm-ok: #2a7f5a; --lm-warn: #b86e00; --lm-drop: #b7392e; --lm-lane: #e3e9ee;\n --lm-s1: #2a78d6; --lm-s2: #eb6834; --lm-s3: #6250d6; --lm-s4: #eda100; color-scheme: light;\n --lm-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n --lm-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font: 14px/1.45 var(--lm-font); color: var(--lm-fg); background: var(--lm-root-bg, var(--lm-bg));\n display: grid; gap: 14px; padding: var(--lm-pad, 16px); min-width: 0; box-sizing: border-box; }\n@media (prefers-color-scheme: dark) { .lm:not([data-theme=\"light\"]) { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; } }\n.lm[data-theme=\"dark\"] { \n --lm-bg: #0d141b; --lm-surface: #151e27; --lm-fg: #e4ebf1; --lm-muted: #93a3b3; --lm-line: #2a3744;\n --lm-accent: #5fb7d6; --lm-accent-soft: #163442; --lm-alt: #c39be0; --lm-alt-soft: #2b2236;\n --lm-ok: #5fc08f; --lm-warn: #e2a24a; --lm-drop: #e26a5c; --lm-lane: #1b2631;\n --lm-s1: #3987e5; --lm-s2: #d95926; --lm-s3: #9085e9; --lm-s4: #c98500; color-scheme: dark; }\n.lm *, .lm *::before, .lm *::after { box-sizing: border-box; }\n.lm h2 { font-size: 1.3rem; font-weight: 600; margin: 0; text-wrap: balance; }\n.lm h3 { font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin: 0; }\n.lm button:focus-visible, .lm input:focus-visible, .lm select:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-problems { margin: 0; padding: 10px 12px; font: .8rem/1.5 var(--lm-mono); white-space: pre-wrap; overflow-x: auto; color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-drop); border-radius: 6px; }\n.lm-note { margin: 0; font-size: .8rem; color: var(--lm-muted); }\n.lm-card { background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; padding: 14px 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }\n\n.lm-wrap { display: grid; gap: 8px; min-width: 0; position: relative; }\n.lm-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }\n.lm-btn { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }\n.lm-board { position: relative; background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 8px; overflow: hidden; margin: 0 auto; width: 100%; }\n.lm-board svg { display: block; width: 100%; height: auto; font-family: var(--lm-font); }\n.lm-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }\n/* the story's title over the board while it plays: a lower third, at the top when what is framed is low; a strip\n across the top of a narrow board */\n.lm-title { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: grid; gap: 1px; max-width: min(34rem, calc(100% - 24px)); padding: 7px 12px 8px; border-left: 4px solid var(--lm-accent); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--lm-surface) 92%, transparent); box-shadow: 0 4px 16px rgb(0 0 0 / .12); pointer-events: none; overflow-wrap: anywhere; }\n.lm-title[data-top] { top: 12px; bottom: auto; }\n.lm-title b { font-size: .95rem; font-weight: 600; }\n.lm-title span { font: 500 .8rem var(--lm-mono); color: var(--lm-muted); }\n@container (max-width: 520px) {\n .lm-title, .lm-title[data-top] { top: 0; right: 0; bottom: auto; left: 0; max-width: none; padding: 4px 8px; border-radius: 0; box-shadow: none; }\n .lm-title b { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .lm-title span { display: none; }\n}\n.lm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--lm-muted); }\n.lm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }\n\n/* full screen (the browser's, or a fixed overlay): a column that never scrolls. The diagram as wide as the screen on\n top; under it the verdict in a line and the panels, compact, in a dock the screen sizes. The load changes what is\n in them, never their size, so it never moves the board. Focus: the diagram, the story, the verdict and the load */\n.lm-side, .lm-card > .lm-panel { display: contents; }\n.lm-panel { display: grid; gap: 14px; min-width: 0; }\n.lm[data-full] { height: 100vh; height: 100dvh; padding: 16px; background: var(--lm-bg); overflow: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; position: relative; }\n.lm[data-full=\"overlay\"] { position: fixed; inset: 0; z-index: 2147483000; width: auto; max-width: none; max-height: none; margin: 0; border: 0; }\n.lm[data-full] > * { flex: none; }\n/* a page of its own keeps the rest outside full screen, as <Loadmap> does */\n.lm[data-full] > :not(.lm-head, h2, .lm-scenarios, .lm-story, .lm-wrap, .lm-line, .lm-dock, .lm-side) { display: none; }\n.lm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-width: 0; }\n.lm-head h2 { font-size: 1.1rem; }\n.lm[data-full] .lm-wrap { gap: 6px; }\n/* the board as large as fits (--lm-fit, from Diagram), left under the bar, so the legend starts where the board does */\n.lm[data-full] .lm-board { width: var(--lm-fit, 100%); margin: 0; align-self: start; justify-self: start; }\n.lm-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }\n.lm-modes { display: inline-flex; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--lm-line); border-radius: 6px; overflow: hidden; }\n.lm-modes button { font: 500 .8rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 0; padding: 6px 12px; cursor: pointer; }\n.lm-modes button[aria-pressed=\"true\"] { background: var(--lm-fg); color: var(--lm-surface); }\n.lm[data-full] .lm-story { padding: 6px 12px; }\n.lm[data-full] [data-out] { display: none; }\n\n.lm-line { display: flex; align-items: center; gap: 6px 14px; min-width: 0; padding: 6px 12px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-line[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-line[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-headline { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-num { font: 600 .95em var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-link { font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: none; border: 0; padding: 2px 4px; cursor: pointer; white-space: nowrap; }\n.lm-line .lm-range { flex: 0 1 380px; display: grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 10px; font-size: .84rem; }\n.lm-line output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-line input[type=range] { width: 100%; accent-color: var(--lm-accent); }\n\n.lm-dock { display: flex; gap: 10px; min-width: 0; }\n.lm[data-full] > .lm-dock { flex: 1 1 0; min-height: clamp(200px, 26dvh, 340px); }\n.lm-tabs { display: none; margin: 0; padding: 0; border: 0; min-width: 0; }\n.lm-mini { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; display: grid; container-type: inline-size; }\n.lm-mini[data-mini=\"controls\"] { flex-grow: 1.25; }\n.lm-mini[data-mini=\"limits\"] { flex-grow: 1.45; }\n.lm-mini[data-mini=\"live\"] { flex-grow: .8; }\n.lm-mini[data-mini=\"headroom\"] { flex-grow: .9; }\n.lm-mini[data-mini=\"compare\"] { flex-grow: 1.3; }\n.lm-mini > .lm-card { min-height: 0; overflow: hidden; padding: 10px 12px; gap: 6px; align-content: start; }\n.lm-mini [data-clip] { visibility: hidden; }\n.lm-more { position: absolute; top: 6px; right: 6px; font: 500 .8rem var(--lm-font); color: var(--lm-accent); background: var(--lm-surface); border: 0; border-radius: 4px; padding: 2px 6px; cursor: pointer; }\n.lm-more[data-more]:not([data-more=\"\"])::before { content: attr(data-more) \" \"; }\n.lm-mini .lm-meters { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; }\n.lm-mini .lm-meter { display: flex; align-items: baseline; gap: 8px; padding: 3px 8px; }\n.lm-mini .lm-meter b { flex: none; font-size: .9rem; }\n.lm-mini .lm-meter span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n/* one grid for every row, so the bars line up whatever the names */\n.lm-mini-limits { display: grid; grid-template-columns: minmax(0, max-content) minmax(48px, 1fr) auto auto; gap: 6px 10px; }\n.lm-mini-lim { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; font-size: .8rem; }\n.lm-mini-lim .lm-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-mini-lim .lm-tag { margin-left: 5px; }\n.lm-mini-lim .lm-track { height: 9px; }\n.lm-mini-lim .lm-val { white-space: nowrap; }\n.lm-mini-lim .lm-sub { font: 400 .74rem var(--lm-mono); color: var(--lm-muted); }\n.lm-mini .lm-controls { gap: 6px; column-gap: 16px; }\n.lm-mini .lm-controls small, .lm-mini .lm-controls > h3:not(:first-child) { display: none; }\n.lm-mini .lm-controls label.lm-range { grid-template-columns: minmax(0, 1fr) minmax(90px, 1.2fr); align-items: center; gap: 10px; font-size: .8rem; }\n.lm-mini .lm-select { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .8rem; }\n.lm-mini .lm-select select { width: auto; padding: 1px 6px; font-size: .78rem; }\n.lm-mini .lm-switch { font-size: .8rem; }\n.lm-mini .lm-switch input { margin-top: 2px; }\n.lm-mini .lm-presets { gap: 4px; }\n.lm-mini .lm-presets button { padding: 2px 8px; font-size: .72rem; }\n@container (min-width: 420px) {\n .lm-mini .lm-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n .lm-mini .lm-controls > :is(h3, .lm-presets), .lm-mini .lm-controls > h3 + .lm-range { grid-column: 1 / -1; }\n}\n.lm-mini .lm-compare > :not(h3:first-child, .lm-table-wrap:nth-child(3)) { display: none; }\n.lm-mini .lm-table { font-size: .76rem; }\n.lm-mini .lm-table th, .lm-mini .lm-table td { padding: 3px 8px 3px 0; }\n.lm-mini .lm-table small { display: none; }\n.lm-mini .lm-table thead th { white-space: nowrap; font-size: .6rem; }\n.lm-mini > .lm-card:has(> .lm-spark) { grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; }\n.lm-spark { position: relative; min-height: 0; }\n.lm-spark svg { position: absolute; inset: 0; display: block; overflow: hidden; }\n.lm-spark-th { stroke: var(--lm-muted); stroke-dasharray: 4 3; }\n.lm-spark-load { stroke: var(--lm-fg); opacity: .45; }\n.lm-spark-text { margin: 0; font-size: .76rem; color: var(--lm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n\n/* the drawer: the page's own panel, alone, over the right of the board */\n.lm[data-full] > .lm-drawer:not([data-drawer]) { display: none; }\n.lm[data-full] > .lm-drawer[data-drawer] { display: grid; gap: 14px; align-content: start; position: absolute; top: 16px; right: 16px; bottom: 16px; z-index: 4; width: min(640px, calc(100% - 32px)); overflow: auto; overscroll-behavior: contain; padding: 14px; background: var(--lm-bg); border: 1px solid var(--lm-line); border-radius: 10px; box-shadow: -8px 0 30px rgb(0 0 0 / .2); container-type: inline-size; }\n.lm-side[data-drawer] :is(.lm-panel, .lm-strip, .lm-charts, .lm-card):not([data-drawn]):not(.lm-panel *) { display: none; }\n.lm-side[data-drawer] .lm-strip { grid-template-columns: minmax(0, 1fr); }\n.lm-drawer-bar { display: flex; justify-content: flex-end; }\n\n/* a page of its own: its .lm-side is a box under the board that scrolls on its own, the board as large as leaves it a\n third of the screen */\n.lm[data-full] > .lm-side:not(.lm-drawer) { display: grid; gap: 14px; align-content: start; flex: 1 1 0; min-height: 33dvh; overflow: auto; overscroll-behavior: contain; container-type: inline-size; }\n\n/* focus: the board and what runs on it in the middle of the screen */\n.lm[data-mode=\"focus\"] .lm-scenarios, .lm[data-mode=\"focus\"] > .lm-side:not(.lm-drawer) { display: none; }\n.lm[data-mode=\"focus\"] > .lm-wrap { margin-top: auto; }\n.lm[data-mode=\"focus\"] > :is(.lm-story, .lm-line) { order: 1; }\n.lm[data-mode=\"focus\"]::after { content: \"\"; order: 2; margin-top: auto; }\n.lm[data-mode=\"focus\"] > .lm-story { border-left-width: 4px; padding: 10px 14px; }\n.lm[data-mode=\"focus\"] > .lm-story p { font-size: 1.1rem; }\n\n@media (max-width: 760px) {\n .lm[data-full] { padding: 10px; gap: 8px; }\n /* the page has the title, and the legend: here they would leave the diagram no room */\n .lm[data-full] > h2, .lm[data-full] :is(.lm-head h2, .lm-legend, .lm-story legend) { display: none; }\n /* the one exception: here the diagram runs top to bottom, and shrunk to the screen it is too small to read, so it\n pans in a box of its own with the bar on top. The page never scrolls */\n .lm[data-full] .lm-board { width: 100%; }\n .lm[data-full] > .lm-wrap { height: 40dvh; overflow: auto; row-gap: 0; overscroll-behavior: contain; }\n .lm[data-mode=\"focus\"] > .lm-wrap { height: auto; flex: 1 1 0; min-height: 0; margin-top: 0; }\n .lm[data-full] .lm-bar { position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: var(--lm-bg); }\n .lm[data-full] .lm-line { flex-wrap: wrap; }\n .lm[data-full] > .lm-story { padding: 6px 10px; gap: 6px 10px; }\n .lm[data-full] > .lm-story p { font-size: .84rem; }\n .lm[data-full] .lm-story button { padding: 4px 10px; }\n .lm[data-full] .lm-headline { flex-basis: 100%; }\n .lm-dock { flex-direction: column; min-height: 0; gap: 6px; }\n .lm-tabs { display: flex; flex: none; gap: 2px; border-bottom: 1px solid var(--lm-line); overflow: hidden; }\n .lm-tabs button { font: 500 .78rem var(--lm-font); color: var(--lm-muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 8px; cursor: pointer; white-space: nowrap; }\n .lm-tabs button[aria-pressed=\"true\"] { color: var(--lm-fg); border-color: var(--lm-fg); }\n .lm-mini:not([data-active]) { display: none; }\n .lm[data-full] > .lm-side[data-drawer] { inset: 8px; width: auto; }\n}\n\n.lm-verdict { margin: 0; padding: 10px 14px; border-left: 4px solid var(--lm-ok); background: var(--lm-accent-soft); border-radius: 0 6px 6px 0; }\n.lm-verdict[data-tier=\"warn\"] { border-color: var(--lm-warn); }\n.lm-verdict[data-tier=\"over\"] { border-color: var(--lm-drop); }\n.lm-measure { margin: 6px 0 0; padding: 0 14px; font-size: .86rem; color: var(--lm-muted); }\n\n.lm-strip { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 14px; align-items: start; }\n@container (max-width: 860px) { .lm-strip { grid-template-columns: minmax(0, 1fr); } }\n.lm { container-type: inline-size; }\n\n.lm-meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }\n.lm-meter { padding: 8px 10px; border-radius: 6px; background: var(--lm-bg); min-width: 0; }\n.lm-meter b { display: block; font: 500 1.15rem var(--lm-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.lm-meter span { font-size: .74rem; color: var(--lm-muted); }\n.lm-meter[data-state=\"warn\"] b { color: var(--lm-warn); } .lm-meter[data-state=\"over\"] b { color: var(--lm-drop); }\n\n.lm-limits { display: grid; gap: 10px; }\n.lm-lim, .lm-scale { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 10rem; gap: 4px 14px; align-items: center; }\n@container (max-width: 640px) { .lm-lim, .lm-scale { grid-template-columns: minmax(0, 1fr); } .lm-scale > :first-child, .lm-scale > :last-child { display: none; } }\n.lm-lim b { display: block; font-weight: 600; font-size: .88rem; }\n.lm-lim .lm-sub { display: block; font-size: .74rem; color: var(--lm-muted); }\n.lm-tag { font: 600 .64rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }\n.lm-tag[data-kind=\"first\"] { color: var(--lm-surface); background: var(--lm-drop); }\n.lm-tag[data-kind=\"estimated\"] { color: var(--lm-warn); border: 1px solid currentColor; }\n.lm-tag[data-kind=\"range\"] { color: var(--lm-muted); border: 1px solid currentColor; }\n.lm-track { position: relative; height: 16px; background: var(--lm-bg); border-radius: 3px; overflow: hidden; }\n.lm-fill { position: absolute; inset: 0 auto 0 0; background: var(--lm-ok); transition: width .25s ease; }\n.lm-fill[data-state=\"warn\"] { background: var(--lm-warn); } .lm-fill[data-state=\"over\"] { background: var(--lm-drop); }\n.lm-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lm-fg); opacity: .55; }\n.lm-val { font: 500 .8rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-val small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-scale { font: 400 .7rem var(--lm-mono); color: var(--lm-muted); }\n.lm-scale div { position: relative; height: 12px; }\n.lm-scale div span { position: absolute; transform: translateX(-50%); white-space: nowrap; }\n\n.lm-controls label.lm-range { display: grid; gap: 4px; font-size: .84rem; }\n.lm-controls label.lm-range > span { display: flex; justify-content: space-between; gap: 8px; }\n.lm-controls output { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-controls input[type=range] { width: 100%; accent-color: var(--lm-accent); }\n.lm-presets { display: flex; flex-wrap: wrap; gap: 6px; }\n.lm-presets button { font: 500 .76rem var(--lm-font); background: var(--lm-accent-soft); color: var(--lm-fg); border: 1px solid transparent; border-radius: 5px; padding: 5px 10px; cursor: pointer; }\n.lm-presets button[aria-pressed=\"true\"] { border-color: var(--lm-accent); }\n.lm-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: start; font-size: .84rem; cursor: pointer; }\n.lm-switch input { margin: 3px 0 0; accent-color: var(--lm-accent); }\n.lm-switch small, .lm-select small { grid-column: 2; color: var(--lm-muted); font-size: .74rem; line-height: 1.3; }\n.lm-select { display: grid; gap: 4px; font-size: .84rem; }\n.lm-select select { width: 100%; min-width: 0; font: 400 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 5px; padding: 5px 8px; }\n.lm-off { opacity: .45; cursor: default; }\n\n.lm-facts { margin: 0; padding-left: 1.1em; font-size: .88rem; columns: 2; column-gap: 28px; }\n@container (max-width: 860px) { .lm-facts { columns: 1; } }\n.lm-facts li { margin-bottom: 8px; break-inside: avoid; }\n.lm-prov { font: 600 .66rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; }\n.lm-prov[data-kind=\"measured\"] { color: var(--lm-ok); } .lm-prov[data-kind=\"estimated\"] { color: var(--lm-warn); }\n.lm-prov[data-kind=\"configured\"] { color: var(--lm-accent); }\n\n/* scenario identity colours (s1–s4) are checked for colour-blind separation on both surfaces; text never wears them */\n.lm-scenarios { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }\n.lm-scenarios legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); margin-right: 6px; padding: 0; }\n.lm-scenarios button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-scenarios button[aria-pressed=\"true\"] { border-color: var(--lm-fg); box-shadow: inset 0 0 0 1px var(--lm-fg); }\n.lm-scenarios i, .lm-table i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }\n.lm-story { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; min-width: 0; padding: 8px 12px; border: 1px solid var(--lm-line); border-left: 3px solid var(--lm-accent); border-radius: 6px; background: var(--lm-surface); }\n.lm-story legend { float: left; font: 600 .74rem var(--lm-font); text-transform: uppercase; letter-spacing: .08em; color: var(--lm-muted); padding: 0; }\n.lm-story p { flex: 1 1 240px; display: grid; margin: 0; font: 400 .9rem/1.4 var(--lm-font); color: var(--lm-fg); }\n.lm-story p > span { grid-area: 1 / 1; }\n.lm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.lm-story p > span:not([data-shown]), .lm-story em:not([data-shown]) { visibility: hidden; }\n.lm-story-progress { display: flex; align-items: center; gap: 4px; }\n.lm-story-progress i { position: relative; width: 28px; height: 4px; border-radius: 2px; background: var(--lm-line); overflow: hidden; }\n.lm-story-progress i[data-state=\"done\"], .lm-story:not([data-playing]) .lm-story-progress i[data-state=\"now\"] { background: var(--lm-accent); }\n.lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { content: \"\"; position: absolute; inset: 0; background: var(--lm-accent); transform-origin: left; animation: lm-step var(--lm-step) linear both; }\n@keyframes lm-step { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n.lm-story b { font-weight: 600; color: var(--lm-muted); margin-right: 4px; white-space: nowrap; }\n.lm-story-nav { display: flex; gap: 6px; }\n.lm-story em { color: var(--lm-muted); }\n.lm-story button { font: 500 .84rem var(--lm-font); color: var(--lm-fg); background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }\n.lm-story button[aria-disabled=\"true\"] { opacity: .45; cursor: default; }\n.lm-own { font-size: .78rem; color: var(--lm-muted); }\n.lm-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; margin-right: 6px; }\n\n.lm-compare-text { margin: 0; }\n.lm-table-wrap { overflow-x: auto; }\n.lm-table { border-collapse: collapse; width: 100%; font-size: .84rem; }\n.lm-table th, .lm-table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--lm-line); vertical-align: top; }\n.lm-table thead th { font: 600 .7rem var(--lm-font); text-transform: uppercase; letter-spacing: .06em; color: var(--lm-muted); }\n.lm-table tbody th { font-weight: 600; white-space: nowrap; }\n.lm-table td { font-family: var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-table td.lm-text { font-family: var(--lm-font); }\n.lm-table td small { display: block; font: 400 .72rem var(--lm-font); color: var(--lm-muted); }\n.lm-table tr[aria-current] th { text-decoration: underline; text-underline-offset: 3px; }\n\n.lm-chart { position: relative; min-width: 0; }\n.lm-chart svg { display: block; overflow: visible; }\n.lm-chart:focus-visible { outline: 2px solid var(--lm-accent); outline-offset: 2px; }\n.lm-axis, .lm-axis text { font: 400 11px var(--lm-mono); fill: var(--lm-muted); }\n.lm-mark { font: 600 11px var(--lm-mono); fill: var(--lm-fg); }\n.lm-tip { position: absolute; z-index: 2; display: grid; gap: 2px; width: max-content; max-width: min(17rem, calc(100% - 8px)); overflow-wrap: anywhere; padding: 8px 10px; font-size: .78rem; background: var(--lm-surface); color: var(--lm-fg); border: 1px solid var(--lm-line); border-radius: 6px; box-shadow: 0 4px 14px rgb(0 0 0 / .14); pointer-events: none; }\n.lm-tip strong { font: 600 .82rem var(--lm-mono); font-variant-numeric: tabular-nums; }\n.lm-tip .lm-sub { color: var(--lm-muted); }\n.lm-nowrap { white-space: nowrap; }\n.lm-node { cursor: pointer; outline: none; }\n.lm-node:focus-visible > :first-child { stroke-width: 3; }\n\n@media (prefers-reduced-motion: reduce) {\n .lm-fill { transition: none; }\n .lm-story[data-playing] .lm-story-progress i[data-state=\"now\"]::before { animation: none; transform: none; }\n}\n";
|
|
278
89
|
/** Adds the stylesheet once per document. */
|
|
279
90
|
export declare function injectStyles(doc?: Document): void;
|
|
280
|
-
export { type AnyNodeDef, type ClusterDef, type DiagramProps, type Dot, type EdgeDef, type ElkEngine, type Engine, type FlowColor, type FlowView, type FullScreenMode, type Label, type LoadmapController, type LoadmapHandle, type LoadmapOptions, type LoadmapPanel, type LoadmapProps, type NodeDef, type PoolDef, type Theme, type View, type ViewDef, cluster, compact, defineView, edge, fitLinear, fmt, multiple, node, pct, pool, secs };
|
|
91
|
+
export { type AnyNodeDef, type ClusterDef, type Cue, type DiagramProps, type Dot, type EdgeDef, type ElkEngine, type Engine, type FlowColor, type FlowView, type FullScreenMode, LOADMAP_PANELS, type Label, Loadmap, type LoadmapController, type LoadmapHandle, type LoadmapOptions, type LoadmapPanel, type LoadmapProps, LoadmapRoot, type NodeDef, type PoolDef, type Theme, type View, type ViewDef, cluster, compact, defineView, edge, fitLinear, fmt, handleOf, multiple, node, pct, pool, secs, useLoadmap, usePageTheme };
|