observablehq / observablehq/plot

crash on nullish facet data

Open
#1,439 1 comment 0 reactions 1 assignee View on GitHub

@Fil is already working on this.

Since Apr 10, 2023.

question
Dominant language
HTML
Stars
5.4k
Forks
244
PR merge metrics
No merged PRs in 30d

Description

I think this should throw an error, rather than crashing. Not really a bug since it's not following the general definition of data+channels, but the crashes it produces (in at least two places) show that we're controlling that y is non-null, and then expect facet.data to have a length.

export async function AAA() {
  return Plot.plot({
    facet: {data: null, y: ["a", "b", "c", "d"]},
    marks: [Plot.dotX([1, 2, 4, 5])]
  });
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.