Open
Description
What is the feature ?
When objects, such as datapoints, axes, gridlines, legends, labels, etc. are rendered with some backends such as SVG, it would be useful if custom data can be added to these elements. For example, SVG elements can have custom data-*
attributes. This is useful to target individual rendered elements with other libraries for interactivity, animation, etc. For example:
<!--Current-->
<circle cx="100" cy="100" r="2" opacity="1" fill="#FF0000"/>
<!--Proposed-->
<circle cx="100" cy="100" r="2" opacity="1" fill="#FF0000" data-id="12345" data-comment="A red circle"/>
Why this feature is useful and how people would use the feature ?
For SVG specifically, custom data can be used by javascript to add interactivity to elements(c.f. #13), for animation, etc. This may also be useful for other backends which retain some structural information.
Additional Information
Inspired by this matplotlib example for making interactive plots.