mikowitz/graphvix

Graph.clear doesn't resets ids

Opened this issue · 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"]}}