Viewing a saved revision (read-only)
4a1ce2cbbb95419aa08a1eaf0c03c49b
Multiple Views in a Single SVG
This example shows how to place multiple visualizations side by side within a single SVG, comparing the same daily air temperature dataset across different chart types. The left half displays a multi-line chart where each year is a colored line, with 2024 highlighted in red and thicker, while the right half reuses the same rendering logic in a separate group translated horizontally. The code uses d3’s `scaleLinear`, `scaleSequential`, `flatGroup`, and `line` generators, along with `observeResize` from `@curran/responsive-axes` to handle responsive dimensions. Data comes from the `@curran/daily-surface-air-temperature` package, and colors are mapped via `interpolatePlasma`.
AI-generated descriptionA visualization of Daily Surface Air Temperature, colored by year, with 2024 highlighted in red. Made in collaboration with EJ Fox, leveraging data prepared by Matthias Stahl.