How wanglin2/mind-map works
Purpose and deployable surfaces
This repository contains an open-source framework-agnostic JavaScript mind-map engine plus a Vue 2 browser editor built on it. The engine is published from simple-mind-map/index.js (with simple-mind-map/full.js as a broader bundle entry); the application starts at web/src/main.js and mounts web/src/App.vue. Prebuilt static output is committed under dist/ and can be served through nginx.conf or Dockerfile.
Application shell and editor orchestration
Vue provides routing, global state, localization, and the editor workspace. web/src/router.js selects document/editor pages; web/src/store.js holds UI/application state; web/src/pages/Edit/Index.vue composes the interactive editor. web/src/pages/Edit/components/Edit.vue is the main boundary between UI controls and the mind-map library, while toolbars, sidebars, import/export, and context menus invoke library APIs.
Core mind-map runtime
The library’s core coordinates stateful editing, events, rendering, and viewport behavior:
• simple-mind-map/src/core/command/Command.js
• simple-mind-map/src/core/event/Event.js
• simple-mind-map/src/core/render/Render.js
• simple-mind-map/src/core/view/View.js
Commands mediate mutations and keyboard actions; events distribute interaction/lifecycle signals; rendering transforms map data into visual nodes and connections; the view manages canvas/SVG viewport navigation such as pan and zoom.
Node model, visual construction, and editing
Node rendering is decomposed into a central node object plus shape, style, layout, content, expansion, and interaction concerns. Key paths are:
• simple-mind-map/src/core/render/node/MindMapNode.js
• simple-mind-map/src/core/render/node/Shape.js
• simple-mind-map/src/core/render/node/Style.js
This is the primary boundary where structured node data and theme/options become editable visual objects. TextEdit.js handles in-place text editing, while node command wrappers and cooperative helpers connect visual actions back to command-driven state changes.
Layout and presentation pipeline
Layouts calculate node positions and connector geometry independently of the UI. The shared contract begins at simple-mind-map/src/layouts/Base.js; concrete topology implementations include:
• simple-mind-map/src/layouts/MindMap.js
• simple-mind-map/src/layouts/LogicalStructure.js
• simple-mind-map/src/layouts/Fishbone.js
The render pipeline selects a layout based on map options, computes placement, then renders nodes/lines. Themes provide the default visual policy through simple-mind-map/src/theme/index.js and simple-mind-map/src/theme/default.js.
Extensibility, formats, and integrations
Optional capabilities are library plugins, installed by consumers rather than embedded in core. Architecturally significant plugins include interaction/export and rich map annotations:
• simple-mind-map/src/plugins/Drag.js
• simple-mind-map/src/plugins/Export.js
• simple-mind-map/src/plugins/ExportXMind.js
Import/export converters form a separate data boundary for Markdown, text, and XMind: simple-mind-map/src/parse/markdown.js, simple-mind-map/src/parse/toMarkdown.js, and simple-mind-map/src/parse/xmind.js. The Vue app exposes these through web/src/pages/Edit/components/Import.vue and web/src/pages/Edit/components/Export.vue.
Runtime boundaries and external services
The shipped product is a client-side web application: browser DOM/canvas/SVG APIs, Vue 2, and Element UI are material runtime dependencies. There is no server implementation in this tree. web/src/api/index.js and AI-facing UI (web/src/pages/Edit/components/AiChat.vue, AiCreate.vue) represent an outbound API boundary; deployment is static assets behind Nginx. Closed-source desktop, Obsidian, and uTools products referenced by the README are not implemented here.
Main entry points: Render.js Renderer · Index.vue Editor workspace · Command.js Commands · MindMapNode.js Mind-map node
Components 27
Vue editor
Browser editor application.
- App bootstrap
web/src/main.js - App shell
web/src/App.vue - Router
web/src/router.js - Global state
web/src/store.js - Editor workspace · Composes the interactive editor.
web/src/pages/Edit/Index.vue - Editor bridge · Connects UI controls to mind-map APIs.
web/src/pages/Edit/components/Edit.vue - Import UI
web/src/pages/Edit/components/Import.vue - Export UI
web/src/pages/Edit/components/Export.vue - Outbound API · Used by AI-facing editor UI.
web/src/api/index.js
Mind-map engine
Framework-agnostic runtime and extensions.
- Library entry · Published engine entry point.
simple-mind-map/index.js - Full bundle · Broader published bundle.
simple-mind-map/full.js - Commands · Mediates edits and keyboard actions.
simple-mind-map/src/core/command/Command.js - Events · Distributes interaction and lifecycle signals.
simple-mind-map/src/core/event/Event.js - Renderer · Builds nodes and connections from map data.
simple-mind-map/src/core/render/Render.js - Viewport · Manages pan and zoom.
simple-mind-map/src/core/view/View.js - Mind-map node · Editable visual representation of structured node data.
simple-mind-map/src/core/render/node/MindMapNode.js - Node shape
simple-mind-map/src/core/render/node/Shape.js - Node style
simple-mind-map/src/core/render/node/Style.js - Layout strategies · Shared topology contract with mind-map, logical, and fishbone layouts.
simple-mind-map/src/layouts/Base.js - Mind-map layout
simple-mind-map/src/layouts/MindMap.js - Logical layout
simple-mind-map/src/layouts/LogicalStructure.js - Fishbone layout
simple-mind-map/src/layouts/Fishbone.js - Themes · Default theme policy.
simple-mind-map/src/theme/index.js - Optional plugins · Consumer-installed interaction and export capabilities.
simple-mind-map/src/plugins/Drag.js - Format converters · Markdown, text, and XMind conversion.
simple-mind-map/src/parse/markdown.js
Delivery
Static deployment boundary.
- Static assets · Committed browser deployment output.
- Nginx serving
nginx.conf
Connections 29
- Library entry → Commands: exposes
- Library entry → Renderer: exposes
- Full bundle → Optional plugins: includes extensions
- Commands → Events: emits changes
- Commands → Renderer: drives updates
- Renderer → Mind-map node: constructs
- Renderer → Layout strategies: selects
- Renderer → Themes: applies
- Renderer → Viewport: renders in
- Mind-map node → Node shape: uses
- Mind-map node → Node style: uses
- Mind-map node → Commands: edits through
- Layout strategies → Mind-map layout: implements
- Layout strategies → Logical layout: implements
- Layout strategies → Fishbone layout: implements
- Optional plugins → Commands: extends
- Optional plugins → Format converters: exports formats
- App bootstrap → App shell: mounts
- App shell → Router: uses
- App shell → Global state: uses
- Router → Editor workspace: routes to
- Editor workspace → Editor bridge: composes
- Editor workspace → Import UI: includes
- Editor workspace → Export UI: includes
- Editor bridge → Library entry: uses engine APIs
- Import UI → Format converters: imports via
- Export UI → Format converters: exports via
- Editor workspace → Outbound API: AI requests
- Static assets → Nginx serving: served by