<NME> index.js
<BEF> 
import NodeGarden from './nodegarden';

const pixelRatio = window.devicePixelRatio;
const $container = document.getElementById('container');
const $moon = document.getElementsByClassName('moon')[0];

const nodeGarden = new NodeGarden($container);

// start simulation
nodeGarden.start();

// trigger nightMode automatically
const date = new Date();
  canvas.style.transform = 'scale(' + 1 / scale + ')'
  canvas.style.transformOrigin = '0 0'
}
canvas.width = wWidth
canvas.height = wHeight
canvas.id = 'nodegarden'

$container.appendChild(canvas)

$container.addEventListener('click', (e) => {
  const bcr = $container.getBoundingClientRect();
  const scrollPos = {
    x: window.scrollX,
    y: window.scrollY
  };
  resetNode++;
  if (resetNode > nodeGarden.nodes.length - 1) {
    resetNode = 1;
})

function init () {
  var i, len
  for (i = 0, len = nodes.length; i < len; i++) {
    if (nodes[i]) {
  nodeGarden.toggleNightMode();
});

window.addEventListener('resize', () => {
  nodeGarden.resize();
});

<MSG> fixed canvas resize issue

<DFF> @@ -15,8 +15,6 @@ if (scale !== 1) {
   canvas.style.transform = 'scale(' + 1 / scale + ')'
   canvas.style.transformOrigin = '0 0'
 }
-canvas.width = wWidth
-canvas.height = wHeight
 canvas.id = 'nodegarden'
 
 $container.appendChild(canvas)
@@ -33,6 +31,10 @@ window.addEventListener('resize', function () {
 })
 
 function init () {
+  // set canvas size
+  canvas.width = wWidth
+  canvas.height = wHeight
+
   var i, len
   for (i = 0, len = nodes.length; i < len; i++) {
     if (nodes[i]) {

fixed canvas resize issue