2017-05-31 106 views
1

是否存在vis.js節點的CSS z-index的等價物?vis.js網絡:節點z-index

假設我有2種節點(在物理禁用的圖中):圓形和矩形。我希望長方形在重疊時始終顯示在圓上。

回答

0

mentioned issue來看,更精確的答案是:有設置的z-index沒有記錄的方式(並且沒有這樣的概念),但是你可以使用什麼(在某些更新時可能會破壞它)是節點按照它們定義的相同順序繪製。從comment

我用下面的測試節點:

var nodes = [ 
    {id: 'a', label: 'a', shape: 'dot'}, 
    {id: 'b', label: 'b', shape: 'dot'}, 
    {id: 'c', label: 'c', shape: 'dot'}, 
    {id: 'd', label: 'd', shape: 'dot'} 
]; 

未選中時,這些將繪製在節點順序:

enter image description here

現在,讓我們改變順序:

var nodes = [ 
    {id: 'c', label: 'c', shape: 'dot'}, 
    {id: 'b', label: 'b', shape: 'dot'}, 
    {id: 'd', label: 'd', shape: 'dot'}, 
    {id: 'a', label: 'a', shape: 'dot'} 
]; 

enter image description here