Comments (6)
不用 custom_node_render
时会卡顿吗?
能看看你是怎么实现的 custom_node_render 吗?要不然不知道怎么帮你。
from jsmind.
Hi @aloehh 这个问题已经在 0.8.1 中修复了,你升级一下试试吧,如有问题的话,可以 reopen 这个 issue.
非常感谢!
from jsmind.
感谢作者回复。
不用 custom_node_render 拖拽正常,不卡顿。以下是我用 custom_node_render的代码 :
const options = {
container: 'jsmind_container', // [必选] 容器的ID
editable: true, // [可选] 是否启用编辑
theme: 'primary', // 主题
view: {
engine: 'canvas', // 思维导图各节点之间线条的绘制引擎
hmargin: 100, // 思维导图距容器外框的最小水平距离
vmargin: 50, // 思维导图距容器外框的最小垂直距离
line_width: 2, // 思维导图线条的粗细
line_color: '#4181FF', // 思维导图线条的颜色
mode: 'side', // 右侧显示
draggable: true,
custom_node_render(jm, element, node) {
console.log(element, node);
element.innerHTML =<div class='node-title-my relative'>${node.topic} <span onclick="alert(11)" >click-me</span></div>
;
return true;
}
}
from jsmind.
你好, @aloehh 我在本地测试的时候并没有出现卡顿的情况,你是在什么环境下测试的?
你有没有试过把 node-title-my relative
这俩样式去掉呢?也可以试试去掉 onclick=alert()
这个再测试一下。
另外,我感觉应该写成 custom_node_render: function(jm, element, node) {...}
, 不过你这种写法也能正常运行,在我这里两种写法都没有卡顿的现象。
或者你能录一下屏吗?
from jsmind.
你说有时无法拖拽
是说有时候鼠标拖不动节点的意思吧。这个我倒是发现了,它其实跟鼠标事件的捕获相关,我看一下是否能从 jsmind 角度来处理。如果不行的话我再跟你说 custom render 要怎么改。
from jsmind.
”你说有时无法拖拽 是说有时候鼠标拖不动节点的意思吧“,对, 是这种现象, 有时拖不动节点。
样式以及点击事件我都去掉过, 写法也换过custom_node_render: function(jm, element, node) {...},但 时而无法拖动的现象仍旧存在。
感谢作者大大百忙之中帮忙查问题~
from jsmind.
Related Issues (20)
- 如何将生成的思维导图导出呢。我这边用jm实例绘制,拿到的jm实例数据是空的,下载下来的也是空白 HOT 10
- Error: dom-to-image is required since 0.7.2 HOT 1
- uniapp中引入jsmind时, 思维导图的线 和 结点 会分开显示, 不在一起 HOT 4
- 拖拽调整节点顺序,部分位置无法吸附上去 HOT 2
- 请问可以自定义节点样式吗? HOT 2
- 请问有没有办法动态获取jsmind的高度
- 节点删除之后未及时更新 index 属性导致与index 属性相关的方法出现异常,如find_node_after等 HOT 4
- 放大后截图,存在节点错乱问题 HOT 4
- Root node not centered HOT 15
- 通过npm包安装的无法使用下载导图和拖拽功能啊 HOT 12
- Nodes don't move when press up/down keys HOT 4
- 设置了 custom_node_render 后 jmexpander 位置计算错误被遮蔽 HOT 7
- 最后一个节点编辑后,宽度无法正确调整 HOT 4
- 根节点的连线错位 HOT 2
- 导出图片问题 HOT 1
- 拖拽事件无法自定义 HOT 2
- 节点内输入的内容怎么换行? HOT 2
- 节点方向(direction) HOT 1
- 这个方向是对了,细节上有小问题,引用不要远程引用,用本地的,如 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.