Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify node and edge label behaviour #176

Open
diegozea opened this issue Feb 24, 2022 · 0 comments
Open

Unify node and edge label behaviour #176

diegozea opened this issue Feb 24, 2022 · 0 comments

Comments

@diegozea
Copy link
Collaborator

Maybe it could be great to unify the node and edge label behavior. At this moment, names don't skip nothing and throw an error with missing. For example:

image

using Graphs, Plots, GraphRecipes
graph = smallgraph(:karate)
begin
	node_labels = Union{Nothing, String}[]
	for node in vertices(graph)
		if node == 1
			push!(node_labels, "Mr. Hi")
		elseif node == 34
			push!(node_labels, "John A")
		else
			push!(node_labels, nothing)
		end
	end
end
graphplot(graph, names=node_labels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant