AlgebraOfGraphics.jl
AlgebraOfGraphics.jl copied to clipboard
AoG doesn't respect the `levels` of a categorical vector when transformation is applied
Here's an MWE
julia> using CategoricalArrays;
julia> d = DataFrame(x = ["z", "a", "b"], v = [1, 2, 3]);
julia> d.x = categorical(d.x, ; levels = d.x);
julia> data(d) * mapping(:x, :v) * visual(BarPlot) |> draw
julia> # So far so good!
julia> d_labs = Dict("z" => "Z", "a" => "A", "b" => "B");
julia> data(d) * mapping(:x => (t -> d_labs[t]), :v) * visual(BarPlot) |> draw
It would be great is I could apply the transformation but then alzo have the "z" row go first.