@graphlearning/graphl-flow 0.9.0 → 0.10.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 CHANGED
@@ -43,14 +43,14 @@ const scene: SceneModel = {
43
43
  | `item` | `id`, `title`, `muted?`, `sub?`, `icon?`, `bullets?`, `stack?`, `chip?`, `tone?`, `span?` |
44
44
  | `group` | `id`, `children`, `title?`, `sub?`, `icon?`, `badge?`, `dir?: 'row' \| 'col' \| 'grid'`, `cols?`, `bare?`, `dashed?`, `muted?`, `spread?`, `cell?: number \| true`, `tone?`, `span?` |
45
45
  | `table` | `id`, `rows`, `columns?`, `title?`, `tone?`, `span?` — a row is `[cells…]` or `{ cells, id?, tag?, tone? }` |
46
- | `code` | `id`, `code`, `lang?`, `filename?`, `show?: [from, to][]`, `highlight?: number[]`, `terminal?`, `output?`, `console?`, `cols?`, `tone?`, `span?` |
46
+ | `code` | `id`, `code`, `lang?`, `filename?`, `show?: [from, to][]`, `highlight?: number[]`, `terminal?`, `output?`, `console?`, `cols?`, `wrap?`, `tone?`, `span?` — `wrap` soft-wraps a long editor line under its own text |
47
47
  | `tty` | `id`, `screen: string[]`, `title?`, `cols?`, `inverse?`, `bold?` (`[row, from, to][]`) — a full-screen program's grid |
48
- | `plot` | `id`, `x`, `y` (axes: `min`, `max`, `step?`, `label?`, or `labels` for categories), `series`, `title?`, `axes?`, `grid?` |
49
- | `tree` | `id`, `entries` (`name`, `children?`, `folder?`, `state?: active \| new \| muted`, `note?`, `icon?`), `title?` |
48
+ | `plot` | `id`, `x`, `y` (axes: `min`, `max`, `step?`, `label?`, or `labels` for categories), `series`, `title?`, `axes?`, `grid?`, `compact?` — with `w`, the plot is that wide and its drawing area takes what the gutters leave |
49
+ | `tree` | `id`, `entries` (`name`, `children?`, `folder?`, `state?: active \| new \| muted`, `note?`, `icon?`), `title?`, `compact?` (13px rows: a sidebar beside a code pane) |
50
50
  | `note` | `id`, `text`, `tone?` — a dashed callout of wrapping prose |
51
51
  | any node | `minW?`/`minH?` (floors), `maxW?`/`maxH?` (caps), `w?`/`h?` (exact), `fill?`, `span?`, `tone?`; groups also `bare?` |
52
52
  | `Edge` | `from`, `to` (a node id; a table row `table.row`; a code line `code.L12`; a tree entry `tree.src/a.py`; a tty row `top.R7`), `label?`, `dashed?`, `bidirectional?` |
53
- | `Scene` | `nodes`, `edges?`, `title?`, `sub?`, `dir?`, `pulse?` |
53
+ | `Scene` | `nodes`, `edges?`, `title?`, `sub?`, `dir?`, `pulse?`, `padding?` (the fit's margin per side, 0–0.2, default 0.04) |
54
54
 
55
55
  **Layout.** A group lays its children out as `dir: 'col'` (default), `'row'` (one column per child)
56
56
  or `'grid'` (`cols`, default 2). `span: 'all'` gives a child a full row — a rail under columns.
@@ -172,26 +172,32 @@ themselves in a legend; other series label their last point.
172
172
 
173
173
  Recipes for whole video frames; each has a study fixture.
174
174
 
175
- **Console frames (0.7).** Two columns, both FIXED: the console (or a `tty` in its slot, same `w`/`h`) |
176
- the PICTURE of what it just showed — a `bare` group of the rest of 16:9. No edges between them; ring
177
- the console line with `focus`. See `dev/fixtures/studies/console-frame.ts`.
175
+ **One grid (0.10).** Every IDE, notebook and console frame is 1344×756 (16:9) with
176
+ `padding: 0.01`, every column a fixed `w` with a full-height floor, so they all land on ONE fit
177
+ (about 42px code in the 4K frame) and `check` asserts it (`SAME_FIT`).
178
178
 
179
- **IDE frames.** Three columns: `tree` | (editor `code` over terminal `code`, in a `bare` group) |
180
- a SIDE PANE — a `bare` group with a fixed width `w`. The IDE alone is narrower than 16:9; the side
181
- pane fills the frame and holds whatever the moment needs (a `note`, a `compact` plot, a small memory
182
- diagram) or nothing. See `dev/fixtures/studies/ide-frame.ts`.
179
+ **IDE frames.** `tree` (`compact`, 175) | editor `code` (`wrap`) over terminal `code`, in a `bare`
180
+ group (715: 72 columns) | a SIDE PANE (434): a group titled with the moment's mental model, `spread`,
181
+ holding a diagram (a memory diagram, a plot with `w`, a result table). Two variants of one height: a
182
+ tall editor over a short terminal, or the reverse. Without the explorer the side pane takes its
183
+ column (619), so the frame still fills 16:9. See `dev/fixtures/studies/ide-frame.ts`.
183
184
 
184
- **Notebook frames.** The same three columns with a notebook in the middle: `tree` | a group (the
185
- notebook: `title: 'explore.ipynb'`, `icon: 'jupyter'`) of CELLS | the fixed side pane. A cell is a
185
+ **Notebook frames.** The same columns with a notebook in the middle: `tree` | a group (the
186
+ notebook: `title: 'explore.ipynb'`, `icon: 'jupyter'`) of CELLS | the side pane. A cell is a
186
187
  `group` with `cell: n`, the execution count drawn as `[n]` in a gutter (`cell: true` draws `[ ]`, not
187
188
  run yet). Its first child is the input `code` (drawn without a tab bar, stretched to the cell),
188
189
  followed by its outputs: `{ type: 'code', output: true }` for printed text (`! ` lines are errors), a
189
190
  `table` for a DataFrame, or a `plot`. See `dev/fixtures/studies/notebook-frame.ts`.
190
191
 
192
+ **Console frames.** Two columns: the console (760: 80 columns, 29 rows; or a `tty` in its slot, same
193
+ `w`/`h`) | the PICTURE of what it just showed — a `bare`, `spread` group of the rest (574). No edges
194
+ between them; ring the console line with `focus`. See `dev/fixtures/studies/console-frame.ts`.
195
+
191
196
  `minW`/`minH` are FLOORS and `maxW`/`maxH` CAPS, in the scene's own pixels; `w`/`h` set both. Give
192
197
  every frame of a video the same floors and a fixed side pane, and they get the same zoom: no pane
193
198
  moves between cuts, whatever the side pane holds. Prose wraps to the pane; tables and code do not,
194
- so keep them narrow. A plot never scales — use `compact: true` (a 420×280 area) in a side pane.
199
+ so keep them narrow. A plot never scales — use `compact: true` (a 420×280 area) in a side pane, or
200
+ `compact` with a `w` to fit a narrower column.
195
201
  Don't draw an edge between the IDE's columns: an arrow widens the gap it crosses and moves every
196
202
  pane. Point at code with `highlight` and the narration; edges INSIDE the side pane are fine.
197
203
 
@@ -208,7 +214,9 @@ diagram hits that, split the slide or trim bullets — a denser scene can only g
208
214
  line included — with a ring and a glow in its own tone. It is drawn with box-shadow, so it moves
209
215
  nothing: every section of a course can focus a different node on the same scene without a jump.
210
216
 
211
- **Fit.** `Scene` fills its parent and scales the scene to fit, centred, with a 4% margin. The scale
217
+ **Fit.** `Scene` fills its parent and scales the scene to fit, centred, with a 4% margin per side —
218
+ or the scene's own `padding` (a fraction, 0–0.2): a fixed frame template already shaped to the pane
219
+ sets `padding: 0.01` to fill the recording. The scale
212
220
  depends only on the parent's size and the scene's natural size, so the same scene in the same frame
213
221
  always lands on the same pixels. The view is locked (no zoom/pan); page scroll passes through and text
214
222
  stays selectable. The root carries `data-fit="ready"` once fonts have loaded, edges are routed and the fit is applied —
package/dist/fit.d.ts CHANGED
@@ -17,4 +17,4 @@ export declare const MAX_SCALE = 4;
17
17
  * That is what makes recordings reproducible: two frames whose scenes have the same natural box get
18
18
  * the same scale and put every panel at the same pixels.
19
19
  */
20
- export declare function fitTransform(pane: Size, content: Size): Fit;
20
+ export declare function fitTransform(pane: Size, content: Size, padding?: number): Fit;