gpt4 book ai didi

Javascript - GoJS 流程图

转载 作者:行者123 更新时间:2023-11-30 11:44:14 26 4
gpt4 key购买 nike

我正在使用 Flowchart来自 http://gojs.net/latest/samples/flowchart.html它工作正常。唯一的问题是,它没有 t display the toolbar symbols which are shown in the example. Have someone used Flowchart` 也有同样的问题吗?

var $ = go.GraphObject.make;

myPalette =
$(go.Palette, "myPaletteDiv", // must name or refer to the DIV HTML element
{
"animationManager.duration": 800, // slightly longer than default (600ms) animation
nodeTemplateMap: myDiagram.nodeTemplateMap, // share the templates used by myDiagram
model: new go.GraphLinksModel([ // specify the contents of the Palette
{category: "Start", text: "Start"},
{text: "Step"},
{text: "???", figure: "Diamond"},
{category: "End", text: "End"},
{category: "Comment", text: "Comment"}
])
});

问题

enter image description here

最佳答案

我认为您在初始化 Diagram 及其 Diagram.nodeTemplateMap 之前正在初始化 Palette。这实际上意味着 Palette 没有使用您的自定义模板,因此 Palette 中的节点正在使用默认节点模板。

如果您查看流程图示例中的源代码,您会看到:

// initialize the Palette that is on the left side of the page
myPalette =
$(go.Palette, "myPaletteDiv", // must name or refer to the DIV HTML element
{
"animationManager.duration": 800, // slightly longer than default (600ms) animation
nodeTemplateMap: myDiagram.nodeTemplateMap, // share the templates used by myDiagram

关于Javascript - GoJS 流程图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41547324/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com