gpt4 book ai didi

javascript - graph.addCell 和 graph.insertVertex 之间的主要区别是什么?

转载 作者:行者123 更新时间:2023-12-02 23:27:22 24 4
gpt4 key购买 nike

graph.addCell 和 graph.insertVertex 之间的主要区别是什么?它们可以互换使用吗?我什么时候使用每一个?

这两个函数的文档可以在 here 找到

最佳答案

mxGraph.prototype.insertVertex = function(parent, id, value,
x, y, width, height, style, relative)
{
var vertex = this.createVertex(parent, id, value, x, y, width, height, style, relative);

return this.addCell(vertex, parent);
};

https://github.com/jgraph/mxgraph/blob/master/javascript/src/js/view/mxGraph.js#L4471

单元格要么是顶点,要么是边,请参阅 graph theory .

addCell 添加给定的单元格。 insertVertex/Edge 是创建顶点/边并调用 addCell 的包装器。

关于javascript - graph.addCell 和 graph.insertVertex 之间的主要区别是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56680410/

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