observablehq / observablehq/plot

Expose warnings

Open
#1,192 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently, ⚠️ warnings are just sent to console.warn. It'd be great if they were also exposed programmatically, so other code (like Observable itself) can consume them.

Possible approaches:

  • as a property on the DOM node, like plot.scales
  • as an onWarn callback
  • …? add your own!

It'd be great if the warning came with information about where it originated, as if we could place an error caret at the spot in the configuration object where you should look: somewhere in the nth mark, in the x scale, etc.

Related links (mostly a note to self):

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.

Research direction

Read src/warnings.ts and trace where warnings are sent to console.warn. Compare the proposed DOM property and onWarn approaches with the Observable use case. Done means the project has a settled API for consuming warnings programmatically and includes origin information such as the affected mark or scale.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.