Monthly Archive: February 2014

It’s An Angular Life

It’s An Angular Life

The Game of Life A while back, I programmed the Game of Life. No, not the board game. The game of life is a cellular simulation, where you have a grid of cells, each of which is either alive or dead. At each turn, the following rules are executed: Any live cell with fewer than two live neighbours dies, as if caused...

Who You Gonna Call(back)?

Who You Gonna Call(back)?

In Javascript, callback functions are widely used. But what is a callback function? It’s a function which is passed as an argument to another function. For example: myFunc(someArgument, anotherFunc); In this code, myFunc receives the callback function anotherFunc as an argument. myFunc will run its code, and as soon as it’s complete, it will call anotherFunc. This is the basic idea of...

Enter, Update, and Exit in D3

Enter, Update, and Exit in D3

Today at Flatiron we began learning D3, or Data-Driven Documents. D3 is a library to visualize data. Some of the examples are pretty awesome. One key aspect of using D3 is the enter/update/exit life cycle. When you’re binding your data to elements in your DOM, it is enter/update/exit that saves you from having to manually enter a div to hold each piece...