Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
define product on Combined (#56)
Browse files Browse the repository at this point in the history
* define product on combined

* no need for tuple

* fix theme

* use correct fieldname

* switch condition
  • Loading branch information
Pietro Vertechi authored Dec 4, 2018
1 parent 870728f commit ba17e33
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/basic_recipes/multiple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,20 @@ function plot!(p::Combined{multipleplot, <:Tuple{PlotList}})
plot!(p, plottype(s), attr, s.args...)
end
end

function default_theme(scene, ::Type{<:Combined{S, T}}) where {S<:Tuple, T}
merge((default_theme(scene, Combined{pt}) for pt in S.parameters)...)
end

function plot!(p::Combined{S, <:Tuple{Vararg{Any, N}}}) where {S <: Tuple, N}
for pt in S.parameters
plot!(p, Combined{pt}, Theme(p), p[1:N]...)
end
end

function Base.:*(::Type{<:Combined{S}}, ::Type{<:Combined{T}}) where {S, T}
params1 = S isa Type{<:Tuple} ? S.parameters : [S]
params2 = T isa Type{<:Tuple} ? T.parameters : [T]
params = union(params1, params2)
Combined{Tuple{params...}}
end

0 comments on commit ba17e33

Please sign in to comment.