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

Auto mark: add more override-only mark types? #1422

Open
Tracked by #1252
tophtucker opened this issue Apr 4, 2023 · 1 comment
Open
Tracked by #1252

Auto mark: add more override-only mark types? #1422

tophtucker opened this issue Apr 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@tophtucker
Copy link
Contributor

tophtucker commented Apr 4, 2023

So far, the only mark types that Plot.auto supports are those that it might pick automatically — except area, which is a lot like a line with zero: true, but you can only get it by explicitly setting the mark type. We could add more marks like that. E.g. box plots and voronois would be easy.

In these cases, you're not getting much automatic inference out of Plot.auto, except the different reduce syntax; you should almost certainly be using the explicit mark. But if we want mark types to be available in the chart cell, we'd have to add them to Plot.auto. But most of these override-only marks would take us farther outside the fuzzy intersection we've aimed for, where most channels (except size) apply to all the marks you could choose, and most configs lead to some chart.

The other issue is that many of these are most valuable in combination with another mark, in which case maybe we should think about them more like we think about the zero rule: as a "decoration" atop the main chosen mark.

  • Box plot: could only support fill or stroke; wouldn’t work on quant-quant scales. See also The box mark could use bin/rect instead of group/bar for quantitative data #1330
  • Voronoi: might be better as a decoration atop dot; unclear value if not for interaction
  • Vector: notionally the reason “size” isn’t called “radius”, but not very useful without a rotate channel passed through, which wouldn’t apply to any other mark
  • Hexbin: it’s a transformation, not a mark; benefits from having a background of Plot.hexgrid.
  • Density / contour: sorta rare; maybe a useful mark to infer if number of points is gigantic?
  • Linear regression: would have to have x and y version, because we can't infer independent/dependent variable; might be better as a decoration atop dot; could be specified more like y: {value: "height", regress: true}??
  • Text: probably the most important, but also the most suited for being a decoration, and would need a text channel too

Demo: https://observablehq.com/d/371da15a81cfa596
Sketch PR: #1423

@tophtucker tophtucker added the enhancement New feature or request label Apr 4, 2023
This was referenced Apr 4, 2023
@Fil
Copy link
Contributor

Fil commented Apr 4, 2023

The spike mark (technically a vector with a spike shape) is useful without rotate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants