@loadmap/react 0.17.1 → 0.18.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 +14 -5
- package/dist/{Loadmap-DmcFVIQF.d.ts → Loadmap-BMCWIC-r.d.ts} +14 -3
- package/dist/{Loadmap-CuGJSFnl.js → Loadmap-BjtmzxzK.js} +911 -683
- package/dist/index.d.ts +21 -5
- package/dist/index.js +2 -2
- package/dist/{later-Dk7QnTxR.js → later-B9SnId7C.js} +6 -3
- package/dist/source.d.ts +1 -1
- package/dist/source.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -86,12 +86,20 @@ A scenario, a story step or a control that changes the structure (more pods, mor
|
|
|
86
86
|
what stays moves to its new place, what is new fades in. `transition={1.2}` sets the seconds it takes (default 0.8);
|
|
87
87
|
0 cuts, and so does reduced motion. The load never moves it.
|
|
88
88
|
|
|
89
|
+
The scenarios and the load share one bar over the diagram, so the reader moves the load and watches what it does. It
|
|
90
|
+
stays in view while the page scrolls; a page with a fixed header of its own sets `--lm-sticky-top` (its height) on an
|
|
91
|
+
ancestor of the root. On a phone the bar sits under the diagram, in thumb reach. Its track is coloured by what the load
|
|
92
|
+
does (under the target, past it, past capacity, a ± range as a blend) and runs on a log scale when the load spans ten
|
|
93
|
+
times or more. Under it, a mark for today, each preset that sets the load, the target and where it runs out: a click
|
|
94
|
+
takes it. ← → move a step, Page Up and Page Down to the next mark. Picking a scenario keeps the load.
|
|
95
|
+
|
|
89
96
|
The diagram's **Full screen** fits the screen without scrolling: the diagram as wide as it, the verdict in one line
|
|
90
97
|
under it, and the panels of the page side by side in a compact form (a phone shows one at a time, under tabs, and
|
|
91
98
|
pans the diagram in its own box). Each compact panel opens whole over the diagram. `fullScreen={['verdict', 'live',
|
|
92
99
|
'controls']}` keeps only those (`LOADMAP_PANELS` lists them all: `verdict`, `live`, `limits`, `controls`, `headroom`,
|
|
93
|
-
`compare`, `assumptions`). A switch beside Close, or the F key,
|
|
94
|
-
|
|
100
|
+
`compare`, `assumptions`; `controls` is the design, the load being in the bar). A switch beside Close, or the F key,
|
|
101
|
+
turns full screen into **focus**: the bar, the diagram, the story and the verdict, if it is listed.
|
|
102
|
+
`fullScreenMode="focus"` opens full screen there
|
|
95
103
|
(default `'panels'`). The story bar's Play tells the story on the diagram: the whole diagram, a close-up on what each
|
|
96
104
|
step changes, the change, and the whole diagram again for the step's `seconds`, a short title on the board (the step's
|
|
97
105
|
`title`, or what it changes). The component that runs out first wears a ring that breathes while the story plays and
|
|
@@ -105,9 +113,10 @@ buttons on it go − · zoom · + · Fit. A page that scrolls keeps its plain wh
|
|
|
105
113
|
frames the diagram in the rest. Pictures and recordings always show the whole diagram, whatever the reader's view.
|
|
106
114
|
|
|
107
115
|
`useLoadmap` with `LoadmapRoot`, `Diagram`, `Verdict`, `Limits`, `Controls` and the others builds a page of your own
|
|
108
|
-
layout from the same pieces
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
layout from the same pieces: `LoadBar` is the bar, `Scenarios` and `LoadRange` its two halves, and
|
|
117
|
+
`<Controls load={false}>` leaves the load to it. The diagram's Full screen takes the whole root: inside a
|
|
118
|
+
`<div className="lm-side">` after the `Diagram`, your pieces become a box below it that scrolls on its own; a title,
|
|
119
|
+
the `LoadBar` (or `Scenarios`) and the `Story` stay above the diagram, and the rest waits outside. The controller has the state: `lm.fullScreen`,
|
|
111
120
|
`lm.toggleFullScreen()`, `lm.fullScreenMode`, `lm.storyPlaying`, `lm.cue` (what the board says about the step played).
|
|
112
121
|
|
|
113
122
|
Docs, live examples and the editor: https://jaim3r0jas.github.io/loadmap/ · MIT
|
|
@@ -196,7 +196,15 @@ declare class Engine {
|
|
|
196
196
|
readColors(root: Element): void;
|
|
197
197
|
flowColor(flow: string): string;
|
|
198
198
|
outcomeColor(outcome: Particle['outcome']): string;
|
|
199
|
-
|
|
199
|
+
/**
|
|
200
|
+
* Gives the canvas one pixel for each of the screen's: `px`, the device pixels the browser says it covers, else its
|
|
201
|
+
* size × the pixel ratio. With any other size the browser stretches the dots and blurs them. Wants no scene: a board
|
|
202
|
+
* that has its size before its first layout keeps it.
|
|
203
|
+
*/
|
|
204
|
+
resize(px?: {
|
|
205
|
+
width: number;
|
|
206
|
+
height: number;
|
|
207
|
+
}): void;
|
|
200
208
|
/** Advances the sim, the move to a new structure and the story played, by `dtReal` seconds. */
|
|
201
209
|
step(dtReal: number, o?: {
|
|
202
210
|
particles?: boolean;
|
|
@@ -394,7 +402,7 @@ interface LoadmapProps<P> extends LoadmapOptions<P> {
|
|
|
394
402
|
compare?: boolean;
|
|
395
403
|
/**
|
|
396
404
|
* The panels full screen shows, compact, below the diagram. Default every one the page shows. Focus mode shows the
|
|
397
|
-
* verdict and the load
|
|
405
|
+
* verdict of these. The scenarios and the load are in the bar over the diagram, in every layout.
|
|
398
406
|
*/
|
|
399
407
|
fullScreen?: readonly LoadmapPanel[];
|
|
400
408
|
/** A click (or Enter) on a box of the diagram, by its id: every box is a button then. */
|
|
@@ -403,7 +411,10 @@ interface LoadmapProps<P> extends LoadmapOptions<P> {
|
|
|
403
411
|
selected?: string | null;
|
|
404
412
|
ref?: Ref<LoadmapHandle>;
|
|
405
413
|
}
|
|
406
|
-
/**
|
|
414
|
+
/**
|
|
415
|
+
* The whole page piece: the scenarios and the load in a bar over the diagram, the diagram, verdict, headroom, live
|
|
416
|
+
* meters, limits, the design controls and assumptions.
|
|
417
|
+
*/
|
|
407
418
|
declare function Loadmap<P>({ model, view, theme, title, assumptions, headroom, compare, fullScreen, onNodeClick, selected, ref, ...o }: LoadmapProps<P>): import("react").JSX.Element;
|
|
408
419
|
declare function handleOf(lm: LoadmapController): LoadmapHandle;
|
|
409
420
|
export { Insets as _, 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 };
|