Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Success Rate

Public visualization

Viewing a saved revision (read-only)

2e31d62abe584f7a88d620a80c531c05

Success Rate

0 stars0🌍 Public
Llukastieber
Last edited Aug 20, 2020
Created on Aug 20, 2020
Forked from React Starter

This example displays a color legend for two fruit types, apple and lemon, each assigned a distinct color from a red-to-yellow palette. The visualization renders SVG circles with corresponding text labels, positioned along the horizontal center of a 960 by 600 canvas. Implemented in React with D3 v5, the code defines a custom `colorLegend` component that uses `scaleOrdinal` to map data domains to colors and appends circle and text elements to groups, with enter and exit animations for dynamic updates.

AI-generated description

React Starter code.