observablehq / observablehq/plot
The pointer interaction shouldn’t synchronously dispatch an event on initial render
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
The pointer interaction calls render(null) on the initial render, which I believe calls through to context.dispatchValue, resulting in a figure.dispatchEvent before the generated figure has even been returned. There’s no need to dispatch an event during the initial render, since it’s not possible for external listeners to be registered yet. Avoiding this call would address some compatibility issues in non-browser environments.
Ref. https://github.com/observablehq/plot/discussions/2158#discussioncomment-10512970
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
Start at the pointer interaction's initial render path and inspect how render(null) reaches context.dispatchValue and figure.dispatchEvent. Done means the initial render no longer dispatches an event before the generated figure is returned, while later pointer interactions still dispatch as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100