Comments (5)
Thank you for your kindness @Vente16 .
I have considered the solution to merge all plugins to jsMind
core library. TBH, I don't like it, since we have to load all features whether we use them or not.
A better solution is publishing plugins as standalone npm packages, but I haven't figured out if they should be.
from jsmind.
Hi @Vente16 , have you seen the error below:
jsMind
is the dependency ofdraggable_node
, and should be loaded before loaddraggable_node
jsMind
should be global so it can be used indraggable_node
- it's expected that
draggableNode
isundefined
, since nothing is exported
try it:
require(["jsMind"], function (jsMind) {
window.jsMind = jsMind
require(["draggable_node"], function (draggableNode) {
var mind={};
var jm = new jsMind(options);
jm.show(mind)
});
});
I know it's not a good solution, but it can be used as a workaround.
And, do you have any suggestion about that?
from jsmind.
Hi @Vente16 , have you seen the error below:
jsMind
is the dependency ofdraggable_node
, and should be loaded before loaddraggable_node
jsMind
should be global so it can be used indraggable_node
- it's expected that
draggableNode
isundefined
, since nothing is exportedtry it:
require(["jsMind"], function (jsMind) { window.jsMind = jsMind require(["draggable_node"], function (draggableNode) { var mind={}; var jm = new jsMind(options); jm.show(mind) }); });I know it's not a good solution, but it can be used as a workaround. And, do you have any suggestion about that?
Yep, I've seen that error before and I solve it loading jsmind first and then draggable_node
I was wondering if there is any chance to have draggable_node in jsmind and enable it or disabled it with a param something like this:
const options = { draggable: true }
const jm = new jsMind(options);
If that would be possible I'd like to contribute with that
from jsmind.
Thank you for your kindness @Vente16 .
I have considered the solution to merge all plugins to
jsMind
core library. TBH, I don't like it, since we have to load all features whether we use them or not.A better solution is publishing plugins as standalone npm packages, but I haven't figured out if they should be.
Okay, cool.
require(["jsMind"], function (jsMind) {
window.jsMind = jsMind
require(["draggable_node"], function (draggableNode) {
var mind={};
var jm = new jsMind(options);
jm.show(mind)
});
});
This previous code didn't work for me, same error but I will close this issue and figured out another way. Thanks!
from jsmind.
A new version v0.6.5 has been published. jsMind
will work fine with requirejs
:
Please note that jsmind.js
is not in the js
directory but in es6
<script src="https://requirejs.org/docs/release/2.3.6/minified/require.js"></script>
<script type="text/javascript">
require.config({
paths: {
// note: replace `latest` with a specific version on production
'jsmind': 'https://unpkg.com/jsmind@latest/es6/jsmind',
'jsmind/draggable_node':
'https://unpkg.com/jsmind@latest/es6/jsmind.draggable-node',
},
});
require(['jsmind', 'jsmind/draggable_node'], function (jsMind, _) {
let mind = {...};
let options = {
container: 'jsmind_container',
editable: true,
theme: 'primary',
};
let jm = new jsMind(options);
jm.show(mind);
});
</script>
https://hizzgdev.github.io/jsmind/example/3_requirejs.html
from jsmind.
Related Issues (20)
- example html from github do not work in browsers HOT 8
- 为何一个节点显示不完全 HOT 3
- Click on HTML topic content of node doesn't select the node HOT 4
- 怎么监听双击修改topic HOT 5
- 节点支持纵向布局吗?缩放后画布支持鼠标拖拽的操作吗? HOT 1
- 画布移动问题 HOT 3
- jsmind,太棒了,能参考这里,增加相关功能就完美了 HOT 3
- 引用了 jsmind.draggable-node.js之后,双击节点(跟节点除外)不能进入编辑模式 HOT 15
- 请问作者有计划添加垂直布局的支持吗? HOT 2
- 这是jsmind 容器没找到报的错吗?但是我明明打印的出来容器的dom HOT 15
- drag & drop node in angular project HOT 19
- 右击鼠标弹出增删改节点,同时快捷键新增节点,这时右击鼠标会有问题 HOT 5
- add new option node_max_width to allow to control a node width HOT 3
- 支不支持懒加载 HOT 1
- 建议/疑问 HOT 3
- 能否控制节点输入字符长度事件回调 HOT 5
- 能否支持导入到xmind中,或者能导出xmind支持的格式 HOT 1
- 移动端的自适应 HOT 10
- allow images to be in nodes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsmind.