liveBook · Manning

Title element

As explained in D3.js in Action, Third Edition

An SVG title element provides a text title for an SVG graphic or graphical element for accessibility and other user agents.

An SVG <title> element supplies a concise text title for a graphic or graphical element, helping screen readers and other user agents identify its purpose. section 10.2.3

Place <title> directly inside the SVG, give it an id, and reference that id through aria-labelledby. Pair it with role="img" and a <desc> element for fuller context. section 10.3

Accessible scatterplot title

A D3.js scatterplot can use the title “Visualization of a collection of cetacean species,” while its associated description supplies additional information. The same pattern labels legends, such as “Legend for the area of the circles.”

How D3.js in Action, Third Edition covers it

How deep it goes
Shows implementation with D3.js, ids, ARIA references, and descriptions, but defers broader interaction handling.
Examples
Uses a cetacean scatterplot, an area legend, and color legends as concrete SVG labeling examples.
What you can do after
Apply it via D3.js to label SVG charts and legends for screen-reader users.
How it connects
Connects SVG graphics with screen readers, accessibility, ARIA, semantic HTML, and the desc element.

This explainer was generated by Manning's knowledge graph from the text of D3.js in Action, Third Edition. The section links point to the parts of the book it draws on.