Factor scatter plot grid into seperate .js file