A really, really simple example about the usage of GeoJSON and D3's geo path generators with purely geometrical (non-geographical) data.
It creates a GeoJSON polygon representing a square for each pair of coordinates in the input data, then it packs all polygons in a feature collection. In order to use the path generator, a custom projection is defined, representing the identity (I don't know if there is a better way to implement that). A feature's type
property is then used to color the rendering.
xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title>GeoJSON squares</title>
<link type="text/css" href="index.css" rel="stylesheet"/>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="index.js"></script>
</head>
<body onload="main()"></body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js