julia> using AlgebraOfGraphics, DataFrames
julia> df = DataFrame(i=[1,2,1,2], c=[1,1,1,1], variable=[:a,:a,:b,:b], value=[10,20,30,40])
4ร4 DataFrame
Row โ i c variable value
โ Int64 Int64 Symbol Int64
โโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1 โ 1 1 a 10
2 โ 2 1 a 20
3 โ 1 1 b 30
4 โ 2 1 b 40
julia> p = data(df) * mapping(:value, color = :c => categorical) * mapping(layout_x = :variable)
ERROR: MethodError: no method matching AlgebraOfGraphics.DataContext(::AlgebraOfGraphics.ColumnDict, ::NamedTuple{(:color, :layout_x), Tuple{NamedDims.NamedDimsArray{(:c,), CategoricalArrays.CategoricalValue{Int64, UInt32}, 1, CategoricalArrays.CategoricalVector{Int64, UInt32, Int64, CategoricalArrays.CategoricalValue{Int64, UInt32}, Union{}}}, NamedDims.NamedDimsArray{(:variable,), CategoricalArrays.CategoricalValue{Symbol, UInt32}, 1, CategoricalArrays.CategoricalVector{Symbol, UInt32, Symbol, CategoricalArrays.CategoricalValue{Symbol, UInt32}, Union{}}}}}, ::Nothing)
Closest candidates are:
AlgebraOfGraphics.DataContext(::AlgebraOfGraphics.ColumnDict, ::NT, ::I) where {NT, I<:AbstractVector{Int64}} at /home/pietro/.julia/packages/AlgebraOfGraphics/X3avF/src/context.jl:93
AlgebraOfGraphics.DataContext(::Any) at /home/pietro/.julia/packages/AlgebraOfGraphics/X3avF/src/context.jl:98
Stacktrace:
[1] _merge(c::AlgebraOfGraphics.DataContext{NamedTuple{(:color,), Tuple{NamedDims.NamedDimsArray{(:c,), CategoricalArrays.CategoricalValue{Int64, UInt32}, 1, CategoricalArrays.CategoricalVector{Int64, UInt32, Int64, CategoricalArrays.CategoricalValue{Int64, UInt32}, Union{}}}}}, Vector{Int64}}, s1::AlgebraOfGraphics.Mapping, s2::AlgebraOfGraphics.Mapping)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/X3avF/src/context.jl:138
[2] merge(s1::AlgebraOfGraphics.Mapping, s2::AlgebraOfGraphics.Mapping)
@ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/X3avF/src/context.jl:30
[3] *
@ ~/.julia/packages/AlgebraOfGraphics/X3avF/src/context.jl:21 [inlined]
[4] *(::AlgebraOfGraphics.DataContext{NamedTuple{, Tuple{}}, Base.OneTo{Int64}}, ::AlgebraOfGraphics.Mapping, ::AlgebraOfGraphics.Mapping)
@ Base ./operators.jl:540
[5] top-level scope
@ REPL[47]:1
``