Skip to main content
100%

Fork of Flowers with D3

✓ Published0🌍 Public
NNanditha Reddy
Last edited Feb 25, 2024
Created on Feb 25, 2024
Forked from Flowers with D3

This example displays a bar chart of three countries—Malta, Outer Space, and the Netherlands—as stylized flowers with green stems, colored petals, and brown vases, with each flower’s height corresponding to a score on a 0–100 scale. The visualization uses D3 v7’s `scaleBand` and `scaleLinear` for positioning, `axisLeft` and `axisBottom` for axes, and `select` to manage the SVG. Petals are drawn via a loop of `circle` elements positioned with trigonometry, while stems and vases are rendered with `rect` elements. Data is hardcoded in the `countries` array, and the background is set to lightgreen.

AI-generated description

Creating flowers with D3.

The height of each individual flower can be changed by editing an array.

MIT Licensed

Similar vizzes