Skip to main content
100%

More complex SVG + D3

✓ Published1🌍 Public
MMarta
Last edited Sep 26, 2024
Created on Sep 26, 2024
Forked from SVG + D3

This example demonstrates SVG masking with D3, where 100 horizontal and 100 vertical rectangles render as a grid and are selectively revealed through two masks. The masks contain symbol paths from `d3.symbol` and `d3.symbols`, with one mask inverted to create contrasting visibility. Using `d3.select`, `d3.range`, and `selection.join`, the code appends rectangles and paths directly to the SVG, positioning symbols at evenly spaced intervals. The `renderMask` function accepts an inverted flag to alternate fill colors between black and white, showcasing how D3 v7 enables dynamic mask construction.

AI-generated description

Trying to learn how this thing works.

ISC Licensed

Similar vizzes