Skip to content

Commit

Permalink
Merge pull request #68 from daschw/namedtuples
Browse files Browse the repository at this point in the history
Namedtuples
  • Loading branch information
daschw authored Nov 9, 2020
2 parents d1f1f4b + bdab504 commit d30b5f4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions RecipesPipeline/src/user_recipe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,16 @@ end
# list of tuples
@recipe f(v::AVec{<:Tuple}) = unzip(v)
@recipe f(tup::Tuple) = [tup]

# list of NamedTuples
@recipe function f(ntv::AVec{<:NamedTuple{K, Tuple{S, T}}}) where {K, S, T}
xguide --> string(K[1])
yguide --> string(K[2])
return Tuple.(ntv)
end
@recipe function f(ntv::AVec{<:NamedTuple{K, Tuple{R, S, T}}}) where {K, R, S, T}
xguide --> string(K[1])
yguide --> string(K[2])
zguide --> string(K[3])
return Tuple.(ntv)
end

0 comments on commit d30b5f4

Please sign in to comment.