observablehq / observablehq/plot
Expose warnings
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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