fresh block
✓ Published0🌍 Public
CCoreyBurkhart
Last edited Apr 21, 2017
Created on Apr 21, 2017
This example demonstrates a simple gradient-filled rectangle drawn in an SVG canvas. It shows a black horizontal bar with a linear gradient that fades from fully opaque on the left to nearly transparent on the right, positioned near the top of the frame. The code uses D3 v4 to select the body, append an SVG element, and construct a linearGradient definition with two stop points via `selectAll` and `data`. A single `rect` is then appended and styled with the gradient, relying on D3's data-binding to set offset and opacity values.
AI-generated descriptionBuilt with blockbuilder.org
mit Licensed