Coder Social home page Coder Social logo

Comments (6)

hizzgdev avatar hizzgdev commented on June 9, 2024 1

不用 custom_node_render 时会卡顿吗?
能看看你是怎么实现的 custom_node_render 吗?要不然不知道怎么帮你。

from jsmind.

hizzgdev avatar hizzgdev commented on June 9, 2024 1

Hi @aloehh 这个问题已经在 0.8.1 中修复了,你升级一下试试吧,如有问题的话,可以 reopen 这个 issue.
非常感谢!

from jsmind.

aloehh avatar aloehh commented on June 9, 2024

感谢作者回复。
不用 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.

hizzgdev avatar hizzgdev commented on June 9, 2024

你好, @aloehh 我在本地测试的时候并没有出现卡顿的情况,你是在什么环境下测试的?

你有没有试过把 node-title-my relative 这俩样式去掉呢?也可以试试去掉 onclick=alert() 这个再测试一下。

另外,我感觉应该写成 custom_node_render: function(jm, element, node) {...}, 不过你这种写法也能正常运行,在我这里两种写法都没有卡顿的现象。

或者你能录一下屏吗?

from jsmind.

hizzgdev avatar hizzgdev commented on June 9, 2024

你说有时无法拖拽 是说有时候鼠标拖不动节点的意思吧。这个我倒是发现了,它其实跟鼠标事件的捕获相关,我看一下是否能从 jsmind 角度来处理。如果不行的话我再跟你说 custom render 要怎么改。

from jsmind.

aloehh avatar aloehh commented on June 9, 2024

”你说有时无法拖拽 是说有时候鼠标拖不动节点的意思吧“,对, 是这种现象, 有时拖不动节点。
样式以及点击事件我都去掉过, 写法也换过custom_node_render: function(jm, element, node) {...},但 时而无法拖动的现象仍旧存在。
感谢作者大大百忙之中帮忙查问题~

from jsmind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.