Skip to main content
100%

React Starter

✓ Published0🌍 Public
JJanet Chen
Last edited Jan 30, 2020
Created on Jan 30, 2020
Forked from React Starter

This example demonstrates how D3’s data-join pattern can be used within a React application to render circles that change color based on value. It shows a minimal setup where two arrays of numbers are passed to an `updateVis` function, which appends circles to an SVG using `d3.select`, `selectAll`, and `enter`. Each circle’s radius and vertical position are fixed, while horizontal placement is calculated from its index. Circles with values greater than 30 are filled blue, otherwise red, using D3’s `attr` method. The code relies on React 16.10, D3’s `select` and `range`, and a bundled JavaScript file.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes