Skip to main content
100%

Arrays

✓ Published0🌍 Public
CCraftbd
Last edited Feb 1, 2018
Created on Feb 1, 2018

This example visualizes a French flag using three rectangles, each corresponding to an object in a static JavaScript array named `FrenchFlag`. The D3.js v4 code selects all `rect` elements, binds the array data, and appends the rectangles to an SVG canvas. Each rectangle’s `x` position and `fill` color are mapped from the data’s `x` and `fill` properties, while `y`, `width`, and `height` are set uniformly. The result shows how D3’s data-binding and attribute-mapping functions generate simple, data-driven graphics.

AI-generated description

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/greenmna/'>greenmna</a>'s block: <a href='http://bl.ocks.org/greenmna/4aeb30365f1c2d7a1c72ed7f6171a4d6'>Arrays</a>

mit Licensed

Similar vizzes