Add :mesh3d seriestype (in theory)
This commit is contained in:
parent
8dcff1f73d
commit
3160795f21
@ -429,6 +429,7 @@ const _plotly_seriestype = [
|
|||||||
:shape,
|
:shape,
|
||||||
:scattergl,
|
:scattergl,
|
||||||
:straightline,
|
:straightline,
|
||||||
|
:mesh3d
|
||||||
]
|
]
|
||||||
const _plotly_style = [:auto, :solid, :dash, :dot, :dashdot]
|
const _plotly_style = [:auto, :solid, :dash, :dot, :dashdot]
|
||||||
const _plotly_marker = [
|
const _plotly_marker = [
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# https://plot.ly/javascript/getting-started
|
# https://plot.ly/javascript/getting-started
|
||||||
|
|
||||||
is_subplot_supported(::PlotlyBackend) = true
|
is_subplot_supported(::PlotlyBackend) = true
|
||||||
@ -446,7 +445,7 @@ function plotly_data(series::Series, letter::Symbol, data)
|
|||||||
data
|
data
|
||||||
end
|
end
|
||||||
|
|
||||||
if series[:seriestype] in (:heatmap, :contour, :surface, :wireframe)
|
if series[:seriestype] in (:heatmap, :contour, :surface, :wireframe, :mesh3d)
|
||||||
plotly_surface_data(series, data)
|
plotly_surface_data(series, data)
|
||||||
else
|
else
|
||||||
plotly_data(data)
|
plotly_data(data)
|
||||||
@ -490,6 +489,7 @@ as_gradient(grad, α) = cgrad(alpha = α)
|
|||||||
# get a dictionary representing the series params (plotattributes is the Plots-dict, plotattributes_out is the Plotly-dict)
|
# get a dictionary representing the series params (plotattributes is the Plots-dict, plotattributes_out is the Plotly-dict)
|
||||||
function plotly_series(plt::Plot, series::Series)
|
function plotly_series(plt::Plot, series::Series)
|
||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
|
println(st)
|
||||||
|
|
||||||
sp = series[:subplot]
|
sp = series[:subplot]
|
||||||
clims = get_clims(sp, series)
|
clims = get_clims(sp, series)
|
||||||
@ -553,7 +553,7 @@ function plotly_series(plt::Plot, series::Series)
|
|||||||
plotattributes_out[:showscale] = hascolorbar(sp) && hascolorbar(series)
|
plotattributes_out[:showscale] = hascolorbar(sp) && hascolorbar(series)
|
||||||
|
|
||||||
elseif st in (:surface, :wireframe)
|
elseif st in (:surface, :wireframe)
|
||||||
plotattributes_out[:type] = "surface"
|
plotattributes_out[:type] = "surface"
|
||||||
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 st == :wireframe
|
if st == :wireframe
|
||||||
plotattributes_out[:hidesurface] = true
|
plotattributes_out[:hidesurface] = true
|
||||||
@ -572,7 +572,14 @@ function plotly_series(plt::Plot, series::Series)
|
|||||||
end
|
end
|
||||||
plotattributes_out[:showscale] = hascolorbar(sp)
|
plotattributes_out[:showscale] = hascolorbar(sp)
|
||||||
end
|
end
|
||||||
|
elseif st == :mesh3d
|
||||||
|
plotattributes_out[:type] = "mesh3d"
|
||||||
|
plotattributes_out[:x], plotattributes_out[:y], plotattributes_out[:z] = x, y, z
|
||||||
|
plotattributes_out[:colorscale] = plotly_colorscale(series[:fillcolor], series[:fillalpha])
|
||||||
|
plotattributes_out[:opacity] = series[:fillalpha]
|
||||||
|
if series[:fill_z] !== nothing
|
||||||
|
plotattributes_out[:surfacecolor] = plotly_surface_data(series, series[:fill_z])
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@warn("Plotly: seriestype $st isn't supported.")
|
@warn("Plotly: seriestype $st isn't supported.")
|
||||||
return KW()
|
return KW()
|
||||||
|
|||||||
@ -1534,3 +1534,5 @@ julia> areaplot(1:3, [1 2 3; 7 8 9; 4 5 6], seriescolor = [:red :green :blue], f
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
is_3d(::Type{Val{:mesh3d}}) = true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user