Add :mesh3d seriestype (in theory)

This commit is contained in:
Adrian Dawid 2020-08-11 00:53:03 +02:00
parent 8dcff1f73d
commit 3160795f21
3 changed files with 14 additions and 4 deletions

View File

@ -429,6 +429,7 @@ const _plotly_seriestype = [
:shape,
:scattergl,
:straightline,
:mesh3d
]
const _plotly_style = [:auto, :solid, :dash, :dot, :dashdot]
const _plotly_marker = [

View File

@ -1,4 +1,3 @@
# https://plot.ly/javascript/getting-started
is_subplot_supported(::PlotlyBackend) = true
@ -446,7 +445,7 @@ function plotly_data(series::Series, letter::Symbol, data)
data
end
if series[:seriestype] in (:heatmap, :contour, :surface, :wireframe)
if series[:seriestype] in (:heatmap, :contour, :surface, :wireframe, :mesh3d)
plotly_surface_data(series, data)
else
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)
function plotly_series(plt::Plot, series::Series)
st = series[:seriestype]
println(st)
sp = series[:subplot]
clims = get_clims(sp, series)
@ -572,7 +572,14 @@ function plotly_series(plt::Plot, series::Series)
end
plotattributes_out[:showscale] = hascolorbar(sp)
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
@warn("Plotly: seriestype $st isn't supported.")
return KW()

View File

@ -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
is_3d(::Type{Val{:mesh3d}}) = true