@fusion.dev/helix-docs 0.197.1 → 0.199.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.
@@ -92,6 +92,44 @@ The turning `Loader` slows to one turn every four seconds. A loader that stops
92
92
  looks broken, and the turn still shows that work is in progress. The pending
93
93
  ring on `IconButton` slows the same way.
94
94
 
95
+ ## Pause the page's motion
96
+
97
+ Motion that starts by itself and runs longer than five seconds needs a way to
98
+ pause it, under WCAG 2.2.2. `Motion Toggle` pauses all of it on the page at
99
+ once, and a second press lets it run again:
100
+
101
+ ```html
102
+ <helix-motion-toggle>Pause motion</helix-motion-toggle>
103
+ ```
104
+
105
+ While the page's motion is paused:
106
+
107
+ - `Carousel` stops rotating under `autoplay`.
108
+ - `Video` pauses a video that started itself, and plays it again after.
109
+ - `Aura`, `Orb`, and `Strands` hold the frame they show.
110
+ - A graph that `connectGraph` lays out stops where its notes stand, and its
111
+ three.js view stops turning.
112
+ - A map layer's `frames` stop on the frame they show.
113
+
114
+ The choice is the page's, held on the document element as
115
+ `data-helix-motion="paused"`. Set it in your markup to start the page paused,
116
+ or call `pauseMotion` from `@fusion.dev/helix-core`, and select on the
117
+ attribute to pause motion of your own:
118
+
119
+ ```js
120
+ import { pauseMotion } from '@fusion.dev/helix-core'
121
+
122
+ pauseMotion()
123
+ pauseMotion(false)
124
+ ```
125
+
126
+ With reduced motion set, `Carousel` and `Video` do not start by themselves,
127
+ and a graph lays out its notes with the drawing hidden, then shows them where
128
+ they settle.
129
+
130
+ A graph layout that runs past five seconds also offers its own button, in the
131
+ graph's frame, that stops it where the notes stand.
132
+
95
133
  ## Starting styles and view transitions
96
134
 
97
135
  Overlays use `@starting-style` to animate in. It sets a starting value and needs
@@ -6,19 +6,30 @@ title: Spatial charts
6
6
 
7
7
  # Spatial charts
8
8
 
9
- Helix has three charts drawn in three dimensions. Each reads its numbers from a
9
+ Helix has six charts drawn in three dimensions. Each reads its numbers from a
10
10
  table in the document, as every Helix chart does:
11
11
 
12
+ - `Spatial Bar Chart` stands a bar for each category and series, each as tall
13
+ as its value, such as signups by region and by quarter.
12
14
  - `Spatial Heatmap` draws a strip of days as a relief, each day a prism as tall
13
15
  as its reading.
16
+ - `Spatial Ribbon Chart` draws a ribbon for each series, one behind another,
17
+ its top following the values across, such as latency by region over two
18
+ weeks.
14
19
  - `Spatial Scatter Chart` places each row as a point in a box, by three measures
15
20
  at once.
16
21
  - `Spatial Surface Chart` draws one measure as a surface over two others, such
17
22
  as load by hour and by day.
23
+ - `Spatial Treemap` shares a floor out among blocks, each as large as one
24
+ measure and as tall as another, gathered by group, such as each service's
25
+ requests and its response time.
18
26
 
19
27
  Each chart draws itself in SVG. `@fusion.dev/helix-plot` can also draw it with
20
28
  three.js, in a view you can drag round and zoom.
21
29
 
30
+ **Every spatial chart is experimental**, so its API can change.
31
+ [Versioning](./versioning#stability) lists each status.
32
+
22
33
  ## Draw a spatial chart
23
34
 
24
35
  Put the table in the document, and point the chart at it with `for`:
@@ -48,12 +59,25 @@ Put the table in the document, and point the chart at it with `for`:
48
59
 
49
60
  Each chart reads its columns in its own way:
50
61
 
62
+ - **Spatial Bar Chart** reads its table as `Bar Chart` does: each row is a
63
+ category, and each numeric column a series. Categories run across and series
64
+ back in depth, the first series in front, so one series is a single row of
65
+ bars.
66
+ - **Spatial Ribbon Chart** reads its table as `Line Chart` does: each row is a
67
+ place along the ribbons, and each numeric column a series. Places run across
68
+ and series back in depth, the first series in front. A place with no reading
69
+ ends a ribbon short.
51
70
  - **Spatial Scatter Chart** takes the first three numeric columns as across, up,
52
71
  and in depth. `group-by` names a column of text that colors each point by its
53
72
  group.
54
73
  - **Spatial Surface Chart** takes the first numeric column as across, the second
55
74
  as depth, and the third as the height. A place on the grid with no reading
56
75
  leaves a hole.
76
+ - **Spatial Treemap** takes the first numeric column as each block's size, its
77
+ share of the floor, and the second as its height. `group-by` names a column
78
+ of text that gathers its rows into one part of the floor, in one color. With
79
+ no second numeric column, the blocks stand as one slab. A row with no size
80
+ is left out.
57
81
  - **Spatial Heatmap** reads its table as `Heatmap` does, down each column of
58
82
  `rows` and then across. Its table goes inside it.
59
83
 
@@ -91,9 +115,12 @@ Each chart has its own connector and driver:
91
115
 
92
116
  | Chart | Connector | Driver |
93
117
  |---|---|---|
118
+ | `Spatial Bar Chart` | `connectSpatialBarChart` | `threeBarDriver` |
94
119
  | `Spatial Heatmap` | `connectSpatialHeatmap` | `threeHeatmapDriver` |
120
+ | `Spatial Ribbon Chart` | `connectSpatialRibbonChart` | `threeRibbonDriver` |
95
121
  | `Spatial Scatter Chart` | `connectSpatialScatterChart` | `threeScatterDriver` |
96
122
  | `Spatial Surface Chart` | `connectSpatialSurfaceChart` | `threeSurfaceDriver` |
123
+ | `Spatial Treemap` | `connectSpatialTreemap` | `threeTreemapDriver` |
97
124
 
98
125
  `Spatial Heatmap` takes the element in its `renderer` slot, because its table
99
126
  is inside it:
@@ -131,10 +158,60 @@ Chromium on an Apple silicon Mac:
131
158
  | `Spatial Scatter Chart` | 2,000 points | 5,000 points: 67 ms a turn step |
132
159
  | `Spatial Surface Chart` | 900 readings, a grid of 30 by 30 | 1,600 readings: 50 ms, and 3,600: 113 ms |
133
160
  | `Spatial Heatmap` | 365 days | 730 days: 50 ms, and 1,825: 132 ms |
161
+ | `Spatial Bar Chart` | 400 bars | 800 bars: 66 ms, and 1,600: 124 ms |
162
+ | `Spatial Ribbon Chart` | 800 readings | 1,600 readings: 50 ms, and 3,200: 83 ms |
163
+ | `Spatial Treemap` | 400 blocks | 800 blocks: 68 ms, and 1,600: 151 ms |
134
164
 
135
165
  A slower machine reaches these sizes sooner. three.js draws each chart on the
136
166
  graphics card.
137
167
 
168
+ ## Read a place more closely
169
+
170
+ Two options help you read where a reading stands:
171
+
172
+ - `drop-lines` on `Spatial Scatter Chart` draws a line from each point straight
173
+ down to the floor, in its group's color, so where a point stands across and in
174
+ depth reads off the floor's grid.
175
+ - `contours` on `Spatial Surface Chart` draws the surface's contour lines on it,
176
+ at each tick of its height, so its shape reads as on a map, and two places at
177
+ the same height read as such.
178
+
179
+ three.js draws both as well.
180
+
181
+ ## Draw a chart for a landing page
182
+
183
+ `no-box` draws `Spatial Bar Chart`, `Spatial Ribbon Chart`, `Spatial Scatter
184
+ Chart`, `Spatial Surface Chart`, or `Spatial Treemap` with no box, grid,
185
+ numbers, or names, and nothing behind it, so the readings stand on the page as
186
+ a picture does:
187
+
188
+ ```html
189
+ <helix-spatial-surface-chart
190
+ emphasis="outlined"
191
+ for="load"
192
+ label="Load over a week"
193
+ no-box
194
+ ></helix-spatial-surface-chart>
195
+ ```
196
+
197
+ The table, the summary, the tooltip, and the keys still carry every value, and
198
+ three.js draws no box either. `Spatial Heatmap` has no box, and its `start` and
199
+ `end` slots are the only names it draws, so leave them empty for the same
200
+ picture.
201
+
202
+ ## When a 3D bar or ribbon chart fits
203
+
204
+ A flat `Bar Chart` is read more exactly. Studies of 3D bars measure readers
205
+ judging a value less closely than on flat ones, and a bar can stand behind
206
+ another. Use `Spatial Bar Chart` where the shape across two sets of names
207
+ matters more than any one value, such as which regions grew in which quarters.
208
+ A drag turns the view to show a bar another hides, and the tooltip and the
209
+ table carry every exact value.
210
+
211
+ The same holds for `Spatial Ribbon Chart` beside `Line Chart`. Use it where
212
+ series cross often enough that their lines tangle, and each in its own depth
213
+ reads apart.
214
+
138
215
  ## Read a chart with the pointer and the keys
139
216
 
140
217
  A pointer resting on a reading shows its row in the chart's tooltip, the same
@@ -154,6 +231,15 @@ The plot takes focus, and the keys move the reading:
154
231
  | Enter, Space | Presses the point | Presses the place |
155
232
  | Escape | Lets the reading go | Lets the reading go |
156
233
 
234
+ `Spatial Bar Chart` reads as `Spatial Surface Chart` does: the left and right
235
+ arrows move from category to category, and the down and up arrows from series to
236
+ series. `Spatial Ribbon Chart` reads the same way, from place to place along a
237
+ ribbon and from ribbon to ribbon.
238
+
239
+ `Spatial Treemap` reads as `Spatial Scatter Chart` does: the left and right
240
+ arrows move from item to item in the table's order, and the down and up arrows
241
+ among the item's measures.
242
+
157
243
  `Spatial Heatmap` takes `Heatmap`'s keys, and Shift with an arrow turns its
158
244
  view, except under `selection-mode="multiple"`, where it selects a range.
159
245
 
@@ -161,8 +247,9 @@ In three.js, a step of Shift with an arrow moves over a quarter of a second,
161
247
  and with reduced motion set it happens at once. In the SVG drawing, a step
162
248
  happens at once, and a drag turns the view as the pointer moves. Both drawings
163
249
  turn round the middle of the data and keep their size through a drag, so
164
- nothing else on the page moves. Once the drag ends, the SVG drawing settles
165
- into the space that fits it, at once with reduced motion set. No spatial chart
250
+ nothing else on the page moves. Once a drag or a step ends, each settles into
251
+ the space that fits it, at once with reduced motion set. three.js keeps the
252
+ zoom you chose. No spatial chart
166
253
  turns by itself.
167
254
 
168
255
  The numbers and names stand outside the box, along the edges that face the
@@ -174,17 +261,36 @@ the two ends of its front edge, clear of the relief.
174
261
 
175
262
  Each chart takes its colors from your theme, and these hooks change them:
176
263
 
264
+ - **Spatial Bar Chart**: each series takes a series color,
265
+ `--chart-series-1` and on, and each face of a bar is that color darkened by
266
+ how far it turns from the light.
267
+ - **Spatial Ribbon Chart**: each series takes a series color, `--chart-series-1`
268
+ and on, and each face of a ribbon is that color darkened by how far it turns
269
+ from the light.
177
270
  - **Spatial Scatter Chart**: each group takes a series color,
178
271
  `--chart-series-1` and on.
179
272
  - **Spatial Surface Chart**: the surface is shaded from `--spatial-surface-chart-low`
180
273
  to `--spatial-surface-chart-high`.
274
+ - **Spatial Treemap**: each group takes a series color, `--chart-series-1` and
275
+ on, and each face of a block is that color darkened by how far it turns from
276
+ the light.
181
277
  - **Spatial Heatmap**: each day takes its tone's color, as on `Heatmap`:
182
278
  `--heatmap-tone-1` to `--heatmap-tone-5` along the ramp, or a named tone such
183
279
  as `--heatmap-tone-success`. `--spatial-heatmap-left-shade` and
184
280
  `--spatial-heatmap-right-shade` set how much less light each side of a prism
185
281
  is than its top.
186
282
 
187
- three.js reads the same colors, so the two drawings agree. It lights the
283
+ `emphasis` and `material` change how the marks are drawn, as on every chart:
284
+
285
+ - `emphasis="outlined"` draws each mark as its edge over a fill faded toward
286
+ the page. On `Spatial Surface Chart` it is a wireframe.
287
+ - `emphasis="subtle"` draws a faint wash under the same edge, which shows what
288
+ stands behind a prism, a point, or a fold of the surface.
289
+ - `material="glass"` lets the most of what is behind each mark through, and
290
+ `material="frosted"` less.
291
+
292
+ three.js reads the same colors, `emphasis`, and `material`, so the two drawings
293
+ agree. It lights the
188
294
  prisms and the surface itself, so the two shade hooks apply to the SVG drawing
189
295
  alone.
190
296