Alcohol Vega Lite
✓ Published0🌍 Public
This example uses a scatterplot to compare beer servings and total liters of pure alcohol consumed per country, with tooltips revealing country names on hover. It fetches data from the FiveThirtyEight alcohol-consumption GitHub repository using D3’s `csv` loader, then renders the chart with Vega-Lite via the vega-lite-api wrapper, which registers Vega and Vega-Lite and uses vega-tooltip for interactions. The visualization adapts to the full window size and applies custom axis and label styling from a config object.
AI-generated descriptionA demonstration of how to start using D3 version 6.
data from
https://github.com/fivethirtyeight/data/tree/master/alcohol-consumption
MIT Licensed