I have created a CodePen here: https://codepen.io/rickgove/pen/jOMxZYj?editors=0010
I have a matrix in JavaScript: