Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在JointJS DirectedGraph中添加单独的元素_Javascript_Directed Graph_Jointjs - Fatal编程技术网

Javascript 在JointJS DirectedGraph中添加单独的元素

Javascript 在JointJS DirectedGraph中添加单独的元素,javascript,directed-graph,jointjs,Javascript,Directed Graph,Jointjs,是否可以在DirectedGraph函数之外添加元素?我曾尝试使用文档中的graph.addCell(),但该图表仅显示DirectedGraph插件中的元素 我试图实现一个DirectedGraph,其中可能有一两个元素在正常层次结构之外链接了“额外的父元素” 我正在使用如图所示的源代码 任何建议/指导都很好。谢谢 只需包含外围元素即可完成。要在发布的图像中实现布局,请使用: <div id="adjacency-list">{ "A":["B"], "B":["

是否可以在DirectedGraph函数之外添加元素?我曾尝试使用文档中的graph.addCell(),但该图表仅显示DirectedGraph插件中的元素

我试图实现一个DirectedGraph,其中可能有一两个元素在正常层次结构之外链接了“额外的父元素”

我正在使用如图所示的源代码


任何建议/指导都很好。谢谢

只需包含外围元素即可完成。要在发布的图像中实现布局,请使用:

<div id="adjacency-list">{
    "A":["B"],
    "B":["C","D"],
    "C":[],
    "D":[],
    "EXTRA":["D"]
}</div>
{
“A”:[“B”],
“B”:[“C”、“D”],
“C”:[…],
“D”:[…],
“额外”:[“D”]
}
这不包括在文档中。据我所知,它对任何数量的父/子组合都非常有效