Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Charts Web Component

Public visualization

Viewing a saved revision (read-only)

c23ac731970f4a94915ce5044768ab44

Charts Web Component

0 stars0🌍 Public
AAlexCamp2112
Last edited Jul 26, 2021
Created on Jul 26, 2021
Forked from React Starter

This React web component renders a horizontal bar chart where a blue rectangle represents each data category, with the bar’s width proportional to its score value. The code defines the bars through D3’s `svg.selectAll`, `enter()`, and `.append("rect")` operations, while explicitly using `x`, `y`, `d3.scaleBand`, `d3.scaleLinear` (implied by the x/y domains) and `d3.axisBottom` for the time-scaled axes. The example includes commented-out D3 code for loading CSV data via `d3.csv`, though the active implementation relies on hard-coded data passed to React’s `ReactDOM.render`.

AI-generated description

React Starter code.