Skip to content

AoG doesn't respect the levels of a categorical vector when transformation is applied #491

@pdeffebach

Description

@pdeffebach

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions