Heat Map application graphed in D3.js.
This project is based on FreeCodeCamp Project 3
Source Code
1
I used ES6 modules with export and import to organize the code into separate files.
export {makeXAxis,makeYAxis,getXCoord,getYCoord};
import {makeXAxis, makeYAxis,getXCoord,getYCoord} from './Axis.js';
2
Even though I only used Month, I needed the entire Date to place the rectangle in the correct place on the Y Axis.
return yScale(new Date("2019-" + d.month + "-01")) + "px";
3
Separated selecting the rects in the legend from selecting the rects in the Heat Map.
Put each selection in its own group <g>
.