Skip to main content
100%

The margin convention

✓ Published1🌍 Public
Yyastika
Last edited May 27, 2021
Created on May 27, 2021

This example demonstrates the "margin convention" for chart layout by rendering a horizontal bar chart of cervical cancer patient counts across Indian states and territories. Using React for the user interface, the visualization loads the data via D3's `csv` utility and scales the bars with `scaleBand` and `scaleLinear`. The implementation explicitly defines a margin object that subtracts from the total SVG dimensions to establish an inner plotting area, and the bars are positioned and sized within a translated group using those margins.

AI-generated description

A program that loads in some data about css named colors using D3 utilities, and uses React to render the data.

MIT Licensed

Similar vizzes