A simple example of a rectangular adjacency matrix. The scaleBand.padding()
method is not used because it is less flexible than using pixel math. This way, we can use pixel-based paddings and still be able to use the scale to address a specific cell without having to correct pixel values by taking the unknown padding amount into account.
xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title>Rectangular adjacency matrix</title>
<link type="text/css" href="index.css" rel="stylesheet"/>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v0.4.min.js"></script>
</head>
<body>
<svg></svg>
<script src="index.js"></script>
</body>
</html>
https://d3js.org/d3.v4.min.js
https://d3js.org/d3-selection-multi.v0.4.min.js