相关疑难解决方法(0)

vis.js Level sorting in Hierarchical Layout

I have a fairly simple hierarchical structure of nodes, but when vis.js draws them, the order of nodes on each level doesn't make much sense - there are a lot of crossed edges (screenshot: Default Layout )

I am hoping to get a layout similar to that given here: Expected Layout

My vis.js options are as follows;

{
    "layout": {
        "hierarchical": {
            "direction": "LR",
            "sortMethod": "directed",
            "nodeSpacing": 200,
            "treeSpacing": 400
        }
    },
    "edges": {
        "smooth": {
            "type": "continuous"
        }
    }, …
Run Code Online (Sandbox Code Playgroud)

javascript vis.js vis.js-network

7
推荐指数
1
解决办法
3663
查看次数

标签 统计

javascript ×1

vis.js ×1

vis.js-network ×1