@fusion.dev/helix-headless 0.130.0 → 0.131.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/custom-elements.json +177 -2
- package/dist/element-events.generated.js +1 -0
- package/dist/graph/root/graph-model.d.ts +23 -0
- package/dist/graph/root/graph-model.js +29 -0
- package/dist/graph/root/graph-root.d.ts +33 -1
- package/dist/graph/root/graph-root.js +54 -10
- package/package.json +5 -5
- package/types/jsx.d.ts +56 -0
- package/types/vue.d.ts +16 -1
package/custom-elements.json
CHANGED
|
@@ -50219,6 +50219,54 @@
|
|
|
50219
50219
|
}
|
|
50220
50220
|
],
|
|
50221
50221
|
"description": "The notes in the order of their names, as the page's language orders words."
|
|
50222
|
+
},
|
|
50223
|
+
{
|
|
50224
|
+
"kind": "function",
|
|
50225
|
+
"name": "groupsOf",
|
|
50226
|
+
"return": {
|
|
50227
|
+
"type": {
|
|
50228
|
+
"text": "GraphGroupEntry[]"
|
|
50229
|
+
}
|
|
50230
|
+
},
|
|
50231
|
+
"parameters": [
|
|
50232
|
+
{
|
|
50233
|
+
"name": "nodes",
|
|
50234
|
+
"type": {
|
|
50235
|
+
"text": "readonly GraphNode[]"
|
|
50236
|
+
}
|
|
50237
|
+
}
|
|
50238
|
+
],
|
|
50239
|
+
"description": "The groups the notes are in, each once, **in the order `sort()` gives\ntheir names**, which is the order `connectGraph` hands out the series\ncolors in: the legend's first group is the drawing's first color.\n\nA group takes a tone where every one of its notes has the same one, since\nthe drawing colors a toned note by its tone and the group's name in the\ncolor of a note without one."
|
|
50240
|
+
},
|
|
50241
|
+
{
|
|
50242
|
+
"kind": "function",
|
|
50243
|
+
"name": "withoutGroups",
|
|
50244
|
+
"return": {
|
|
50245
|
+
"type": {
|
|
50246
|
+
"text": "Set<string> | undefined"
|
|
50247
|
+
}
|
|
50248
|
+
},
|
|
50249
|
+
"parameters": [
|
|
50250
|
+
{
|
|
50251
|
+
"name": "nodes",
|
|
50252
|
+
"type": {
|
|
50253
|
+
"text": "readonly GraphNode[]"
|
|
50254
|
+
}
|
|
50255
|
+
},
|
|
50256
|
+
{
|
|
50257
|
+
"name": "local",
|
|
50258
|
+
"type": {
|
|
50259
|
+
"text": "Set<string> | undefined"
|
|
50260
|
+
}
|
|
50261
|
+
},
|
|
50262
|
+
{
|
|
50263
|
+
"name": "hidden",
|
|
50264
|
+
"type": {
|
|
50265
|
+
"text": "readonly string[]"
|
|
50266
|
+
}
|
|
50267
|
+
}
|
|
50268
|
+
],
|
|
50269
|
+
"description": "The notes kept by the local graph, `local`, where there is one, less every\nnote in a hidden group, or `undefined` where nothing is left out. A note in\nno group is never hidden: the legend names only groups."
|
|
50222
50270
|
}
|
|
50223
50271
|
],
|
|
50224
50272
|
"exports": [
|
|
@@ -50261,6 +50309,22 @@
|
|
|
50261
50309
|
"name": "sortedOf",
|
|
50262
50310
|
"module": "src/graph/root/graph-model.ts"
|
|
50263
50311
|
}
|
|
50312
|
+
},
|
|
50313
|
+
{
|
|
50314
|
+
"kind": "js",
|
|
50315
|
+
"name": "groupsOf",
|
|
50316
|
+
"declaration": {
|
|
50317
|
+
"name": "groupsOf",
|
|
50318
|
+
"module": "src/graph/root/graph-model.ts"
|
|
50319
|
+
}
|
|
50320
|
+
},
|
|
50321
|
+
{
|
|
50322
|
+
"kind": "js",
|
|
50323
|
+
"name": "withoutGroups",
|
|
50324
|
+
"declaration": {
|
|
50325
|
+
"name": "withoutGroups",
|
|
50326
|
+
"module": "src/graph/root/graph-model.ts"
|
|
50327
|
+
}
|
|
50264
50328
|
}
|
|
50265
50329
|
]
|
|
50266
50330
|
},
|
|
@@ -50270,7 +50334,7 @@
|
|
|
50270
50334
|
"declarations": [
|
|
50271
50335
|
{
|
|
50272
50336
|
"kind": "class",
|
|
50273
|
-
"description": "Helix draws no graph. A force layout of thousands of notes is physics and\nWebGL, which a renderer such as Sigma.js does. Put the renderer's box in the\nframe, and `connectGraph` from `@fusion.dev/helix-graph` draws `nodes` and\n`links` in it and keeps it in step with the frame.\n\nWhat the frame adds is what a drawing of a graph cannot do: a list of every\nnote beside it, which is the graph for a screen reader and a quick way to\nfind a note for anyone. The selected note comes first, then the notes it\nlinks to and from, then every other note, and the search field narrows it.\nSelecting a note in the list or in the drawing is the same selection.\n\nSet `depth` to show the local graph: only the notes within that many links\nof the selected one.\n\n`nodes` and `links` are properties, never markup: a graph of ten thousand\nnotes as ten thousand elements would cost what the renderer exists to save.\nThe list draws only the rows in view.\n\nThe list scrolls on this tier. It carries `data-scroller`, and `core` ships\n`[data-scroller] { overflow: auto }` into every shadow root. You still need\nto set a block size on the list, or it grows to hold every row.",
|
|
50337
|
+
"description": "Helix draws no graph. A force layout of thousands of notes is physics and\nWebGL, which a renderer such as Sigma.js does. Put the renderer's box in the\nframe, and `connectGraph` from `@fusion.dev/helix-graph` draws `nodes` and\n`links` in it and keeps it in step with the frame.\n\nWhat the frame adds is what a drawing of a graph cannot do: a list of every\nnote beside it, which is the graph for a screen reader and a quick way to\nfind a note for anyone. The selected note comes first, then the notes it\nlinks to and from, then every other note, and the search field narrows it.\nSelecting a note in the list or in the drawing is the same selection.\n\nSet `depth` to show the local graph: only the notes within that many links\nof the selected one.\n\nSet `legend` to name the groups over the drawing, each a button that shows\nor hides its notes. `hiddenGroups` holds the groups turned off, and the\nlist holds only what the drawing shows.\n\n`nodes` and `links` are properties, never markup: a graph of ten thousand\nnotes as ten thousand elements would cost what the renderer exists to save.\nThe list draws only the rows in view.\n\nThe list scrolls on this tier. It carries `data-scroller`, and `core` ships\n`[data-scroller] { overflow: auto }` into every shadow root. You still need\nto set a block size on the list, or it grows to hold every row.",
|
|
50274
50338
|
"name": "HelixHeadlessGraph",
|
|
50275
50339
|
"cssParts": [
|
|
50276
50340
|
{
|
|
@@ -50321,6 +50385,22 @@
|
|
|
50321
50385
|
"description": "The strip above the graph.",
|
|
50322
50386
|
"name": "header"
|
|
50323
50387
|
},
|
|
50388
|
+
{
|
|
50389
|
+
"description": "The groups over the drawing, with `legend`, each a button that shows or hides its notes.",
|
|
50390
|
+
"name": "legend"
|
|
50391
|
+
},
|
|
50392
|
+
{
|
|
50393
|
+
"description": "One group in the legend, pressed while its notes are shown. Carries `data-tone` where every note in the group has the same tone, which colors the notes over the group's own color.",
|
|
50394
|
+
"name": "legend-item"
|
|
50395
|
+
},
|
|
50396
|
+
{
|
|
50397
|
+
"description": "A group in the legend whose notes are hidden.",
|
|
50398
|
+
"name": "legend-item-hidden"
|
|
50399
|
+
},
|
|
50400
|
+
{
|
|
50401
|
+
"description": "The mark in a group's color, before its name.",
|
|
50402
|
+
"name": "legend-swatch"
|
|
50403
|
+
},
|
|
50324
50404
|
{
|
|
50325
50405
|
"description": "The list of notes, which draws only the rows in view.",
|
|
50326
50406
|
"name": "list"
|
|
@@ -50444,6 +50524,15 @@
|
|
|
50444
50524
|
"description": "How many links from the selected note to show, for its local graph. Unset\nshows every note. The list holds what the drawing shows.",
|
|
50445
50525
|
"attribute": "depth"
|
|
50446
50526
|
},
|
|
50527
|
+
{
|
|
50528
|
+
"kind": "field",
|
|
50529
|
+
"name": "hiddenGroups",
|
|
50530
|
+
"type": {
|
|
50531
|
+
"text": "readonly string[]"
|
|
50532
|
+
},
|
|
50533
|
+
"default": "[]",
|
|
50534
|
+
"description": "The groups turned off in the legend, by name, whose notes neither the drawing nor the list shows. A property, never an attribute."
|
|
50535
|
+
},
|
|
50447
50536
|
{
|
|
50448
50537
|
"kind": "field",
|
|
50449
50538
|
"name": "label",
|
|
@@ -50454,6 +50543,26 @@
|
|
|
50454
50543
|
"description": "The graph's name, read by screen readers, such as \"Research notes\".\nRequired.",
|
|
50455
50544
|
"attribute": "label"
|
|
50456
50545
|
},
|
|
50546
|
+
{
|
|
50547
|
+
"kind": "field",
|
|
50548
|
+
"name": "legend",
|
|
50549
|
+
"type": {
|
|
50550
|
+
"text": "boolean"
|
|
50551
|
+
},
|
|
50552
|
+
"default": "false",
|
|
50553
|
+
"description": "Names the groups over the drawing, each a button in its color that shows\nor hides its notes. Drawn where the notes have two groups or more.",
|
|
50554
|
+
"attribute": "legend"
|
|
50555
|
+
},
|
|
50556
|
+
{
|
|
50557
|
+
"kind": "field",
|
|
50558
|
+
"name": "legendLabel",
|
|
50559
|
+
"type": {
|
|
50560
|
+
"text": "string"
|
|
50561
|
+
},
|
|
50562
|
+
"default": "'Groups'",
|
|
50563
|
+
"description": "The legend's name, read by screen readers.",
|
|
50564
|
+
"attribute": "legend-label"
|
|
50565
|
+
},
|
|
50457
50566
|
{
|
|
50458
50567
|
"kind": "field",
|
|
50459
50568
|
"name": "linkedBothLabel",
|
|
@@ -50610,7 +50719,17 @@
|
|
|
50610
50719
|
"text": "Set<string> | undefined"
|
|
50611
50720
|
},
|
|
50612
50721
|
"privacy": "private",
|
|
50613
|
-
"description": "The notes the local graph
|
|
50722
|
+
"description": "The notes the local graph and the legend keep, or `undefined` where neither leaves any out."
|
|
50723
|
+
},
|
|
50724
|
+
{
|
|
50725
|
+
"kind": "field",
|
|
50726
|
+
"name": "groups",
|
|
50727
|
+
"type": {
|
|
50728
|
+
"text": "GraphGroupEntry[]"
|
|
50729
|
+
},
|
|
50730
|
+
"privacy": "private",
|
|
50731
|
+
"default": "[]",
|
|
50732
|
+
"description": "The groups the notes are in, each with the tone all its notes share\nwhere they share one. **In the order of their names**, which is the\norder `connectGraph` gives them their colors in."
|
|
50614
50733
|
},
|
|
50615
50734
|
{
|
|
50616
50735
|
"kind": "field",
|
|
@@ -50855,6 +50974,36 @@
|
|
|
50855
50974
|
],
|
|
50856
50975
|
"description": "How a row stands to the selected note, in words, or nothing where it does not."
|
|
50857
50976
|
},
|
|
50977
|
+
{
|
|
50978
|
+
"kind": "method",
|
|
50979
|
+
"name": "toggleGroup",
|
|
50980
|
+
"privacy": "private",
|
|
50981
|
+
"return": {
|
|
50982
|
+
"type": {
|
|
50983
|
+
"text": "void"
|
|
50984
|
+
}
|
|
50985
|
+
},
|
|
50986
|
+
"parameters": [
|
|
50987
|
+
{
|
|
50988
|
+
"name": "name",
|
|
50989
|
+
"type": {
|
|
50990
|
+
"text": "string"
|
|
50991
|
+
}
|
|
50992
|
+
}
|
|
50993
|
+
],
|
|
50994
|
+
"description": "Shows a group's notes or hides them, through the request a page can refuse."
|
|
50995
|
+
},
|
|
50996
|
+
{
|
|
50997
|
+
"kind": "method",
|
|
50998
|
+
"name": "renderLegend",
|
|
50999
|
+
"privacy": "private",
|
|
51000
|
+
"return": {
|
|
51001
|
+
"type": {
|
|
51002
|
+
"text": "TemplateResult | typeof nothing"
|
|
51003
|
+
}
|
|
51004
|
+
},
|
|
51005
|
+
"description": "The groups over the drawing, with `legend`, each a button pressed while\nits notes are shown. **Nothing for one group or none**: a legend of one\nnames what every note is, and turning it off empties the graph."
|
|
51006
|
+
},
|
|
50858
51007
|
{
|
|
50859
51008
|
"kind": "method",
|
|
50860
51009
|
"name": "choose",
|
|
@@ -52157,6 +52306,14 @@
|
|
|
52157
52306
|
"name": "helix-before-activate",
|
|
52158
52307
|
"reactProp": "onhelix-before-activate"
|
|
52159
52308
|
},
|
|
52309
|
+
{
|
|
52310
|
+
"type": {
|
|
52311
|
+
"text": "HelixGraphFilterEvent"
|
|
52312
|
+
},
|
|
52313
|
+
"description": "A group in the legend was pressed, to show or hide its notes. The detail's `hidden` is every group that would be hidden. Cancelable: cancel it to keep the groups as they were, or to set `hiddenGroups` yourself.",
|
|
52314
|
+
"name": "helix-graph-filter",
|
|
52315
|
+
"reactProp": "onhelix-graph-filter"
|
|
52316
|
+
},
|
|
52160
52317
|
{
|
|
52161
52318
|
"type": {
|
|
52162
52319
|
"text": "HelixGraphLayoutEvent"
|
|
@@ -52233,6 +52390,24 @@
|
|
|
52233
52390
|
"description": "The graph's name, read by screen readers, such as \"Research notes\".\nRequired.",
|
|
52234
52391
|
"fieldName": "label"
|
|
52235
52392
|
},
|
|
52393
|
+
{
|
|
52394
|
+
"name": "legend",
|
|
52395
|
+
"type": {
|
|
52396
|
+
"text": "boolean"
|
|
52397
|
+
},
|
|
52398
|
+
"default": "false",
|
|
52399
|
+
"description": "Names the groups over the drawing, each a button in its color that shows\nor hides its notes. Drawn where the notes have two groups or more.",
|
|
52400
|
+
"fieldName": "legend"
|
|
52401
|
+
},
|
|
52402
|
+
{
|
|
52403
|
+
"name": "legend-label",
|
|
52404
|
+
"type": {
|
|
52405
|
+
"text": "string"
|
|
52406
|
+
},
|
|
52407
|
+
"default": "'Groups'",
|
|
52408
|
+
"description": "The legend's name, read by screen readers.",
|
|
52409
|
+
"fieldName": "legendLabel"
|
|
52410
|
+
},
|
|
52236
52411
|
{
|
|
52237
52412
|
"name": "linked-both-label",
|
|
52238
52413
|
"type": {
|
|
@@ -89,3 +89,26 @@ export declare const within: (adjacency: Adjacency, from: string, depth: number)
|
|
|
89
89
|
export declare const entriesOf: (sorted: readonly GraphNode[], adjacency: Adjacency, active: string, query: string, shown?: ReadonlySet<string>) => Entry[];
|
|
90
90
|
/** The notes in the order of their names, as the page's language orders words. */
|
|
91
91
|
export declare const sortedOf: (nodes: readonly GraphNode[], lang?: string) => GraphNode[];
|
|
92
|
+
/** One group the notes are in, as the legend names it. */
|
|
93
|
+
export interface GraphGroupEntry {
|
|
94
|
+
/** The group's name, as the notes give it. */
|
|
95
|
+
name: string;
|
|
96
|
+
/** The tone every note in the group has, where they all have the same one, which colors them over the group's color. */
|
|
97
|
+
tone?: GraphNodeTone | undefined;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The groups the notes are in, each once, **in the order `sort()` gives
|
|
101
|
+
* their names**, which is the order `connectGraph` hands out the series
|
|
102
|
+
* colors in: the legend's first group is the drawing's first color.
|
|
103
|
+
*
|
|
104
|
+
* A group takes a tone where every one of its notes has the same one, since
|
|
105
|
+
* the drawing colors a toned note by its tone and the group's name in the
|
|
106
|
+
* color of a note without one.
|
|
107
|
+
*/
|
|
108
|
+
export declare const groupsOf: (nodes: readonly GraphNode[]) => GraphGroupEntry[];
|
|
109
|
+
/**
|
|
110
|
+
* The notes kept by the local graph, `local`, where there is one, less every
|
|
111
|
+
* note in a hidden group, or `undefined` where nothing is left out. A note in
|
|
112
|
+
* no group is never hidden: the legend names only groups.
|
|
113
|
+
*/
|
|
114
|
+
export declare const withoutGroups: (nodes: readonly GraphNode[], local: Set<string> | undefined, hidden: readonly string[]) => Set<string> | undefined;
|
|
@@ -73,3 +73,32 @@ export const sortedOf = (nodes, lang) => {
|
|
|
73
73
|
const collator = new Intl.Collator(lang || undefined, { numeric: true, sensitivity: 'base' });
|
|
74
74
|
return [...nodes].sort((one, other) => collator.compare(nameOf(one), nameOf(other)));
|
|
75
75
|
};
|
|
76
|
+
export const groupsOf = (nodes) => {
|
|
77
|
+
const tones = new Map();
|
|
78
|
+
for (const node of nodes) {
|
|
79
|
+
if (node.group === undefined || node.group === '') {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const tone = node.tone ?? null;
|
|
83
|
+
if (!tones.has(node.group)) {
|
|
84
|
+
tones.set(node.group, tone);
|
|
85
|
+
}
|
|
86
|
+
else if (tones.get(node.group) !== tone) {
|
|
87
|
+
tones.set(node.group, null);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return [...tones.keys()].sort().map((name) => ({ name, tone: tones.get(name) ?? undefined }));
|
|
91
|
+
};
|
|
92
|
+
export const withoutGroups = (nodes, local, hidden) => {
|
|
93
|
+
if (hidden.length === 0) {
|
|
94
|
+
return local;
|
|
95
|
+
}
|
|
96
|
+
const off = new Set(hidden);
|
|
97
|
+
const kept = new Set();
|
|
98
|
+
for (const node of nodes) {
|
|
99
|
+
if ((local === undefined || local.has(node.id)) && !off.has(node.group ?? '')) {
|
|
100
|
+
kept.add(node.id);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return kept;
|
|
104
|
+
};
|
|
@@ -20,6 +20,10 @@ declare const HelixHeadlessGraph_base: (new (...args: any[]) => import("@fusion.
|
|
|
20
20
|
* Set `depth` to show the local graph: only the notes within that many links
|
|
21
21
|
* of the selected one.
|
|
22
22
|
*
|
|
23
|
+
* Set `legend` to name the groups over the drawing, each a button that shows
|
|
24
|
+
* or hides its notes. `hiddenGroups` holds the groups turned off, and the
|
|
25
|
+
* list holds only what the drawing shows.
|
|
26
|
+
*
|
|
23
27
|
* `nodes` and `links` are properties, never markup: a graph of ten thousand
|
|
24
28
|
* notes as ten thousand elements would cost what the renderer exists to save.
|
|
25
29
|
* The list draws only the rows in view.
|
|
@@ -41,6 +45,7 @@ declare const HelixHeadlessGraph_base: (new (...args: any[]) => import("@fusion.
|
|
|
41
45
|
*
|
|
42
46
|
* @event {HelixActivateEvent} helix-activate - A note was selected, in the list or in the drawing. The detail's `value` is its `id`.
|
|
43
47
|
* @event {HelixBeforeActivateEvent} helix-before-activate - A note is about to be selected. Cancelable: cancel it to keep the selection in your own state.
|
|
48
|
+
* @event {HelixGraphFilterEvent} helix-graph-filter - A group in the legend was pressed, to show or hide its notes. The detail's `hidden` is every group that would be hidden. Cancelable: cancel it to keep the groups as they were, or to set `hiddenGroups` yourself.
|
|
44
49
|
* @event {HelixGraphLayoutEvent} helix-graph-layout - A layout settled, with where it put each note, sent by `laidOut()`. Keep the positions and pass them back as each note's `x` and `y`, and `z` where a renderer draws in three dimensions.
|
|
45
50
|
* @event {HelixGraphPanEvent} helix-graph-pan - A pan button or arrow key was pressed. `connectGraph` moves the drawing.
|
|
46
51
|
* @event {HelixGraphPartChangeEvent} helix-graph-part-change - The notes, the links, the selection, the depth or the gestures changed. Used by `connectGraph`; pages do not need to listen for it.
|
|
@@ -60,6 +65,10 @@ declare const HelixHeadlessGraph_base: (new (...args: any[]) => import("@fusion.
|
|
|
60
65
|
* @csspart gesture-hint - Words over the graph for a moment when it lets a gesture pass to the page, such as how to zoom it.
|
|
61
66
|
* @csspart gesture-status - The line shown while a graph with `gestures="activate"` has the gestures.
|
|
62
67
|
* @csspart header - The strip above the graph.
|
|
68
|
+
* @csspart legend - The groups over the drawing, with `legend`, each a button that shows or hides its notes.
|
|
69
|
+
* @csspart legend-item - One group in the legend, pressed while its notes are shown. Carries `data-tone` where every note in the group has the same tone, which colors the notes over the group's own color.
|
|
70
|
+
* @csspart legend-item-hidden - A group in the legend whose notes are hidden.
|
|
71
|
+
* @csspart legend-swatch - The mark in a group's color, before its name.
|
|
63
72
|
* @csspart list - The list of notes, which draws only the rows in view.
|
|
64
73
|
* @csspart live - What screen readers hear when a search changes how many notes there are.
|
|
65
74
|
* @csspart note - One note in the list.
|
|
@@ -96,11 +105,20 @@ export declare class HelixHeadlessGraph extends HelixHeadlessGraph_base {
|
|
|
96
105
|
* shows every note. The list holds what the drawing shows.
|
|
97
106
|
*/
|
|
98
107
|
depth?: number;
|
|
108
|
+
/** The groups turned off in the legend, by name, whose notes neither the drawing nor the list shows. A property, never an attribute. */
|
|
109
|
+
hiddenGroups: readonly string[];
|
|
99
110
|
/**
|
|
100
111
|
* The graph's name, read by screen readers, such as "Research notes".
|
|
101
112
|
* Required.
|
|
102
113
|
*/
|
|
103
114
|
label: string;
|
|
115
|
+
/**
|
|
116
|
+
* Names the groups over the drawing, each a button in its color that shows
|
|
117
|
+
* or hides its notes. Drawn where the notes have two groups or more.
|
|
118
|
+
*/
|
|
119
|
+
legend: boolean;
|
|
120
|
+
/** The legend's name, read by screen readers. */
|
|
121
|
+
legendLabel: string;
|
|
104
122
|
/** How a note linked both to and from the selected one is described, with `{note}`. */
|
|
105
123
|
linkedBothLabel: string;
|
|
106
124
|
/** How a note the selected one links to is described, with `{note}`, the selected note's name. */
|
|
@@ -135,8 +153,14 @@ export declare class HelixHeadlessGraph extends HelixHeadlessGraph_base {
|
|
|
135
153
|
private sorted;
|
|
136
154
|
/** The list's rows, read again when anything they come from changes. */
|
|
137
155
|
private entries;
|
|
138
|
-
/** The notes the local graph
|
|
156
|
+
/** The notes the local graph and the legend keep, or `undefined` where neither leaves any out. */
|
|
139
157
|
private kept;
|
|
158
|
+
/**
|
|
159
|
+
* The groups the notes are in, each with the tone all its notes share
|
|
160
|
+
* where they share one. **In the order of their names**, which is the
|
|
161
|
+
* order `connectGraph` gives them their colors in.
|
|
162
|
+
*/
|
|
163
|
+
private groups;
|
|
140
164
|
/** Whether the graph has been drawn whole, which `drawn()` says. */
|
|
141
165
|
private whole;
|
|
142
166
|
/** How many notes there were when the count was last said. */
|
|
@@ -195,6 +219,14 @@ export declare class HelixHeadlessGraph extends HelixHeadlessGraph_base {
|
|
|
195
219
|
private countText;
|
|
196
220
|
/** How a row stands to the selected note, in words, or nothing where it does not. */
|
|
197
221
|
private relationText;
|
|
222
|
+
/** Shows a group's notes or hides them, through the request a page can refuse. */
|
|
223
|
+
private toggleGroup;
|
|
224
|
+
/**
|
|
225
|
+
* The groups over the drawing, with `legend`, each a button pressed while
|
|
226
|
+
* its notes are shown. **Nothing for one group or none**: a legend of one
|
|
227
|
+
* names what every note is, and turning it off empties the graph.
|
|
228
|
+
*/
|
|
229
|
+
private renderLegend;
|
|
198
230
|
/** Selects the note a row names, through the request a page can refuse. */
|
|
199
231
|
private choose;
|
|
200
232
|
/**
|
|
@@ -4,18 +4,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, fillTemplate, formatNumbers, HelixElement, HelixGraphLayoutEvent, HelixGraphPanEvent, HelixGraphPartChangeEvent, HelixGraphReadyEvent, HelixGraphSignalEvent, HelixGraphZoomEvent, MixinControllerActive, MixinViewport, VirtualizeController, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, fillTemplate, formatNumbers, HelixElement, HelixGraphFilterEvent, HelixGraphLayoutEvent, HelixGraphPanEvent, HelixGraphPartChangeEvent, HelixGraphReadyEvent, HelixGraphSignalEvent, HelixGraphZoomEvent, MixinControllerActive, MixinViewport, VirtualizeController, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { list, magnifyingGlass } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
11
11
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
12
|
-
import { adjacencyOf, entriesOf, nameOf, sortedOf, within, } from './graph-model.js';
|
|
12
|
+
import { adjacencyOf, entriesOf, groupsOf, nameOf, sortedOf, within, withoutGroups, } from './graph-model.js';
|
|
13
13
|
const PAGE = 10;
|
|
14
14
|
let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinControllerActive(HelixElement)) {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
this.countLabel = '{count} notes';
|
|
18
|
+
this.hiddenGroups = [];
|
|
18
19
|
this.label = '';
|
|
20
|
+
this.legend = false;
|
|
21
|
+
this.legendLabel = 'Groups';
|
|
19
22
|
this.linkedBothLabel = 'Linked both ways with {note}';
|
|
20
23
|
this.linkedFromLabel = 'Linked from {note}';
|
|
21
24
|
this.links = [];
|
|
@@ -31,6 +34,7 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
31
34
|
this.adjacency = new Map();
|
|
32
35
|
this.sorted = [];
|
|
33
36
|
this.entries = [];
|
|
37
|
+
this.groups = [];
|
|
34
38
|
this.whole = false;
|
|
35
39
|
this.said = '';
|
|
36
40
|
this.virtualize = new VirtualizeController(this, {
|
|
@@ -120,14 +124,17 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
120
124
|
if (changed.has('nodes')) {
|
|
121
125
|
this.sorted = sortedOf(this.nodes, this.closest?.('[lang]')?.getAttribute('lang') ?? '');
|
|
122
126
|
}
|
|
123
|
-
if (
|
|
127
|
+
if (changed.has('nodes')) {
|
|
128
|
+
this.groups = groupsOf(this.nodes);
|
|
129
|
+
}
|
|
130
|
+
if (['nodes', 'links', 'active', 'depth', 'hiddenGroups'].some((name) => changed.has(name))) {
|
|
124
131
|
const held = this.active !== '' && this.nodes.some((node) => node.id === this.active);
|
|
125
|
-
this.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
const local = typeof this.depth === 'number' && held
|
|
133
|
+
? within(this.adjacency, this.active, Math.max(0, this.depth))
|
|
134
|
+
: undefined;
|
|
135
|
+
this.kept = withoutGroups(this.nodes, local, this.hiddenGroups);
|
|
129
136
|
}
|
|
130
|
-
if (['nodes', 'links', 'active', 'depth', 'query'].some((name) => changed.has(name))) {
|
|
137
|
+
if (['nodes', 'links', 'active', 'depth', 'hiddenGroups', 'query'].some((name) => changed.has(name))) {
|
|
131
138
|
this.entries = entriesOf(this.sorted, this.adjacency, this.active, this.query, this.kept);
|
|
132
139
|
this.cursor = 0;
|
|
133
140
|
const list = this.partNamed('list');
|
|
@@ -142,7 +149,7 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
142
149
|
if (changed.has('nodes') || changed.has('links')) {
|
|
143
150
|
this.dispatchEvent(new HelixGraphPartChangeEvent({ kind: 'data' }));
|
|
144
151
|
}
|
|
145
|
-
else if (changed.has('active') || changed.has('depth')) {
|
|
152
|
+
else if (changed.has('active') || changed.has('depth') || changed.has('hiddenGroups')) {
|
|
146
153
|
this.dispatchEvent(new HelixGraphPartChangeEvent({ kind: 'focus' }));
|
|
147
154
|
}
|
|
148
155
|
if (changed.has('query') && changed.get('query') !== undefined) {
|
|
@@ -192,6 +199,34 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
192
199
|
return '';
|
|
193
200
|
}
|
|
194
201
|
}
|
|
202
|
+
toggleGroup(name) {
|
|
203
|
+
const hidden = this.hiddenGroups.includes(name)
|
|
204
|
+
? this.hiddenGroups.filter((group) => group !== name)
|
|
205
|
+
: [...this.hiddenGroups, name];
|
|
206
|
+
if (this.dispatchEvent(new HelixGraphFilterEvent({ hidden }))) {
|
|
207
|
+
this.hiddenGroups = hidden;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
renderLegend() {
|
|
211
|
+
if (!this.legend || this.groups.length < 2) {
|
|
212
|
+
return nothing;
|
|
213
|
+
}
|
|
214
|
+
const hidden = new Set(this.hiddenGroups);
|
|
215
|
+
return html `<div part="legend" role="group" aria-label=${this.legendLabel}>
|
|
216
|
+
${this.groups.map(({ name, tone }) => {
|
|
217
|
+
const shown = !hidden.has(name);
|
|
218
|
+
return html `<button
|
|
219
|
+
part="legend-item${shown ? '' : ' legend-item-hidden'}"
|
|
220
|
+
type="button"
|
|
221
|
+
aria-pressed=${shown ? 'true' : 'false'}
|
|
222
|
+
data-tone=${tone ?? nothing}
|
|
223
|
+
@click=${() => this.toggleGroup(name)}
|
|
224
|
+
>
|
|
225
|
+
<span part="legend-swatch" aria-hidden="true"></span>${name}
|
|
226
|
+
</button>`;
|
|
227
|
+
})}
|
|
228
|
+
</div>`;
|
|
229
|
+
}
|
|
195
230
|
choose(index) {
|
|
196
231
|
const entry = this.entries[index];
|
|
197
232
|
if (entry) {
|
|
@@ -300,7 +335,7 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
300
335
|
<slot></slot>
|
|
301
336
|
${this.renderGestures()}
|
|
302
337
|
</div>
|
|
303
|
-
${this.renderControls()}
|
|
338
|
+
${this.renderControls()} ${this.renderLegend()}
|
|
304
339
|
</div>
|
|
305
340
|
<div
|
|
306
341
|
part="panel"
|
|
@@ -352,9 +387,18 @@ __decorate([
|
|
|
352
387
|
__decorate([
|
|
353
388
|
property({ type: Number })
|
|
354
389
|
], HelixHeadlessGraph.prototype, "depth", void 0);
|
|
390
|
+
__decorate([
|
|
391
|
+
property({ attribute: false })
|
|
392
|
+
], HelixHeadlessGraph.prototype, "hiddenGroups", void 0);
|
|
355
393
|
__decorate([
|
|
356
394
|
property()
|
|
357
395
|
], HelixHeadlessGraph.prototype, "label", void 0);
|
|
396
|
+
__decorate([
|
|
397
|
+
property({ type: Boolean })
|
|
398
|
+
], HelixHeadlessGraph.prototype, "legend", void 0);
|
|
399
|
+
__decorate([
|
|
400
|
+
property({ attribute: 'legend-label' })
|
|
401
|
+
], HelixHeadlessGraph.prototype, "legendLabel", void 0);
|
|
358
402
|
__decorate([
|
|
359
403
|
property({ attribute: 'linked-both-label' })
|
|
360
404
|
], HelixHeadlessGraph.prototype, "linkedBothLabel", void 0);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix-headless",
|
|
3
3
|
"description": "Headless component tier. Structure, accessibility, state, and form participation. No styling.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.131.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
},
|
|
47
47
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@fusion.dev/helix-core": "0.
|
|
50
|
-
"@fusion.dev/helix-icons": "0.
|
|
49
|
+
"@fusion.dev/helix-core": "0.131.0",
|
|
50
|
+
"@fusion.dev/helix-icons": "0.131.0",
|
|
51
51
|
"uqr": "^0.1.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@fusion.dev/helix-cem": "0.
|
|
55
|
-
"@fusion.dev/helix-testing": "0.
|
|
54
|
+
"@fusion.dev/helix-cem": "0.131.0",
|
|
55
|
+
"@fusion.dev/helix-testing": "0.131.0",
|
|
56
56
|
"@fusion.dev/scripts": "0.0.0-dev",
|
|
57
57
|
"@happy-dom/global-registrator": "^20.0.0",
|
|
58
58
|
"@lit-labs/ssr": "^4.1.0",
|
package/types/jsx.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ import type {
|
|
|
36
36
|
HelixFacetEvent,
|
|
37
37
|
HelixFilterEvent,
|
|
38
38
|
HelixFormElement,
|
|
39
|
+
HelixGraphFilterEvent,
|
|
39
40
|
HelixGraphLayoutEvent,
|
|
40
41
|
HelixGraphPanEvent,
|
|
41
42
|
HelixGraphPartChangeEvent,
|
|
@@ -9375,6 +9376,9 @@ export type HelixHeadlessGraphHelixActivateElementEvent =
|
|
|
9375
9376
|
/** `helix-before-activate` event type */
|
|
9376
9377
|
export type HelixHeadlessGraphHelixBeforeActivateElementEvent =
|
|
9377
9378
|
HelixHeadlessGraphElementEvent<HelixBeforeActivateEvent>;
|
|
9379
|
+
/** `helix-graph-filter` event type */
|
|
9380
|
+
export type HelixHeadlessGraphHelixGraphFilterElementEvent =
|
|
9381
|
+
HelixHeadlessGraphElementEvent<HelixGraphFilterEvent>;
|
|
9378
9382
|
/** `helix-graph-layout` event type */
|
|
9379
9383
|
export type HelixHeadlessGraphHelixGraphLayoutElementEvent =
|
|
9380
9384
|
HelixHeadlessGraphElementEvent<HelixGraphLayoutEvent>;
|
|
@@ -9405,6 +9409,13 @@ shows every note. The list holds what the drawing shows. */
|
|
|
9405
9409
|
/** The graph's name, read by screen readers, such as "Research notes".
|
|
9406
9410
|
Required. */
|
|
9407
9411
|
label?: (HelixHeadlessGraph["label"]) | undefined;
|
|
9412
|
+
/** Names the groups over the drawing, each a button in its color that shows
|
|
9413
|
+
or hides its notes. Drawn where the notes have two groups or more. */
|
|
9414
|
+
legend?: (HelixHeadlessGraph["legend"]) | undefined;
|
|
9415
|
+
/** The legend's name, read by screen readers. */
|
|
9416
|
+
"legend-label"?: (HelixHeadlessGraph["legendLabel"]) | undefined;
|
|
9417
|
+
/** The legend's name, read by screen readers. */
|
|
9418
|
+
legendLabel?: (HelixHeadlessGraph["legendLabel"]) | undefined;
|
|
9408
9419
|
/** How a note linked both to and from the selected one is described, with `{note}`. */
|
|
9409
9420
|
"linked-both-label"?: (HelixHeadlessGraph["linkedBothLabel"]) | undefined;
|
|
9410
9421
|
/** How a note linked both to and from the selected one is described, with `{note}`. */
|
|
@@ -9626,6 +9637,8 @@ Ignored once `active` is written. */
|
|
|
9626
9637
|
|
|
9627
9638
|
Ignored once `active` is written. */
|
|
9628
9639
|
defaultActive?: (HelixHeadlessGraph["defaultActive"]) | undefined;
|
|
9640
|
+
/** The groups turned off in the legend, by name, whose notes neither the drawing nor the list shows. A property, never an attribute. */
|
|
9641
|
+
hiddenGroups?: (HelixHeadlessGraph["hiddenGroups"]) | undefined;
|
|
9629
9642
|
/** The links between notes, each from `source` to `target`. A property, never an attribute. */
|
|
9630
9643
|
links?: (HelixHeadlessGraph["links"]) | undefined;
|
|
9631
9644
|
/** The notes. A property, never an attribute. */
|
|
@@ -9637,6 +9650,10 @@ Ignored once `active` is written. */
|
|
|
9637
9650
|
"onhelix-before-activate"?: ((
|
|
9638
9651
|
e: HelixHeadlessGraphHelixBeforeActivateElementEvent,
|
|
9639
9652
|
) => void) | undefined;
|
|
9653
|
+
/** A group in the legend was pressed, to show or hide its notes. The detail's `hidden` is every group that would be hidden. Cancelable: cancel it to keep the groups as they were, or to set `hiddenGroups` yourself. */
|
|
9654
|
+
"onhelix-graph-filter"?: ((
|
|
9655
|
+
e: HelixHeadlessGraphHelixGraphFilterElementEvent,
|
|
9656
|
+
) => void) | undefined;
|
|
9640
9657
|
/** A layout settled, with where it put each note, sent by `laidOut()`. Keep the positions and pass them back as each note's `x` and `y`, and `z` where a renderer draws in three dimensions. */
|
|
9641
9658
|
"onhelix-graph-layout"?: ((
|
|
9642
9659
|
e: HelixHeadlessGraphHelixGraphLayoutElementEvent,
|
|
@@ -9674,6 +9691,13 @@ shows every note. The list holds what the drawing shows. */
|
|
|
9674
9691
|
/** The graph's name, read by screen readers, such as "Research notes".
|
|
9675
9692
|
Required. */
|
|
9676
9693
|
"prop:label"?: (HelixHeadlessGraph["label"]) | undefined;
|
|
9694
|
+
/** Names the groups over the drawing, each a button in its color that shows
|
|
9695
|
+
or hides its notes. Drawn where the notes have two groups or more. */
|
|
9696
|
+
"prop:legend"?: (HelixHeadlessGraph["legend"]) | undefined;
|
|
9697
|
+
/** The legend's name, read by screen readers. */
|
|
9698
|
+
"attr:legend-label"?: (HelixHeadlessGraph["legendLabel"]) | undefined;
|
|
9699
|
+
/** The legend's name, read by screen readers. */
|
|
9700
|
+
"prop:legendLabel"?: (HelixHeadlessGraph["legendLabel"]) | undefined;
|
|
9677
9701
|
/** How a note linked both to and from the selected one is described, with `{note}`. */
|
|
9678
9702
|
"attr:linked-both-label"?: (HelixHeadlessGraph["linkedBothLabel"]) | undefined;
|
|
9679
9703
|
/** How a note linked both to and from the selected one is described, with `{note}`. */
|
|
@@ -9895,6 +9919,8 @@ Ignored once `active` is written. */
|
|
|
9895
9919
|
|
|
9896
9920
|
Ignored once `active` is written. */
|
|
9897
9921
|
"prop:defaultActive"?: (HelixHeadlessGraph["defaultActive"]) | undefined;
|
|
9922
|
+
/** The groups turned off in the legend, by name, whose notes neither the drawing nor the list shows. A property, never an attribute. */
|
|
9923
|
+
"prop:hiddenGroups"?: (HelixHeadlessGraph["hiddenGroups"]) | undefined;
|
|
9898
9924
|
/** The links between notes, each from `source` to `target`. A property, never an attribute. */
|
|
9899
9925
|
"prop:links"?: (HelixHeadlessGraph["links"]) | undefined;
|
|
9900
9926
|
/** The notes. A property, never an attribute. */
|
|
@@ -9907,6 +9933,10 @@ Ignored once `active` is written. */
|
|
|
9907
9933
|
"on:helix-before-activate"?: ((
|
|
9908
9934
|
e: HelixHeadlessGraphHelixBeforeActivateElementEvent,
|
|
9909
9935
|
) => void) | undefined;
|
|
9936
|
+
/** A group in the legend was pressed, to show or hide its notes. The detail's `hidden` is every group that would be hidden. Cancelable: cancel it to keep the groups as they were, or to set `hiddenGroups` yourself. */
|
|
9937
|
+
"on:helix-graph-filter"?: ((
|
|
9938
|
+
e: HelixHeadlessGraphHelixGraphFilterElementEvent,
|
|
9939
|
+
) => void) | undefined;
|
|
9910
9940
|
/** A layout settled, with where it put each note, sent by `laidOut()`. Keep the positions and pass them back as each note's `x` and `y`, and `z` where a renderer draws in three dimensions. */
|
|
9911
9941
|
"on:helix-graph-layout"?: ((
|
|
9912
9942
|
e: HelixHeadlessGraphHelixGraphLayoutElementEvent,
|
|
@@ -31260,6 +31290,10 @@ export type CustomElements = {
|
|
|
31260
31290
|
* Set `depth` to show the local graph: only the notes within that many links
|
|
31261
31291
|
* of the selected one.
|
|
31262
31292
|
*
|
|
31293
|
+
* Set `legend` to name the groups over the drawing, each a button that shows
|
|
31294
|
+
* or hides its notes. `hiddenGroups` holds the groups turned off, and the
|
|
31295
|
+
* list holds only what the drawing shows.
|
|
31296
|
+
*
|
|
31263
31297
|
* `nodes` and `links` are properties, never markup: a graph of ten thousand
|
|
31264
31298
|
* notes as ten thousand elements would cost what the renderer exists to save.
|
|
31265
31299
|
* The list draws only the rows in view.
|
|
@@ -31277,6 +31311,9 @@ export type CustomElements = {
|
|
|
31277
31311
|
* shows every note. The list holds what the drawing shows.
|
|
31278
31312
|
* - `label`: The graph's name, read by screen readers, such as "Research notes".
|
|
31279
31313
|
* Required.
|
|
31314
|
+
* - `legend`: Names the groups over the drawing, each a button in its color that shows
|
|
31315
|
+
* or hides its notes. Drawn where the notes have two groups or more.
|
|
31316
|
+
* - `legend-label`/`legendLabel`: The legend's name, read by screen readers.
|
|
31280
31317
|
* - `linked-both-label`/`linkedBothLabel`: How a note linked both to and from the selected one is described, with `{note}`.
|
|
31281
31318
|
* - `linked-from-label`/`linkedFromLabel`: How a note the selected one links to is described, with `{note}`, the selected note's name.
|
|
31282
31319
|
* - `links-to-label`/`linksToLabel`: How a note that links to the selected one is described, with `{note}`.
|
|
@@ -31387,6 +31424,7 @@ export type CustomElements = {
|
|
|
31387
31424
|
* - `default-active`/`defaultActive`: The `value` of the item declared current in markup.
|
|
31388
31425
|
*
|
|
31389
31426
|
* Ignored once `active` is written.
|
|
31427
|
+
* - `hiddenGroups`: The groups turned off in the legend, by name, whose notes neither the drawing nor the list shows. A property, never an attribute. (property only)
|
|
31390
31428
|
* - `links`: The links between notes, each from `source` to `target`. A property, never an attribute. (property only)
|
|
31391
31429
|
* - `nodes`: The notes. A property, never an attribute. (property only)
|
|
31392
31430
|
* - `ready`: Whether the graph has been drawn whole. For code that runs after `helix-graph-ready`. (property only) (readonly)
|
|
@@ -31417,6 +31455,7 @@ export type CustomElements = {
|
|
|
31417
31455
|
*
|
|
31418
31456
|
* - `helix-activate`: A note was selected, in the list or in the drawing. The detail's `value` is its `id`.
|
|
31419
31457
|
* - `helix-before-activate`: A note is about to be selected. Cancelable: cancel it to keep the selection in your own state.
|
|
31458
|
+
* - `helix-graph-filter`: A group in the legend was pressed, to show or hide its notes. The detail's `hidden` is every group that would be hidden. Cancelable: cancel it to keep the groups as they were, or to set `hiddenGroups` yourself.
|
|
31420
31459
|
* - `helix-graph-layout`: A layout settled, with where it put each note, sent by `laidOut()`. Keep the positions and pass them back as each note's `x` and `y`, and `z` where a renderer draws in three dimensions.
|
|
31421
31460
|
* - `helix-graph-pan`: A pan button or arrow key was pressed. `connectGraph` moves the drawing.
|
|
31422
31461
|
* - `helix-graph-part-change`: The notes, the links, the selection, the depth or the gestures changed. Used by `connectGraph`; pages do not need to listen for it.
|
|
@@ -31482,6 +31521,10 @@ export type CustomElements = {
|
|
|
31482
31521
|
* - `gesture-hint`: Words over the graph for a moment when it lets a gesture pass to the page, such as how to zoom it.
|
|
31483
31522
|
* - `gesture-status`: The line shown while a graph with `gestures="activate"` has the gestures.
|
|
31484
31523
|
* - `header`: The strip above the graph.
|
|
31524
|
+
* - `legend`: The groups over the drawing, with `legend`, each a button that shows or hides its notes.
|
|
31525
|
+
* - `legend-item`: One group in the legend, pressed while its notes are shown. Carries `data-tone` where every note in the group has the same tone, which colors the notes over the group's own color.
|
|
31526
|
+
* - `legend-item-hidden`: A group in the legend whose notes are hidden.
|
|
31527
|
+
* - `legend-swatch`: The mark in a group's color, before its name.
|
|
31485
31528
|
* - `list`: The list of notes, which draws only the rows in view.
|
|
31486
31529
|
* - `live`: What screen readers hear when a search changes how many notes there are.
|
|
31487
31530
|
* - `note`: One note in the list.
|
|
@@ -51641,6 +51684,10 @@ export type CustomElementsSolidJs = {
|
|
|
51641
51684
|
* Set `depth` to show the local graph: only the notes within that many links
|
|
51642
51685
|
* of the selected one.
|
|
51643
51686
|
*
|
|
51687
|
+
* Set `legend` to name the groups over the drawing, each a button that shows
|
|
51688
|
+
* or hides its notes. `hiddenGroups` holds the groups turned off, and the
|
|
51689
|
+
* list holds only what the drawing shows.
|
|
51690
|
+
*
|
|
51644
51691
|
* `nodes` and `links` are properties, never markup: a graph of ten thousand
|
|
51645
51692
|
* notes as ten thousand elements would cost what the renderer exists to save.
|
|
51646
51693
|
* The list draws only the rows in view.
|
|
@@ -51658,6 +51705,9 @@ export type CustomElementsSolidJs = {
|
|
|
51658
51705
|
* shows every note. The list holds what the drawing shows.
|
|
51659
51706
|
* - `label`: The graph's name, read by screen readers, such as "Research notes".
|
|
51660
51707
|
* Required.
|
|
51708
|
+
* - `legend`: Names the groups over the drawing, each a button in its color that shows
|
|
51709
|
+
* or hides its notes. Drawn where the notes have two groups or more.
|
|
51710
|
+
* - `legend-label`/`legendLabel`: The legend's name, read by screen readers.
|
|
51661
51711
|
* - `linked-both-label`/`linkedBothLabel`: How a note linked both to and from the selected one is described, with `{note}`.
|
|
51662
51712
|
* - `linked-from-label`/`linkedFromLabel`: How a note the selected one links to is described, with `{note}`, the selected note's name.
|
|
51663
51713
|
* - `links-to-label`/`linksToLabel`: How a note that links to the selected one is described, with `{note}`.
|
|
@@ -51768,6 +51818,7 @@ export type CustomElementsSolidJs = {
|
|
|
51768
51818
|
* - `default-active`/`defaultActive`: The `value` of the item declared current in markup.
|
|
51769
51819
|
*
|
|
51770
51820
|
* Ignored once `active` is written.
|
|
51821
|
+
* - `hiddenGroups`: The groups turned off in the legend, by name, whose notes neither the drawing nor the list shows. A property, never an attribute. (property only)
|
|
51771
51822
|
* - `links`: The links between notes, each from `source` to `target`. A property, never an attribute. (property only)
|
|
51772
51823
|
* - `nodes`: The notes. A property, never an attribute. (property only)
|
|
51773
51824
|
* - `ready`: Whether the graph has been drawn whole. For code that runs after `helix-graph-ready`. (property only) (readonly)
|
|
@@ -51798,6 +51849,7 @@ export type CustomElementsSolidJs = {
|
|
|
51798
51849
|
*
|
|
51799
51850
|
* - `helix-activate`: A note was selected, in the list or in the drawing. The detail's `value` is its `id`.
|
|
51800
51851
|
* - `helix-before-activate`: A note is about to be selected. Cancelable: cancel it to keep the selection in your own state.
|
|
51852
|
+
* - `helix-graph-filter`: A group in the legend was pressed, to show or hide its notes. The detail's `hidden` is every group that would be hidden. Cancelable: cancel it to keep the groups as they were, or to set `hiddenGroups` yourself.
|
|
51801
51853
|
* - `helix-graph-layout`: A layout settled, with where it put each note, sent by `laidOut()`. Keep the positions and pass them back as each note's `x` and `y`, and `z` where a renderer draws in three dimensions.
|
|
51802
51854
|
* - `helix-graph-pan`: A pan button or arrow key was pressed. `connectGraph` moves the drawing.
|
|
51803
51855
|
* - `helix-graph-part-change`: The notes, the links, the selection, the depth or the gestures changed. Used by `connectGraph`; pages do not need to listen for it.
|
|
@@ -51863,6 +51915,10 @@ export type CustomElementsSolidJs = {
|
|
|
51863
51915
|
* - `gesture-hint`: Words over the graph for a moment when it lets a gesture pass to the page, such as how to zoom it.
|
|
51864
51916
|
* - `gesture-status`: The line shown while a graph with `gestures="activate"` has the gestures.
|
|
51865
51917
|
* - `header`: The strip above the graph.
|
|
51918
|
+
* - `legend`: The groups over the drawing, with `legend`, each a button that shows or hides its notes.
|
|
51919
|
+
* - `legend-item`: One group in the legend, pressed while its notes are shown. Carries `data-tone` where every note in the group has the same tone, which colors the notes over the group's own color.
|
|
51920
|
+
* - `legend-item-hidden`: A group in the legend whose notes are hidden.
|
|
51921
|
+
* - `legend-swatch`: The mark in a group's color, before its name.
|
|
51866
51922
|
* - `list`: The list of notes, which draws only the rows in view.
|
|
51867
51923
|
* - `live`: What screen readers hear when a search changes how many notes there are.
|
|
51868
51924
|
* - `note`: One note in the list.
|
package/types/vue.d.ts
CHANGED
|
@@ -196,6 +196,7 @@ import type {
|
|
|
196
196
|
HelixFacetEvent,
|
|
197
197
|
HelixActivateEvent,
|
|
198
198
|
HelixBeforeActivateEvent,
|
|
199
|
+
HelixGraphFilterEvent,
|
|
199
200
|
HelixGraphLayoutEvent,
|
|
200
201
|
HelixGraphPanEvent,
|
|
201
202
|
HelixGraphPartChangeEvent,
|
|
@@ -4811,6 +4812,9 @@ export type HelixHeadlessGraphHelixActivateElementEvent =
|
|
|
4811
4812
|
/** `helix-before-activate` event type */
|
|
4812
4813
|
export type HelixHeadlessGraphHelixBeforeActivateElementEvent =
|
|
4813
4814
|
HelixHeadlessGraphElementEvent<HelixBeforeActivateEvent>;
|
|
4815
|
+
/** `helix-graph-filter` event type */
|
|
4816
|
+
export type HelixHeadlessGraphHelixGraphFilterElementEvent =
|
|
4817
|
+
HelixHeadlessGraphElementEvent<HelixGraphFilterEvent>;
|
|
4814
4818
|
/** `helix-graph-layout` event type */
|
|
4815
4819
|
export type HelixHeadlessGraphHelixGraphLayoutElementEvent =
|
|
4816
4820
|
HelixHeadlessGraphElementEvent<HelixGraphLayoutEvent>;
|
|
@@ -4841,6 +4845,13 @@ shows every note. The list holds what the drawing shows. */
|
|
|
4841
4845
|
/** The graph's name, read by screen readers, such as "Research notes".
|
|
4842
4846
|
Required. */
|
|
4843
4847
|
label?: (HelixHeadlessGraph["label"]) | undefined;
|
|
4848
|
+
/** Names the groups over the drawing, each a button in its color that shows
|
|
4849
|
+
or hides its notes. Drawn where the notes have two groups or more. */
|
|
4850
|
+
legend?: (HelixHeadlessGraph["legend"]) | undefined;
|
|
4851
|
+
/** The legend's name, read by screen readers. */
|
|
4852
|
+
"legend-label"?: (HelixHeadlessGraph["legendLabel"]) | undefined;
|
|
4853
|
+
/** The legend's name, read by screen readers. */
|
|
4854
|
+
legendLabel?: (HelixHeadlessGraph["legendLabel"]) | undefined;
|
|
4844
4855
|
/** How a note linked both to and from the selected one is described, with `{note}`. */
|
|
4845
4856
|
"linked-both-label"?: (HelixHeadlessGraph["linkedBothLabel"]) | undefined;
|
|
4846
4857
|
/** How a note linked both to and from the selected one is described, with `{note}`. */
|
|
@@ -5062,6 +5073,8 @@ Ignored once `active` is written. */
|
|
|
5062
5073
|
|
|
5063
5074
|
Ignored once `active` is written. */
|
|
5064
5075
|
defaultActive?: (HelixHeadlessGraph["defaultActive"]) | undefined;
|
|
5076
|
+
/** The groups turned off in the legend, by name, whose notes neither the drawing nor the list shows. A property, never an attribute. */
|
|
5077
|
+
hiddenGroups?: (HelixHeadlessGraph["hiddenGroups"]) | undefined;
|
|
5065
5078
|
/** The links between notes, each from `source` to `target`. A property, never an attribute. */
|
|
5066
5079
|
links?: (HelixHeadlessGraph["links"]) | undefined;
|
|
5067
5080
|
/** The notes. A property, never an attribute. */
|
|
@@ -5073,6 +5086,8 @@ export type HelixHeadlessGraphVueEvents = {
|
|
|
5073
5086
|
"helix-activate": HelixHeadlessGraphHelixActivateElementEvent;
|
|
5074
5087
|
/** A note is about to be selected. Cancelable: cancel it to keep the selection in your own state. */
|
|
5075
5088
|
"helix-before-activate": HelixHeadlessGraphHelixBeforeActivateElementEvent;
|
|
5089
|
+
/** A group in the legend was pressed, to show or hide its notes. The detail's `hidden` is every group that would be hidden. Cancelable: cancel it to keep the groups as they were, or to set `hiddenGroups` yourself. */
|
|
5090
|
+
"helix-graph-filter": HelixHeadlessGraphHelixGraphFilterElementEvent;
|
|
5076
5091
|
/** A layout settled, with where it put each note, sent by `laidOut()`. Keep the positions and pass them back as each note's `x` and `y`, and `z` where a renderer draws in three dimensions. */
|
|
5077
5092
|
"helix-graph-layout": HelixHeadlessGraphHelixGraphLayoutElementEvent;
|
|
5078
5093
|
/** A pan button or arrow key was pressed. `connectGraph` moves the drawing. */
|
|
@@ -12456,7 +12471,7 @@ export interface WcToolkitVueGlobalComponents {
|
|
|
12456
12471
|
HelixHeadlessFormatDateVueProps,
|
|
12457
12472
|
HelixHeadlessFormatDateVueEvents
|
|
12458
12473
|
>;
|
|
12459
|
-
/** Helix draws no graph. A force layout of thousands of notes is physics and WebGL, which a renderer such as Sigma.js does. Put the renderer's box in the frame, and 'connectGraph' from '@fusion.dev/helix-graph' draws 'nodes' and 'links' in it and keeps it in step with the frame. What the frame adds is what a drawing of a graph cannot do: a list of every note beside it, which is the graph for a screen reader and a quick way to find a note for anyone. The selected note comes first, then the notes it links to and from, then every other note, and the search field narrows it. Selecting a note in the list or in the drawing is the same selection. Set 'depth' to show the local graph: only the notes within that many links of the selected one. 'nodes' and 'links' are properties, never markup: a graph of ten thousand notes as ten thousand elements would cost what the renderer exists to save. The list draws only the rows in view. The list scrolls on this tier. It carries 'data-scroller', and 'core' ships '[data-scroller] { overflow: auto }' into every shadow root. You still need to set a block size on the list, or it grows to hold every row. */
|
|
12474
|
+
/** Helix draws no graph. A force layout of thousands of notes is physics and WebGL, which a renderer such as Sigma.js does. Put the renderer's box in the frame, and 'connectGraph' from '@fusion.dev/helix-graph' draws 'nodes' and 'links' in it and keeps it in step with the frame. What the frame adds is what a drawing of a graph cannot do: a list of every note beside it, which is the graph for a screen reader and a quick way to find a note for anyone. The selected note comes first, then the notes it links to and from, then every other note, and the search field narrows it. Selecting a note in the list or in the drawing is the same selection. Set 'depth' to show the local graph: only the notes within that many links of the selected one. Set 'legend' to name the groups over the drawing, each a button that shows or hides its notes. 'hiddenGroups' holds the groups turned off, and the list holds only what the drawing shows. 'nodes' and 'links' are properties, never markup: a graph of ten thousand notes as ten thousand elements would cost what the renderer exists to save. The list draws only the rows in view. The list scrolls on this tier. It carries 'data-scroller', and 'core' ships '[data-scroller] { overflow: auto }' into every shadow root. You still need to set a block size on the list, or it grows to hold every row. */
|
|
12460
12475
|
"helix-headless-graph": DefineCustomElement<
|
|
12461
12476
|
HelixHeadlessGraph,
|
|
12462
12477
|
HelixHeadlessGraphVueProps,
|