From e449d3221cfec5a514d5abf811ead882d2ee89c8 Mon Sep 17 00:00:00 2001 From: yha Date: Sun, 18 Apr 2021 13:41:10 +0300 Subject: [PATCH] Fix shapes series on plotly --- src/backends/plotly.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 9ff603da..0d4f734b 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -662,7 +662,7 @@ function plotly_series(plt::Plot, series::Series) end function plotly_series_shapes(plt::Plot, series::Series, clims) - segments = collect(series_segments(series)) + segments = series_segments(series) plotattributes_outs = Vector{KW}(undef, length(segments)) # TODO: create a plotattributes_out for each polygon @@ -681,7 +681,7 @@ function plotly_series_shapes(plt::Plot, series::Series, clims) for (letter, data) in zip((:x, :y), shape_data(series, 100)) ) - for segment in segments + for (k, segment) in enumerate(segments) i, rng = segment.attr_index, segment.range length(rng) < 2 && continue @@ -701,10 +701,10 @@ function plotly_series_shapes(plt::Plot, series::Series, clims) :dash => string(get_linestyle(series, i)), ) end - plotattributes_out[:showlegend] = i==1 ? should_add_to_legend(series) : false + plotattributes_out[:showlegend] = k==1 ? should_add_to_legend(series) : false plotly_polar!(plotattributes_out, series) plotly_hover!(plotattributes_out, _cycle(series[:hover], i)) - plotattributes_outs[i] = plotattributes_out + plotattributes_outs[k] = plotattributes_out end if series[:fill_z] !== nothing push!(plotattributes_outs, plotly_colorbar_hack(series, plotattributes_base, :fill))