Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cross2d/mindmap

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cross2d/mindmap

Mindmap Vue Component

  • 1.6.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Mindmap Vue Component

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

NameTypeDefaultDescription
v-modelArrayundefinedSet up mindmap data
widthNumber100%Set component width
heightNumberundefinedSet component height
xSpacingNumber80Set node horizontal spacing
ySpacingNumber20Set node vertical spacing
strokeWidthNumber4Set the width of the line
draggableBooleantrueSet whether node is draggable
gpsBooleantrueWhether to show center button
fitViewBooleantrueWhether to show zoom button
showNodeAddBooleantrueWhether to show add-node button
keyboardBooleantrueWhether to respond to keyboard event
contextMenuBooleantrueWhether to respond to contextMenu event
nodeClickBooleantrueSet whether the node can be clicked and edited
zoomableBooleantrueWhether it can be zoomed or dragged
showUndoBooleantrueWhether to show the undo/redo 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>

Todo

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

Keywords

FAQs

Package last updated on 15 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc