@loadmap/react 0.40.0 → 0.41.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 +51 -32
- package/dist/{Loadmap-DbAbcbNc.js → Loadmap-CM8HshXp.js} +1287 -1897
- package/dist/{Loadmap-BMlU1-mr.d.ts → Loadmap-CyxcmVoc.d.ts} +69 -16
- package/dist/camera-RqbxjjVv.js +209 -0
- package/dist/framePanels-BL9_bQ8A.js +24 -0
- package/dist/index.d.ts +128 -37
- package/dist/index.js +5 -2
- package/dist/later-_c1UnFld.js +195 -0
- package/dist/panels-CemD3oVS.js +479 -0
- package/dist/scenarios-D7DDcwS5.js +521 -0
- package/dist/source.d.ts +1 -1
- package/dist/source.js +5 -2
- package/dist/story-mK-TEB6j.js +127 -0
- package/dist/{zoom-DGmIQ7aO.js → zoom-36lBVilV.js} +45 -8
- package/package.json +5 -5
- package/dist/later-DpL22rlH.js +0 -504
package/README.md
CHANGED
|
@@ -80,6 +80,20 @@ only. Inside a card of its own, `.card > .lm { --lm-pad: 0; --lm-root-bg: transp
|
|
|
80
80
|
background (full screen keeps both); in a grid or a flex row, give it `min-width: 0`, since it sizes the diagram to
|
|
81
81
|
its width.
|
|
82
82
|
|
|
83
|
+
`<Loadmap>` draws everything in one box, the canvas: the title, the scenarios and **▶ Story** in a bar over the
|
|
84
|
+
diagram, the load and the verdict in one line under it, and five panels that open one at a time from their tabs:
|
|
85
|
+
Limits (with the verdict's sentence), Design, Headroom (with the scenarios compared), Live and Assumes. The box has a
|
|
86
|
+
fixed height, `clamp(420px, 70dvh, 760px)` by default: give it yours with `.lm-canvas { height: 560px }`, or `fill` the
|
|
87
|
+
container. The canvas arranges itself by its own size:
|
|
88
|
+
the tabs are a rail from 900 px wide, a row when narrower and a menu under 420 px high; the open panel stands beside
|
|
89
|
+
the diagram, or is a sheet under 520 px. Nothing the reader does changes the box's height or lays the diagram out
|
|
90
|
+
again.
|
|
91
|
+
|
|
92
|
+
`panels={['limits', 'live']}` offers only those tabs (`LOADMAP_PANELS` lists the five: `limits`, `controls`,
|
|
93
|
+
`headroom`, `live`, `assumptions`; `[]` for none). `open`, `defaultOpen` and `onOpen` choose and follow the open one,
|
|
94
|
+
and `headroom={false}` or `compare={false}` leaves the chart or the scenarios compared out of Headroom. A
|
|
95
|
+
`Canvas.Panel` child of `<Loadmap>` is a panel of your own, its tab before the others.
|
|
96
|
+
|
|
83
97
|
A `.loadmap` text draws with `<LoadmapSource source={text} name="shop.loadmap" />` from `@loadmap/react/source`: it
|
|
84
98
|
compiles when the text changes, passes on the options the definition declares (your props win), and while the text
|
|
85
99
|
does not compile shows its diagnostics as `loadmap check` prints them. An edit keeps the values the board shows (the
|
|
@@ -90,37 +104,42 @@ A scenario, a story step or a control that changes the structure (more pods, mor
|
|
|
90
104
|
what stays moves to its new place, what is new fades in. `transition={1.2}` sets the seconds it takes (default 0.8);
|
|
91
105
|
0 cuts, and so does reduced motion. The load never moves it.
|
|
92
106
|
|
|
93
|
-
The
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
107
|
+
The load is under the diagram, in view whatever panel is open, so the reader moves it and watches what it does. Its
|
|
108
|
+
track is coloured by what the load does (under the target, past it, past capacity, a ± range as a blend) and runs on
|
|
109
|
+
a log scale when the load spans ten times or more. Under it, a mark for today, each preset that sets the load, the
|
|
110
|
+
target and where it runs out: a click takes it. ← → move a step, Page Up and Page Down to the next mark. Picking a
|
|
111
|
+
scenario keeps the load.
|
|
112
|
+
|
|
113
|
+
The bar's **Full screen** button shows the same canvas at the screen's size; from 1280 px wide one panel stays open
|
|
114
|
+
beside the diagram. **Panels** beside Close, or the F key, switches the tabs and the panel off and on:
|
|
115
|
+
`chrome="least"` opens full screen with the diagram, the load and the verdict alone. `fill` makes the root fill its
|
|
116
|
+
container for good, with no Full screen button, and `scrolls` leaves the plain wheel and one finger to a page that
|
|
117
|
+
scrolls around it. `fullScreen` and `fullScreenMode` are the names `panels` and `chrome` had before: they still work,
|
|
118
|
+
and say so in the console.
|
|
119
|
+
|
|
120
|
+
**▶ Story** puts the story over the bar: its text, Play, back and next. Play tells it on the diagram: the whole
|
|
121
|
+
diagram, a close-up on what each step changes, the change, and the whole diagram again for the step's `seconds`, a
|
|
122
|
+
short title on the board (the step's `title`, or what it changes). The component that runs out first wears a ring
|
|
123
|
+
that breathes while the story plays and once it is past the target. With reduced motion the camera cuts and the ring
|
|
124
|
+
holds still. `ref.playStory()` plays it on the engine's clock, which `step()` advances.
|
|
125
|
+
|
|
126
|
+
The reader pans and zooms the diagram: a drag pans (a press that hardly moves still clicks a box), two fingers or the
|
|
127
|
+
wheel with Ctrl or ⌘ zoom about the pointer, the keys + − 0 and the arrows work on the focused board, and the buttons
|
|
128
|
+
on it go − · zoom · + · Fit. The page keeps its plain wheel and one finger; in full screen they are the diagram's.
|
|
129
|
+
`zoom` is still taken and no longer needed. Pictures and recordings always show the whole diagram, whatever the
|
|
130
|
+
reader's view.
|
|
131
|
+
|
|
132
|
+
A layout of your own starts with `useLoadmap` and `LoadmapRoot`, and goes one of two ways. `Canvas` is the same box
|
|
133
|
+
with your parts in it: `Canvas.Bar`, `Canvas.Console` and a `Canvas.Panel` for each tab, with `useCanvasSize` and
|
|
134
|
+
`useCanvasPanels` for a part that folds by the canvas's size or opens a panel. Or a document of the parts, every
|
|
135
|
+
panel on the page at once: `Diagram`, `Story`, `Verdict`, `Limits`, `Controls` and the others, with `LoadBar` for the
|
|
136
|
+
scenarios and the load in one bar that stays in view (`--lm-sticky-top` puts it under a fixed header; `Scenarios` and
|
|
137
|
+
`LoadRange` are its two halves, and `<Controls load={false}>` leaves the load to it). There the diagram has its own
|
|
138
|
+
Full screen, which takes the whole root: inside a `<div className="lm-side">` after the `Diagram`, your pieces become
|
|
139
|
+
a box below it that scrolls on its own; a title, the `LoadBar` and the `Story` stay above the diagram, and the rest
|
|
140
|
+
waits outside. `useLoadmap(model, view, { zoom: true })` lets the reader pan and zoom that diagram, and
|
|
141
|
+
`<Diagram lm={lm} canvas={{ left: 420 }} />` fills its container as a canvas; the insets are what the page floats
|
|
142
|
+
over it. The controller has the state: `lm.fullScreen`, `lm.toggleFullScreen()`, `lm.fullScreenMode`,
|
|
143
|
+
`lm.storyPlaying`, `lm.cue` (what the board says about the step played).
|
|
125
144
|
|
|
126
145
|
Docs, live examples and the editor: https://jaim3r0jas.github.io/loadmap/ · MIT
|