Skip to content

spurious "high cardinality" warning #1667

Closed
@Fil

Description

@Fil

We're sometimes seeing "high cardinality" warnings when in fact the cardinality is not so high.
Here's a slightly contrived example (simplified down from a real-life use case):

Plot.plot({
  height: 200,
  marks: [
    Plot.frame(),
    Plot.lineY(aapl.slice(0, 9), {
      x: "Date",
      y: "Close",
      stroke: (d) => d.Date.getUTCDay(),
      fy: (d) => d.Date.getUTCDay(),
      marker: true
    })
  ]
})

Here we have 5 facets, four of which have 2 data points, and the last one has 1—which triggers the warning.

we should probably check that G.size is greater than, say, 10, before warning:
https://github.com/observablehq/plot/blob/df3a3add051049986c029fdad727bd64c929e622/src/style.js#L255-257

“high cardinality” is also tested in Plot.auto, I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions