mirror of
https://github.com/quartz-community/canvas-page.git
synced 2026-11-16 23:53:54 +00:00
Quartz's default canvas page plugin.
- TypeScript 84.8%
- SCSS 15.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .changeset | ||
| .github/workflows | ||
| src | ||
| test | ||
| types | ||
| .eslintrc.json | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc | ||
| CHANGELOG.md | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
| tsup.config.ts | ||
| vitest.config.ts | ||
@quartz-community/canvas-page
A page type plugin that renders JSON Canvas (.canvas) files as interactive, pannable and zoomable canvas pages. Supports the full JSON Canvas 1.0 spec, including text nodes with Markdown rendering, file nodes that link to other pages, link nodes for external URLs, group nodes for visual organization, and edges between nodes rendered as SVG paths with optional labels, arrow markers, and colors.
Installation
npx quartz plugin add @quartz-community/canvas-page
It is already included (and enabled) in the default quartz.config.yaml.
Usage
plugins:
- source: "@quartz-community/canvas-page"
enabled: true
For advanced use cases, you can override in TypeScript:
import * as ExternalPlugin from "./.quartz/plugins";
ExternalPlugin.CanvasPage({
enableInteraction: true,
initialZoom: 1,
});
Features
- Text nodes: Render Markdown content including headings, bold, italic, strikethrough, lists, links, and code blocks via GFM support.
- File nodes: Link to other pages in your vault with popover previews on hover.
- Link nodes: Reference external URLs.
- Group nodes: Visual grouping containers with optional labels and background colors.
- Edges: SVG connections between nodes with optional labels, arrow markers, and colors. Supports all four sides and both preset colors (1–6) and custom hex colors.
- Canvas frame: Canvas pages use the plugin's own fullscreen
canvaspage frame with a togglable left sidebar (setlayout.byPageType.canvas.template: defaultfor the standard three-column layout). Embedded canvases get a fullscreen toggle button instead. - Preset colors: Six preset colors (red, orange, yellow, green, cyan, purple) plus custom hex colors for nodes and edges.
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
enableInteraction |
boolean |
true |
Whether to enable pan and zoom interaction on the canvas. |
initialZoom |
number |
1 |
The initial zoom level when the canvas is first displayed. |
minZoom |
number |
0.1 |
The minimum zoom level allowed when zooming out. |
maxZoom |
number |
5 |
The maximum zoom level allowed when zooming in. |
Documentation
See the Quartz documentation for more information.
License
MIT