Skip to main content
Public

Share visualization

Loading preview…

Coursework 1.js!

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

Coursework 1.js!

0 stars1Public
FFarhaan Qazi
Last edited Mar 2, 2023
Created on Feb 19, 2023

This example displays a horizontal bar chart of COVID-19 case counts by country, using D3.js v5 to generate SVG rectangles. The code loads data from `dataset.csv`, scales case values linearly to bar widths with `d3.scaleLinear`, and maps country names to vertical positions using `d3.scaleBand`. The `select` and `csv` APIs from D3 handle DOM and CSV parsing. The visualization shows only rectangles without axes or labels, representing the ranking of cases from Afghanistan to Botswana.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

Comments

Sign in to join the discussion.

MIT Licensed