diff --git a/Project.toml b/Project.toml index 97820274b..66b42a0e3 100644 --- a/Project.toml +++ b/Project.toml @@ -35,7 +35,7 @@ Colors = "0.9" Compose = "0.7" Contour = "0.5" CoupledFields = "0.1" -DataFrames = "0.15, 0.16, 0.17, 0.18, 0.19" +DataFrames = "0.15, 0.16, 0.17, 0.18, 0.19, 0.20" DataStructures = "0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17" Distributions = "0.16, 0.17, 0.18, 0.19, 0.20, 0.21" DocStringExtensions = "0.7, 0.8" diff --git a/src/Gadfly.jl b/src/Gadfly.jl index e2e4a1fd3..3c814df2b 100755 --- a/src/Gadfly.jl +++ b/src/Gadfly.jl @@ -515,7 +515,7 @@ function render_prepare(plot::Plot) map(s->(s, _theme(l, plot)), collect(stats)) end - for element in flatten(([(s, plot.theme) for s in plot.statistics], + for element in Iterators.flatten(([(s, plot.theme) for s in plot.statistics], [(l.geom, _theme(plot, l)) for l in plot.layers], layer_stats_with_theme...)) @@ -563,7 +563,7 @@ function render_prepare(plot::Plot) (haskey(plot.mapping, var) || haskey(scales, var)) && continue t = :categorical - for data in flatten((datas, subplot_datas)) + for data in Iterators.flatten((datas, subplot_datas)) val = getfield(data, var) if val != nothing && val != :categorical t = classify_data(val) diff --git a/src/data.jl b/src/data.jl index c32ad50e6..d8334b016 100644 --- a/src/data.jl +++ b/src/data.jl @@ -66,7 +66,7 @@ function chain(ds::Data...) if isempty(vs) setfield!(chained_data, name, nothing) else - setfield!(chained_data, name, flatten(vs)) + setfield!(chained_data, name, Iterators.flatten(vs)) end end diff --git a/src/geom/boxplot.jl b/src/geom/boxplot.jl index 1b9264cd4..b99fc3b7d 100644 --- a/src/geom/boxplot.jl +++ b/src/geom/boxplot.jl @@ -121,7 +121,7 @@ function render(geom::BoxplotGeometry, theme::Gadfly.Theme, aes::Gadfly.Aestheti # Outliers if !geom.suppress_outliers && aes.outliers != nothing && !isempty(aes.outliers) - xys = collect(flatten(zip(cycle([x]), ys, cycle([c])) + xys = collect(Iterators.flatten(zip(cycle([x]), ys, cycle([c])) for (x, ys, c) in zip(xs, aes.outliers, cs))) compose!(ctx, (context(), Shape.circle([x for (x, y, c) in xys], [y for (x, y, c) in xys], [theme.point_size], to), svgclass("marker"), diff --git a/src/geom/ribbon.jl b/src/geom/ribbon.jl index 5f6f27a99..a25384415 100644 --- a/src/geom/ribbon.jl +++ b/src/geom/ribbon.jl @@ -55,8 +55,8 @@ function render(geom::RibbonGeometry, theme::Gadfly.Theme, aes::Gadfly.Aesthetic end kys = keys(max_points) - polys = [collect(Tuple{XT, YT}, flatten((min_points[k], max_points[k]))) for k in kys] - lines = [collect(Tuple{XT, YT}, flatten((min_points[k], [(last(min_points[k])[1], NaN)], max_points[k]))) for k in kys] + polys = [collect(Tuple{XT, YT}, Iterators.flatten((min_points[k], max_points[k]))) for k in kys] + lines = [collect(Tuple{XT, YT}, Iterators.flatten((min_points[k], [(last(min_points[k])[1], NaN)], max_points[k]))) for k in kys] n = length(kys) colors = Vector{Union{Colorant, String}}(undef, n) diff --git a/src/scale.jl b/src/scale.jl index 9388f558e..7cb2b3921 100644 --- a/src/scale.jl +++ b/src/scale.jl @@ -622,7 +622,7 @@ const color_continuous_gradient = color_continuous ### WHY HAVE THIS ALIAS? function apply_scale(scale::ContinuousColorScale, aess::Vector{Gadfly.Aesthetics}, datas::Gadfly.Data...) - cdata = skipmissing(flatten(i.color for i in datas if i.color != nothing)) + cdata = skipmissing(Iterators.flatten(i.color for i in datas if i.color != nothing)) if !isempty(cdata) cmin, cmax = extrema(cdata) else diff --git a/src/statistics.jl b/src/statistics.jl index 7d890b39a..6b303ce75 100644 --- a/src/statistics.jl +++ b/src/statistics.jl @@ -851,7 +851,7 @@ function apply_statistic(stat::TickStatistic, isempty(in_vals) && return - in_vals = flatten(in_vals) + in_vals = Iterators.flatten(in_vals) # consider forced tick marks if stat.ticks != :auto