@fusion.dev/helix-docs 0.129.1 → 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/content/graphs.mdx +40 -1
- package/content/metrics.mdx +221 -221
- package/dist/sources.generated.js +261 -222
- package/package.json +9 -9
package/content/graphs.mdx
CHANGED
|
@@ -179,6 +179,33 @@ Set a default for every note with the driver's options, such as
|
|
|
179
179
|
`sigmaDriver(sigma, { material: 'glass', shape: 'circle' })`. cosmos.gl draws a
|
|
180
180
|
note's `shape` and not its `emphasis` or `material`.
|
|
181
181
|
|
|
182
|
+
## Show a legend
|
|
183
|
+
|
|
184
|
+
Set `legend` to name the groups over the drawing, each in its color. Each name
|
|
185
|
+
is a button that shows or hides the group's notes, in the drawing and in the
|
|
186
|
+
list:
|
|
187
|
+
|
|
188
|
+
```html
|
|
189
|
+
<helix-graph label="Company notes" legend>
|
|
190
|
+
<div></div>
|
|
191
|
+
</helix-graph>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`hiddenGroups` holds the names of the groups turned off. Set it to start with
|
|
195
|
+
some hidden. A press sends `helix-graph-filter` first, with every group that
|
|
196
|
+
would be hidden. Cancel it to keep the groups as they were, or to keep them in
|
|
197
|
+
your own state and set `hiddenGroups` yourself:
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
frame.addEventListener('helix-graph-filter', (event) => {
|
|
201
|
+
event.preventDefault()
|
|
202
|
+
frame.hiddenGroups = event.detail.hidden
|
|
203
|
+
})
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The legend is drawn where the notes have two groups or more. On a frame
|
|
207
|
+
narrower than 40rem it is one row, which scrolls.
|
|
208
|
+
|
|
182
209
|
## Select a note
|
|
183
210
|
|
|
184
211
|
Pressing a note selects it, and pressing where no note is clears the selection.
|
|
@@ -205,6 +232,16 @@ for a graph too large to read at once:
|
|
|
205
232
|
</helix-graph>
|
|
206
233
|
```
|
|
207
234
|
|
|
235
|
+
The selected note lights the notes it links to and from. Pass `reach` to
|
|
236
|
+
`connectGraph` to light more: `upstream` lights every note a path of links
|
|
237
|
+
leads from to the selected one, and `downstream` every note a path leads to
|
|
238
|
+
from it. Where each link runs from what a note was derived from to the note,
|
|
239
|
+
`upstream` lights everything the note came from:
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
connectGraph(frame, sigmaDriver(sigma), { reach: 'upstream' })
|
|
243
|
+
```
|
|
244
|
+
|
|
208
245
|
## Draw the notes in a shape
|
|
209
246
|
|
|
210
247
|
Pass a `stencil` and the connector places the notes in its shape from the first
|
|
@@ -230,7 +267,9 @@ connectGraph(frame, driver, {
|
|
|
230
267
|
|
|
231
268
|
With three.js, place the notes on the surface of a 3D model.
|
|
232
269
|
`shapeFromModel` reads a `.glb` or `.gltf` file, and is in its own entry,
|
|
233
|
-
`@fusion.dev/helix-graph/model`, since it loads three.js
|
|
270
|
+
`@fusion.dev/helix-graph/model`, since it loads three.js. It reads a model
|
|
271
|
+
compressed with meshopt, as `gltfpack` writes one, which is often a third of
|
|
272
|
+
the size:
|
|
234
273
|
|
|
235
274
|
```js
|
|
236
275
|
import { shapeFromModel } from '@fusion.dev/helix-graph/model'
|