Skip to content

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

Open
@tophtucker

Description

@tophtucker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions