Closed MachinesAreUs closed 6 years ago
Hi @bitwalker. Any thoughts on this? :)
Sorry for the delay, I promise this is next on my list! Hopefully review this weekend and go from there :)
Can you rebase your changes on master? There are some changes in your PR that I've made on master, or that I would prefer not be in PRs (such as the version change), but other than that, it's pretty much ready to merge. Sorry for the long wait!
Ready @bitwalker ! :)
Thanks! Since this is a breaking change, I'll release it as 1.0.0 sometime today.
I know it's possible to assign complex labels to vertices, like
[:foo, :bar]
, but it would be nice if the handling of multiple labels could be internal to the library, since in several use cases you don't know beforehand all the labels for vertices.This could work like this (modified and extended from doctests for
Graph.label_vertex/3
):You could also receive both single terms and lists in
Graph.label_vertex/3
:This implies 2 breaking changes:
s
added at the end of the originalGraph.vertex_label/2
.Graph.vertex_labels/2
always returns a list.I was careful not to break the .dot serialization (at least with the current tests), but maybe it is worth discussing including both the vertex name and labels in the generated .dot file.