@fusion.dev/helix-docs 0.185.0 → 0.186.1
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/building-on-the-headless-tier.mdx +2 -2
- package/content/charting.mdx +17 -0
- package/content/graphs.mdx +73 -3
- package/content/iconography.mdx +9 -29
- package/content/metrics.mdx +227 -225
- package/dist/pages.generated.js +1 -1
- package/dist/sources.generated.js +328 -259
- package/package.json +9 -9
|
@@ -53,11 +53,11 @@ open.
|
|
|
53
53
|
|
|
54
54
|
[//]: # (renders)
|
|
55
55
|
|
|
56
|
-
**
|
|
56
|
+
**32 of the 99 headless families interpolate another family's tag**, across 22 distinct children.
|
|
57
57
|
|
|
58
58
|
| Family | Renders |
|
|
59
59
|
|---|---|
|
|
60
|
-
| `area-chart`, `bar-chart`, `copy-button`, `donut-chart`, `heatmap`, `line-chart`, `scatter-chart` | `tooltip` |
|
|
60
|
+
| `area-chart`, `bar-chart`, `copy-button`, `donut-chart`, `heatmap`, `isometric-heatmap`, `line-chart`, `scatter-chart` | `tooltip` |
|
|
61
61
|
| `breadcrumbs` | `breadcrumb` |
|
|
62
62
|
| `chat` | `chat-message` |
|
|
63
63
|
| `checkbox-group`, `table` | `checkbox` |
|
package/content/charting.mdx
CHANGED
|
@@ -14,6 +14,7 @@ Helix has these chart families, and each one has its own API page:
|
|
|
14
14
|
- `Scatter Chart`
|
|
15
15
|
- `Donut Chart`
|
|
16
16
|
- `Heatmap`
|
|
17
|
+
- `Isometric Heatmap`
|
|
17
18
|
- `Sparkline`
|
|
18
19
|
- `Trend`
|
|
19
20
|
- `Legend`, which all of the charts share
|
|
@@ -39,6 +40,11 @@ Choose a chart by the question it answers.
|
|
|
39
40
|
- **Whether two measures relate.** `Scatter Chart`, with one point per row.
|
|
40
41
|
- **How each day or check went.** `Heatmap`, for uptime, contributions, or
|
|
41
42
|
activity.
|
|
43
|
+
- **The same days, as a relief.** `Isometric Heatmap` reads the same table as
|
|
44
|
+
`Heatmap` and draws each reading as a prism as tall as its value. Use it where
|
|
45
|
+
the overall shape matters more than any one exact value, such as a busy
|
|
46
|
+
stretch in a year of commits. The tooltip and the table carry the exact
|
|
47
|
+
values.
|
|
42
48
|
- **The shape of a series beside its number.** `Sparkline`, drawn with no axes.
|
|
43
49
|
Use `Trend` to show which way one measurement moved and whether that is good
|
|
44
50
|
news.
|
|
@@ -81,6 +87,17 @@ table should not be seen, hide it visually, and the data is still there:
|
|
|
81
87
|
>…</table>
|
|
82
88
|
```
|
|
83
89
|
|
|
90
|
+
A table hidden this way takes no room on the page, however many rows it has.
|
|
91
|
+
Inside an element with a `transform` or a `filter`, a long hidden table still
|
|
92
|
+
lengthens that element's scrolling area. Wrap the table in a hidden `<div>`
|
|
93
|
+
there:
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<div data-hidden-visually>
|
|
97
|
+
<table id="revenue">…</table>
|
|
98
|
+
</div>
|
|
99
|
+
```
|
|
100
|
+
|
|
84
101
|
The table's caption becomes the chart's accessible name unless you set `label`.
|
|
85
102
|
The caption usually has the right words already.
|
|
86
103
|
|
package/content/graphs.mdx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Add interactive graphs to your site, styled with your theme and drawn by Sigma.js, cosmos.gl,
|
|
2
|
+
description: Add interactive graphs and isometric diagrams to your site, styled with your theme and drawn by Sigma.js, cosmos.gl, three.js, or Helix.
|
|
3
3
|
section: Essentials
|
|
4
4
|
title: Graphs
|
|
5
5
|
---
|
|
@@ -7,7 +7,7 @@ title: Graphs
|
|
|
7
7
|
# Graphs
|
|
8
8
|
|
|
9
9
|
Helix Graph puts a frame around a graph drawn by Sigma.js, cosmos.gl, three.js,
|
|
10
|
-
|
|
10
|
+
a renderer of your own, or Helix's own isometric diagram. The frame adds a searchable list of every note, zoom
|
|
11
11
|
and fullscreen buttons, and keyboard controls. You give the frame notes and
|
|
12
12
|
links, and `@fusion.dev/helix-graph` draws them with the renderer, colored by
|
|
13
13
|
your theme.
|
|
@@ -81,6 +81,7 @@ thousands of notes written as markup would be thousands of elements.
|
|
|
81
81
|
| Sigma.js | Graphs of thousands of notes | `sigma graphology graphology-layout-forceatlas2` | `sigmaDriver` from `@fusion.dev/helix-graph/sigma` |
|
|
82
82
|
| cosmos.gl | Graphs of tens of thousands of notes or more, laid out on the GPU | `@cosmos.gl/graph` | `cosmosDriver` from `@fusion.dev/helix-graph/cosmos` |
|
|
83
83
|
| three.js | Graphs in 3D, and graphs on the surface of a 3D model | `three d3-force-3d` | `threeDriver` from `@fusion.dev/helix-graph/three` |
|
|
84
|
+
| Helix, in SVG | Architecture and flow diagrams of up to a few hundred notes, drawn as solids on an isometric floor | Nothing more | `isometricDriver` from `@fusion.dev/helix-graph/isometric` |
|
|
84
85
|
|
|
85
86
|
None of the renderers is bundled with Helix, so you can use the version you
|
|
86
87
|
already have.
|
|
@@ -105,9 +106,78 @@ const connection = connectGraph(frame, threeDriver(frame.querySelector('div')))
|
|
|
105
106
|
```
|
|
106
107
|
|
|
107
108
|
Drag to turn a 3D graph, and use the wheel or a pinch to zoom. It turns slowly
|
|
108
|
-
on its own
|
|
109
|
+
on its own for its first five seconds, and stops as soon as someone handles it.
|
|
110
|
+
It does not turn for a reader who asked for reduced motion. Set
|
|
109
111
|
`autoRotate: false` to keep it still.
|
|
110
112
|
|
|
113
|
+
A 3D graph draws only while something moves. Every 3D graph on a page shares
|
|
114
|
+
six WebGL contexts: past six, a graph far off screen gives its context back
|
|
115
|
+
and takes it again as it comes near.
|
|
116
|
+
|
|
117
|
+
## Draw an isometric diagram
|
|
118
|
+
|
|
119
|
+
`isometricDriver` draws the graph as an isometric diagram in SVG, with nothing
|
|
120
|
+
more to install. Pass it the box:
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
import { isometricDriver } from '@fusion.dev/helix-graph/isometric'
|
|
124
|
+
|
|
125
|
+
frame.nodes = [
|
|
126
|
+
{ id: 'gateway', label: 'API gateway', group: 'Edge', x: 0, y: 0 },
|
|
127
|
+
{ id: 'orders', label: 'Orders', group: 'Services', x: 3, y: 0 },
|
|
128
|
+
{ id: 'ledger', label: 'Order ledger', group: 'Data', shape: 'circle', x: 6, y: 0 },
|
|
129
|
+
]
|
|
130
|
+
frame.links = [
|
|
131
|
+
{ source: 'gateway', target: 'orders' },
|
|
132
|
+
{ source: 'orders', target: 'ledger' },
|
|
133
|
+
]
|
|
134
|
+
const connection = connectGraph(frame, isometricDriver(frame.querySelector('div')))
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- **Each note stands on a cell of the floor** at its `x` and `y`: `x` runs
|
|
138
|
+
across, and `y` runs back. When no note gives a place, the driver lays the
|
|
139
|
+
notes out in columns along the links, sources first. A note added without a
|
|
140
|
+
place goes to the nearest free cell beside the notes it links to.
|
|
141
|
+
- **A note's `shape` picks its solid.** `square` is a block, which is the
|
|
142
|
+
default, `circle` is a cylinder, and `diamond` is a pyramid. Its `size` sets
|
|
143
|
+
its height.
|
|
144
|
+
- **Each face is shaded from the note's color**, so the diagram takes your
|
|
145
|
+
theme. Each group stands on a plate of its color, with its name written on
|
|
146
|
+
the floor.
|
|
147
|
+
- **Links run along the floor**, with an arrow halfway that points the way the
|
|
148
|
+
link runs.
|
|
149
|
+
|
|
150
|
+
Drag to pan, and use the wheel to zoom. Set `flat: true` to draw every note at
|
|
151
|
+
no height. The drawing moves only when the reader moves it, so there is no
|
|
152
|
+
motion to pause.
|
|
153
|
+
|
|
154
|
+
### Turn and tilt the view
|
|
155
|
+
|
|
156
|
+
`turn` is the compass bearing the diagram is seen from, in degrees, and `tilt`
|
|
157
|
+
is the camera's height above the floor. The defaults are the isometric view:
|
|
158
|
+
`turn: 45`, the front left corner, and `tilt: 35.26`. `tilt` runs from 15 to
|
|
159
|
+
90, which is a plan seen from straight above.
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
const driver = isometricDriver(box, { turn: 20, tilt: 55 })
|
|
163
|
+
connectGraph(frame, driver)
|
|
164
|
+
|
|
165
|
+
driver.turnBy(90) // brings the next corner round to the front
|
|
166
|
+
driver.turnTo({ tilt: 90 }) // looks from straight above
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
- **The faces and the light follow the camera.** Each solid shows the faces
|
|
170
|
+
turned toward the camera, and the light falls from the upper left of the
|
|
171
|
+
page.
|
|
172
|
+
- **A diagram seen whole stays whole** as it turns. Otherwise the view turns
|
|
173
|
+
about the middle of the box.
|
|
174
|
+
- **Shift with a drag** turns the view across and tilts it up and down.
|
|
175
|
+
- **`turnBy` and `turnTo` animate**, unless the reader asked for reduced
|
|
176
|
+
motion.
|
|
177
|
+
|
|
178
|
+
Give your turn buttons labels that name the diagram, such as "Turn the diagram
|
|
179
|
+
left".
|
|
180
|
+
|
|
111
181
|
## Free the renderer
|
|
112
182
|
|
|
113
183
|
Call `connection.disconnect()` when the graph leaves the page, then free the
|
package/content/iconography.mdx
CHANGED
|
@@ -17,36 +17,15 @@ Phosphor. We use the bold weight because Phosphor's regular weight is a
|
|
|
17
17
|
hairline beside the medium weight of Helix text. An icon that looks lighter than
|
|
18
18
|
the words next to it does not work as a mark.
|
|
19
19
|
|
|
20
|
-
## Register the
|
|
20
|
+
## Register the set
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import '@fusion.dev/helix/icon'
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
The
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`warning`. They cost about 700 bytes gzipped.
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
import '@fusion.dev/helix/icon/all'
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
`icon/all` registers all 126 names, for 15 kB gzipped. Import it when a page
|
|
36
|
-
draws glyphs outside the thirteen by name, such as `trash` above. A name that
|
|
37
|
-
resolves to nothing draws nothing, fires `error`, and prints a warning that
|
|
38
|
-
names this entry. `import '@fusion.dev/helix'`, which registers every element,
|
|
39
|
-
registers every name too.
|
|
40
|
-
|
|
41
|
-
`icon/root` registers no names. Import it with `registerIcons` to ship exactly
|
|
42
|
-
the glyphs you name:
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
import { registerIcons } from '@fusion.dev/helix/icon/root'
|
|
46
|
-
import { gear, trash } from '@fusion.dev/helix-icons'
|
|
47
|
-
|
|
48
|
-
registerIcons([gear, trash])
|
|
49
|
-
```
|
|
26
|
+
The Icon entry registers all 126 glyphs by name, so `name` draws any glyph in
|
|
27
|
+
the set. `@fusion.dev/helix/icon/all` is the same entry and registers the same
|
|
28
|
+
set.
|
|
50
29
|
|
|
51
30
|
## Size and color come from the surrounding text
|
|
52
31
|
|
|
@@ -119,9 +98,10 @@ import { trash } from '@fusion.dev/helix-icons'
|
|
|
119
98
|
string. Frameworks can set properties. Plain HTML cannot, so it uses `name`. If
|
|
120
99
|
both are set, `icon` wins.
|
|
121
100
|
|
|
122
|
-
`icon` also keeps your bundle small. `name` looks up glyphs in an index
|
|
123
|
-
bundler can tree-shake
|
|
124
|
-
|
|
101
|
+
`icon` also keeps your bundle small. `name` looks up glyphs in an index of the
|
|
102
|
+
whole set, and no bundler can tree-shake that index. If you render one icon by
|
|
103
|
+
`name`, you ship the whole set: 17 kB gzipped for 126 glyphs. With `icon`, you
|
|
104
|
+
ship only the glyph you import.
|
|
125
105
|
|
|
126
106
|
`icon` also draws glyphs from outside this set. Anything that exports the same
|
|
127
107
|
shape works:
|
|
@@ -148,7 +128,7 @@ Phosphor's weights are outlined, filled paths. `caret-down` is `a12,12` at bold
|
|
|
148
128
|
and `a8,8` at regular, so CSS cannot turn one weight into another, and every
|
|
149
129
|
weight offered adds bytes. Bundlers tree-shake a subpath at each import site. A
|
|
150
130
|
`weight` attribute would put every weight into the index that `name` reads, and
|
|
151
|
-
raise
|
|
131
|
+
raise your bundle from 15 kB to about 90.
|
|
152
132
|
|
|
153
133
|
Only the default weight has that index, so `name` always draws bold. To use the
|
|
154
134
|
set in another weight, import the glyphs and pass them to `icon`.
|