Skip to content

Commit

Permalink
Fix use of continuous scales split over facets (#539)
Browse files Browse the repository at this point in the history
For some reason none of the reference tests showed that there was a
problem with using the non-merged continuous scales to build the
entries. This meant that the scaling in each facet was based on the
local data and not the global data, possibly giving a wrong legend for
some of the facets.
  • Loading branch information
jkrumbiegel authored Aug 26, 2024
1 parent 92e41b6 commit 7532247
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

## Unreleased

## v0.8.4 - 2024-08-26

- Added `fillto` to `BarPlot` aesthetics [#535](https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/535).
- Fixed bug when giving `datalimits` of `density` as a (low, high) tuple [#536](https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/536).
- Fixed bug where facet-local continuous scale limits were used instead of the globally merged ones, possibly leading to mismatches between data and legend [#539](https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/539).

## v0.8.3 - 2024-08-23

Expand Down
2 changes: 1 addition & 1 deletion 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", "Julius Krumbiegel"]
version = "0.8.3"
version = "0.8.4"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand Down
2 changes: 1 addition & 1 deletion src/algebra/layers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function compute_entries_continuousscales(pls_grid, categoricalscales, scale_pro

entries_grid = map(rescaled_pls_grid, CartesianIndices(rescaled_pls_grid)) do processedlayers, idx
map(processedlayers) do processedlayer
to_entry(processedlayer, categoricalscales, continuousscales_grid[idx])
to_entry(processedlayer, categoricalscales, merged_continuousscales)
end
end

Expand Down
6 changes: 6 additions & 0 deletions test/reference_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ reftest("scatter con color highclip lowclip") do
draw(scales(Color = (; colormap = :viridis, colorrange = (2, 7), lowclip = :red, highclip = :cyan)))
end

reftest("scatter con color layout") do
data((; x = 1:8, y = 11:18, z = 1:8, group = repeat(["A", "B"], inner = 4))) *
mapping(:x, :y, color = :z, layout = :group) * visual(Scatter, markersize = 20) |>
draw
end

reftest("scatter marker") do
data((; x = 1:4, y = 5:8, z = ["A", "B", "C", "D"])) * mapping(:x, :y, marker = :z) * visual(Scatter, markersize = 20) |> draw
end
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

2 comments on commit 7532247

@jkrumbiegel
Copy link
Member Author

Choose a reason for hiding this comment

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

@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/113848

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.8.4 -m "<description of version>" 75322475b6b4c91ad7b2a7cd13e1765f8a85c9ed
git push origin v0.8.4

Please sign in to comment.