You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
import React, { useEffect, useRef, useState } from 'react';
import 'jsmind/style/jsmind.css'; // 引入 jsMind 的样式
import jsMind from 'jsmind'; // 默认导入
// import 'jsmind/draggable-node'
// import 'jsmind/screenshot'
// import 'jsmind/es6/jsmind.draggable-node.js';
// import 'jsmind/es6/jsmind.screenshot.js';
// import screenshot from 'jsmind/es6/jsmind.screenshot.js';
// import draggable-node from 'jsmind/es6/jsmind.draggable-node.js';
// 定义思维导图数据
const mindData = {
meta: {
name: 'jsMind-demo-tree',
author: 'hizzgdev@163.com',
version: '0.2'
},
format: 'node_tree',
data: {
id: 'root',
topic: 'jsMind',
children: [
{
id: 'easy',
topic: 'Easy',
direction: 'left',
expanded: false,
children: [
{ id: 'easy1', topic: 'Easy to show' },
{ id: 'easy2', topic: 'Easy to edit' },
{ id: 'easy3', topic: 'Easy to store' },
{ id: 'easy4', topic: 'Easy to embed' }
]
},
{
id: 'open',
topic: 'Open Source',
direction: 'right',
expanded: true,
children: [
{ id: 'open1', topic: 'on GitHub' },
{ id: 'open2', topic: 'BSD License' }
]
},
{
id: 'powerful',
topic: 'Powerful',
direction: 'right',
children: [
{ id: 'powerful1', topic: 'Base on Javascript' },
{ id: 'powerful2', topic: 'Base on HTML5' },
{ id: 'powerful3', topic: 'Depends on you' }
]
},
{
id: 'other',
topic: 'test node',
direction: 'left',
children: [
{ id: 'other1', topic: "I'm from local variable" },
{ id: 'other2', topic: 'I can do everything' }
]
}
]
}
};
const MindMapView = ({ strategies, onDelete, onEdit, onSelectStrategy }) => {
const mindMapContainer = useRef(null);
const jmInstance = useRef(null);
const [selectedNode, setSelectedNode] = useState(null);
const [newNodeTopic, setNewNodeTopic] = useState('');
const [editNodeTopic, setEditNodeTopic] = useState('');
};
export default MindMapView;
Beta Was this translation helpful? Give feedback.
All reactions