GithubHelp home page GithubHelp logo

qingniaotonghua / mindmap-layouts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leungwensen/mindmap-layouts

0.0 1.0 0.0 502 KB

automatic layout algorithms for mindmaps

License: MIT License

JavaScript 91.52% HTML 8.48%

mindmap-layouts's Introduction

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

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

mindmap-layouts's People

Contributors

leungwensen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.