Skip to main content
100%

Texture Test

✓ Published0🌍 Public
CCurran Kelleher
Last edited Jan 28, 2021
Created on Mar 24, 2015

This example demonstrates a texture scale that combines separate ordinal and linear scales for pattern, color, and size into a single fill function. The visualization renders a 12×12 grid of circles, where each circle’s pattern, stroke color, and fill texture are determined by its row and column position. Using the textures.js library and D3 v3, the code creates a caching mechanism in `createTextureScale` to generate and reuse textures for unique combinations of pattern, color, and size. The animation periodically randomizes circle radii, showcasing how the texture scale adapts dynamically.

AI-generated description

A test of textures.js that shows one approach for creating a "texture scale" that combines individual scales for pattern, size, and color.

See also this discussion on GitHub: https://github.com/riccardoscalco/textures/issues/7

Similar vizzes