graphvix icon indicating copy to clipboard operation
graphvix copied to clipboard

Graph.clear doesn't resets ids

Open lalo2302 opened this issue 7 years ago • 0 comments

After creating 1..n nodes, clearing a graph and making a new one with new nodes, the node ids aren't reseted.

Replicate

alias Graphvix.{Graph, Node, Edge}

Graph.new(:test)
Node.new(label: "1")
Node.new(label: "2")
Node.new(label: "3")
Graph.get

iex> ...nodes: %{
    1 => %{attrs: [label: "1"]},
    2 => %{attrs: [label: "2"]},
    3 => %{attrs: [label: "3"]}
  }...

Graph.clear
Graph.new(:test2)
Node.new(label: "1")
iex> {4, %{attrs: [label: "2"]}}

lalo2302 avatar Feb 14 '18 02:02 lalo2302