
webdevcody/sketchlab.app
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
webdevcody/sketchlab.app является кандидатом в агенты, импортированным из https://github.com/webdevcody/sketchlab.app.
Обзор
webdevcody/sketchlab.app является кандидатом в агенты, импортированным из https://github.com/webdevcody/sketchlab.app.
Обзор (машинный перевод)
Быстрый инструмент диаграммы только для браузера (подумайте о крошечной Figma / Excalidraw). Нарисуйте фигуры, соедините их с линиями автоматического захвата, выпадающими значками и всем автосохранением Местно. Нет бэкэнда — доски живут в IndexedDB и доступны для совместного использования через один URL.
##Стек
- Rendering: ** PixiJS v8 (WebGL) — GPU-ускоренный, рендеринг по требованию.
Государство: наномагазины — крошечные реактивные атомы. ** Нет реакции.
** Настойчивость: ** Индексируется DB через
idb-keyval. Обмен: плата JSON →lz-stringсжатие → строка запроса. - **Build: ** Vite + TypeScript. Корабли как статические файлы (обслуживаемые nginx в Dockerfile).
Команды
Навык Клода Кода (создание диаграмм в Sketch Lab)
Агенты могут излучать Sketch Lab GeneratedGraph JSON и открывать его с URL ?g=.
Мастерство размещается с приложением:
Введите код Claude:
Затем перезагрузите код Клода и попросите схему Sketch Lab. Агент строит [5] и открывает его.
Как сохранить производительность с множеством форм
** Обновления с грязным набором, а не полные дифференциации.** Действия мутируют в наномагазине * и * сообщают
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
Sketch Lab
A fast, browser-only diagram tool (think a tiny Figma/Excalidraw). Draw shapes, connect them with auto-snapping lines, drop in icons, and everything auto-saves locally. No backend — boards live in IndexedDB and are shareable via a single URL.
Stack
- Rendering: PixiJS v8 (WebGL) — GPU-accelerated, render-on-demand.
- State: nanostores — tiny reactive atoms. No React.
- Persistence: IndexedDB via
idb-keyval. - Sharing: board JSON →
lz-stringcompression → query string. - Build: Vite + TypeScript. Ships as static files (served by nginx in the Dockerfile).
Commands
npm install
npm run dev # local dev server (http://localhost:5173)
npm run build # type-check + production build to dist/
npm run preview # serve the production build
Claude Code skill (generate diagrams into Sketch Lab)
Agents can emit Sketch Lab GeneratedGraph JSON and open it with a ?g= URL.
The skill is hosted with the app:
Install into Claude Code:
mkdir -p ~/.claude/skills/sketch-lab
curl -fsSL https://sketchlab.webdevcody.com/skills/sketch-lab/SKILL.md \
-o ~/.claude/skills/sketch-lab/SKILL.md
Then restart Claude Code and ask for a Sketch Lab diagram. The agent builds
https://sketchlab.webdevcody.com/?g= and opens it.
How performance is kept flat with many shapes
- Dirty-set updates, not full diffs. Actions mutate the nanostore and tell the
renderer exactly which node/edge ids changed (
scene.updateNode(id)). Dragging one of thousands of shapes touches only that node + its incident edges. - Render-on-demand. The Pixi ticker is stopped;
app.render()is scheduled once per animation frame only when something is dirty. - Per-view redraw guards. A shape’s
Graphicsis only re-tessellated when its geometry/style actually changes; moving it just sets a container transform. - All hit-testing in world space (not Pixi’s event tree), so selection/marquee/ connect/resize are O(changed), and the camera is a single container transform.
Architecture
src/
state/ types, nanostore atoms (store.ts), mutation actions (actions.ts)
render/ Pixi scene singleton (scene.ts), shape/edge view builders,
geometry/snapping math, vector icon registry
interaction/ controller.ts (pointer/keyboard state machine), camera, viewport,
text-editor overlay, "/" icon palette
persistence/ IndexedDB (db.ts), autosave, URL share encode/decode
ui/ dashboard, editor chrome (toolbar/colors/zoom), DOM helpers, router
main.ts hash router: editor (#/board/:id), ?b= board share, ?g= GeneratedGraph import
Shortcuts
V select · T text · R rectangle · O circle · L connector line ·
Рекомендуемые инструменты
Попробуйте другой запрос или уберите фильтр.
Установка
npx skillfish add webdevcody/sketchlab.app