Writes graph and paper data into json file.