observablehq / observablehq/plot
Optional `id` property for marks
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
As already discussed in #66 by @Fil I would also like to have the possibility to add an optional id property to marks mapping to SVG id. This would allow external JavaScript to interact with the chart, like for example Tippy.js for more advanced tooltips.
I think the user would just via documentation have to be made aware of the fact that the ID needs to be unique for the plot and the page as a whole. (Possibly Plot could help with this and optionally prefix the IDs with some ID unique to the chart?)
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 by tracing how mark mappings become SVG attributes and review the documentation for mark options. The change is complete when a mark can optionally produce the requested SVG id, the uniqueness requirement is documented, and external JavaScript can target it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100