Skip to content

Commit

Permalink
bump makie version (#323)
Browse files Browse the repository at this point in the history
* bump makie version

* fix tests

* update news and bump version
  • Loading branch information
Pietro Vertechi authored Jan 28, 2022
1 parent 118931a commit bc1e784
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

- Customizable axis linking behavior.
- Customizable legend and colorbar position and look.
- In v0.6.1, support `level` in `linear` analysis for confidence interval.

## Internal changes

- In v0.6.1, replaced tuples and named tuples in `Layer` and `Entry` with dictionaries from [Dictionaries.jl](https://github.com/andyferris/Dictionaries.jl).
- In v0.6.1, split internal `Entry` type into `ProcessedLayer` (to be used for analyses) and `Entry` (to be used for plotting).

# AlgebraOfGraphics.jl v0.5 Release Notes

Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AlgebraOfGraphics"
uuid = "cbdf2221-f076-402e-a563-3d30da359d67"
authors = ["Pietro Vertechi <pietro.vertechi@veos.digital>"]
version = "0.6.0"
version = "0.6.1"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand Down Expand Up @@ -32,7 +32,7 @@ GeometryBasics = "0.4.1"
GridLayoutBase = "0.6"
KernelDensity = "0.6"
Loess = "0.5.1"
Makie = "0.15.2"
Makie = "0.16.3"
PlotUtils = "1"
PooledArrays = "1"
RelocatableFolders = "0.1"
Expand Down
17 changes: 14 additions & 3 deletions src/algebra/layers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ function compute_processedlayers_grid(processedlayers, categoricalscales)
return pls_grid
end

function compute_attributes(attributes, primary, named)
function compute_attributes(pl::ProcessedLayer)
plottype, primary, positional, named, attributes =
pl.plottype, pl.primary, pl.positional, pl.named, pl.attributes

attrs = NamedArguments()
merge!(attrs, attributes)
merge!(attrs, primary)
Expand All @@ -53,6 +56,13 @@ function compute_attributes(attributes, primary, named)

merge!(attrs, Dictionary(valid_options(; color, cycle)))

# avoid automatic bar width computation in Makie
if (plottype <: BarPlot) && !haskey(attrs, :width)
x = first(positional)
width = (x isa AbstractRange) && (length(positional) == 2) ? step(x) : 1.0
insert!(attrs, :width, width)
end

# remove unnecessary information
return filterkeys(!in((:col, :row, :layout, :alpha)), attrs)
end
Expand All @@ -68,15 +78,16 @@ function compute_entries_continuousscales(pls_grid)
for idx in eachindex(pls_grid), pl in pls_grid[idx]
# Apply continuous transformations
positional = map(contextfree_rescale, pl.positional)
named = map(contextfree_rescale, pl.named)
plottype = Makie.plottype(pl.plottype, positional...)

# Compute continuous scales with correct plottype, to figure out role of color
continuousscales = AlgebraOfGraphics.continuousscales(ProcessedLayer(pl; plottype))
mergewith!(mergescales, continuousscales_grid[idx], continuousscales)

# Compute `Entry` with rescaled columns
named = compute_attributes(pl.attributes, pl.primary, map(contextfree_rescale, pl.named))
entry = Entry(plottype, positional, named)
attrs = compute_attributes(ProcessedLayer(pl; plottype, positional, named))
entry = Entry(plottype, positional, attrs)
push!(entries_grid[idx], entry)
end

Expand Down
2 changes: 1 addition & 1 deletion src/transformations/histogram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function (h::HistogramAnalysis)(input::ProcessedLayer)
label = h.normalization == :none ? "count" : string(h.normalization)
labels = set(output.labels, N+1 => label)
attributes = if N == 1
set(output.attributes, :dodge_gap => 0, :x_gap => 0)
set(output.attributes, :gap => 0, :dodge_gap => 0)
else
output.attributes
end
Expand Down
4 changes: 2 additions & 2 deletions test/analyses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ end

@test processedlayer.primary == NamedArguments((color=["a", "b"],))
@test isempty(processedlayer.named)
@test processedlayer.attributes == NamedArguments((dodge_gap=0, x_gap=0))
@test processedlayer.attributes == NamedArguments((gap=0, dodge_gap=0))
@test processedlayer.plottype == AlgebraOfGraphics.BarPlot

labels = MixedArguments()
Expand Down Expand Up @@ -327,7 +327,7 @@ end

@test processedlayer.primary == NamedArguments((color=["a", "b"],))
@test isempty(processedlayer.named)
@test processedlayer.attributes == NamedArguments((dodge_gap=0, x_gap=0))
@test processedlayer.attributes == NamedArguments((gap=0, dodge_gap=0))
@test processedlayer.plottype == AlgebraOfGraphics.BarPlot

labels = MixedArguments()
Expand Down

2 comments on commit bc1e784

@piever
Copy link
Collaborator

@piever piever commented on bc1e784 Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/53373

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.1 -m "<description of version>" bc1e7849819466e06ff4d98e3d248ac7c405c3f7
git push origin v0.6.1

Please sign in to comment.