MCPcopy Index your code
hub / github.com/Developer-Mike/obsidian-advanced-canvas

github.com/Developer-Mike/obsidian-advanced-canvas @6.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 6.4.0 ↗ · + Follow
655 symbols 1,491 edges 79 files 2 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Logo Advanced Canvas for Obsidian.md

<a href="https://github.com/Developer-Mike/obsidian-advanced-canvas/stargazers"><img src="https://img.shields.io/github/stars/Developer-Mike/obsidian-advanced-canvas?colorA=363a4f&colorB=e0ac00&style=for-the-badge" alt="GitHub star count"></a>
<a href="https://github.com/Developer-Mike/obsidian-advanced-canvas/issues"><img src="https://img.shields.io/github/issues/Developer-Mike/obsidian-advanced-canvas?colorA=363a4f&colorB=e93147&style=for-the-badge" alt="Open issues on GitHub"></a>



<a href="https://obsidian.md/plugins?id=advanced-canvas"><img src="https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/obsidianmd/obsidian-releases/master/community-plugin-stats.json&query=$.advanced-canvas.downloads&label=Downloads&style=for-the-badge&colorA=363a4f&colorB=d53984"/></a>
<a href="https://raw.githubusercontent.com/Developer-Mike/obsidian-advanced-canvas/main/LICENSE"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=GPL-3.0&colorA=363a4f&colorB=b7bdf8" alt="GPL-3.0 license"/></a>





<b>⚡ Supercharge</b> your canvas experience! Create presentations, flowcharts and more!

Feature Overview

This plugin enhances the Obsidian canvas with a wide array of features:

All features can be enabled/disabled in the settings.

Installation

Open the Community Plugins tab in the settings and search for "Advanced Canvas" (or click here).

Other installation methods

  • Install it using BRAT
  • Manual folder creation
    1. Create a folder named advanced-canvas in your vault's plugins folder (<vault>/.obsidian/plugins/).
    2. Download main.js, styles.css and manifest.json from the latest release and put them in the advanced-canvas folder.
    3. Enable the plugin in Settings -> Community plugins -> Installed plugins

Support

Please consider supporting the plugin. There are many hours of work and effort behind it. The two easiest ways to support the plugin are either by starring ⭐ the repository or by donating any amount on Ko-fi ❤️. Thank you!

Support me on Ko-fi

Terminology

  • Canvas: The canvas view is the view in which nodes and edges are displayed.
  • Node: A node is a single element in a canvas that can contain text, files, or links. (Some people also call it card or element - but please always use node.)
  • Text Node: A text node is a node that contains text.
  • File Node: A file node is a node that contains a link to another file.
  • Group Node: A group node is a node that contains other nodes.
  • Link Node: A link node is a node that displays a website.
  • Edge: An edge is a connection between two nodes in a canvas. It can be used to represent relationships or connections between different elements. (Please always use edge instead of arrow to avoid confusion with the edge arrow.)
  • Edge Path: The edge path is just the line that connects two nodes in a canvas.
  • Edge Arrow: The edge arrow is the arrow at the end (or start) of an edge that indicates the direction of the connection.
  • Popup Menu: The popup menu is the horizontal menu that is visible if one or more canvas elements (nodes or edges) are selected.
  • Context Menu: The context menu is menu that is visible if you right-click in a canvas view.
  • Control Menu: The control menu is the vertical menu that is visible in the top right corner of a canvas view.
  • Card Menu: The card menu is the horizontal menu at the bottom of the canvas view where you can find options to create new nodes.

Standardized Format

Compatible with the JSON Canvas format, the Advanced JSON Canvas format takes it a step further by adding more features and flexibility. The Advanced JSON Canvas format was introduced to provide longevity, readability, interoperability, and extensibility for canvases created with Advanced Canvas.

Full Metadata Cache Support

Advanced Canvas enables .canvas files to be indexed by the metadata cache. This means that there is now full compatibility with the graph view, outgoing links and backlinks. You can even enable (optional) the creation of an outgoing link if two embeds in a canvas are connected by an edge. This feature brings the full power of Obsidian's linking system to the canvas file format.

Metadata Cache Support Example

<img src="https://raw.githubusercontent.com/Developer-Mike/obsidian-advanced-canvas/main/assets/docs/metadata-cache-support.png" alt="Metadata Cache Support Example"/>

Outgoing Link Using An Edge Example

<img src="https://raw.githubusercontent.com/Developer-Mike/obsidian-advanced-canvas/main/assets/docs/edge-metadata-cache.png" alt="Outgoing Link Using An Edge Example"/>

Technical Details

  • The file cache of a .canvas file now contains a value for the hash key (Generated from the filepath) instead of an empty string.
    • Check the app.metadataCache.fileCache[<filepath>] object to see the changes.
  • The metadata cache is located in the app.metadataCache object - the same object that is used by Obsidian for markdown files.
    • e.g. app.metadataCache.getCache/app.metadataCache.getFileCache now works with .canvas files.
    • The position object which is found inside metadata cache entries now contains a new key nodeId for .canvas files.
    • The metadata cache entry for a .canvas file now contains a new key nodes which is an object of type { [nodeId: string]: MetadataCacheEntry } - this allows for other plugins to access the full metadata cache for single nodes. The MetadataCacheEntry object is the same as for markdown files (even created with the same function - 1:1 compatibility).
  • The resolved links object now has entries for .canvas files.
    • The app.metadataCache.resolvedLinks object values for .canvas files are implemented in the exact same way as for markdown files.

Frontmatter Support

Additionally, Advanced Canvas introduces full frontmatter support for .canvas files. You can now view and edit the frontmatter directly within the canvas view:

  • Accessing Frontmatter: Click the "info" icon located in the top right corner of the canvas view.
  • Functionality: This allows you to add custom properties (metadata) to your canvas files.
  • Use Cases:
    • Categorization & Tagging: Add tags or custom keys for organization.
    • Aliases: Use aliases to create alternative names for your canvas files.
    • Styling: Use cssclasses to apply custom CSS styles to the entire canvas view.
    • Custom Metadata: Define any other properties relevant to your workflow.
  • Searchability: Properties defined in the frontmatter of your .canvas files are searchable using Obsidian's global search pane, further integrating canvases into your knowledge management system.

This significantly enhances the ability to manage, organize, and customize your canvases alongside your other notes in Obsidian.

Auto File Node Edges

Advanced Canvas can automatically create edges between file nodes based on their frontmatter properties. By default (if enabled), it will create edges to files linked in the canvas-edges frontmatter property. This allows you to create fixed relationships between file nodes in your canvas, making it easier to visualize fixed structures or connections between different files.

Single Node Links & Embeds

Advanced Canvas now allows you to link or embed the content of a single node from a .canvas file directly into your markdown files. This provides a granular way to reference specific pieces of information within your canvases. (Take a look at Advanced Canvas: Copy wikilink to node for getting the id of a node).

  • Syntax:
    • Linking: Use the standard wikilink format with the node ID appended after a #: [[canvas-file-name#node-id]]
    • Embedding: Use the standard embed wikilink format, also with the node ID: ![[canvas-file-name#node-id]]
  • Functionality: When you link or embed a node this way, the actual content of that specific node from the canvas will be displayed or linked within your markdown file. This is incredibly useful for creating direct references to diagrams, text snippets, or any other content held within individual canvas nodes.

Better Default Settings

  • Enforce all new nodes to be aligned to the grid
  • Customize default text node size
  • Customize default file node size
  • Modify the minimum node size
  • Disable the font scaling relative to the zoom level

Native-Like File Search

Quickly locate text within your canvas using a familiar search experience. Advanced Canvas integrates a native-like file search specifically for canvas content.

  • Activation: Use the Search current file command, which is commonly bound to the Ctrl+F (or Cmd+F on macOS) keyboard shortcut.
  • Functionality: This opens a search interface that allows you to search for text across all nodes within the currently active canvas.
  • Benefits: Easily find specific information, navigate to relevant nodes, and streamline your workflow when dealing with text-heavy canvases.

Search Example

<img src="https://raw.githubusercontent.com/Developer-Mike/obsidian-advanced-canvas/main/assets/docs/sample-search.gif" alt="Search Example"/>

Canvas Commands

View available commands

  • Advanced Canvas: Toggle readonly
    • Toggle the readonly state of the canvas
  • Advanced Canvas: Create text node
    • Create a new text node
  • `Advanced Canvas: Cr

Extension points exported contracts — how you extend this code

CanvasData (Interface)
(no doc)
assets/formats/advanced-json-canvas/spec/1.0-1.0.d.ts
AdvancedCanvasPluginSettingsValues (Interface)
(no doc)
src/settings.ts
SearchMatch (Interface)
(no doc)
src/patchers/search-command-patcher.ts
MenuOption (Interface)
(no doc)
src/utils/canvas-helper.ts
EventRef (Interface)
(no doc)
src/@types/CustomWorkspaceEvents.d.ts
NodeTemplate (Interface)
(no doc)
src/canvas-extensions/node-templates-canvas-extension.ts
CanvasMetadata (Interface)
(no doc)
assets/formats/advanced-json-canvas/spec/1.0-1.0.d.ts
CustomWorkspaceEvents (Interface)
(no doc)
src/@types/CustomWorkspaceEvents.d.ts

Core symbols most depended-on inside this repo

getData
called by 89
src/@types/Canvas.d.ts
getSetting
called by 82
src/settings.ts
add
called by 70
src/utils/task-queue.ts
filter
called by 51
src/canvas-extensions/export-canvas-extension.ts
setData
called by 34
src/@types/Canvas.d.ts
canvasCommand
called by 33
src/utils/canvas-helper.ts
getBBox
called by 32
src/@types/Canvas.d.ts
getSelectionData
called by 27
src/@types/Canvas.d.ts

Shape

Method 423
Class 139
Interface 76
Function 17

Languages

TypeScript100%

Modules by API surface

src/@types/Canvas.d.ts91 symbols
src/canvas-extensions/portals-canvas-extension.ts25 symbols
src/settings.ts23 symbols
src/utils/modal-helper.ts22 symbols
src/utils/canvas-helper.ts22 symbols
src/canvas-extensions/node-templates-canvas-extension.ts18 symbols
src/canvas-extensions/presentation-canvas-extension.ts15 symbols
src/@types/Obsidian.d.ts15 symbols
src/canvas-extensions/advanced-styles/edge-pathfinding-methods/pathfinding-a-star.ts14 symbols
src/utils/bbox-helper.ts13 symbols
src/patchers/search-command-patcher.ts13 symbols
src/canvas-extensions/z-ordering-canvas-extension.ts12 symbols

For agents

$ claude mcp add obsidian-advanced-canvas \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact