Skip to content

Commit 81e5fa4

Browse files
committed
Initial release: Canvas MindMap plugin for Obsidian
0 parents  commit 81e5fa4

26 files changed

Lines changed: 4987 additions & 0 deletions

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release Obsidian plugin
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Use Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "18.x"
19+
20+
- name: Build plugin
21+
run: |
22+
npm install
23+
npm run build
24+
25+
- name: Create release
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
tag="${GITHUB_REF#refs/tags/}"
30+
gh release create "$tag" \
31+
--title="$tag" \
32+
--draft \
33+
main.js manifest.json styles.css

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
main.js
3+
*.js.map
4+
data.json

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 bench
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Canvas MindMap
2+
3+
Turn Obsidian Canvas into a powerful mind mapping tool with keyboard-driven node operations, auto-layout, branch coloring, and collapse/expand.
4+
5+
## Features
6+
7+
- **Keyboard-driven editing** — Add child/sibling nodes, delete nodes, and navigate the tree entirely from the keyboard
8+
- **Auto-layout** — Automatically arranges nodes in a clean tree layout after every operation
9+
- **Branch coloring** — Assigns distinct colors to each top-level branch for visual clarity
10+
- **Collapse/expand** — Collapse subtrees to focus on specific branches, expand them when needed
11+
- **Balanced layout** — Distribute children on both sides of a root node for a centered mind map
12+
- **Flip branches** — Move a branch to the opposite side of its parent
13+
- **Spatial navigation** — Navigate between nodes using directional commands (right, left, up, down)
14+
- **Auto-resize** — Nodes automatically resize to fit their content as you type
15+
- **Resize to fit** — Batch-resize selected subtree or all nodes to fit their content
16+
- **FreeMind import** — Import `.mm` files from FreeMind into Obsidian Canvas
17+
- **Table of contents** — A sidebar view showing the tree structure for quick navigation
18+
- **Non-Latin keyboard support** — Physical key fallback for Arabic, Cyrillic, and other keyboard layouts
19+
20+
## Commands
21+
22+
All commands are available from the command palette (`Ctrl/Cmd+P`). You can assign your own hotkeys in Settings > Hotkeys.
23+
24+
| Command | Description |
25+
|---------|-------------|
26+
| Edit selected node | Start editing the selected node |
27+
| Add child node | Create a new child node (selected text moves to child) |
28+
| Add sibling node | Create a sibling node below the current one |
29+
| Delete node and focus parent | Remove the current node and select its parent |
30+
| Flip branch to other side | Move a branch to the opposite side of its parent |
31+
| Toggle balanced layout | Distribute children evenly on both sides, or collapse to one side |
32+
| Navigate right/left/up/down | Move selection spatially through the tree |
33+
| Resize & re-layout selected subtree | Resize nodes in the subtree to fit content and re-layout |
34+
| Resize all nodes to fit content | Resize every node in the canvas to fit its content |
35+
| Apply branch colors | Manually trigger branch color assignment |
36+
| Toggle mindmap mode | Enable or disable mindmap mode for the current canvas |
37+
| Toggle table of contents | Open or close the TOC sidebar |
38+
| Import FreeMind file | Import a `.mm` mind map file into the current canvas |
39+
40+
## Settings
41+
42+
| Setting | Description | Default |
43+
|---------|-------------|---------|
44+
| Default mindmap mode | Whether canvases open in mindmap mode by default | On |
45+
| Auto-layout | Automatically arrange nodes after adding/deleting | On |
46+
| Auto-color branches | Assign distinct colors to top-level branches | On |
47+
| Horizontal gap | Space between parent and child nodes (px) | 80 |
48+
| Vertical gap | Space between sibling nodes (px) | 20 |
49+
| Default node width | Width of newly created nodes (px) | 300 |
50+
| Default node height | Height of newly created nodes (px) | 60 |
51+
| Max node height | Maximum height before a node scrolls (px) | 300 |
52+
| Navigation zoom padding | Extra space around the target node when zooming after navigation (px) | 200 |
53+
54+
## Installation
55+
56+
### From community plugins (coming soon)
57+
58+
1. Open Settings > Community plugins
59+
2. Search for "Canvas MindMap"
60+
3. Click Install, then Enable
61+
62+
### Manual installation
63+
64+
1. Download `main.js`, `manifest.json`, and `styles.css` from the [latest release](https://github.com/mobench/canvas-mindmap/releases/latest)
65+
2. Create a folder `canvas-mindmap` in your vault's `.obsidian/plugins/` directory
66+
3. Copy the downloaded files into that folder
67+
4. Enable the plugin in Settings > Community plugins
68+
69+
## Disclosures
70+
71+
- This plugin does **not** make any network requests
72+
- This plugin does **not** collect telemetry or analytics
73+
- This plugin does **not** access files outside your vault
74+
- This plugin has **no** paid features or premium tiers
75+
- This plugin is desktop only (Canvas is a desktop feature)

esbuild.config.mjs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import esbuild from "esbuild";
2+
import process from "process";
3+
import builtins from "builtin-modules";
4+
5+
const banner = `/*
6+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
7+
if you want to view the source, please visit the github repository of this plugin
8+
*/
9+
`;
10+
11+
const prod = process.argv[2] === "production";
12+
13+
const context = await esbuild.context({
14+
banner: { js: banner },
15+
entryPoints: ["src/main.ts"],
16+
bundle: true,
17+
external: [
18+
"obsidian",
19+
"electron",
20+
"@codemirror/autocomplete",
21+
"@codemirror/collab",
22+
"@codemirror/commands",
23+
"@codemirror/language",
24+
"@codemirror/lint",
25+
"@codemirror/search",
26+
"@codemirror/state",
27+
"@codemirror/view",
28+
"@lezer/common",
29+
"@lezer/highlight",
30+
"@lezer/lr",
31+
...builtins,
32+
],
33+
format: "cjs",
34+
target: "es2018",
35+
logLevel: "info",
36+
sourcemap: prod ? false : "inline",
37+
treeShaking: true,
38+
outfile: "main.js",
39+
});
40+
41+
if (prod) {
42+
await context.rebuild();
43+
process.exit(0);
44+
} else {
45+
await context.watch();
46+
}

manifest.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": "canvas-mindmap",
3+
"name": "Canvas MindMap",
4+
"version": "0.1.0",
5+
"minAppVersion": "1.5.0",
6+
"description": "Turn Obsidian Canvas into a powerful mind mapping tool with keyboard shortcuts, auto-layout, branch coloring, and collapse/expand.",
7+
"author": "mobench",
8+
"isDesktopOnly": true
9+
}

0 commit comments

Comments
 (0)