[plugin][HTML Legend]: Support Shadow Dom
- Dominant language
- JavaScript
- Stars
- 67.7k
- Forks
- 11.9k
- Avg merge
- 7h 39m
- Merged PRs (30d)
- 5
Description
### Feature Proposal
The plugin uses `document.getElementById(id)` and therefore cannot find elements within a Shadow DOM.
```
options: {
plugins: {
htmlLegend: {
// ID of the container to put the legend in
containerID: 'legend-container',
},
legend: {
display: false,
}
}
},
```
### Possible Implementation
The plugin accepts nodes in addition to CSS selectors.
```
options: {
plugins: {
htmlLegend: {
getContainer: () => this.shadowRoot.querySelector('#legend-container'),
},
legend: {
display: false,
}
}
},
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.