Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cousin_space属性设置后,在某些情况下展示不合符预期 #633

Closed
shine-lzx opened this issue Oct 17, 2024 · 2 comments · Fixed by #634
Closed

cousin_space属性设置后,在某些情况下展示不合符预期 #633

shine-lzx opened this issue Oct 17, 2024 · 2 comments · Fixed by #634

Comments

@shine-lzx
Copy link

您好,我在使用jsmind的时候,配置了cousin_space 配置项在相邻子节点都只有一个的时候,这个属性似乎没有生效。
image
`<!-- <!DOCTYPE html>

<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/es6/jsmind.js"></script> <script type="text/javascript"> var mind = { /* 元数据,定义思维导图的名称、作者、版本等信息 */ "meta": { "name": "jsMind-demo-tree", "author": "[email protected]", "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" } ] } ] } }; var options = { container: 'jsmind_container', theme: 'orange', editable: true, }; var jm = new jsMind(options); jm.show(mind); </script> --> <title>Document</title> <script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/es6/jsmind.js"></script> <script type="text/javascript"> var mind = { /* 元数据,定义思维导图的名称、作者、版本等信息 */ "meta": { "name": "jsMind-demo-tree", "author": "[email protected]", "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" } ] } ] } }; var options = { container: 'jsmind_container', theme: 'orange', editable: true, /* 设置cousin_space后,左边超过两个子节点生效,右边的不生效 */ layout: { hspace: 30, // 节点之间的水平间距 vspace: 20, // 节点之间的垂直间距 pspace: 13, // 节点与连接线之间的水平间距(用于容纳节点收缩/展开控制器) cousin_space: 100 // 相邻节点的子节点之间的额外的垂直间距 }, }; var jm = new jsMind(options); jm.show(mind); </script> `
@hizzgdev
Copy link
Owner

感谢你的报告 @shine-lzx , 这个问题在 #634 中修复了。稍后将发布新版本。
你可以先在本地使用 npm run build 命令生成新版本进行测试使用。

@hizzgdev
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants