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
change _.round
to Math.round
the loop from _.times(squaresColumn, function(n) {
to for (var n = 0; n < squaresColumn; n++;) {
xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<title>d3 | simple square grid</title>
<meta name="author" content="Sundar Singh | eesur.com">
<link rel="stylesheet" href="main.css">
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js" charset="utf-8"></script>
</head>
<header>
<h4 id="grid-ref">roll-over grid</h4>
</header>
<section id='grid'></section>
<script src="d3_code_simple_grid.js" charset="utf-8"></script>
</body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js