This block is specific to a Pig MR script. Can this be abstracted out of what should be a generic graph.js file?