Skip to content

Warn users when facet data doesn't match mark data #1009

Closed
@mkfreeman

Description

@mkfreeman

Provide a visual warning to users when they specify facet data that doesn't match the mark data. This is especially tricky in the case when the facet and mark data both use the same .filter() function, for example (notebook here):

Plot.plot({
  facet: {
    data: aapl.filter(d => d.Close > 1),
    y: d => d3.utcFormat("%Y")(d.Date)
  },
  marks: [
    Plot.lineY(aapl.filter(d => d.Close > 1), {x: "Date", y: "Close"})
  ]
})

The logic I would imagine is:

If there is facet data and there is mark data AND the mark data is not strictly equal to === the facet data, provide a warning like Facet data and mark data must be strictly equal for accurate faceting

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