viewer
/viewer
Work on graph.html, the Konstruct graph viewer (Svelte 5 and TypeScript in viewer/, built into konstruct/outputs/viewer.html). Use for any change to how the graph, panel, search or styling looks or behaves.
- Author
- kodexlabsio ↗
- Repository
- konstruct ↗
- Licence
- MIT
- Last repository change
- 12.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Work on graph.html, the Konstruct graph viewer (Svelte 5 and TypeScript in viewer/, built into konstruct/outputs/viewer.html). Use for any change to how the graph, panel, search or styling looks or behaves.
Original author description
Work on graph.html, the Konstruct graph viewer (Svelte 5 and TypeScript in viewer/, built into konstruct/outputs/viewer.html). Use for any change to how the graph, panel, search or styling looks or behaves.
How it works
SKILL.md has no level-two headings · 41 lines, 322 words
SKILL.md preview
---
name: viewer
description: Work on graph.html, the Konstruct graph viewer (Svelte 5 and TypeScript in viewer/, built into konstruct/outputs/viewer.html). Use for any change to how the graph, panel, search or styling looks or behaves.
---
# Working on the viewer
The viewer is `viewer/` (Svelte 5, strict TypeScript, Vite, pnpm, Node from `.nvmrc`), with its
`package.json` and toolchain configs at the repository root, where every `pnpm` command runs.
`pnpm build` writes one self-contained `konstruct/outputs/viewer.html`; Konstruct fills its
`__KONSTRUCT_DATA__` and `__KONSTRUCT_EXPLAIN__` placeholders when it writes `graph.html`.
1. **Run it with real data:**
```bash
uv run konstruct build examples/jaffle_shop
pnpm install
mkdir -p viewer/dev && cp examples/jaffle_shop/konstruct-out/graph.json viewer/dev/
pnpm dev # http://localhost:5173/viewer.html
```
2. **Where things are.** Pure logic with unit tests in `tests/`: `src/lib/model.ts` (graph indexes,
lineage), `selector.ts` (dbt selectors), `route.ts` (hash routes), `search.ts` (fuzzy search),
`layout.ts`, `focus.ts`, `tree.ts`, `stats.ts`, `transform.ts`, `sql.ts`, `export.ts`, `icu.ts` and
`locale.ts`. State: `src/lib/viewer.svelte.ts` (runes) and `i18n.svelte.ts`. Interface:
`src/components/` (TopBar, Nav, Palette, Lineage, Inspector, Help) and `src/components/pages/`.
Messages: `src/locales/` (en-GB is the source; every UI string goes through `t()`). Styles:
`src/app.css`, following `../kodexlabs.io/DESIGN.md` (slate and sky, Manrope and JetBrains Mono,
nothing below 14px), with logical properties so right-to-left languages work.
Loading the graph (inlined, or fetched when a server marks the page with
`<meta name="konstruct-serve">`) is all in `src/lib/source.ts`. For dev, `viewer/dev/explain.json`
(the second placeholder's data) is read if present. The build adds a hash-based CSP
(`vite.config.ts`): no inline handlers, no `{@html}`, no eval, no static `style` attributes.
3. **Keep the contract.** Element ids and classes (`#nodes [data-id]`, `.row[data-col]`, `#page h1`,
`#select`, `#palette-input`, `#tree`, ...) are what `tests/test_browser.py` drives, with an axe-core
check for WCAG 2.2 AA. Insert text only as text;
never use `{@html}`. The page must make no network requests.
4. **Check and build:**
```bash
pnpm format && pnpm check && pnpm test && pnpm build
cd .. && uv run pytest tests/test_browser.py tests/test_html.py
```
5. **Commit the rebuilt `konstruct/outputs/viewer.html` with the source.** The pre-commit hook
rebuilds it and CI fails if it differs from a fresh build.
6. If the change is visible, refresh the screenshots in `docs/images/` (dark theme, 1600 by 900 at
2x) and the viewer page in `docs/guide/viewer.md`.
Versions
The database has no other skills named viewer.
Database snapshot: 13.11.2026 · package version d2800d0cb442 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 96change
Make and finish a change to Konstruct (Python, viewer or docs) so it passes every check CI runs, with docs, golden files and a conforming commit. Use for any code change in this repository. - 100dev-viewer
How to work on packages/viewer, the Vite + React + React Flow + ELK app that renders architecture.json. Use when adding or changing viewer components, hooks, layout, search, playback, styling, accessibility, or viewer tests and e2e specs. - 86new-input
Add a new input to Konstruct, such as an orchestrator, a warehouse connector or a file format, wired through discovery, the build, the graph, tests and docs. Use when Konstruct should read something it does not yet. - 100graph-viewer
Integrate the reusable CDF graph viewer (useGraphViewer) into a Flows app by copying the local code bundle. Use when embedding a graph visualization, adding a knowledge graph, or showing CDF data model relationships and instances. - 100install-learning-graph-viewer
This skill installs an interactive learning graph viewer application into an intelligent textbook project. Use this skill when working with a textbook that has a learning-graph.json file and needs a visual, interactive graph exploration tool with search, filtering, and statistics capabilities. - 100svelte-code-writer
CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (`.svelte`) or Svelte module (`.svelte.ts`/`.svelte.js`).