outsource plot creation functions to plot.js