This example uses strings of quaternary digits to generate squares in a quadtree. The string acts as a unique identifier for squares of different size and position.
Click here to compare with a Hilbert displacement.
xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title>Quaternary numbers for indexing a quadtree</title>
<link type="text/css" rel="stylesheet" href="index.css"/>
<script src="https://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg></svg>
<script src="index.js"></script>
</body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js