fix typeof check in Graph.js

This was incorrectly checking that typeof window was not undefined,
which will always return true, as typeof always returns a string.
Merge pull request #2 from aron/fix-typeof-check

fix typeof check in Graph.js