@bytesbybrandon/living-docs 0.1.1 → 0.2.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/README.md +4 -1
- package/package.json +4 -3
- package/samples/end-of-harness-engineering.json +2 -0
- package/samples/harness-engineering.json +3 -0
- package/src/ingest/index.js +13 -5
- package/src/model/markdown.js +2 -1
- package/src/model/schema.js +3 -1
- package/src/render/blocks.js +36 -2
- package/src/render/style.js +7 -2
- package/src/render/svg.js +15 -12
- package/src/render/themes/hud.js +2 -2
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ Ships an AXI CLI and a stdio MCP server over the same core.
|
|
|
12
12
|
|
|
13
13
|
* **Three themes:** `paper-light` for papers and reports, `paper-dark` for reading notes and essays, `hud` for repo audits and system snapshots.
|
|
14
14
|
* **Generated visuals:** diagrams and charts render as inline SVG from a compact spec, and the console hero uses a seeded graph layout.
|
|
15
|
+
* **Figure motion:** `draw`, `reveal`, and `steps` animate a generated figure with scoped CSS, then freeze for print and reduced motion. See [Document model](docs/guide/document-model.md).
|
|
15
16
|
* **Per-source style tokens:** palette, seed color, type pairing, density, and figure treatment adapt a theme without arbitrary CSS. See [Style tokens](docs/guide/style-tokens.md).
|
|
16
17
|
* **One self-contained file:** inline CSS, inline SVG, no network assets, and print rules. See [Guarantees](docs/guide/guarantees.md).
|
|
17
18
|
* **Engine and interfaces:** the same core powers the CLI and the MCP server.
|
|
@@ -95,6 +96,7 @@ Detailed references:
|
|
|
95
96
|
* [Guarantees](docs/guide/guarantees.md)
|
|
96
97
|
* [Architecture](ARCHITECTURE.md)
|
|
97
98
|
* [Decisions](docs/decisions/0001-one-model-three-themes.md)
|
|
99
|
+
* [Website](https://bytesbybrandon.github.io/living-docs/), built from this repository with `npm run site`
|
|
98
100
|
|
|
99
101
|
---
|
|
100
102
|
|
|
@@ -121,7 +123,8 @@ living-docs/
|
|
|
121
123
|
render/ block renderers, SVG generators, style resolution, themes
|
|
122
124
|
server/ local preview server
|
|
123
125
|
samples/ sample models and one Markdown source
|
|
124
|
-
scripts/ sample build
|
|
126
|
+
scripts/ sample and website build scripts
|
|
127
|
+
site/ landing page template and stylesheet for the website
|
|
125
128
|
tests/ Node test runner suites
|
|
126
129
|
docs/
|
|
127
130
|
decisions/ architecture decision records
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytesbybrandon/living-docs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Turn a source document into a designed, self-contained living doc: academic paper, dark reading notes, or telemetry console. Ships an AXI CLI and an MCP server.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,8 +47,9 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
|
-
"test": "node --test tests/cli.test.js tests/ingest.test.js tests/mcp.test.js tests/render.test.js tests/style.test.js tests/validate.test.js",
|
|
51
|
-
"samples": "node scripts/build-samples.js"
|
|
50
|
+
"test": "node --test tests/cli.test.js tests/ingest.test.js tests/mcp.test.js tests/motion.test.js tests/render.test.js tests/site.test.js tests/style.test.js tests/validate.test.js",
|
|
51
|
+
"samples": "node scripts/build-samples.js",
|
|
52
|
+
"site": "node scripts/build-site.js"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"type": "figure",
|
|
43
43
|
"caption": "Two ways to write a harness. The hand-written path is a single guess; the loop-written path reads failures, proposes edits, and keeps only what survives held-out scoring.",
|
|
44
44
|
"spec": "diagram",
|
|
45
|
+
"motion": "draw",
|
|
45
46
|
"span": "page",
|
|
46
47
|
"diagram": {
|
|
47
48
|
"width": 1000,
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"type": "figure",
|
|
112
113
|
"caption": "Held-out score by round. Each round the editor proposes eight edits; the seven rejected are grey, the kept one is orange. The harness changes only when an edit wins.",
|
|
113
114
|
"spec": "chart",
|
|
115
|
+
"motion": "steps",
|
|
114
116
|
"chart": {
|
|
115
117
|
"kind": "scatter",
|
|
116
118
|
"height": 380,
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"type": "figure",
|
|
42
42
|
"caption": "An agent is a model plus a harness of seven subsystems. The harness owns everything outside the weights.",
|
|
43
43
|
"spec": "diagram",
|
|
44
|
+
"motion": "draw",
|
|
44
45
|
"diagram": {
|
|
45
46
|
"width": 1000,
|
|
46
47
|
"height": 440,
|
|
@@ -118,6 +119,7 @@
|
|
|
118
119
|
"type": "figure",
|
|
119
120
|
"caption": "Extensibility standards across eleven coding harnesses. Counts include partial support, greyed in the paper's original figure.",
|
|
120
121
|
"spec": "chart",
|
|
122
|
+
"motion": "steps",
|
|
121
123
|
"chart": {
|
|
122
124
|
"kind": "bar",
|
|
123
125
|
"height": 340,
|
|
@@ -163,6 +165,7 @@
|
|
|
163
165
|
"type": "figure",
|
|
164
166
|
"caption": "Convergence becomes imitation: Codex reads Claude Code's hook vocabulary while OpenHands reads its plugin format.",
|
|
165
167
|
"spec": "diagram",
|
|
168
|
+
"motion": "draw",
|
|
166
169
|
"diagram": {
|
|
167
170
|
"width": 1000,
|
|
168
171
|
"height": 300,
|
package/src/ingest/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { parseMarkdown, slug, wordCount
|
|
3
|
+
import { parseMarkdown, slug, wordCount } from '../model/markdown.js';
|
|
4
4
|
import { htmlToMarkdown, htmlTitle } from './html.js';
|
|
5
5
|
import { textToMarkdown } from './text.js';
|
|
6
6
|
|
|
@@ -79,8 +79,8 @@ function normalizeBlocks(blocks) {
|
|
|
79
79
|
if (block.type === 'table') {
|
|
80
80
|
return {
|
|
81
81
|
type: 'table',
|
|
82
|
-
columns: block.columns.map(c =>
|
|
83
|
-
rows: block.rows.map(row => row.map(cell =>
|
|
82
|
+
columns: block.columns.map(c => c.trim()),
|
|
83
|
+
rows: block.rows.map(row => row.map(cell => cell.trim()))
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
if (block.type === 'list') {
|
|
@@ -200,16 +200,24 @@ export function blockToModelBlock(block) {
|
|
|
200
200
|
export function draftModel(ingested, { theme = 'paper-dark', includePreamble = true, maxBlocks = 400 } = {}) {
|
|
201
201
|
const { meta, sections, preamble } = ingested;
|
|
202
202
|
const blocks = [];
|
|
203
|
+
let abstractPending = Boolean(meta.abstract);
|
|
204
|
+
const takeBlock = block => {
|
|
205
|
+
if (abstractPending && block.type === 'paragraph' && block.text === meta.abstract) {
|
|
206
|
+
abstractPending = false;
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
return blockToModelBlock(block);
|
|
210
|
+
};
|
|
203
211
|
if (includePreamble && preamble.length) {
|
|
204
212
|
for (const block of preamble) {
|
|
205
|
-
const mapped =
|
|
213
|
+
const mapped = takeBlock(block);
|
|
206
214
|
if (mapped) blocks.push(mapped);
|
|
207
215
|
}
|
|
208
216
|
}
|
|
209
217
|
for (const section of sections) {
|
|
210
218
|
blocks.push({ type: 'heading', title: section.title, level: 2 });
|
|
211
219
|
for (const block of section.blocks) {
|
|
212
|
-
const mapped =
|
|
220
|
+
const mapped = takeBlock(block);
|
|
213
221
|
if (mapped) blocks.push(mapped);
|
|
214
222
|
if (blocks.length >= maxBlocks) break;
|
|
215
223
|
}
|
package/src/model/markdown.js
CHANGED
|
@@ -56,7 +56,8 @@ const olRe = /^\s*\d+[.)]\s+(.*)$/;
|
|
|
56
56
|
const hrRe = /^\s*([-*_])(?:\s*\1){2,}\s*$/;
|
|
57
57
|
|
|
58
58
|
function splitRow(line) {
|
|
59
|
-
|
|
59
|
+
const body = line.trim().replace(/^\|/, '').replace(/(?<!\\)\|$/, '');
|
|
60
|
+
return body.split(/(?<!\\)\|/).map(cell => cell.trim().replace(/\\\|/g, '|'));
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
/**
|
package/src/model/schema.js
CHANGED
|
@@ -157,6 +157,7 @@ export const BLOCKS = {
|
|
|
157
157
|
spec: oneOf(['diagram', 'chart'], 'which generator to use'),
|
|
158
158
|
diagram: { ...diagramSpec, optional: true },
|
|
159
159
|
chart: { ...chartSpec, optional: true },
|
|
160
|
+
motion: oneOf(['none', 'draw', 'reveal', 'steps'], 'static CSS animation for the figure; print and reduced motion stay static', { optional: true }),
|
|
160
161
|
span: oneOf(['column', 'page'], 'column width or full page', { optional: true })
|
|
161
162
|
},
|
|
162
163
|
check(value, path, err) {
|
|
@@ -299,7 +300,8 @@ export const STYLE = {
|
|
|
299
300
|
seed: str('hex color that derives the accent family, e.g. #2f6f8f', { optional: true }),
|
|
300
301
|
type: oneOf(['classic', 'editorial', 'technical', 'mono', 'hybrid', 'terminal'], 'curated type pairing', { optional: true }),
|
|
301
302
|
density: oneOf(['compact', 'normal', 'roomy'], 'vertical rhythm', { optional: true }),
|
|
302
|
-
figure: oneOf(['outline', 'solid', 'minimal'], 'diagram and chart treatment', { optional: true })
|
|
303
|
+
figure: oneOf(['outline', 'solid', 'minimal'], 'diagram and chart treatment', { optional: true }),
|
|
304
|
+
layout: oneOf(['columns', 'single'], 'paper themes only: two columns (default) or one reading column for code and wide tables', { optional: true })
|
|
303
305
|
};
|
|
304
306
|
|
|
305
307
|
export const META = {
|
package/src/render/blocks.js
CHANGED
|
@@ -17,19 +17,53 @@ export function createContext({ theme, palette, baseDir, model }) {
|
|
|
17
17
|
|
|
18
18
|
const spanClass = block => (block.span === 'page' ? ' span-page' : '');
|
|
19
19
|
|
|
20
|
+
function motionCss(id, motion) {
|
|
21
|
+
if (!motion || motion === 'none') return '';
|
|
22
|
+
const scope = `#${id}`;
|
|
23
|
+
const reset = `
|
|
24
|
+
@media (prefers-reduced-motion: reduce){
|
|
25
|
+
${scope} *{animation:none !important;opacity:1 !important;transform:none !important;stroke-dashoffset:0 !important}
|
|
26
|
+
}
|
|
27
|
+
@media print{
|
|
28
|
+
${scope} *{animation:none !important;opacity:1 !important;transform:none !important;stroke-dashoffset:0 !important}
|
|
29
|
+
}`;
|
|
30
|
+
const keyframes = `@keyframes ld-draw{to{stroke-dashoffset:0}}@keyframes ld-fade{to{opacity:1}}@keyframes ld-grow{to{transform:scaleY(1)}}`;
|
|
31
|
+
if (motion === 'draw') {
|
|
32
|
+
return `<style>${keyframes}
|
|
33
|
+
${scope} .ld-line{stroke-dasharray:1;stroke-dashoffset:1;animation:ld-draw 1000ms ease-out forwards}
|
|
34
|
+
${scope} .d-node,${scope} .ch-point,${scope} .ch-bar,${scope} .ch-legend,${scope} .d-edge-labels{opacity:0.15;animation:ld-fade 420ms ease-out forwards;animation-delay:calc(var(--i,0)*70ms + 420ms)}
|
|
35
|
+
${scope} .ch-bar{transform-box:fill-box;transform-origin:bottom;transform:scaleY(0);animation-name:ld-grow,ld-fade;animation-duration:500ms,300ms;animation-delay:calc(var(--i,0)*50ms + 300ms)}
|
|
36
|
+
${reset}</style>`;
|
|
37
|
+
}
|
|
38
|
+
if (motion === 'steps') {
|
|
39
|
+
return `<style>${keyframes}
|
|
40
|
+
${scope} .ld-line{stroke-dasharray:1;stroke-dashoffset:1;animation:ld-draw 700ms ease-out forwards;animation-delay:calc(var(--i,0)*140ms)}
|
|
41
|
+
${scope} .d-node,${scope} .ch-point,${scope} .ch-legend,${scope} .d-edge-labels{opacity:0.15;animation:ld-fade 360ms ease-out forwards;animation-delay:calc(var(--i,0)*140ms + 120ms)}
|
|
42
|
+
${scope} .ch-bar{transform-box:fill-box;transform-origin:bottom;transform:scaleY(0);opacity:0.15;animation:ld-grow 420ms ease-out forwards,ld-fade 200ms ease-out forwards;animation-delay:calc(var(--i,0)*120ms),calc(var(--i,0)*120ms)}
|
|
43
|
+
${reset}</style>`;
|
|
44
|
+
}
|
|
45
|
+
return `<style>${keyframes}
|
|
46
|
+
${scope} .d-node,${scope} .ch-point,${scope} .ch-bar,${scope} .ch-legend,${scope} .d-edge-labels{opacity:0.15;animation:ld-fade 420ms ease-out forwards;animation-delay:calc(var(--i,0)*70ms)}
|
|
47
|
+
${scope} .ld-line{stroke-dasharray:1;stroke-dashoffset:1;animation:ld-draw 800ms ease-out forwards}
|
|
48
|
+
${reset}</style>`;
|
|
49
|
+
}
|
|
50
|
+
|
|
20
51
|
function renderFigure(block, ctx) {
|
|
21
52
|
const number = ++ctx.counters.figure;
|
|
22
53
|
const span = block.span || (ctx.theme === 'hud' ? 'column' : 'page');
|
|
54
|
+
const motion = block.motion || 'none';
|
|
23
55
|
let svg = '';
|
|
24
56
|
try {
|
|
25
57
|
svg = block.spec === 'diagram'
|
|
26
|
-
? diagramSvg(block.diagram, ctx.palette, { figure: ctx.style?.figure })
|
|
27
|
-
: chartSvg(block.chart, ctx.palette, { figure: ctx.style?.figure });
|
|
58
|
+
? diagramSvg(block.diagram, ctx.palette, { figure: ctx.style?.figure, motion })
|
|
59
|
+
: chartSvg(block.chart, ctx.palette, { figure: ctx.style?.figure, motion });
|
|
28
60
|
} catch (error) {
|
|
29
61
|
ctx.warnings.push(`figure ${number}: ${error.message}`);
|
|
30
62
|
svg = `<div class="fig-error">Figure unavailable: ${escapeHtml(error.message)}</div>`;
|
|
31
63
|
}
|
|
64
|
+
const motionStyle = motionCss(`fig-${number}`, motion);
|
|
32
65
|
return `<figure class="fig${span === 'page' ? ' span-page' : ''}" id="fig-${number}">
|
|
66
|
+
${motionStyle}
|
|
33
67
|
<div class="fig-frame">${svg}</div>
|
|
34
68
|
<figcaption><span class="fig-num">Fig. ${number}.</span> ${renderInline(block.caption)}</figcaption>
|
|
35
69
|
</figure>`;
|
package/src/render/style.js
CHANGED
|
@@ -173,13 +173,15 @@ export function resolveStyle(theme, basePalette, style = {}, accentOverride) {
|
|
|
173
173
|
|
|
174
174
|
const density = DENSITIES.has(style.density) ? style.density : 'normal';
|
|
175
175
|
const figure = FIGURES.has(style.figure) ? style.figure : 'outline';
|
|
176
|
+
const layout = !isConsole && style.layout === 'single' ? 'single' : 'columns';
|
|
176
177
|
|
|
177
178
|
return {
|
|
178
179
|
palette,
|
|
179
180
|
type,
|
|
180
181
|
density,
|
|
181
182
|
figure,
|
|
182
|
-
|
|
183
|
+
layout,
|
|
184
|
+
className: `density-${density} type-${type} fig-${figure} layout-${layout}`
|
|
183
185
|
};
|
|
184
186
|
}
|
|
185
187
|
|
|
@@ -287,5 +289,8 @@ export function styleCss(theme, palette, resolved) {
|
|
|
287
289
|
const overrides = theme === 'hud' ? CONSOLE_OVERRIDES : PAPER_OVERRIDES;
|
|
288
290
|
const density = DENSITY[theme]?.[resolved.density] || '';
|
|
289
291
|
const type = TYPE[theme]?.[resolved.type] || '';
|
|
290
|
-
|
|
292
|
+
const layout = resolved.layout === 'single'
|
|
293
|
+
? '.columns{column-count:1;max-width:880px;margin-left:auto;margin-right:auto}.span-page{column-span:none}.footnotes{column-count:1}'
|
|
294
|
+
: '';
|
|
295
|
+
return `${palettes(palette)}${overrides}${density}${type}${layout}`;
|
|
291
296
|
}
|
package/src/render/svg.js
CHANGED
|
@@ -60,7 +60,7 @@ function iconMarkup(node, palette) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export function diagramSvg(spec, palette, { figure = 'outline' } = {}) {
|
|
63
|
+
export function diagramSvg(spec, palette, { figure = 'outline', motion = 'none' } = {}) {
|
|
64
64
|
const W = spec.width || 1000;
|
|
65
65
|
const H = spec.height || 520;
|
|
66
66
|
const nodes = (spec.nodes || []).map(node => ({ w: 150, h: 56, kind: 'box', icon: 'none', ...node }));
|
|
@@ -126,7 +126,8 @@ export function diagramSvg(spec, palette, { figure = 'outline' } = {}) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
const markerEnd = edge.style === 'line' ? '' : ` marker-end="url(#${marker})"`;
|
|
129
|
-
|
|
129
|
+
const animLine = motion !== 'none' && edge.style !== 'dashed' ? ' class="ld-line" pathLength="1"' : '';
|
|
130
|
+
edges.push(`<path${animLine} d="${d}" fill="none" stroke="${stroke}" stroke-width="1.1"${dash}${markerEnd}/>`);
|
|
130
131
|
if (edge.label) {
|
|
131
132
|
edgeLabels.push(`<text x="${round(labelPoint.x)}" y="${round(labelPoint.y)}" text-anchor="${labelPoint.anchor}" font-size="10.5" fill="${palette.ink}" stroke="${palette.bg}" stroke-width="4" paint-order="stroke" stroke-linejoin="round">${escapeHtml(edge.label)}</text>`);
|
|
132
133
|
}
|
|
@@ -135,6 +136,7 @@ export function diagramSvg(spec, palette, { figure = 'outline' } = {}) {
|
|
|
135
136
|
|
|
136
137
|
// Nodes.
|
|
137
138
|
const nodeMarkup = [];
|
|
139
|
+
let nodeIndex = 0;
|
|
138
140
|
for (const node of nodes) {
|
|
139
141
|
const minimal = figure === 'minimal';
|
|
140
142
|
const solid = figure === 'solid';
|
|
@@ -154,7 +156,7 @@ export function diagramSvg(spec, palette, { figure = 'outline' } = {}) {
|
|
|
154
156
|
const blockHeight = lines.length * lineHeight + (node.sub ? 13 : 0) + iconSpace;
|
|
155
157
|
let textY = node.y + (node.h - blockHeight) / 2 + lineHeight - 4 + iconSpace;
|
|
156
158
|
|
|
157
|
-
nodeMarkup.push(`<g class="d-node d-node-${node.kind}">`);
|
|
159
|
+
nodeMarkup.push(`<g class="d-node d-node-${node.kind}" style="--i:${nodeIndex++}">`);
|
|
158
160
|
if (node.kind === 'stack') {
|
|
159
161
|
nodeMarkup.push(`<rect x="${node.x + 5}" y="${node.y + 5}" width="${node.w}" height="${node.h}" rx="2" fill="${palette.surface}" stroke="${palette.muted}" stroke-opacity="0.5"/>`);
|
|
160
162
|
}
|
|
@@ -170,7 +172,7 @@ export function diagramSvg(spec, palette, { figure = 'outline' } = {}) {
|
|
|
170
172
|
nodeMarkup.push('</g>');
|
|
171
173
|
}
|
|
172
174
|
parts.push(`<g class="d-nodes">${nodeMarkup.join('')}</g>`);
|
|
173
|
-
if (edgeLabels.length) parts.push(`<g class="d-edge-labels">${edgeLabels.join('')}</g>`);
|
|
175
|
+
if (edgeLabels.length) parts.push(`<g class="d-edge-labels" style="--i:${nodes.length}">${edgeLabels.join('')}</g>`);
|
|
174
176
|
|
|
175
177
|
if (spec.notes?.length) {
|
|
176
178
|
const notes = spec.notes.map((note, i) =>
|
|
@@ -201,7 +203,7 @@ function seriesPoints(series) {
|
|
|
201
203
|
return (series.values || []).map((value, i) => ({ x: i + 1, y: value, label: series.labels?.[i] }));
|
|
202
204
|
}
|
|
203
205
|
|
|
204
|
-
export function chartSvg(spec, palette, { figure = 'outline' } = {}) {
|
|
206
|
+
export function chartSvg(spec, palette, { figure = 'outline', motion = 'none' } = {}) {
|
|
205
207
|
const W = spec.width || 1000;
|
|
206
208
|
const H = spec.height || 420;
|
|
207
209
|
const showGrid = figure !== 'minimal';
|
|
@@ -257,6 +259,7 @@ export function chartSvg(spec, palette, { figure = 'outline' } = {}) {
|
|
|
257
259
|
const barWidth = Math.max(4, Math.min(64, (slot * 0.55) / series.length));
|
|
258
260
|
|
|
259
261
|
const legend = [];
|
|
262
|
+
let markIndex = 0;
|
|
260
263
|
series.forEach((item, seriesIndex) => {
|
|
261
264
|
const tone = palette[item.tone] || palette.accent;
|
|
262
265
|
const points = seriesPoints(item).sort((a, b) => a.x - b.x);
|
|
@@ -267,24 +270,24 @@ export function chartSvg(spec, palette, { figure = 'outline' } = {}) {
|
|
|
267
270
|
const x = sx(point.x) - (series.length * barWidth) / 2 + seriesIndex * barWidth;
|
|
268
271
|
const y = sy(Math.max(yMin, point.y));
|
|
269
272
|
const height = Math.max(1, margin.t + plotH - y);
|
|
270
|
-
parts.push(`<rect x="${round(x)}" y="${round(y)}" width="${round(barWidth - 1.5)}" height="${round(height)}" fill="${tone}" fill-opacity="0.9"/>`);
|
|
273
|
+
parts.push(`<rect class="ch-bar" style="--i:${markIndex++}" x="${round(x)}" y="${round(y)}" width="${round(barWidth - 1.5)}" height="${round(height)}" fill="${tone}" fill-opacity="0.9"/>`);
|
|
271
274
|
});
|
|
272
275
|
} else if (item.kind === 'step' || spec.kind === 'steps') {
|
|
273
276
|
let d = `M ${round(sx(points[0].x))} ${round(sy(points[0].y))}`;
|
|
274
277
|
for (let i = 1; i < points.length; i++) {
|
|
275
278
|
d += ` H ${round(sx(points[i].x))} V ${round(sy(points[i].y))}`;
|
|
276
279
|
}
|
|
277
|
-
parts.push(`<path d="${d}" fill="none" stroke="${tone}" stroke-width="1.6"/>`);
|
|
278
|
-
points.forEach(point => parts.push(`<circle cx="${round(sx(point.x))}" cy="${round(sy(point.y))}" r="2.6" fill="${tone}"/>`));
|
|
280
|
+
parts.push(`<path${motion !== 'none' ? ' class="ld-line" pathLength="1"' : ''} d="${d}" fill="none" stroke="${tone}" stroke-width="1.6"/>`);
|
|
281
|
+
points.forEach(point => parts.push(`<circle class="ch-point" style="--i:${markIndex++}" cx="${round(sx(point.x))}" cy="${round(sy(point.y))}" r="2.6" fill="${tone}"/>`));
|
|
279
282
|
} else if (item.kind === 'dot' || spec.kind === 'scatter') {
|
|
280
|
-
points.forEach(point => parts.push(`<circle cx="${round(sx(point.x))}" cy="${round(sy(point.y))}" r="3.2" fill="${tone}"/>`));
|
|
283
|
+
points.forEach(point => parts.push(`<circle class="ch-point" style="--i:${markIndex++}" cx="${round(sx(point.x))}" cy="${round(sy(point.y))}" r="3.2" fill="${tone}"/>`));
|
|
281
284
|
} else {
|
|
282
285
|
const path = points.map((point, i) => `${i ? 'L' : 'M'} ${round(sx(point.x))} ${round(sy(point.y))}`).join(' ');
|
|
283
|
-
parts.push(`<path d="${path}" fill="none" stroke="${tone}" stroke-width="1.5"/>`);
|
|
284
|
-
points.forEach(point => parts.push(`<circle cx="${round(sx(point.x))}" cy="${round(sy(point.y))}" r="3.4" fill="${tone}" stroke="${palette.bg}" stroke-width="0.8"/>`));
|
|
286
|
+
parts.push(`<path${motion !== 'none' ? ' class="ld-line" pathLength="1"' : ''} d="${path}" fill="none" stroke="${tone}" stroke-width="1.5"/>`);
|
|
287
|
+
points.forEach(point => parts.push(`<circle class="ch-point" style="--i:${markIndex++}" cx="${round(sx(point.x))}" cy="${round(sy(point.y))}" r="3.4" fill="${tone}" stroke="${palette.bg}" stroke-width="0.8"/>`));
|
|
285
288
|
}
|
|
286
289
|
|
|
287
|
-
legend.push(`<g><rect x="0" y="-6" width="10" height="7" fill="${tone}"/><text x="15" y="0" font-size="10.5" fill="${palette.ink}">${escapeHtml(item.name)}</text></g>`);
|
|
290
|
+
legend.push(`<g class="ch-legend" style="--i:${markIndex++}"><rect x="0" y="-6" width="10" height="7" fill="${tone}"/><text x="15" y="0" font-size="10.5" fill="${palette.ink}">${escapeHtml(item.name)}</text></g>`);
|
|
288
291
|
});
|
|
289
292
|
|
|
290
293
|
for (const note of spec.annotations || []) {
|
package/src/render/themes/hud.js
CHANGED
|
@@ -43,7 +43,7 @@ body{margin:0;background:#020409;color:var(--ink);font-family:var(--mono);font-s
|
|
|
43
43
|
.scene-head{padding:14px 16px 0}
|
|
44
44
|
.scene-head .brand-row{padding-bottom:6px}
|
|
45
45
|
.scene-top{display:flex;justify-content:space-between;padding:12px 16px 6px;font-size:9px;letter-spacing:.12em;color:#5f8090;text-transform:uppercase}
|
|
46
|
-
.scene-stage{position:relative;aspect-ratio:16/8.6;min-height:300px;margin-top:2px;background:radial-gradient(ellipse at 55% 45%,rgba(30,90,120,.35),rgba(4,8,14,0) 66%),#03060b}
|
|
46
|
+
.scene-stage{position:relative;width:100%;min-width:0;aspect-ratio:16/8.6;min-height:300px;margin-top:2px;background:radial-gradient(ellipse at 55% 45%,rgba(30,90,120,.35),rgba(4,8,14,0) 66%),#03060b}
|
|
47
47
|
.scene-canvas{position:absolute;inset:0;width:100%;height:100%}
|
|
48
48
|
.scene-label{position:absolute;transform:translate(-50%,-50%);font-size:9.5px;letter-spacing:.04em;color:#7fa6b8;white-space:nowrap;text-shadow:0 0 6px #03060b;pointer-events:none}
|
|
49
49
|
.scene-crosshair{position:absolute;transform:translate(-50%,-50%);width:190px;height:190px;border:1px solid rgba(94,200,229,.22);border-radius:50%;pointer-events:none}
|
|
@@ -217,7 +217,7 @@ tbody td{padding:5px 6px;color:#b7d4e1;border-bottom:1px solid #0a1822}
|
|
|
217
217
|
.hud-head{flex-direction:column;gap:8px}
|
|
218
218
|
.live{font-size:8px}
|
|
219
219
|
.scene-stage{min-height:240px}
|
|
220
|
-
.scene-card{
|
|
220
|
+
.scene-card{left:12px!important;top:auto!important;bottom:10px;transform:none;min-width:0;max-width:none;width:calc(100% - 24px)}
|
|
221
221
|
.scene-label{font-size:8px}
|
|
222
222
|
.sc-tail{margin-left:0}
|
|
223
223
|
.footnotes{column-count:1}
|