Documentation error in edgelabel argument

Open Beginner friendly
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
julia
Domain
documentation

Research direction

Start with the gplot docstring in src/plot.jl and the Documentation site's Function prototype section linked in the issue. Check how edgelabel is described in both places, then update the documentation so it matches the demonstrated behavior; done means neither location claims that nothing is accepted.

Written by the indexing model from the issue text.

Description

In the documentation in gplot function, the edgelabel argument says it can be both a vector or nothing, however, it can only be a vector.

I found the Union{Vector, Nothing} in the following places:

Example:

julia> gplot(g, edgelabel = nothing)
ERROR: MethodError: no method matching iterate(::Nothing)
Closest candidates are:
  iterate(::Union{LinRange, StepRangeLen}) at range.jl:664
  iterate(::Union{LinRange, StepRangeLen}, ::Int64) at range.jl:664
  iterate(::T) where T<:Union{Base.KeySet{var"#s79", var"#s78"} where {var"#s79", var"#s78"<:Dict}, Base.ValueIterator{var"#s77"} where var"#s77"<:Dict} at dict.jl:693
  ...
Stacktrace:
 [1] isempty(itr::Nothing)
   @ Base .\essentials.jl:767
 [2] gplot(g::MetaDiGraph{Int64, Float64}, locs_x_in::Vector{Float64}, locs_y_in::Vector{Float64}; nodelabel::Nothing, nodelabelc::RGB{FixedPointNumbers.N0f8}, nodelabelsize::Float64, NODELABELSIZE::Float64, nodelabeldist::Float64, nodelabelangleoffset::Float64, edgelabel::Nothing, edgelabelc::RGB{FixedPointNumbers.N0f8}, edgelabelsize::Float64, EDGELABELSIZE::Float64, edgestrokec::RGB{FixedPointNumbers.N0f8}, edgelinewidth::Float64, EDGELINEWIDTH::Float64, edgelabeldistx::Float64, edgelabeldisty::Float64, nodesize::Float64, NODESIZE::Float64, nodefillc::RGB{FixedPointNumbers.N0f8}, nodestrokec::Nothing, nodestrokelw::Float64, arrowlengthfrac::Float64, arrowangleoffset::Float64, linetype::String, outangle::Float64)
   @ GraphPlot C:\Users\89446\.julia\packages\GraphPlot\vrIy8\src\plot.jl:121
 [3] gplot(g::MetaDiGraph{Int64, Float64}; layout::typeof(spring_layout), keyargs::Base.Iterators.Pairs{Symbol, Nothing, Tuple{Symbol}, NamedTuple{(:edgelabel,), Tuple{Nothing}}})
   @ GraphPlot C:\Users\89446\.julia\packages\GraphPlot\vrIy8\src\plot.jl:229
 [4] top-level scope
   @ REPL[17]:1

However with gplot(g, edgelabel = []) works fine.

Dominant language
Julia
Stars
213
Forks
62
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaGraphs/GraphPlot.jl

All issues in JuliaGraphs/GraphPlot.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.