Multiple Views in a Single SVG
✓ Published3🌍 Public
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 way of adding multiple visualizations to a single page.
MIT Licensed