ssshooter / mind-elixir-core Goto Github PK
View Code? Open in Web Editor NEW⚗ Mind Elixir is a framework agnostic mind map core.
Home Page: https://docs.mind-elixir.com/
License: MIT License
⚗ Mind Elixir is a framework agnostic mind map core.
Home Page: https://docs.mind-elixir.com/
License: MIT License
My team is facing an issue while using your package, that is, the mind-map image generated has the name of the center node but with underscores at random positions in the name. Is there a way to set a name of our choice?
console.log('d', d)
let mind = new MindElixir({
el: '#map',
direction: MindElixir.LEFT,
data: MindElixir.new(d), // can also set data return from .getAllData()
draggable: true, // default true
contextMenu: true, // default true
toolBar: true, // default true
nodeMenu: true, // default true
keypress: true, // default true
})
mind.init()
Where d in console
linkData: Object { }
nodeData: Object { id: "root", topic: "Solid Map", root: true, … }
Any ideas?
xmind.html:30 Uncaught TypeError: MindElixir.new is not a function
at xmind.html:30
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<head>
<meta charset="utf-8">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mind-elixir.js"></script>
</head>
<body>
<div class="outer">
<div id="map"></div>
</div>
<style>
.outer {
position: relative;
margin: 50px;
}
#map {
height: 500px;
width: 100%;
overflow: auto;
}
</style>
<script type="text/javascript">
let mind = new MindElixir({
el: '#map',
direction: MindElixir.LEFT,
data: MindElixir.new('new topic'), // can also set data return from .getAllData()
draggable: true, // default true
contextMenu: true, // default true
toolBar: true, // default true
nodeMenu: true, // default true
keypress: true, // default true
})
mind.init()
// mind.getAllData()
E('node-id')
</script>
</body>
</html>
Link between Node Not working
通过
<script src="https://cdn.jsdelivr.net/npm/regenerator-runtime"></script> <script src="https://cdn.jsdelivr.net/npm/mind-elixir/dist/mind-elixir.js"></script>或者源码编译导入
在mind-exlixir.js中对firefox(版本84.0 (64 位))存在兼容性问题,drag和dragend中的e.clientX和e.clientY的值始终都为0,会导致拖拽更换位置失败,
个人临时方案为通过dragover将值传递给drag和dargend以临时解决
是否考虑一下把右键菜单中的增加子节点、增加同级节点和删除节点都能定制化?
有没知道的大佬赐教下
1、专注模式下getAllDataString()获取的content和专注前不一致,导致比较判断是否有新变更不准(明明没做任何变更)。
2、专注模式下getAllDataString()获取content保存后,下次加载编辑时对应专注节点无法再次进入专注模式了。
Somebody(including me :)) think about joining the sub nodes again like below a linked issue :
I guess it's not supported yet, do you have any plan to support it ?
In node menu, add URL field. URL would be applied to topic text or to an icon (added if there is a link).
Great project, but I can not find the license info, please add one so we can safely use it or not according the the license.
Hi When I embed the package in my React application It returned this error :
Uncaught TypeError: Cannot read property 'className' of null
at be.init (modules.js?hash=ebcd0e163cd7e6204aeb0085474fd08407040388:90811)
at module (App.jsx:57)
at fileEvaluate (modules-runtime-hot.js?hash=d12281259a6cee99786429a66f76b05f13449c7f:388)
at Module.require (modules-runtime-hot.js?hash=d12281259a6cee99786429a66f76b05f13449c7f:270)
at Module.moduleLink [as link] (modules.js?hash=ebcd0e163cd7e6204aeb0085474fd08407040388:309)
at module (main.jsx:1)
at fileEvaluate (modules-runtime-hot.js?hash=d12281259a6cee99786429a66f76b05f13449c7f:388)
at Module.require (modules-runtime-hot.js?hash=d12281259a6cee99786429a66f76b05f13449c7f:270)
at require (modules-runtime-hot.js?hash=d12281259a6cee99786429a66f76b05f13449c7f:310)
at app.js?hash=b94593292eb30aa3f5e883365e84509373d0f757:157
My code :
import React from 'react';
import Editor from "rich-markdown-editor";
import MindElixir, {E} from 'mind-elixir'
export const App = () => (<div>
<h1>Atomical</h1>
<Editor defaultValue="# Votre Titre
* \
\" onChange={(value) => {
console.log(value());
}}/>
<div id="map"></div>
</div>);
let options = {
el: '#map',
direction: MindElixir.LEFT,
// create new map data
data: MindElixir.new('new topic'),
draggable: true, // default true
contextMenu: true, // default true
toolBar: true, // default true
nodeMenu: true, // default true
keypress: true, // default true
locale: 'en', // [zh_CN,zh_TW,en,ja] waiting for PRs
overflowHidden: false, // default false
primaryLinkStyle: 2, // [1,2] default 1
primaryNodeVerticalGap: 15, // default 25
primaryNodeHorizontalGap: 15, // default 65
contextMenuOption: {
focus: true,
link: true,
extend: [
{
name: 'Node edit',
onclick: () => {
alert('extend menu')
}
}
]
},
allowUndo: false,
before: {
insertSibling(el, obj) {
return true
},
async addChild(el, obj) {
await sleep()
return true
}
}
}
let mind = new MindElixir(options)
mind.init()
I'm rendering the mindmap in a small div.
Is there a way to control the zoom/scale/fit before it renders?
There's also some bugs in the toolbars when the parent div has height and width are set to 100%, I might just have to manually set some styling (it looks like the padding isn't calculated properly)
如题,谢谢?
能否给个结合Vue 2.0 以上版本使用的示例?谢谢。
I have initialized one mind map by following the code of the repo, now I want to initialize another mind map bu it throws the error- "Cannot read property 'className' of null at me.init".
My source code is-
// vue file
<v-btn color="primary" @click="initializeSecond()">Add one more mind map</v-btn>
<v-row no-gutters>
<v-col sm="6">
<div id="map-1" style="width: 100%; height: 500px"></div>
</v-col>
<v-col sm="6">
<div id="map-2" style="width: 100%; height: 500px"></div>
</v-col>
</v-row>
// Js code
import MindElixir, { E } from "mind-elixir";
data() {
return {
ME: null,
ME_1: null
}
},
mounted() {
let options = {
el: '#map-1',
direction: MindElixir.LEFT,
// the data return from `.getAllData()`
data: dummyData,
draggable: true, // default true
contextMenu: true, // default true
toolBar: true, // default true
nodeMenu: true, // default true
keypress: true, // default true
locale: 'en', // [zh_CN,zh_TW,en,ja] waiting for PRs
overflowHidden: false, // default false
primaryLinkStyle: 2, // [1,2] default 1
primaryNodeVerticalGap: 15, // default 25
primaryNodeHorizontalGap: 15, // default 65
contextMenuOption: {
focus: true,
link: true,
extend: [
{
name: 'Node edit',
onclick: () => {
alert('extend menu')
},
},
],
},
allowUndo: false
}
this.ME = new MindElixir(options);
this.ME.init();
},
methods: {
async initializeSecond() {
try {
let option = {
el: '#map-2',
direction: MindElixir.LEFT,
// the data return from `.getAllData()`
data: dummyData,
draggable: true, // default true
contextMenu: true, // default true
toolBar: true, // default true
nodeMenu: true, // default true
keypress: true, // default true
locale: 'en', // [zh_CN,zh_TW,en,ja] waiting for PRs
overflowHidden: false, // default false
primaryLinkStyle: 2, // [1,2] default 1
primaryNodeVerticalGap: 15, // default 25
primaryNodeHorizontalGap: 15, // default 65
contextMenuOption: {
focus: true,
link: true,
extend: [
{
name: 'Node edit',
onclick: () => {
alert('extend menu')
},
},
],
},
allowUndo: false
}
this.ME_1 = await new MindElixir(option);
this.ME_1.init();
} catch (error) {
console.error('______', error)
}
}
}
// Error
Could you please help? @SSShooter
Hello I'm looking for create a mind map from a markdown file which was import. And I am searching How to support markdown with title and bullet and export markdown with title and bullet from the mind map? @SSShooter
节点内容可以为html,请问现在有方式进行支持吗
For example, add nodeRender(node:HTMLElement){} option.
I prefer to resize the "map" to my parent element,
but I guess it's set as 100% (even it's parent has just 500px)..
Is there anyway to resize the map width ?
我使用如下代码进行初始化, 其中data使用的是MindElixir.new方法创建一个默认的Topic.
import MindElixir, { E } from 'mind-elixir'
let options = {
el: '#map',
direction: MindElixir.LEFT,
// create new map data
data: MindElixir.new('new topic'),
draggable: true, // default true
contextMenu: true, // default true
toolBar: true, // default true
nodeMenu: true, // default true
keypress: true, // default true
locale: 'zh_CN', // [zh_CN,zh_TW,en,ja] waiting for PRs
overflowHidden: false, // default false
primaryLinkStyle: 2, // [1,2] default 1
primaryNodeVerticalGap: 15, // default 25
primaryNodeHorizontalGap: 15, // default 65
allowUndo: false,
}
let mind = new MindElixir(options)
mind.init()
当我在默认的Topic下创建子Node, 并且在子Node上打开右键菜单, 点击 专注 , 此时是可以进入子Node的专注模式的. 但是这时候在进入专注模式的子Node上点击右键菜单的 取消专注 , 此时无法退回到 new topic 这个默认根Node上.
比如初始化 2 个思维导图实例,在第一个导图用快捷键操作后,切换到第二个导图,快捷键依然作用在第一个导图
1.移动端的节点信息框改为菜单,除了颜色、标签等,还可以加节点操作,如添加同级,添加下一级,删除等等。
2.支持双指挤压缩放。
另外,建议PC端鼠标滚轮默认控制缩放,滚动拖拽就能实现。
How do you get the context menu to appear on touch screens like the iPad and iPhone
It works fine on Windows Surface and Android devices.
可以给节点加网址超链接吗,这样点击节点就可以跳转到相关的网页资源。
Hi
I get the following when I try to style a child. (It is in your codepens for Vue and React as well).
Failed to execute 'querySelector' on 'Document': '[data-nodeid=2095d830cb304bd5]' is not a valid selector.
如题,盼回复,谢谢.
how to export in markdown format?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.