@graphlearning/graphl-flow 0.2.0 → 0.4.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 +9 -2
- package/dist/index.js +828 -812
- package/dist/index.js.map +1 -1
- package/dist/routing.d.ts +13 -0
- package/dist/styles.css +16 -0
- package/dist/types.d.ts +7 -0
- package/package.json +1 -1
package/dist/routing.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export interface Routed {
|
|
|
23
23
|
side: 'on' | 'before' | 'after';
|
|
24
24
|
seg: 'h' | 'v';
|
|
25
25
|
};
|
|
26
|
+
/** How many edges hold a slot in this edge's channel (0: none). The layout widens the gap for them. */
|
|
27
|
+
slots: number;
|
|
26
28
|
}
|
|
27
29
|
/** An edge ends this far OUTSIDE its node, so the arrowhead never touches the border. */
|
|
28
30
|
export declare const ANCHOR_OUTSET = 4;
|
|
@@ -30,6 +32,17 @@ export declare const ANCHOR_OUTSET = 4;
|
|
|
30
32
|
export declare const PORT_INSET = 12;
|
|
31
33
|
/** Two ports closer than this on one face make the whole face spread evenly. */
|
|
32
34
|
export declare const PORT_MIN_GAP = 14;
|
|
35
|
+
/** The arrowhead's length (its marker is 10 user units): a slot keeps at least this run to each anchor. */
|
|
36
|
+
export declare const HEAD_LEN = 10;
|
|
37
|
+
/** Between two slots in one channel. */
|
|
38
|
+
export declare const SLOT_GAP = 8;
|
|
39
|
+
/**
|
|
40
|
+
* The gap a channel needs for `n` slots: a full head's run at each end, outside each anchor, and
|
|
41
|
+
* SLOT_GAP between neighbours. One slot needs 28 — inside EDGE_GAP — so only a SHARED channel grows.
|
|
42
|
+
* Without it, three arrows fanning into one node through a 32px gap left a 4px last run, which the
|
|
43
|
+
* 6px head trim reversed: the arrowhead pointed back into the gap (0.2, edge-fan-in).
|
|
44
|
+
*/
|
|
45
|
+
export declare const slotRoom: (n: number) => number;
|
|
33
46
|
/**
|
|
34
47
|
* `sides[i]` names the two SIBLINGS edge i runs between — the children of its lowest common
|
|
35
48
|
* ancestor that contain each end. The faces are chosen from THEIR boxes, not the nodes': two nested
|
package/dist/styles.css
CHANGED
|
@@ -29,6 +29,18 @@
|
|
|
29
29
|
.gf-group .gf-group[data-toned] { background: var(--gf-tint); border-color: color-mix(in srgb, var(--gf-accent) 35%, transparent); }
|
|
30
30
|
/* A bare group only arranges: no frame, fill or padding, at any depth. */
|
|
31
31
|
.gf-group[data-bare], .gf-group .gf-group[data-bare] { border: 0; padding: 0; background: none; border-radius: 0; }
|
|
32
|
+
/* A notebook cell: the `[n]` gutter, then the input (stretched to the cell, no bar) over its outputs.
|
|
33
|
+
The gutter is a fixed width in ch, so every cell's input starts at the same x. */
|
|
34
|
+
.gf-group[data-cell], .gf-group .gf-group[data-cell] {
|
|
35
|
+
display: grid; grid-template-columns: auto 1fr; column-gap: 8px;
|
|
36
|
+
border: 0; padding: 0; background: none; border-radius: 0;
|
|
37
|
+
}
|
|
38
|
+
.gf-cell-n {
|
|
39
|
+
box-sizing: content-box; min-width: 5ch; padding-top: 9px; text-align: right; user-select: none;
|
|
40
|
+
font: 15px/1.6 'IBM Plex Mono', ui-monospace, monospace; color: var(--gf-code-gutter);
|
|
41
|
+
}
|
|
42
|
+
.gf-group[data-cell] > .gf-body > .gf-code:first-child:not([data-output]) { justify-self: stretch; }
|
|
43
|
+
.gf-group[data-cell] > .gf-body > .gf-code:first-child > .gf-code-bar { display: none; }
|
|
32
44
|
.gf-group-head { margin-bottom: 10px; }
|
|
33
45
|
.gf-group-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; }
|
|
34
46
|
.gf-group-sub { margin-top: 2px; font-size: 14px; color: var(--gf-muted); }
|
|
@@ -122,6 +134,10 @@
|
|
|
122
134
|
.gf-fold { color: var(--gf-code-gutter); font-style: italic; background: color-mix(in srgb, var(--gf-code-gutter) 10%, transparent); user-select: none; }
|
|
123
135
|
.gf-prompt { color: var(--gf-ok); user-select: none; }
|
|
124
136
|
.gf-line[data-kind='out'] { color: var(--gf-muted); }
|
|
137
|
+
/* A cell's printed output: plain text on the page, in ink — it is the result, not a terminal echo. */
|
|
138
|
+
.gf-code[data-output] { border: 0; border-radius: 0; background: none; padding: 2px 0; }
|
|
139
|
+
.gf-code[data-output] .gf-line { padding-left: 12px; }
|
|
140
|
+
.gf-code[data-output] .gf-line[data-kind='out'] { color: var(--gf-ink); }
|
|
125
141
|
.gf-line[data-kind='err'] { color: var(--gf-err); }
|
|
126
142
|
.tok-var { color: var(--gf-code-var); }
|
|
127
143
|
.tok-method { color: var(--gf-code-method); }
|
package/dist/types.d.ts
CHANGED
|
@@ -57,6 +57,11 @@ export interface Group extends Base {
|
|
|
57
57
|
bare?: boolean;
|
|
58
58
|
/** Distribute the children over the group's full height when it is stretched taller than them. */
|
|
59
59
|
spread?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* A notebook cell: the execution count drawn as `[n]` in a gutter (`true`: not run yet, `[ ]`),
|
|
62
|
+
* the children — the input `code` first, then its outputs — stacked beside it. No frame or head.
|
|
63
|
+
*/
|
|
64
|
+
cell?: number | true;
|
|
60
65
|
children: SceneNode[];
|
|
61
66
|
}
|
|
62
67
|
/** One table row: its cells, plus an optional id, a short tag in a leading gutter, and a tone. */
|
|
@@ -97,6 +102,8 @@ export interface Code extends Base {
|
|
|
97
102
|
highlight?: number[];
|
|
98
103
|
/** A terminal: `$ cmd` lines are commands, `! text` errors, the rest output. No line numbers. */
|
|
99
104
|
terminal?: boolean;
|
|
105
|
+
/** A notebook cell's printed output: plain text, no frame or line numbers; `! text` is an error. */
|
|
106
|
+
output?: boolean;
|
|
100
107
|
}
|
|
101
108
|
/** An axis in DATA units. `labels` makes it categorical: one slot per label (bar charts). */
|
|
102
109
|
export interface PlotAxis {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphlearning/graphl-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Declarative diagram engine — authors describe groups, items and edges; the browser lays them out and the engine draws the edges.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|