Skip to main content
100%

Fork of React + D3 Viz Starter

✓ Published0🌍 Public
OOssianL
Last edited Mar 8, 2021
Created on Mar 7, 2021

A circular color wheel displays all 148 CSS named colors as equal-width arcs emanating from the center. The visualization loads its data from a CSV file listing named colors and their RGB hex values, then renders each arc using the d3.arc() function within a React component. As the user moves the mouse, the entire group of arcs rotates by an offset calculated from the cursor's x-position, creating an interactive feel. The code uses React hooks like useEffect and useMemo to manage data loading and arc generation.

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
MIT Licensed

Similar vizzes