Rectangles using data color
Four rectangles are drawn from a hard-coded JSON array, each with its own fill color and a monospace text label offset to the right. The visualization uses D3 v4’s data join: `selectAll("rect").data(jsonRectangles).enter().append("rect")` binds the array, then `attr` methods set each rectangle’s `x`, `y`, `height`, and `width` from properties, while `style("fill", ...)` applies the color. Text labels are similarly bound and positioned using `x_axis + width + 5` and `y_axis + height`. The example demonstrates basic static SVG rendering with D3 selections and data-driven attributes.
AI-generated descriptionBuilt with blockbuilder.org
forked from <a href='http://bl.ocks.org/Igathi/'>Igathi</a>'s block: <a href='http://bl.ocks.org/Igathi/713b5a2deed36e1f2a153d7a303d8279'>Rectangles using data</a>
forked from <a href='http://bl.ocks.org/Igathi/'>Igathi</a>'s block: <a href='http://bl.ocks.org/Igathi/3097cf705d68751252b647422bff668d'>Rectangles using data</a>