【问题标题】:Don't overlap nodes in GOJS for ForceDirectedLayout不要在 GOJS 中为 ForceDirectedLayout 重叠节点
【发布时间】:2019-03-28 10:32:06
【问题描述】:

我正在使用 go js 通过拖放绘制图表,我想为我使用 GO jsForceDirectedLayout 绘制网络图,但是问题我的节点是相互重叠的,但我不希望这样。 ForceDirectedLayout中有什么方法不允许节点相互重叠。

【问题讨论】:

    标签: layout gojs


    【解决方案1】:

    ForceDirectedLayout不可能保证没有节点相互重叠,但是为了减少重叠的机会,你可以增加它的ma​​xIterations和defaultElectricalCharge。

    https://gojs.net/latest/api/symbols/ForceDirectedLayout.html#maxIterations

    https://gojs.net/latest/api/symbols/ForceDirectedLayout.html#defaultElectricalCharge

    如果您的节点异常大,您可能还需要增加 defaultSpringLength 的值。

    https://gojs.net/latest/api/symbols/ForceDirectedLayout.html#defaultSpringLength

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-22
    • 1970-01-01
    • 1970-01-01
    • 2015-01-26
    • 1970-01-01
    相关资源
    最近更新 更多