• Stars
    star
    184
  • Rank 209,187 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

automatic layout algorithms for mindmaps

mindmap-layouts

automatic layout algorithms for mindmaps

input

{
    "root": {
        "name": "root",
        "children": [
            {
                "name": "child-1",
                "children": [
                    {
                        "name": "child-1-1"
                    },
                    {
                        "name": "child-1-2",
                        "children": [
                            {
                                "name": "child-1-2-1"
                            }
                        ]
                    }
                ]
            },
            {
                "name": "child-2"
            },
            {
                "name": "child-3"
            },
            {
                "name": "child-4",
                "children": [
                    {
                        "name": "child-4-1"
                    },
                    {
                        "name": "child-4-2"
                    }
                ]
            }
        ]
    },
    "links": [
        {
            "source": "child-1-1",
            "name": "special link",
            "target": "child-2"
        }
    ]
}

Root and each of its descendants are nodes in a mindmap, like Topic in XMind.

Links are extra edges that connects two nodes in a mindmap, like Relationship in XMind.

Checkout more about .xmind file: xmind-sdk-javascript

Install

$ npm install mindmap-layouts --save

API

const MindmapLayouts = require('mindmap-layouts')
const layout = new MindmapLayouts.Standard(root, options) // root is tree node like above
const rootNode = layout.doLayout() // you have x, y, centX, centY, actualHeight, actualWidth, etc.

checkout here for a real world demo

demo

layouts

standard

standard

right logical

right-logical

left logical

left-logical

downward organizational

downward-organizational

upward organizational

upward-organizational

[TODO] right fishbone

[TODO] left fishbone

[TODO] indented

[TODO] arc tree

[TODO] elbow tree

[TODO] horizontal Timeline

[TODO] vertical Timeline

links

More Repositories

1

svg-icon

An ultimate SVG icons collection DONE RIGHT, with over 10,000 SVG icons out of the box.
JavaScript
1,054
star
2

xmind-sdk-javascript

XMind SDK for javascript (IN BOTH NODE.JS & BROWSERS)
JavaScript
144
star
3

70-math-quizs-for-programmers

《程序员的算法趣题》代码
Ruby
61
star
4

tiny-segmenter

Mirror of TinySegmenter, the super compact Japanese tokenizer in JavaScript.
45
star
5

blog

leungwensen's blog
HTML
35
star
6

zfinder

[DEPRECATED] it will be wrapped as an APP
JavaScript
13
star
7

d2recharts

data driven react components of echarts
JavaScript
7
star
8

plantuml-parser

parser plantuml language
JavaScript
5
star
9

pastry

please use zero: https://github.com/leungwensen/zero-lang instead.
JavaScript
5
star
10

lab

a collection of all kind of experiments
JavaScript
4
star
11

random-graph

generate random graphs
JavaScript
4
star
12

cjk-tokenizer

A CJK text tokenizer
JavaScript
4
star
13

marked-plus

marked with a few more features
JavaScript
3
star
14

yasuhati

JavaScriptで休むな!8分音符ちゃん♪
JavaScript
3
star
15

template2module

precompile templates into modules, built for high performance
JavaScript
3
star
16

marked-plus-renderer

a renderer function built on top of `marked-plus`, to implement all the extra features I wanted for markdown
JavaScript
3
star
17

file-encoder

file-encoder is a script to convert files to a specified encoding
JavaScript
2
star
18

toolbox

dotfiles, scripts, etc.
Shell
2
star
19

toc-generator

generate table of content
JavaScript
2
star
20

wiser-javascript

wiser in javascript (the search engine from《検索エンジン自作入門》)
JavaScript
2
star
21

doc-indexer

built for static page full-text search
JavaScript
1
star
22

amd-module

A little grave of my AMD loader
JavaScript
1
star
23

gitlab-helper

scripts to help you manage gitlab repos
JavaScript
1
star
24

palettes

Color Palettes, view & make
JavaScript
1
star