🌍 Public
Viewing a saved revision (read-only)
354d09fff74e4fcab3f7ae55c99673e8
More complex 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 descriptionTrying to learn how this thing works.
ISC Licensed