Split state and pings js graph in a separate file