Create only undirected edges from smaller node ID to higher node ID
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
c17142e648
commit
b2b225f4ae
|
@ -103,6 +103,7 @@ series.each do |series, files|
|
||||||
end
|
end
|
||||||
edges.uniq!
|
edges.uniq!
|
||||||
# edges.filter! { |e| e[:from] < e[:to] }
|
# edges.filter! { |e| e[:from] < e[:to] }
|
||||||
|
edges.map! { |e| { :from => [e[:from], e[:to]].min, :to => [e[:from], e[:to]].max } }.uniq!
|
||||||
|
|
||||||
puts ("export const nodes = " + JSON.pretty_unparse(data.values) + ";")
|
puts ("export const nodes = " + JSON.pretty_unparse(data.values) + ";")
|
||||||
puts ("export const edges = " + JSON.pretty_unparse(edges) + ";")
|
puts ("export const edges = " + JSON.pretty_unparse(edges) + ";")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user