Skip to main content
Public

Share visualization

Loading preview…

Melting Data for Multiple Lines

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Melting Data for Multiple Lines

1
PPeter S
Last edited Oct 5, 2019
Created on Sep 19, 2019

This example visualizes population trends for countries over time as multiple smoothed lines, using a nested data structure to group values by region. The chart displays yearly population estimates from the UN’s medium variant dataset, covering 1950 to 2100. Built with React and D3 v5, the code employs `d3.nest` for data grouping, `d3.line` with `curveBasis` for path generation, and `d3.scaleOrdinal` with `schemeCategory10` for color mapping. A custom color legend and axes with tick formatting complete the SVG rendering.

AI-generated description

An example showing the one week Temperature from San Francisco. The data comes form here

Comments

Sign in to join the discussion.

MIT Licensed