AlgebraOfGraphics.jl icon indicating copy to clipboard operation
AlgebraOfGraphics.jl copied to clipboard

pre-grouped data rework

Open piever opened this issue 3 years ago • 1 comments

Allow pre-grouped syntax to work in conjunction with the data syntax. Ideally one should be able to use either the dims() context or the data(df) context, both or none.

Requires:

  • decoupling processing of different contexts
  • allowing df to contain arrays rather than vectors if pregrouped data has a more complex shape
  • ensuring that all helpers (esp. figuring out categorical conversions) work in all conditions, at the moment verbatim seems a bit problematic with pre-grouped data. The following errors
using CairoMakie, AlgebraOfGraphics, DataFrames
n = 5
df = DataFrame(g = 1:n, xy = [[Tuple(rand(2)) for _ in 1:2] for _ in 1:n])
fig = draw(mapping(df.xy => verbatim, layout=df.g => nonnumeric) * visual(Lines))

piever avatar Nov 29 '21 10:11 piever

See https://github.com/JuliaPlots/AlgebraOfGraphics.jl/discussions/345 for a proposal.

piever avatar Feb 09 '22 10:02 piever