Textures.js is a JavaScript library for creating SVG patterns. Made on top of d3.js, it is designed for data visualization.
Textures.js @ GitHub.