Quartz's default graph plugin.
  • TypeScript 96.7%
  • SCSS 3.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-09 23:03:17 +01:00
.changeset chore: version package 2026-11-09 04:06:26 +00:00
.github/workflows ci: run ci.yml on the changesets version PR and report it as a commit status 2026-11-09 03:47:26 +01:00
src fix(i18n): French graph title in sentence case (jackyzha0/quartz#2513) 2026-11-07 22:45:10 +01:00
test fix: resolve ESLint and formatting issues for CI compliance 2026-03-09 03:47:43 +01:00
types fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
.eslintrc.json fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
.gitignore chore: migrate to npm publishing 2026-07-23 09:07:16 +02:00
.prettierignore fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
.prettierrc Initial commit 2026-02-07 04:05:30 +01:00
CHANGELOG.md chore: version package 2026-11-09 04:06:26 +00:00
LICENSE Initial commit 2026-02-07 04:05:30 +01:00
package-lock.json chore: version package 2026-11-09 04:06:26 +00:00
package.json chore: version package 2026-11-09 04:06:26 +00:00
README.md docs(readme): Quartz 5.1 — npm install and config, correct options and defaults 2026-11-09 22:57:49 +01:00
tsconfig.build.json fix: use separate tsconfig for DTS build to avoid vitest dependency 2026-03-22 13:12:01 +01:00
tsconfig.json fix: use fetchData global for path-prefixed deployments 2026-03-16 18:54:25 +01:00
tsup.config.ts build: keep preact and the other shared packages external (tsup's noExternal overrode them) 2026-11-09 04:49:29 +01:00
vitest.config.ts fix: resolve CI failures by fixing lint config and test setup 2026-02-09 12:58:48 +01:00

@quartz-community/graph

The Graph View component for Quartz - visualize your digital garden as an interactive network graph.

Features

  • 🕸️ Interactive Network Graph - Visualize connections between your pages
  • 🎨 Local & Global Views - See connections to current page or explore the entire graph
  • ⚡ Smooth Animations - Built with D3 force simulation and PixiJS rendering
  • 🏷️ Tag Support - Visualize tags as nodes in the graph
  • 🖱️ Interactive Controls - Drag, zoom, and pan around the graph
  • 💾 Visited Tracking - Highlights pages you've already visited
  • ⌨️ Keyboard Shortcuts - Press Ctrl/Cmd + G to toggle the global graph

Installation

npx quartz plugin add @quartz-community/graph

Usage

This plugin is already enabled in the default quartz.config.yaml. Options go under options, separately for the local and the global graph:

plugins:
  - source: "@quartz-community/graph"
    enabled: true
    options:
      localGraph:
        depth: 2
        showTags: false
      globalGraph:
        removeTags: [draft]
    layout:
      position: right
      priority: 10

Configuration Options

interface D3Config {
  /** Enable node dragging */
  drag: boolean;
  /** Enable zooming */
  zoom: boolean;
  /** Depth of connections to show (-1 for all) */
  depth: number;
  /** Graph scale factor */
  scale: number;
  /** Force repelling strength */
  repelForce: number;
  /** Center force strength */
  centerForce: number;
  /** Distance between linked nodes */
  linkDistance: number;
  /** Label font size */
  fontSize: number;
  /** Opacity multiplier */
  opacityScale: number;
  /** Tag nodes to leave out of the graph */
  removeTags: string[];
  /** Show tags as nodes */
  showTags: boolean;
  /** Dim non-hovered nodes on hover */
  focusOnHover?: boolean;
  /** Enable radial layout */
  enableRadial?: boolean;
}

// Defaults (local / global): drag true, zoom true, depth 1 / -1, scale 1.1 / 0.9,
// repelForce 0.5, centerForce 0.3 / 0.2, linkDistance 30, fontSize 0.6, opacityScale 1,
// removeTags [], showTags true, focusOnHover false / true, enableRadial false / true

interface GraphOptions {
  localGraph?: Partial<D3Config>; // Local page graph config
  globalGraph?: Partial<D3Config>; // Global graph config
}

Default Behavior

Local Graph

By default, the local graph:

  • Shows 1 level of connections (direct links only)
  • Dragging enabled
  • Zoom enabled
  • Tags shown as nodes
  • 250px height
  • Displays on the right side of pages

Global Graph

By default, the global graph:

  • Shows all connections (depth: -1)
  • Opens in fullscreen modal when clicking the graph icon
  • Keyboard shortcut: Ctrl/Cmd + G
  • Focus on hover enabled (dims non-connected nodes)
  • Radial layout enabled
  • Click outside or press Escape to close

How It Works

The Graph component fetches connection data from /static/contentIndex.json (generated by Quartz's built-in content index, configuration.contentIndex) and renders it using:

  • D3 for physics simulation (force-directed layout)
  • PixiJS for high-performance WebGL rendering

External libraries are loaded from CDN when the graph is first rendered.

[!info] Graph View needs the content index, which is built into Quartz and on by default. Don't turn it off (configuration.contentIndex: false) when you use the graph.

Development

This is a first-party Quartz community plugin. It serves as both:

  1. A production-ready Graph View component
  2. A reference implementation for building Quartz community plugins

To build locally:

npm install
npm run build

Documentation

See the plugin page and the Graph view feature page in the Quartz documentation.

License

MIT