javascript - 文本与 gojs 树图中的箭头重叠
问题描述
我目前正在使用 gojs 创建一个树形结构图
我在安排节点时遇到问题,文本与箭头重叠
建议/帮助非常感谢
myDiagram.nodeTemplate =
$(go.Node, "Auto", {
movable: true
},
$(go.Panel, "Vertical",
$(go.Panel, "Auto", {
background: "white"
}, {
portId: ""
},
$(go.Shape, "Circle", {
strokeWidth: 4,
margin: go.Margin.parse("10 5 10 5"),
height: 75,
width: 75,
cursor: "pointer"
},
new go.Binding("fill", "color"), new go.Binding("stroke", "strokeColor")
),
$(go.Panel, "Vertical",
$(go.Picture, {
source: "https://msdnshared.blob.core.windows.net/media/2017/05/icon.png",
background: "white",
width: 25,
height: 25
})
)
),
$(go.Panel, "Auto",
$(go.TextBlock, {
margin: 5,
font: '14px "Open Sans", sans-serif'
},
new go.Binding("text", "name"))
)
)
);
我的工作小提琴可用
解决方案
删除分配:
{
portId: ""
},
阅读讨论:https ://gojs.net/latest/intro/ports.html#SinglePorts ,除了让面板保持圆形形状和图片作为端口,您希望整个节点行为的默认行为作为港口。
推荐阅读
- vba - 访问子字典的值
- python - 命令行 - 如何在输入命令中监听按键?
- c# - C# ArrayList 与 C++ 互操作
- angular - Angular 工具栏固定在顶部
- sql - SQLite:使用旧记录合并同一表中的行以填充新记录中的空白
- matplotlib - 关闭 X11 连接时,远程 Jupyter 内核(通过 ssh)崩溃
- sql - 如何通过搜索 SQL Server 中的所有表来查找任何数据类型的值
- node.js - 如何使用 docker-compose 设置节点
- r - 在多个 url 上抓取 jsonlite - 错误:词法错误:json 文本中的字符无效
- node.js - 如何从下拉列表中选择任何值并在节点js的同一页面中的下一个下拉列表中自动获取另一个值