myscript/iinkts/rendering-system
Claude Code and agent skill by myscript/iinkts
- community
Checking that the SKILL.md file is still in the repository.
Guide to the rendering architecture (SVG vs Canvas, drawing strokes/symbols, custom styling). Use when modifying rendering logic, debugging visual issues, or implementing custom renderers.
Install
npx vskill@latest install myscript/iinkts/rendering-systemSKILL.md
Rendering System Architecture
Overview
The rendering system draws digital ink and recognized content to screen. Two renderer implementations:
| Renderer | Technology | Performance | Use Case | |
|---|---|---|---|---|
SVGRenderer | SVG DOM | Better quality | Default for most editors | |
CanvasRenderer | Canvas 2D | Better performance | High stroke count scenarios |
Base abstraction: BaseRenderer (src/renderer/BaseRenderer.ts)
Renderer Selection
Configured via editor options:
Default: SVG for all editors.
SVG Renderer Architecture
Component Structure — registry dispatch, not per-type fields
Per-type SVG rendering is NOT hardcoded on SVGRenderer as private fields — it's dispatched through the same plugin registry used for symbol behavior everywhere else:
Per-type rendering lives in each type's *Util class (src/symbol-utils/{type}/{Type}Util.ts): StrokeUtil, TextUtil, MathUtil, ShapeUtil, EdgeUtil, DecoratorUtil — each implements getSVGElement(symbol). See the symbol-system skill for the full *Ops/*Util layering. Adding a new renderable type means adding a getSVGElement() to its *Util, not touching SVGRenderer.
Other renderer pieces:
SVGRendererConst(src/renderer/svg/utils/SVGRendererConst.ts) — SVG constants/attr presetsSVGBuilder— real implementation in src/symbol-utils/SVGBuilder.ts;src/renderer/svg/utils/SVGBuilder.tsis a re-export shimSVGStroker(src/renderer/svg/SVGStroker.ts) — stroke path generationSVGSSRenderer(src/renderer/svg/SVGSSRenderer.ts) — server-side rendering support
Implementation: src/renderer/svg/SVGRenderer.ts
Rendering Flow
- Capture Phase: User draws → strokes added to
#layerCapture - Recognition Phase: Backend responds → symbols rendered to
#layerModel - Clear Capture: Recognized strokes removed from capture layer
- Update Model: Symbols updated in model layer
SVG Element Structure
Symbol-Specific Renderers
Stroke Rendering
`StrokeUtil.getSVGElement()` (src/symbol-utils/stroke/StrokeUtil.ts) — illustrative shape, see the real file for exact attrs:
Pressure support: Variable stroke width via path interpolation.
Shape Rendering
`ShapeUtil.getSVGElement()` (src/symbol-utils/shape/ShapeUtil.ts) — illustrative shape:
Supported shapes: Circle, Ellipse, Polygon.
Text Rendering
`TextUtil.getSVGElement()` (src/symbol-utils/text/TextUtil.ts) — illustrative shape:
Math rendering: Uses MathML or LaTeX → SVG conversion (server-side).
Edge Rendering
Lines, arcs, polylines rendered as SVG paths with specific d attributes, via EdgeUtil.getSVGElement().
Decorator Rendering
`DecoratorUtil.getSVGElement()` (src/symbol-utils/decorator/DecoratorUtil.ts) renders UI overlays:
- Selection box: Rectangle around selected symbols
- Resize handles: Circles at corners/edges
- Rotation handle: Circle above selection
- Guides: Smart guides for alignment
Styling: Applied via CSS classes (.selection-box, .resize-handle).
Canvas Renderer Architecture
Component Structure
Canvas Helper Classes (all in src/renderer/canvas/):
CanvasRenderer- Main canvas rendererCanvasRendererStroke- Stroke rendering with pressureCanvasRendererShape- Shape rendering (circles, polygons, etc.)CanvasRendererText- Text rendering using Canvas text API
Implementation: src/renderer/canvas/CanvasRenderer.ts
Rendering Flow
- Clear Canvas:
context.clearRect(0, 0, width, height) - Draw Model: Iterate all symbols, draw each
- Draw Capture: Draw temporary strokes
- Draw Decorators: Selection, handles
Performance: Uses requestAnimationFrame for smooth updates.
Canvas Drawing
Stroke Drawing
Pressure: Varies line width along stroke path.
Shape Drawing
Text Drawing
Limitation: No native MathML support → rendered as plain text or images.
Style System
Pen Style
TPenStyle (src/style/Types.ts):
Usage:
Theme System
TTheme for UI element styling:
Application: Injected as CSS variables.
Style Helpers
StyleHelper (src/style/StyleHelper.ts):
rgbToHex(r, g, b)- Color conversionhexToRgb(hex)- Reverse conversioncomputeStyleFromCss(element)- Extract computed styles
Transform System
Symbols can be transformed (translate, rotate, resize) via MatrixTransform.
Matrix Transform
MatrixTransform (src/transform/MatrixTransform.ts):
Usage:
Symbol Bounds
Box class (src/model/Box.ts) for bounding boxes:
Usage: Selection, hit testing, clipping.
Custom CSS Integration
iinkTS injects CSS at runtime via style element.
Default Styles
iink.css (src/iink.css):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/rendering-system/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/myscript/iinkts/rendering-system)