Skip to main content
Public

Share visualization

Loading preview…

Assignment 6

vizhub.com

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

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

Assignment 6

0 stars0Public
NNihanthkumarreddy
Last edited Nov 14, 2026
Created on Nov 14, 2026

This example renders five circles from a CSV file containing x and y coordinates. Each circle is clickable, toggling its fill from black to white with a black stroke when selected. The visualization uses React with D3.js, employing `scaleLinear` for coordinate mapping and the `join` pattern for data binding. Container dimensions are tracked via a `ResizeObserver` hook to make the SVG responsive.

AI-generated description

React D3 Starter

A minimal React + D3 starter for building interactive data visualizations.

Files

  • index.html — page shell and import map (React + D3 from a CDN).
  • index.jsx — mounts the <App /> component.
  • App.jsx — loads data.csv and renders the visualization.
  • viz.js — D3 render entry point.
  • renderCircles.js — draws the circles.
  • useContainerDimensions.js — tracks the container size.
  • data.csv — sample data.
  • styles.css — page styles.

Getting started

Edit App.jsx to change what gets rendered; the preview updates live as you type.

Comments

Sign in to join the discussion.