Skip to main content
100%

#Utrecht2024 TASK: First steps in Svelte

• Draft12🔗 Unlisted
MMatthias Stahl
Last edited Jul 1, 2024
Created on Jun 30, 2024

This example displays a bubble chart of countries, plotting life expectancy against GDP per capita while using bubble size to represent population and color to distinguish continents. The visualization uses data from the Gapminder dataset, though the code includes data from 2007 despite the README specifying 2022. The implementation uses Svelte components and D3.js APIs, including `scaleLinear` for axes, `scaleSqrt` for bubble sizing, and `scaleOrdinal` for coloring. Each bubble is a custom SVG path rendered via a `Datapoint` component, with positions and attributes calculated declaratively through Svelte's reactive statements.

AI-generated description

Task

  • format the data: numbers should be numbers – not strings
  • filter and only use data of the year 2022
  • determine the min and max value of GDP and life expectancy

Original visualization

Interactive version

Data

Gapminder

MIT Licensed

Similar vizzes