Skip to content

Throw a better error when facet: "exclude" is used without faceting? #1281

@mbostock

Description

@mbostock

This current throws TypeError: Cannot read properties of undefined (reading 'facetsIndex').

Plot.plot({
  marks: [
    Plot.dot(penguins, {x: "culmen_depth_mm", y: "culmen_length_mm", fill: "#ccc", facet: "exclude"}),
    Plot.dot(penguins, {x: "culmen_depth_mm", y: "culmen_length_mm", fx: "sex", fy: "species"})
  ]
})

Since no top-level or mark-level faceting is declared, facet: "exclude" should probably throw a specific helpful error instead of crashing internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t workingdocumentationImprovements or additions to docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions