Butter Macronutrients
✓ Published0🌍 Public
A pie chart visualizes butter's macronutrient composition per 100 grams, showing fat as the dominant slice at 81.11g alongside smaller protein and carbohydrate segments. Clicking any slice highlights it with a darker stroke and full opacity while dimming others. Built with D3 v7, the chart uses pie and arc generators with a custom start angle for rotation, and labels position via arc centroid calculations. A unidirectional data flow pattern manages selection state, with the SVG rendered through d3.select and join operations.
AI-generated descriptionMIT Licensed