Giter VIP home page Giter VIP logo

mindmap's Introduction

Mindmap Vue Component

npm

A mind map Vue component inspired by MindNode, based on d3.js
The functions currently implemented include editing, dragging, zooming, undoing, and context menu ...

中文说明

Online demo:https://mindnode.5xin.xyz/

Install

npm install @hellowuxin/mindmap
// In your vue file
import mindmap from '@hellowuxin/mindmap'

API

Name Type Default Description
v-model Array undefined Set up mindmap data
width Number 100% Set component width
height Number undefined Set component height
xSpacing Number 80 Set node horizontal spacing
ySpacing Number 20 Set node vertical spacing
strokeWidth Number 4 Set the width of the line
draggable Boolean true Set whether node is draggable
gps Boolean true Whether to show center button
fitView Boolean true Whether to show zoom button
showNodeAdd Boolean true Whether to show add-node button
keyboard Boolean true Whether to respond to keyboard event
contextMenu Boolean true Whether to respond to contextMenu event
nodeClick Boolean true Set whether the node can be clicked and edited
zoomable Boolean true Whether it can be zoomed or dragged
showUndo Boolean true Whether to show the undo/redo button
download Boolean true Whether to show the download button

Example

<template>
  <div id="app">
    <mindmap
      v-model="data"
    ></mindmap>
  </div>
</template>

<script>
import mindmap from '@hellowuxin/mindmap'

export default {
  name: 'App',
  components: {
    mindmap
  },
  data: () => ({
    data: [{
      "name":"如何学习D3",
      "children":
      [
        {
          "name":"预备知识",
          "children":
          [
            {"name":"HTML & CSS", "children": []},
            {"name":"JavaScript", "children": []}
        },
        {
          "name":"安装",
          "children": []
        },
        ...
      ]
    }]
  })
}
</script>

Keyboard Event

⇥ tab⏎ enter⌫ backspace⌘ cmd+z⌘ cmd+y

Todo

  • Export multiple formats
  • Set node width and height
  • Multiple root nodes
  • Collapse node
  • ...

mindmap's People

Contributors

hellowuxin avatar dependabot[bot] avatar

Watchers

James Cloos 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.