fix plotly

This commit is contained in:
Daniel Schwabeneder 2018-05-05 18:37:16 +02:00
parent ba9a8d52cc
commit 5797ad2d5b

View File

@ -580,9 +580,19 @@ function plotly_series(plt::Plot, series::Series)
end
# set the "type"
if st in (:path, :scatter, :scattergl, :straightline, :path3d, :scatter3d)
if st in (:path, :straightline, :path3d)
return plotly_series_segments(series, d_out, x, y, z)
elseif st in (:scatter, :scattergl)
d_out[:type] = string(st)
d_out[:mode] = hasline ? "lines+markers" : "markers"
d_out[:x], d_out[:y] = x, y
elseif st == :scatter3d
d_out[:mode] = string(st)
d_out[:mode] = hasline ? "lines+markers" : "markers"
d_out[:x], d_out[:y], d_out[:z] = x, y, z
elseif st == :heatmap
d_out[:type] = "heatmap"
d_out[:x], d_out[:y], d_out[:z] = x, y, z
@ -753,15 +763,14 @@ function plotly_series_segments(series::Series, d_base::KW, x, y, z)
# add "marker"
if hasmarker
inds = eachindex(x)
d_out[:marker] = KW(
:symbol => get(_plotly_markers, series[:markershape], string(series[:markershape])),
:symbol => get(_plotly_markers, _cycle(series[:markershape], i), string(_cycle(series[:markershape], i))),
# :opacity => series[:markeralpha],
:size => 2 * series[:markersize],
:color => rgba_string.(plot_color.(get_markercolor.(series, inds), get_markeralpha.(series, inds))),
:size => 2 * _cycle(series[:markersize], i),
:color => rgba_string.(plot_color.(get_markercolor.(series, i), get_markeralpha.(series, i))),
:line => KW(
:color => rgba_string.(plot_color.(get_markerstrokecolor.(series, inds), get_markerstrokealpha.(series, inds))),
:width => series[:markerstrokewidth],
:color => rgba_string.(plot_color.(get_markerstrokecolor.(series, i), get_markerstrokealpha.(series, i))),
:width => _cycle(series[:markerstrokewidth], i),
),
)
end