update
This commit is contained in:
parent
bbcf0921ba
commit
b7f71fb29f
|
@ -6,7 +6,6 @@
|
|||
<component name="ChangeListManager">
|
||||
<list default="true" id="f609c0f2-cd0d-4eea-87f1-8caf02d3f04f" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/frame/ContentView.py" beforeDir="false" afterPath="$PROJECT_DIR$/frame/ContentView.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/graph/directed_acyclic_graph/DAGLayout.py" beforeDir="false" afterPath="$PROJECT_DIR$/graph/directed_acyclic_graph/DAGLayout.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from graph.DataType import Point, Arrow
|
||||
from typing import List, Dict, Tuple
|
||||
from math import floor,ceil
|
||||
|
||||
|
||||
class DAGLayerHelper:
|
||||
|
@ -241,9 +242,10 @@ class DAGGraph:
|
|||
if len(target_nodes_within_layer) == 0:
|
||||
return
|
||||
|
||||
# 初始化节点排序
|
||||
if layer_index == 0:
|
||||
for idx in range(0, len(target_nodes_within_layer)):
|
||||
target_nodes_within_layer[idx].sort_number = idx
|
||||
target_nodes_within_layer[idx].sort_number = idx + 1
|
||||
pass
|
||||
pass
|
||||
|
||||
|
@ -262,9 +264,9 @@ class DAGGraph:
|
|||
# 整理节点排序
|
||||
target_nodes_within_layer.sort(key=compare_item)
|
||||
for idx in range(0, len(target_nodes_within_layer)):
|
||||
target_nodes_within_layer[idx].sort_number = idx
|
||||
target_item = target_nodes_within_layer[idx]
|
||||
target_item.sort_number = idx + 1
|
||||
pass
|
||||
|
||||
pass
|
||||
|
||||
self.__graph_layer_nodes_sort(layer_index + 1, nodes)
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue