Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple marks / stats in a single layer #2911

Open
mwaskom opened this issue Jul 17, 2022 · 0 comments
Open

Support multiple marks / stats in a single layer #2911

mwaskom opened this issue Jul 17, 2022 · 0 comments

Comments

@mwaskom
Copy link
Owner

mwaskom commented Jul 17, 2022

Concrete use-case is something like combining Dot and Interval to show a point estimate and confidence intervals. Currently that would require something like

Plot(...).add(Interval(), Est()).add(Dot(), Agg())

But that gets annoying as soon as you start adding moves, layer-specific variables, etc. It would be preferable to make it easy to combine marks. One can also imagine wanting to have "stat pipelines", e.g normalize and then aggregate.

We already support multiple moves by passing list[Move]. So that's the most straightforward solution. But unlike with the move, some aspects of the plot setup depend on properties of the mark (e.g., its default orientation rules) and it would be messier to always be looping over the marks. You might also want a more sophisticated combination of the objects, e.g. to only need to specify properties directly once and have them "inherited".

I think there's probably three options here:

  1. Accept list[Mark]
  2. Allow Mark + Mark to generate a new mark, potentially with some inheritance of properties (though trickier to define)
  3. Don't accept multiple marks, but internally have a CompoundMark concept that makes it easier to define, e.g. DotInterval

I think I would kind of lean towards 2 but maybe just because it feels snazzy (which is to say, not for good reason). It would look something like

Plot(...).add(Dot() + Interval(), Est()

IDK, that's kind of nice I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant