Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataFrames_0.2 compatibility #1360

Merged
merged 1 commit into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/Gadfly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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...))

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/geom/boxplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions src/geom/ribbon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/scale.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down