Provides functions to extract data from D3.js-rendered SVG charts and convert
them to the MAIDR JSON schema for accessible, non-visual chart interaction.
D3.js is the most widely used low-level SVG-based data visualization library
on the web. This binder bridges D3 charts to MAIDR's accessibility features
including audio sonification, text descriptions, braille output, and keyboard
navigation.
D3.js binds data to DOM elements via the __data__ property during .data()
joins. The binder functions query the SVG for chart elements using CSS selectors
and extract the bound data to generate the MAIDR schema.
Usage
With Script Tag (vanilla JS)
<scriptsrc="maidr/dist/d3.js"></script> <script> // After D3 renders the chart: the binder writes the `maidr-data` // attribute for you by default (pass `autoApply: false` to opt out). maidrD3.bindD3Bar(svgElement, { selector:'rect.bar', title:'My Chart', axes: { x:'Category', y:'Value' }, }); </script>
MAIDR D3.js Binder
Provides functions to extract data from D3.js-rendered SVG charts and convert them to the MAIDR JSON schema for accessible, non-visual chart interaction.
D3.js is the most widely used low-level SVG-based data visualization library on the web. This binder bridges D3 charts to MAIDR's accessibility features including audio sonification, text descriptions, braille output, and keyboard navigation.
Supported Chart Types
How It Works
D3.js binds data to DOM elements via the
__data__property during.data()joins. The binder functions query the SVG for chart elements using CSS selectors and extract the bound data to generate the MAIDR schema.Usage
With Script Tag (vanilla JS)
With ES Modules
With React