Skip to content

chezhe/mdmp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MDMP, aka MarkDown2MindmaP

About

You can convert markdown list to mindmap.

  1. First, use simple-markdown to parse markdown into a tree structure.
type MapTree = {
  title: string
  children: MapTree[]
}
  1. Then, recursively render the nodes and their children until children is empty.

  2. Finally, we have node DOM, use ref to get the DOM element position and size, use svg to connect them.

You can

  1. dynamically add/remove/update nodes

  2. render multiple mindmap

  3. control the connection line

  • curved
  • direct
  • rectilinear
  1. control the line if animated

Test

run

yarn test

to test the parse function and the render function.

About parse

on branch feature/parse, I wrote a custom parse function to parse markdown into a tree structure. It's simple and fast, but only works with list, not like simple-markdown.