MakieOrg / AlgebraOfGraphics.jl

An algebraic spin on grammar-of-graphics data visualization in Julia. Powered by the Makie.jl plotting ecosystem.
https://aog.makie.org
MIT License
443 stars 45 forks source link

Interface for common calculation of analysis attributes #199

Open piever opened 3 years ago

piever commented 3 years ago

So far extrema for density plots and bins for histograms are computed globally (they are the same for all variables in all subplots).

We currently do not have an interface to decide whether they should be computed globally, per subplot (to allow different subplots to have different bins, while still having consistent bins per subplots to stack or dodge) or per trace.

A possible approach could be to completely outsource this to the user, and pass as bins (or any other attribute) a function that takes as input a Dict whose keys encode the "primary variables" that specify which trace it is and whose values are positional and named arguments for the analysis. This function would return another Dict with the bins information.

knuesel commented 3 years ago

This sounds involved, why not density(extrema=:global) where :global could be replaced with :subplot or :trace?

tbenst commented 3 years ago

A possible approach could be to completely outsource this to the user

such an approach might also solve https://github.com/JuliaPlots/AlgebraOfGraphics.jl/issues/266 -- namely "Interface for common access to analysis attributes"