Change i,j,k to series keyword
This commit is contained in:
parent
13353f1637
commit
e594e22c68
@ -288,6 +288,7 @@ const _series_defaults = KW(
|
|||||||
# one logical series to be broken up (path and markers, for example)
|
# one logical series to be broken up (path and markers, for example)
|
||||||
:hover => nothing, # text to display when hovering over the data points
|
:hover => nothing, # text to display when hovering over the data points
|
||||||
:stride => (1,1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride.
|
:stride => (1,1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride.
|
||||||
|
:connections => nothing, # tuple of arrays to specifiy connectivity of a 3d mesh
|
||||||
:extra_kwargs => Dict()
|
:extra_kwargs => Dict()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -574,11 +574,19 @@ function plotly_series(plt::Plot, series::Series)
|
|||||||
elseif st == :mesh3d
|
elseif st == :mesh3d
|
||||||
plotattributes_out[:type] = "mesh3d"
|
plotattributes_out[:type] = "mesh3d"
|
||||||
plotattributes_out[:x], plotattributes_out[:y], plotattributes_out[:z] = x, y, z
|
plotattributes_out[:x], plotattributes_out[:y], plotattributes_out[:z] = x, y, z
|
||||||
|
|
||||||
if :i in keys(series[:extra_kwargs]) && :j in keys(series[:extra_kwargs]) && :k in keys(series[:extra_kwargs])
|
if series[:connections] != nothing
|
||||||
plotattributes_out[:i] = series[:extra_kwargs][:i]
|
if typeof(series[:connections]) <: Tuple{Array,Array,Array}
|
||||||
plotattributes_out[:j] = series[:extra_kwargs][:j]
|
i,j,k = series[:connections]
|
||||||
plotattributes_out[:k] = series[:extra_kwargs][:k]
|
if length(i) == length(j) == length(k)
|
||||||
|
throw(ArgumentError("Argument connections must consist of equally sized arrays."))
|
||||||
|
end
|
||||||
|
plotattributes_out[:i] = i
|
||||||
|
plotattributes_out[:j] = j
|
||||||
|
plotattributes_out[:k] = k
|
||||||
|
else
|
||||||
|
throw(ArgumentError("Argument connections has to be a tuple of three arrays."))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
plotattributes_out[:colorscale] = plotly_colorscale(series[:fillcolor], series[:fillalpha])
|
plotattributes_out[:colorscale] = plotly_colorscale(series[:fillcolor], series[:fillalpha])
|
||||||
|
|||||||
@ -331,8 +331,7 @@ function _override_seriestype_check(plotattributes::AKW, st::Symbol)
|
|||||||
if !RecipesPipeline.is3d(st) && !(st in (:contour, :contour3d))
|
if !RecipesPipeline.is3d(st) && !(st in (:contour, :contour3d))
|
||||||
z = plotattributes[:z]
|
z = plotattributes[:z]
|
||||||
if !isa(z, Nothing) &&
|
if !isa(z, Nothing) &&
|
||||||
(size(plotattributes[:x]) == size(plotattributes[:y]) == size(z)) &&
|
(size(plotattributes[:x]) == size(plotattributes[:y]) == size(z))
|
||||||
st !== :mesh3d
|
|
||||||
st = (st == :scatter ? :scatter3d : :path3d)
|
st = (st == :scatter ? :scatter3d : :path3d)
|
||||||
plotattributes[:seriestype] = st
|
plotattributes[:seriestype] = st
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1547,4 +1547,3 @@ julia> areaplot(1:3, [1 2 3; 7 8 9; 4 5 6], seriescolor = [:red :green :blue], f
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
is_3d(::Type{Val{:mesh3d}}) = true
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user