From c6c8b0823cbff5ebcbad70f3a8d292a07af4bc9f Mon Sep 17 00:00:00 2001 From: wb-zyx597643 Date: Wed, 24 Jun 2020 16:05:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20mindmap=EF=BC=8Crelationbooks?= =?UTF-8?q?=E6=96=B0=E4=BE=8B=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/demo/mindMap-new/data.js | 374 ++++++++++++++++++ example/demo/mindMap-new/index.jsx | 65 +++ example/demo/mindMap-new/index.less | 41 ++ example/demo/mindMap-new/node.js | 29 ++ example/demo/relationalBooks-new/alis-node.js | 76 ++++ example/demo/relationalBooks-new/data.js | 134 +++++++ example/demo/relationalBooks-new/index.jsx | 44 +++ example/demo/relationalBooks-new/index.less | 115 ++++++ example/demo/relationalBooks-new/node.js | 101 +++++ example/index.jsx | 10 + 10 files changed, 989 insertions(+) create mode 100644 example/demo/mindMap-new/data.js create mode 100644 example/demo/mindMap-new/index.jsx create mode 100644 example/demo/mindMap-new/index.less create mode 100644 example/demo/mindMap-new/node.js create mode 100644 example/demo/relationalBooks-new/alis-node.js create mode 100644 example/demo/relationalBooks-new/data.js create mode 100644 example/demo/relationalBooks-new/index.jsx create mode 100644 example/demo/relationalBooks-new/index.less create mode 100644 example/demo/relationalBooks-new/node.js diff --git a/example/demo/mindMap-new/data.js b/example/demo/mindMap-new/data.js new file mode 100644 index 00000000..5ca83368 --- /dev/null +++ b/example/demo/mindMap-new/data.js @@ -0,0 +1,374 @@ +'use strict'; + +const Node = require('./node.js'); + +module.exports = { + nodes: { + isRoot: true, + id: 'Root', + title: '根节点', + Class: Node, + children: [{ + id: 'subNode1', + Class: Node, + title: '子节点 1', + side: "left", + children: [{ + id: 'subNode1-1', + Class: Node, + title: '子节点 1-1', + side: "right", + }, + { + id: 'subNode1-2', + Class: Node, + title: '子节点 1-2', + side: "right", + children: [{ + id: 'subNode1-2-1', + Class: Node, + title: '子节点 1-2-1', + side: "right", + }] + }, { + id: 'subNode1-3', + Class: Node, + title: '子节点 1-3', + side: "right", + } + ] + }, { + id: 'subNode2', + Class: Node, + title: '子节点 2', + side: "left", + children: [{ + id: 'subNode2-1', + Class: Node, + title: '子节点 2-1', + side: "right", + children: [{ + id: 'subNode2-1-1', + Class: Node, + title: '子节点 2-1-1', + side: "right", + }] + }, + { + id: 'subNode2-2', + Class: Node, + title: '子节点 2-2', + side: "right", + }, { + id: 'subNode2-3', + Class: Node, + title: '子节点 2-3', + side: "right", + children: [{ + id: 'subNode2-3-1', + Class: Node, + title: '子节点 2-3-1', + side: "right", + }] + } + ] + }, + { + id: 'subNode3', + Class: Node, + title: '子节点 3', + side: "left", + children: [{ + id: 'subNode3-1', + side: "left", + Class: Node, + title: '子节点 3-1', + children: [{ + id: 'subNode3-1-1', + side: "left", + Class: Node, + title: '子节点 3-1-1', + }, { + id: 'subNode3-1-2', + side: "left", + Class: Node, + title: '子节点 3-1-2', + }, { + id: 'subNode3-1-3', + side: "left", + Class: Node, + title: '子节点 3-1-3', + }] + }] + }, { + id: 'subNode4', + Class: Node, + title: '子节点 4', + side: "right", + children: [{ + id: 'subNode4-1', + Class: Node, + side: "right", + title: '子节点 4-1', + children: [{ + id: 'subNode4-1-1', + side: "right", + Class: Node, + title: '子节点 4-1-1', + }, { + id: 'subNode4-1-2', + side: "right", + Class: Node, + title: '子节点 4-1-2', + }, { + id: 'subNode4-1-3', + side: "right", + Class: Node, + title: '子节点 4-1-3', + }, { + id: 'subNode4-1-4', + Class: Node, + side: "right", + title: '子节点 4-1-4', + }] + }, { + id: 'subNode4-2', + Class: Node, + side: "right", + title: '子节点 4-2', + }, { + id: 'subNode4-3', + side: "right", + Class: Node, + title: '子节点 4-3', + }, { + id: 'subNode4-4', + Class: Node, + side: "right", + title: '子节点 4-4', + }] + }, { + id: 'subNode5', + Class: Node, + side: 'right', + title: '子节点 5', + children: [{ + id: 'subNode5-1', + Class: Node, + title: '子节点 5-1', + side: "right", + }, + { + id: 'subNode5-2', + Class: Node, + title: '子节点 5-2', + side: "right", + children: [{ + id: 'subNode5-2-1', + Class: Node, + title: '子节点 5-2-1', + side: "right", + }, { + id: 'subNode5-2-2', + Class: Node, + title: '子节点 5-2-2', + side: "right", + }, { + id: 'subNode5-2-3', + Class: Node, + title: '子节点 5-2-3', + side: "right", + }] + }, { + id: 'subNode5-3', + Class: Node, + title: '子节点 5-3', + side: "right", + children: [{ + id: 'subNode5-3-1', + Class: Node, + title: '子节点 5-3-1', + side: "right", + }, { + id: 'subNode5-3-2', + Class: Node, + title: '子节点 5-3-2', + side: "right", + }] + } + ] + } + ] + }, + edges: [{ + id: '0', + target: 'subNode1', + source: 'Root', + type: 'node', + }, { + id: '1', + source: 'Root', + target: 'subNode2', + type: 'node' + }, { + id: '2', + source: 'subNode2', + target: 'subNode2-1', + type: 'node' + }, { + id: '3', + source: 'subNode2', + target: 'subNode2-2', + type: 'node' + }, { + id: '4', + source: 'subNode2-3', + target: 'subNode2', + type: 'node' + }, { + id: '4', + source: 'subNode2-3', + target: 'subNode2-3-1', + type: 'node' + }, { + id: '4', + source: 'subNode2-1-1', + target: 'subNode2-1', + type: 'node' + }, { + id: '5', + source: 'subNode3', + target: 'Root', + type: 'node' + }, { + id: '6', + source: 'subNode3-1', + target: 'subNode3', + type: 'node' + }, { + id: '7', + source: 'subNode4', + target: 'Root', + type: 'node' + }, { + id: '8', + source: 'subNode4', + target: 'subNode4-1', + type: 'node' + }, { + id: '9', + source: 'subNode4-2', + target: 'subNode4', + type: 'node' + }, { + id: '10', + source: 'subNode4-3', + target: 'subNode4', + type: 'node' + }, { + id: '11', + source: 'subNode4-4', + target: 'subNode4', + type: 'node' + }, { + id: '12', + source: 'subNode4-1-1', + target: 'subNode4-1', + type: 'node' + }, { + id: '13', + source: 'subNode4-1-2', + target: 'subNode4-1', + type: 'node' + }, { + id: '14', + source: 'subNode4-1-3', + target: 'subNode4-1', + type: 'node' + }, { + id: '15', + source: 'subNode4-1-4', + target: 'subNode4-1', + type: 'node' + }, { + id: '16', + source: 'subNode1', + target: 'subNode1-1', + type: 'node' + }, { + id: '17', + source: 'subNode1', + target: 'subNode1-2', + type: 'node' + }, { + id: '18', + source: 'subNode1', + target: 'subNode1-3', + type: 'node' + }, { + id: '19', + source: 'subNode1-2', + target: 'subNode1-2-1', + type: 'node' + }, { + id: '20', + source: 'subNode5', + target: 'Root', + type: 'node' + }, { + id: '21', + source: 'subNode5', + target: 'subNode5-1', + type: 'node' + }, { + id: '22', + source: 'subNode5', + target: 'subNode5-2', + type: 'node' + }, { + id: '23', + source: 'subNode5', + target: 'subNode5-3', + type: 'node' + }, { + id: '24', + source: 'subNode5-2', + target: 'subNode5-2-1', + type: 'node' + }, { + id: '25', + source: 'subNode5-2', + target: 'subNode5-2-2', + type: 'node' + }, { + id: '26', + source: 'subNode5-2', + target: 'subNode5-2-3', + type: 'node' + }, { + id: '27', + source: 'subNode5-3', + target: 'subNode5-3-1', + type: 'node' + }, { + id: '28', + source: 'subNode5-3', + target: 'subNode5-3-2', + type: 'node' + }, { + id: '29', + source: 'subNode3-1', + target: 'subNode3-1-1', + type: 'node' + }, { + id: '28', + source: 'subNode3-1', + target: 'subNode3-1-2', + type: 'node' + }, { + id: '28', + source: 'subNode3', + target: 'subNode3-1-3', + type: 'node' + }] +}; \ No newline at end of file diff --git a/example/demo/mindMap-new/index.jsx b/example/demo/mindMap-new/index.jsx new file mode 100644 index 00000000..303fdbe3 --- /dev/null +++ b/example/demo/mindMap-new/index.jsx @@ -0,0 +1,65 @@ +'use strict'; +import React, {Component} from 'react'; +import mockData from './data.js'; +const Canvas = require('../../../index.js').TreeCanvas; +require('./index.less'); + +class MindMapNew extends Component { + constructor() { + super(); + } + componentDidMount() { + let root = document.getElementById('dag-canvas'); + this.canvas = new Canvas({ + root: root, + disLinkable: true, // 可删除连线 + linkable: true, // 可连线 + draggable: true, // 可拖动 + zoomable: true, // 可放大 + moveable: true, // 可平移 + theme: { + edge: { + type: 'AdvancedBezier', + } + }, + layout: { + type: 'mindmap', + options: { + direction: 'H', + getSide(d) { + return d.data.side || 'right'; + }, + getHeight(d) { + return 10; + }, + getWidth(d) { + return 40; + }, + getHGap(d) { + return 50; + }, + getVGap(d) { + return 20; + }, + } + } + }); + this.canvas.draw(mockData, {}, () => { + this.canvas.focusCenterWithAnimate(); + } + ); + this.canvas.on('events', (data) => { + console.log(data); + }); + } + render() { + return ( +
+
+
+
+ ); + } +} + +module.exports = MindMapNew; diff --git a/example/demo/mindMap-new/index.less b/example/demo/mindMap-new/index.less new file mode 100644 index 00000000..0489ac47 --- /dev/null +++ b/example/demo/mindMap-new/index.less @@ -0,0 +1,41 @@ +.mind-map-new { + width: 100%; + height: 100%; + text-align: center; + background: #fff; + .compactBoxTree-canvas { + width: 100%; + height: 100%; + .butterfly-wrapper { + #Root { + border-radius: 10px; + font-weight: 500; + border: 1px solid #d9d9d9; + padding: 8px 16px; + .iconfont { + background: #9254DE; + } + .title { + color: #333; + } + } + .mind-map-node { + position: absolute; + background: #fff; + border: 1px solid #d9d9d9; + border-radius: 10px; + padding: 8px 8px; + display: flex; + justify-content: space-between; + .iconfont { + background: #40A9FF; + padding: 6px; + border-radius: 50%; + } + .title { + color: #333; + } + } + } + } +} \ No newline at end of file diff --git a/example/demo/mindMap-new/node.js b/example/demo/mindMap-new/node.js new file mode 100644 index 00000000..87c26d05 --- /dev/null +++ b/example/demo/mindMap-new/node.js @@ -0,0 +1,29 @@ +'use strict'; + +const Node = require('../../../index.js').TreeNode; +const $ = require('jquery'); + +class BaseNode extends Node { + constructor(opts) { + super(opts); + } + + draw = (opts) => { + console.log('opts: ', opts); + let container = $('
') + .css('top', opts.top) + .css('left', opts.left) + .attr('id', opts.id); + let titleDom = $(` +
+ ${opts.id === 'Root' ? '' : ''} + ${opts.options.title} +
`); + + container.append(titleDom); + + return container[0]; + } +} + +module.exports = BaseNode; \ No newline at end of file diff --git a/example/demo/relationalBooks-new/alis-node.js b/example/demo/relationalBooks-new/alis-node.js new file mode 100644 index 00000000..f96df321 --- /dev/null +++ b/example/demo/relationalBooks-new/alis-node.js @@ -0,0 +1,76 @@ +'use strict'; + +const Node = require('../../../index.js').Node; +const $ = require('jquery'); + +class AlisBaseNode extends Node { + constructor(opts) { + super(opts); + this.options = opts; + } + + draw = (opts) => { + let className = this.options.type; + let container = $('
') + .css('top', opts.top + 'px') + .css('left', opts.left + 'px') + .addClass(className) + .attr('id', opts.id); + + this._createTitle(container); + this._createContent(container); + this._onRemoveNode(container); + + return container[0]; + } + + _createTitle = (dom) => { + let title = $( + `
+ ${this.options.name} +
`); + + dom.append(title); + this._editNode(title); + } + + _createContent(dom) { + let con = $(` +
+

${this.options.data.content}

+ +
`); + + dom.append(con); + this._editNode(con); + } + + _onRemoveNode(dom) { + $(dom).find('#close').click(function () { + dom[0].remove(); + }); + } + + _editNode = (dom) => { + dom.find('.alis-node-edit').click(function (e) { + const oldNode = $(this).prev('.title-text'); + const oldNodeText = $(this).prev('.title-text').text(); + + if (dom[0] === $('.group-node > .title')[0]) { + oldNode.html(``); + $(oldNode).find('input').focus().val(oldNodeText); + } else { + oldNode.html(``); + $(oldNode).find('textarea').focus().val(oldNodeText); + } + oldNode.children().keyup(function (event) { + if (event.keyCode === 13 || event.keyCode === 27) { + const oldInputText = $(this).val(); + + $(this).parent('.title-text').text(oldInputText); + } + }); + }) + } +} +module.exports = AlisBaseNode; \ No newline at end of file diff --git a/example/demo/relationalBooks-new/data.js b/example/demo/relationalBooks-new/data.js new file mode 100644 index 00000000..c10e3930 --- /dev/null +++ b/example/demo/relationalBooks-new/data.js @@ -0,0 +1,134 @@ +'use strict'; + +const BaseNode = require('./node.js'); +const AlisBaseNode = require('./alis-node.js'); +const $ = require('jquery'); + +module.exports = { + nodes: [{ + id: '0', + name: 'Book', + top: 264, + left: 172, + data: { + content: ['id', 'isbn', 'title'] + }, + endpoints: [{ + id: 'point_1', + type: 'source', + orientation: [1, 0], + pos: [0, 1.5] + + }, { + id: 'point_2', + type: 'target', + orientation: [-1, 0], + pos: [0, 1.5] + }], + Class: BaseNode + }, { + id: '1', + name: 'BookPublisher', + top: 488, + left: 374, + data: { + content: ['book_id', 'publisher_id'] + }, + endpoints: [{ + id: 'point_1', + type: 'target', + orientation: [-1, 0], + pos: [0, 1.5] + }, { + id: 'point_2', + type: 'source', + orientation: [1, 0], + pos: [0, 2.5] + }], + Class: BaseNode + }, { + id: '2', + name: 'Author', + top: 488, + left: 750, + data: { + content: ['id', 'name'] + }, + endpoints: [{ + id: 'point_1', + type: 'target', + orientation: [-1, 0], + pos: [0, 1.5] + }], + Class: BaseNode + }, { + id: '3', + name: 'BookAuthor', + top: 754, + left: -36, + data: { + content: ['book_id', 'author_id'] + }, + endpoints: [{ + id: 'point_1', + type: 'source', + orientation: [1, 0], + pos: [0, 1.5] + }, { + id: 'point_2', + type: 'source', + orientation: [1, 0], + pos: [0, 2.5] + }], + Class: BaseNode + }, { + id: '4', + name: 'Publisher', + data: { + content: ['id', 'name'] + }, + top: 754, + left: 374, + endpoints: [{ + id: 'point_1', + type: 'target', + orientation: [-1, 0], + pos: [0, 1.5] + }], + Class: BaseNode + }, { + id: '5', + name: 'Books By Author', + data: { + content: 'SELECT * FROM b INNER JOIN book_author ba ON b.id = ba.book_id GROUP BY ba.author_id' + }, + top: 744, + left: 900, + Class: AlisBaseNode + }], + edges: [{ + source: 'point_1', + target: 'point_1', + sourceNode: '0', + targetNode: '1', + type: 'endpoint', + }, { + source: 'point_2', + target: 'point_1', + sourceNode: '1', + targetNode: '4', + type: 'endpoint', + }, { + source: 'point_1', + target: 'point_2', + sourceNode: '3', + targetNode: '0', + type: 'endpoint', + }, { + source: 'point_2', + target: 'point_1', + sourceNode: '3', + targetNode: '2', + type: 'endpoint', + }], +}; \ No newline at end of file diff --git a/example/demo/relationalBooks-new/index.jsx b/example/demo/relationalBooks-new/index.jsx new file mode 100644 index 00000000..b0d766e2 --- /dev/null +++ b/example/demo/relationalBooks-new/index.jsx @@ -0,0 +1,44 @@ +'use strict'; +import React, {Component} from 'react'; +const Canvas = require('../../../index.js').Canvas; +const mockData = require('./data.js'); + +require('./index.less'); +require('butterfly-dag/dist/index.css'); + +class RelationalBooksNew extends Component { + constructor() { + super(); + this.canvas = null; + } + componentDidMount() { + let root = document.getElementById('dag-canvas'); + this.canvas = new Canvas({ + root: root, + disLinkable: true, // 可删除连线 + linkable: true, // 可连线 + draggable: true, // 可拖动 + zoomable: true, // 可放大 + moveable: true, // 可平移 + theme: { + edge: { + type: 'Straight', + }, + } + }); + this.canvas.setMinimap(true); + this.canvas.draw(mockData, () => { + this.canvas.focusCenterWithAnimate(); + }); + } + render() { + return ( +
+
+
+
+ ); + } +} + +module.exports = RelationalBooksNew; diff --git a/example/demo/relationalBooks-new/index.less b/example/demo/relationalBooks-new/index.less new file mode 100644 index 00000000..4cf1b4a3 --- /dev/null +++ b/example/demo/relationalBooks-new/index.less @@ -0,0 +1,115 @@ +.relational-books-page{ + width: 100%; + height: 100%; + position: relative; + .butterfly-minimap-container { + top: 30px; + right: 30px !important; + } + .flow-canvas { + width: 100%; + height: 100%; + .butterflies-link { + stroke: #c66767; + stroke-width: 3px; + } + .butterfly-wrapper { + .base-node { + width: 200px; + position: absolute; + .title { + line-height: 32px; + height: 32px; + width: 100%; + display: flex; + justify-content: space-between; + background: #597EF7; + padding: 0 8px; + color: #fff; + .remove { + cursor: pointer; + } + .add-node { + cursor: pointer; + } + } + .content { + height: 32px; + width: 200px; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 8px; + background: #fff; + border: 1px solid #d9d9d9; + .remove { + visibility: hidden; + cursor: pointer; + } + .text { + .input-text { + height: 28px; + border: 1px solid #000; + width: 130px; + padding: 0 4px; + } + } + .edit { + visibility: hidden; + cursor: pointer; + } + } + .content:hover > .remove,.content:hover > .edit { + visibility: visible; + } + .content:hover { + background: #d9d9d9; + } + } + .group-node { + width: 200px; + position: absolute; + .title { + line-height: 32px; + height: 32px; + width: 100%; + display: flex; + justify-content: space-between; + background: #597EF7; + padding: 0 8px; + color: #fff; + .title-text { + input { + width: 140px; + color: #333; + height: 28px; + border: 1px solid #ccc; + } + } + #close { + cursor: pointer; + } + .alis-node-edit { + cursor: pointer; + } + } + .container { + display: flex; + padding: 8px; + justify-content: space-between; + border: 1px solid #ccc; + background: #fff; + p { + textarea { + min-height: 80px; + width: 164px; + } + } + .alis-node-edit { + cursor: pointer; + } + } + } + } + } +} \ No newline at end of file diff --git a/example/demo/relationalBooks-new/node.js b/example/demo/relationalBooks-new/node.js new file mode 100644 index 00000000..6a92b1fd --- /dev/null +++ b/example/demo/relationalBooks-new/node.js @@ -0,0 +1,101 @@ +'use strict'; + +const Node = require('../../../index.js').Node; +const $ = require('jquery'); +import '../../static/iconfont.css'; + +class BaseNode extends Node { + constructor(opts) { + super(opts); + this.options = opts; + } + draw = (opts) => { + let className = this.options.type; + let container = $('
') + .css('top', opts.top + 'px') + .css('left', opts.left + 'px') + .addClass(className) + .attr('id', opts.id); + + this._createTitle(container); + this._createChildNode(container); + + return container[0]; + } + + _createTitle(dom) { + let title = $(` +
+ ${this.options.name} + +
`); + + dom.append(title); + this._onAddNode(title); + this._onRemovedNode(title); + } + + _createChildNode(dom) { + $.each(this.options.data.content, (i, item) => { + dom.append(` +
+ + ${item} + +
`); + }); + + let childNode = dom.find('.content'); + + this._onRemovedNode(childNode); + this._onEditNode(childNode); + } + + _onRemovedNode(dom) { + dom.find('.remove').on('click', function () { + this.parentNode.remove(); + }); + } + + _onEditNode(dom) { + dom.find('.edit').click(function () { + const oldNode = $(this).prev('.text'); + const oldNodeText = $(this).prev('.text').text(); + + if ($(oldNode.html()).attr("type") !== 'text') { + oldNode.html(``); + $(oldNode).find('input').focus().val(oldNodeText); + oldNode.children().keyup(function (event) { + if (event.keyCode === 13 || event.keyCode === 27) { + const oldInputText = $(this).val(); + + oldNode.text(oldInputText); + } + }); + } + }) + } + + _onAddNode(dom) { + dom.find('.add-node').click(() => { + let code = ''; + const codeLength = 4; + const random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); + + for (let i = 0; i < codeLength; i++) { + const index = Math.floor(Math.random() * 36); + code += random[index]; + } + dom.parent('.base-node').append(` +
+ + ${code} + +
`); + + this._onRemovedNode($('.content')); + this._onEditNode($('.content')); + }); + } +} +module.exports = BaseNode; diff --git a/example/index.jsx b/example/index.jsx index 2d768ff5..536f386a 100644 --- a/example/index.jsx +++ b/example/index.jsx @@ -11,10 +11,12 @@ import Diodes from './demo/diodes/index.jsx'; import Force from './demo/force/index.jsx'; import RelationalNetwork from './demo/relationalNetwork/index.jsx'; import RelationalBooks from './demo/relationalBooks/index.jsx'; +import RelationalBooksNew from './demo/relationalBooks-new/index.jsx'; import System from './demo/system/index.jsx'; import liteGraph from './demo/liteGraph/index.jsx'; import EntityRelationship from './demo/entityRelationship/index.jsx'; import MindMap from './demo/mindMap/index.jsx'; +import MindMapNew from './demo/mindMap-new/index.jsx'; import CompactBoxTreeNew from './demo/compactBoxTree-new/index.jsx'; import EntityRelationshipNew from './demo/entityRelationship-new/index.jsx'; import EmergencyNew from './demo/emergency-new/index.jsx'; @@ -100,6 +102,12 @@ ReactDOM.render(( decision-new + + RelationalBooks-new + + + MindMapNew + @@ -123,6 +131,8 @@ ReactDOM.render(( + + From 255b633dc18ea082c1164b19dcc19c50ef410d48 Mon Sep 17 00:00:00 2001 From: wb-zyx597643 Date: Sun, 28 Jun 2020 20:08:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BC=A9=E8=BF=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/demo/mindMap-new/data.js | 78 ++++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/example/demo/mindMap-new/data.js b/example/demo/mindMap-new/data.js index 5072fdea..eb807cc0 100644 --- a/example/demo/mindMap-new/data.js +++ b/example/demo/mindMap-new/data.js @@ -34,7 +34,7 @@ module.exports = { side: "right", } ] - }, + }, { id: 'subNode1-3', Class: Node, @@ -42,7 +42,7 @@ module.exports = { side: "right", } ] - }, + }, { id: 'subNode2', Class: Node, @@ -68,7 +68,7 @@ module.exports = { Class: Node, title: '子节点 2-2', side: "right", - }, + }, { id: 'subNode2-3', Class: Node, @@ -102,7 +102,7 @@ module.exports = { side: "left", Class: Node, title: '子节点 3-1-1', - }, + }, { id: 'subNode3-1-2', side: "left", @@ -118,7 +118,7 @@ module.exports = { ] } ] - }, + }, { id: 'subNode4', Class: Node, @@ -132,43 +132,43 @@ module.exports = { title: '子节点 4-1', children: [ { - id: 'subNode4-1-1', - side: "right", - Class: Node, - title: '子节点 4-1-1', - }, + id: 'subNode4-1-1', + side: "right", + Class: Node, + title: '子节点 4-1-1', + }, { id: 'subNode4-1-2', side: "right", Class: Node, title: '子节点 4-1-2', - }, + }, { id: 'subNode4-1-3', side: "right", Class: Node, title: '子节点 4-1-3', }, - { + { id: 'subNode4-1-4', Class: Node, side: "right", title: '子节点 4-1-4', } ] - }, - { + }, + { id: 'subNode4-2', Class: Node, side: "right", title: '子节点 4-2', - }, + }, { id: 'subNode4-3', side: "right", Class: Node, title: '子节点 4-3', - }, + }, { id: 'subNode4-4', Class: Node, @@ -176,7 +176,7 @@ module.exports = { title: '子节点 4-4', } ] - }, + }, { id: 'subNode5', Class: Node, @@ -200,7 +200,7 @@ module.exports = { Class: Node, title: '子节点 5-2-1', side: "right", - }, + }, { id: 'subNode5-2-2', Class: Node, @@ -214,27 +214,27 @@ module.exports = { side: "right", } ] - }, - { - id: 'subNode5-3', - Class: Node, - title: '子节点 5-3', - side: "right", - children: [ - { - id: 'subNode5-3-1', - Class: Node, - title: '子节点 5-3-1', - side: "right", - }, - { - id: 'subNode5-3-2', - Class: Node, - title: '子节点 5-3-2', - side: "right", - } - ] - } + }, + { + id: 'subNode5-3', + Class: Node, + title: '子节点 5-3', + side: "right", + children: [ + { + id: 'subNode5-3-1', + Class: Node, + title: '子节点 5-3-1', + side: "right", + }, + { + id: 'subNode5-3-2', + Class: Node, + title: '子节点 5-3-2', + side: "right", + } + ] + } ] } ]