Skip to main content
Public

Share visualization

Loading preview…

Temperature in San Francisco Line Chart

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

Temperature in San Francisco Line Chart

1
Rrenguangz
Last edited Aug 27, 2021
Created on Aug 27, 2021

This line chart visualizes temperature readings over time for San Francisco, using a dataset from Data Canvas. The chart employs a time-based x-axis and a linear y-axis for temperature, with grid lines extending across the plot area. The visualization renders multiple line paths, each representing a different city, using ordinal color scaling. Built with React and D3 v5, the SVG rendering leverages d3.scaleTime, d3.scaleLinear, d3.line, and d3.nest to group data by city, while the VizContainer handles margins and layout.

AI-generated description

Boilerplate code for a React + D3 visualization with:

  • CDN links for React, ReactDOM, and D3
  • Basic React boilerplate
  • Variables for dimensions and margins
  • A VizContainer component that:
    • Abstracts SVG/group container elements
    • Follows the margin convention
    • Show the margins, which can be easily removed by deleting the showMargins={true} prop

Comments

Sign in to join the discussion.

MIT Licensed