Skip to main content
100%

Linear Gradient

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 16, 2011

This example demonstrates a full-screen rectangle filled with a diagonal linear gradient. The gradient transitions from a solid green color at the top-left corner to a solid red color at the bottom-right corner, using the `pad` spread method. The visualization is rendered as SVG, constructed with the D3.js v3 library. It uses `d3.select` to append an `svg` element, defines a `linearGradient` inside a `defs` block with two `stop` elements, and applies the gradient as a fill via a URL reference.

AI-generated description
gpl-3.0 Licensed

Similar vizzes