@fusion.dev/helix-docs 0.193.0 → 0.195.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/charting.mdx +26 -18
- package/content/coding-agents.mdx +71 -30
- package/content/introduction.mdx +1 -0
- package/content/metrics.mdx +226 -226
- package/content/spatial-charts.mdx +30 -6
- package/content/using-helix-with-an-agent.mdx +56 -96
- package/dist/pages.generated.js +2 -2
- package/dist/sources.generated.js +410 -376
- package/package.json +11 -9
|
@@ -116,17 +116,32 @@ Once three.js has drawn, the chart hides its SVG drawing.
|
|
|
116
116
|
| | SVG | three.js |
|
|
117
117
|
|---|---|---|
|
|
118
118
|
| What it needs | Nothing more than the chart | `@fusion.dev/helix-plot`, three.js, and WebGL |
|
|
119
|
-
| How the view moves | Shift with an arrow
|
|
119
|
+
| How the view moves | Drag to turn and tilt, and Shift with an arrow to turn a step | Drag to turn, the wheel or a pinch to zoom, and Shift with an arrow to turn a step |
|
|
120
120
|
| Light | Shaded by which way each face turns, with no perspective | Lit from above, in perspective |
|
|
121
121
|
| Without WebGL | Drawn | Not drawn, and the SVG drawing stays |
|
|
122
122
|
|
|
123
|
-
Start with SVG. Connect three.js where a reader gains from
|
|
124
|
-
|
|
123
|
+
Start with SVG. Connect three.js where a reader gains from zooming and from
|
|
124
|
+
perspective, or where the data is larger than SVG draws smoothly.
|
|
125
|
+
|
|
126
|
+
**The SVG drawing turns within a frame or two up to these sizes**, measured in
|
|
127
|
+
Chromium on an Apple silicon Mac:
|
|
128
|
+
|
|
129
|
+
| Chart | Turns within a frame or two | Measured above that |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `Spatial Scatter Chart` | 2,000 points | 5,000 points: 67 ms a turn step |
|
|
132
|
+
| `Spatial Surface Chart` | 900 readings, a grid of 30 by 30 | 1,600 readings: 50 ms, and 3,600: 113 ms |
|
|
133
|
+
| `Spatial Heatmap` | 365 days | 730 days: 50 ms, and 1,825: 132 ms |
|
|
134
|
+
|
|
135
|
+
A slower machine reaches these sizes sooner. three.js draws each chart on the
|
|
136
|
+
graphics card.
|
|
125
137
|
|
|
126
138
|
## Read a chart with the pointer and the keys
|
|
127
139
|
|
|
128
140
|
A pointer resting on a reading shows its row in the chart's tooltip, the same
|
|
129
|
-
tooltip every Helix chart shows. A tap shows it until a tap lands elsewhere.
|
|
141
|
+
tooltip every Helix chart shows. A tap shows it until a tap lands elsewhere. A
|
|
142
|
+
drag turns and tilts the view, and a press that hardly moves is still a press.
|
|
143
|
+
On a touch screen, a drag across turns the view, and a drag up or down scrolls
|
|
144
|
+
the page.
|
|
130
145
|
|
|
131
146
|
The plot takes focus, and the keys move the reading:
|
|
132
147
|
|
|
@@ -142,10 +157,19 @@ The plot takes focus, and the keys move the reading:
|
|
|
142
157
|
`Spatial Heatmap` takes `Heatmap`'s keys, and Shift with an arrow turns its
|
|
143
158
|
view, except under `selection-mode="multiple"`, where it selects a range.
|
|
144
159
|
|
|
145
|
-
In three.js, a
|
|
146
|
-
set it happens at once.
|
|
160
|
+
In three.js, a step of Shift with an arrow moves over a quarter of a second,
|
|
161
|
+
and with reduced motion set it happens at once. In the SVG drawing, a step
|
|
162
|
+
happens at once, and a drag turns the view as the pointer moves. Both drawings
|
|
163
|
+
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
|
|
147
166
|
turns by itself.
|
|
148
167
|
|
|
168
|
+
The numbers and names stand outside the box, along the edges that face the
|
|
169
|
+
reader, and move to other edges as the view turns. A number that would cover
|
|
170
|
+
another is left out. `Spatial Heatmap` stands its first and last labels under
|
|
171
|
+
the two ends of its front edge, clear of the relief.
|
|
172
|
+
|
|
149
173
|
## Color a spatial chart
|
|
150
174
|
|
|
151
175
|
Each chart takes its colors from your theme, and these hooks change them:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: The rules an agent follows to write Helix code, and the five mistakes that look like Helix bugs.
|
|
3
3
|
parent: coding-agents
|
|
4
4
|
section: Getting started
|
|
5
5
|
title: Using Helix with an agent
|
|
@@ -8,41 +8,52 @@ title: Using Helix with an agent
|
|
|
8
8
|
|
|
9
9
|
# Using Helix with an agent
|
|
10
10
|
|
|
11
|
-
This guide is
|
|
11
|
+
This guide is what an agent reads before writing Helix code. It is also the
|
|
12
|
+
`helix` skill: `skills/helix/SKILL.md` in `@fusion.dev/helix`, which matches the
|
|
13
|
+
version installed, and the skill in Helix's plugin for coding agents. [Coding
|
|
14
|
+
agents](./coding-agents) says how to install the plugin or link the skill.
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
- `skills/helix/SKILL.md` inside `@fusion.dev/helix`, which matches the version
|
|
15
|
-
you installed and works offline
|
|
16
|
+
## Use a Helix family wherever one exists
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
Write a Helix element for everything Helix has a family for, and a native
|
|
19
|
+
element only for page structure. Before you write a native element, ask whether
|
|
20
|
+
a family stands in for it:
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
- `helix api find <tag>`, or the MCP tool `helix_find`, answers a native tag
|
|
23
|
+
with its family: `button` finds Button, and `h1` finds Text.
|
|
24
|
+
- Each family's file lists the native elements it replaces under `replaces`.
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
https://fusion.dev/helix/components/<family>.md
|
|
25
|
-
https://fusion.dev/helix/components/<family>.json
|
|
26
|
-
```
|
|
26
|
+
These native elements have families:
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
- controls: `button`, `input` of every visible type, `select`, and `textarea`
|
|
29
|
+
- overlays and disclosure: `dialog` and `details`
|
|
30
|
+
- text: `h1` to `h6` and `p`, which `helix-text` writes with `as="h1"` and the
|
|
31
|
+
rest
|
|
32
|
+
- content: `img`, `picture`, `hr`, `ul`, `ol`, `table`, `code`, `pre`, `kbd`,
|
|
33
|
+
`blockquote`, `q`, `video`, `progress`, and `meter`
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
- every event, with its class and its React prop
|
|
34
|
-
- every slot, part, and custom property
|
|
35
|
-
- the examples, each with the import lines it needs
|
|
35
|
+
Page structure stays native: `main`, `section`, `article`, `header`, `footer`,
|
|
36
|
+
`nav`, `form`, `label`, `div`, `span`, and `a`. So does markup a CMS writes
|
|
37
|
+
inside `data-prose`.
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
`helix scan` and the MCP tool `helix_check` report each native element a page
|
|
40
|
+
writes where an installed family stands in for it, as `native-element`.
|
|
41
|
+
|
|
42
|
+
## Look up a family before writing its tags
|
|
43
|
+
|
|
44
|
+
Each family's API is in the packages you installed, and on this site:
|
|
45
|
+
|
|
46
|
+
- `helix api family <family>`, or the MCP tool `helix_family`
|
|
47
|
+
- `node_modules/@fusion.dev/helix/api.json`
|
|
48
|
+
- `https://fusion.dev/helix/components/<family>.md` and `.json`
|
|
41
49
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
Each lists the import lines, every tag, every property with its literal union,
|
|
51
|
+
every event with its React prop, every slot, part, and custom property, and the
|
|
52
|
+
examples with the imports each one needs.
|
|
53
|
+
|
|
54
|
+
**If a tag is not in a family's file, it does not exist.** A property value
|
|
55
|
+
outside a declared union is invalid. Find a family by name, alias, or purpose
|
|
56
|
+
with `helix api find`, or the MCP tool `helix_find`.
|
|
46
57
|
|
|
47
58
|
## Five mistakes that look like Helix bugs
|
|
48
59
|
|
|
@@ -147,12 +158,9 @@ Each missing layer has its own symptom:
|
|
|
147
158
|
- Unstyled headings mean `base.css` is missing.
|
|
148
159
|
- No color anywhere means `primitives.css` or `tokens.css` is missing.
|
|
149
160
|
|
|
150
|
-
To tell the last two apart, look at the stylesheet.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
to `rgba(0, 0, 0, 0)`, because `tokens.css` refers to a primitive 297 times and
|
|
154
|
-
to nothing else. A missing `primitives.css` looks like a working install, and
|
|
155
|
-
`helix.css` exists to prevent it.
|
|
161
|
+
To tell the last two apart, look at the stylesheet. Without `tokens.css`,
|
|
162
|
+
nothing declares `--helix-color-*`. Without `primitives.css`, every token is
|
|
163
|
+
declared and every color resolves to transparent.
|
|
156
164
|
|
|
157
165
|
## Choosing a component family
|
|
158
166
|
|
|
@@ -192,73 +200,25 @@ You can style a component in three ways. Try them in this order:
|
|
|
192
200
|
belong to `@fusion.dev/helix-styles`. The underscore marks them as internal.
|
|
193
201
|
Read the semantic tokens that refer to them.
|
|
194
202
|
|
|
195
|
-
##
|
|
196
|
-
|
|
197
|
-
`@fusion.dev/helix-styles` is plain CSS with no JavaScript. It includes recipes
|
|
198
|
-
for markup that Helix does not render:
|
|
199
|
-
|
|
200
|
-
```html
|
|
201
|
-
<button
|
|
202
|
-
data-button="solid"
|
|
203
|
-
data-button-tone="primary"
|
|
204
|
-
>Save</button>
|
|
205
|
-
<article data-prose><h2>From a CMS</h2></article>
|
|
206
|
-
<div data-density="sm">…</div>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
A recipe sets appearance only. It has none of these:
|
|
210
|
-
|
|
211
|
-
- state
|
|
212
|
-
- form participation
|
|
213
|
-
- focus trapping
|
|
214
|
-
- keyboard handling
|
|
215
|
-
|
|
216
|
-
If you are adding a script to a recipe, use the component.
|
|
217
|
-
|
|
218
|
-
## Link your tool to this guide
|
|
219
|
-
|
|
220
|
-
**Point your tool at the guide, and do not copy it.** A copy starts to go stale
|
|
221
|
-
as soon as you paste it, and the guide changes with the library.
|
|
222
|
-
|
|
223
|
-
The skill in the package matches the Helix you installed. In Claude Code, link
|
|
224
|
-
it into your project's skills folder:
|
|
203
|
+
## Markup Helix does not render
|
|
225
204
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
Other tools read a file in your repository. Add a line to it that names the
|
|
232
|
-
skill, or this page:
|
|
233
|
-
|
|
234
|
-
```md
|
|
235
|
-
Helix: read node_modules/@fusion.dev/helix/skills/helix/SKILL.md before
|
|
236
|
-
writing components, and node_modules/@fusion.dev/helix/api.json for the API.
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
| Tool | Where it goes |
|
|
240
|
-
|---|---|
|
|
241
|
-
| Claude Code | `.claude/skills/helix`, or a line in `AGENTS.md` or `CLAUDE.md` |
|
|
242
|
-
| Cursor | `.cursor/rules/` |
|
|
243
|
-
| GitHub Copilot | `.github/copilot-instructions.md` |
|
|
244
|
-
| Anything else | Whatever it reads. The line is the same |
|
|
205
|
+
HTML that a CMS or a Markdown library writes, inside an element with
|
|
206
|
+
`data-prose`, takes Helix's typography from `@fusion.dev/helix-styles` and needs
|
|
207
|
+
no Helix elements. Everywhere else, write the Helix element.
|
|
245
208
|
|
|
246
|
-
|
|
247
|
-
have to maintain a file we generated in your repository against our changes. A
|
|
248
|
-
tool that rewrote it on install would be a dependency you did not ask for, in a
|
|
249
|
-
directory you own. You add the link or the line, and you can delete it.
|
|
209
|
+
## Check the code you wrote
|
|
250
210
|
|
|
251
|
-
|
|
211
|
+
Run these after you write Helix code, and fix every finding at `error` and
|
|
212
|
+
`warn` before you finish. Each prints JSON with `--json`.
|
|
252
213
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
214
|
+
| Command | MCP tool | What it finds |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| `helix scan` | `helix_check` | Unknown tags, attributes, values, slots, parts, hooks, events, and tokens, a native element a Helix family replaces, a missing import, and the rest, each with its file and line |
|
|
217
|
+
| `helix diagnostics --once <url>` | `helix_check_page` | The same on the running page, and what the library logged as it ran |
|
|
218
|
+
| `helix theme audit` | `helix_audit_theme` | Every foreground and background pair in your theme that misses its contrast target |
|
|
256
219
|
|
|
257
|
-
`helix
|
|
258
|
-
|
|
259
|
-
takes `claude`, `cursor`, or `vscode`, and writes the server into the file that
|
|
260
|
-
client reads. [Coding agents](./coding-agents) lists the tools. It runs on your
|
|
261
|
-
machine, talks to a client you chose, and makes no network requests.
|
|
220
|
+
`helix scan --file <path>` reports one file's findings and still reads the whole
|
|
221
|
+
project, so an import in another file counts.
|
|
262
222
|
|
|
263
223
|
## What this guide does not cover
|
|
264
224
|
|
package/dist/pages.generated.js
CHANGED
|
@@ -38,7 +38,7 @@ export const docPages = [
|
|
|
38
38
|
title: 'Charting',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
description: '
|
|
41
|
+
description: 'Install Helix for a coding agent, and the files an agent can read to write Helix code.',
|
|
42
42
|
order: 4,
|
|
43
43
|
section: 'Getting started',
|
|
44
44
|
slug: 'coding-agents',
|
|
@@ -264,7 +264,7 @@ export const docPages = [
|
|
|
264
264
|
title: 'Typography',
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
|
-
description: '
|
|
267
|
+
description: 'The rules an agent follows to write Helix code, and the five mistakes that look like Helix bugs.',
|
|
268
268
|
parent: 'coding-agents',
|
|
269
269
|
section: 'Getting started',
|
|
270
270
|
slug: 'using-helix-with-an-agent',
|