block by eesur 3fc83ddc4c060e6bd43e

d3 | simple square grid

Full Screen

Simple square grid that is made of squares (well rect)

Change the height, width and square vars to alter. It simply loops over number of columns and creates a row for each loop iteration.


Note: If you don’t want to use lodash

  1. change _.round to Math.round

  2. the loop from _.times(squaresColumn, function(n) { to for (var n = 0; n < squaresColumn; n++;) {

index.html

d3_code_simple_grid.js

main.css