Obsidian Canvas Creator
Transform text content into structured Obsidian Canvas files with support for MindMap and freeform layouts.
When to Use This Skill
- - User requests to create a canvas, mind map, or visual diagram from text
- User wants to organize information spatially
- User mentions "Obsidian Canvas" or similar visualization tools
- Converting structured content (articles, notes, outlines) into visual format
Core Workflow
1. Analyze Content
Read and understand the input content:
- - Identify main topics and hierarchical relationships
- Extract key points, facts, and supporting details
- Note any existing structure (headings, lists, sections)
2. Determine Layout Type
Ask user to choose or infer from context:
MindMap Layout:
- - Radial structure from center
- Parent-child relationships
- Clear hierarchy
- Good for: brainstorming, topic exploration, hierarchical content
Freeform Layout:
- - Custom positioning
- Flexible relationships
- Multiple connection types
- Good for: complex networks, non-hierarchical content, custom arrangements
3. Plan Structure
For MindMap:
- - Identify central concept (root node)
- Map primary branches (main topics)
- Organize secondary branches (subtopics)
- Position leaf nodes (details)
For Freeform:
- - Group related concepts
- Identify connection patterns
- Plan spatial zones
- Consider visual flow
4. Generate Canvas
Create JSON following the Canvas specification:
Node Creation:
- - Assign unique 8-12 character hex IDs
- Set appropriate dimensions based on content length
- Apply consistent color schemes
- Ensure no coordinate overlaps
Edge Creation:
- - Connect parent-child relationships
- Use appropriate arrow styles
- Add labels for complex relationships
- Choose line styles (straight for hierarchy, curved for cross-references)
Grouping (Optional):
- - Create visual containers for related nodes
- Use subtle background colors
- Add descriptive labels
5. Apply Layout Algorithm
MindMap Layout Calculations:
Refer to references/layout-algorithms.md for detailed algorithms. Key principles:
- - Center root at (0, 0)
- Distribute primary nodes radially
- Space secondary nodes based on sibling count
- Maintain minimum spacing: 320px horizontal, 200px vertical
Freeform Layout Principles:
- - Start with logical groupings
- Position groups with clear separation
- Connect across groups with curved edges
- Balance visual weight across canvas
6. Validate and Output
Before outputting:
Validation Checklist:
- - All nodes have unique IDs
- No coordinate overlaps (check distance > node dimensions + spacing)
- All edges reference valid node IDs
- Groups (if any) have labels
- Colors use consistent format (hex or preset numbers)
- JSON is properly escaped (Chinese quotes: 『』 for double, 「」 for single)
Output Format:
- - Complete, valid JSON Canvas file
- No additional explanation text
- Directly importable into Obsidian
Node Sizing Guidelines
Text Length-Based Sizing:
- - Short text (<30 chars): 220 × 100 px
- Medium text (30-60 chars): 260 × 120 px
- Long text (60-100 chars): 320 × 140 px
- Very long text (>100 chars): 320 × 180 px
Color Schemes
Preset Colors (Recommended):
- -
"1" - Red (warnings, important) - INLINECODE2 - Orange (action items)
- INLINECODE3 - Yellow (questions, notes)
- INLINECODE4 - Green (positive, completed)
- INLINECODE5 - Cyan (information, details)
- INLINECODE6 - Purple (concepts, abstract)
Custom Hex Colors:
Use for brand consistency or specific themes. Always use uppercase format: INLINECODE7
Critical Rules
- 1. Quote Handling:
- Chinese double quotes → 『』
- Chinese single quotes → 「」
- English double quotes → INLINECODE8
- 2. ID Generation:
- 8-12 character random hex strings
- Must be unique across all nodes and edges
- 3. Z-Index Order:
- Output groups first (bottom layer)
- Then subgroups
- Finally text/link nodes (top layer)
- 4. Spacing Requirements:
- Minimum horizontal: 320px between node centers
- Minimum vertical: 200px between node centers
- Account for node dimensions when calculating
- 5. JSON Structure:
- Top level contains only
nodes and
edges arrays
- No extra wrapping objects
- No comments in output
- 6. No Emoji:
- Do not use any Emoji symbols in node text
- Use color coding or text labels for visual distinction instead
Examples
Simple MindMap Request
User: "Create a mind map about solar system planets"
Process:
- 1. Identify center: "Solar System"
- Primary branches: Inner Planets, Outer Planets, Dwarf Planets
- Secondary nodes: Individual planets with key facts
- Apply radial layout
- Generate JSON with proper spacing
Freeform Content Request
User: "Turn this article into a canvas" + [article text]
Process:
- 1. Extract article structure (intro, body sections, conclusion)
- Identify key concepts and relationships
- Group related sections spatially
- Connect with labeled edges
- Apply freeform layout with clear zones
Reference Documents
- - Canvas Specification:
references/canvas-spec.md - Complete JSON Canvas format specification - Layout Algorithms:
references/layout-algorithms.md - Detailed positioning algorithms for both layout types
Load these references when:
- - Need specification details for edge cases
- Implementing complex layout calculations
- Troubleshooting validation errors
Tips for Quality Canvases
- 1. Keep text concise: Each node should be scannable (<2 lines preferred)
- Use hierarchy: Group by importance and relationship
- Balance the canvas: Distribute nodes to avoid clustering
- Strategic colors: Use colors to encode meaning, not just decoration
- Meaningful connections: Only add edges that clarify relationships
- Test in Obsidian: Verify the output opens correctly
Common Pitfalls to Avoid
- - Overlapping nodes (always check distances)
- Inconsistent quote escaping (breaks JSON parsing)
- Missing group labels (causes sidebar navigation issues)
- Too much text in nodes (use file nodes for long content)
- Duplicate IDs (each must be unique)
- Unconnected nodes (unless intentional islands)
Obsidian Canvas Creator
将文本内容转换为结构化的Obsidian Canvas文件,支持思维导图和自由布局两种模式。
何时使用此技能
- - 用户请求从文本创建画布、思维导图或可视化图表
- 用户希望以空间方式组织信息
- 用户提及Obsidian Canvas或类似可视化工具
- 将结构化内容(文章、笔记、大纲)转换为可视化格式
核心工作流程
1. 分析内容
阅读并理解输入内容:
- - 识别主要主题和层级关系
- 提取关键点、事实和支持性细节
- 注意任何现有结构(标题、列表、章节)
2. 确定布局类型
请用户选择或从上下文中推断:
思维导图布局:
- - 从中心向外辐射结构
- 父子关系
- 清晰的层级
- 适用于:头脑风暴、主题探索、层级化内容
自由布局:
- - 自定义定位
- 灵活的关系
- 多种连接类型
- 适用于:复杂网络、非层级化内容、自定义排列
3. 规划结构
思维导图:
- - 确定中心概念(根节点)
- 映射主要分支(主要主题)
- 组织次要分支(子主题)
- 定位叶节点(细节)
自由布局:
- - 分组相关概念
- 识别连接模式
- 规划空间区域
- 考虑视觉流程
4. 生成画布
按照Canvas规范创建JSON:
节点创建:
- - 分配唯一的8-12字符十六进制ID
- 根据内容长度设置适当尺寸
- 应用一致的配色方案
- 确保坐标无重叠
边创建:
- - 连接父子关系
- 使用适当的箭头样式
- 为复杂关系添加标签
- 选择线条样式(层级用直线,交叉引用用曲线)
分组(可选):
- - 为相关节点创建视觉容器
- 使用柔和的背景色
- 添加描述性标签
5. 应用布局算法
思维导图布局计算:
详细算法请参考references/layout-algorithms.md。关键原则:
- - 将根节点居中于(0, 0)
- 径向分布主节点
- 根据兄弟节点数量间隔次级节点
- 保持最小间距:水平320px,垂直200px
自由布局原则:
- - 从逻辑分组开始
- 将分组清晰分离定位
- 使用曲线边连接跨组节点
- 平衡画布上的视觉重量
6. 验证并输出
输出前:
验证清单:
- - 所有节点具有唯一ID
- 无坐标重叠(检查距离 > 节点尺寸 + 间距)
- 所有边引用有效节点ID
- 分组(如有)有标签
- 颜色使用一致格式(十六进制或预设数字)
- JSON正确转义(中文双引号:『』,中文单引号:「」)
输出格式:
- - 完整、有效的JSON Canvas文件
- 无额外解释文本
- 可直接导入Obsidian
节点尺寸指南
基于文本长度的尺寸:
- - 短文本(<30字符):220 × 100 px
- 中等文本(30-60字符):260 × 120 px
- 长文本(60-100字符):320 × 140 px
- 超长文本(>100字符):320 × 180 px
配色方案
预设颜色(推荐):
- - 1 - 红色(警告、重要)
- 2 - 橙色(行动项)
- 3 - 黄色(问题、笔记)
- 4 - 绿色(积极、已完成)
- 5 - 青色(信息、细节)
- 6 - 紫色(概念、抽象)
自定义十六进制颜色:
用于品牌一致性或特定主题。始终使用大写格式:#4A90E2
关键规则
- 1. 引号处理:
- 中文双引号 → 『』
- 中文单引号 → 「」
- 英文双引号 → \
- 2. ID生成:
- 8-12字符随机十六进制字符串
- 所有节点和边必须唯一
- 3. Z轴顺序:
- 先输出分组(底层)
- 然后是子分组
- 最后是文本/链接节点(顶层)
- 4. 间距要求:
- 最小水平:节点中心间距320px
- 最小垂直:节点中心间距200px
- 计算时需考虑节点尺寸
- 5. JSON结构:
- 顶层仅包含nodes和edges数组
- 无额外包装对象
- 输出中无注释
- 6. 无表情符号:
- 节点文本中不使用任何表情符号
- 使用颜色编码或文本标签进行视觉区分
示例
简单思维导图请求
用户:创建一个关于太阳系行星的思维导图
处理过程:
- 1. 识别中心:太阳系
- 主要分支:内行星、外行星、矮行星
- 次级节点:各行星及其关键事实
- 应用径向布局
- 生成具有适当间距的JSON
自由内容请求
用户:将这篇文章转换为画布 + [文章文本]
处理过程:
- 1. 提取文章结构(引言、正文部分、结论)
- 识别关键概念和关系
- 空间上分组相关部分
- 使用带标签的边连接
- 应用具有清晰区域的自由布局
参考文档
- - Canvas规范:references/canvas-spec.md - 完整的JSON Canvas格式规范
- 布局算法:references/layout-algorithms.md - 两种布局类型的详细定位算法
在以下情况加载这些参考:
- - 需要边缘情况的规范细节
- 实现复杂布局计算
- 排查验证错误
高质量画布技巧
- 1. 保持文本简洁:每个节点应易于浏览(最好不超过2行)
- 使用层级:按重要性和关系分组
- 平衡画布:分布节点避免聚集
- 策略性使用颜色:用颜色编码含义,而非仅装饰
- 有意义的连接:仅添加能阐明关系的边
- 在Obsidian中测试:验证输出能正确打开
需避免的常见陷阱
- - 节点重叠(始终检查距离)
- 引号转义不一致(破坏JSON解析)
- 缺少分组标签(导致侧边栏导航问题)
- 节点文本过多(长内容使用文件节点)
- 重复ID(每个必须唯一)
- 未连接的节点(除非有意为之的独立节点)