{"id":13724437,"url":"https://github.com/SchmidtDSE/plastics-prototype","last_synced_at":"2025-05-07T18:32:13.600Z","repository":{"id":200879859,"uuid":"657345553","full_name":"SchmidtDSE/plastics-prototype","owner":"SchmidtDSE","description":"Decision support tool for plastics policy.","archived":false,"fork":false,"pushed_at":"2024-10-21T22:45:10.000Z","size":5978,"stargazers_count":6,"open_issues_count":3,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-25T17:30:49.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SchmidtDSE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":"support/README.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-22T21:32:49.000Z","updated_at":"2024-10-21T22:44:39.000Z","dependencies_parsed_at":"2023-10-20T07:05:10.255Z","dependency_job_id":"e5421d33-cd69-4ddb-b3ac-b0c6ed324545","html_url":"https://github.com/SchmidtDSE/plastics-prototype","commit_stats":{"total_commits":1177,"total_committers":5,"mean_commits":235.4,"dds":0.3432455395072217,"last_synced_commit":"f03fdf1131d3e213e1beb76b62228e1c79fefddf"},"previous_names":["schmidtdse/plastics-prototype"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SchmidtDSE%2Fplastics-prototype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SchmidtDSE%2Fplastics-prototype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SchmidtDSE%2Fplastics-prototype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SchmidtDSE%2Fplastics-prototype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SchmidtDSE","download_url":"https://codeload.github.com/SchmidtDSE/plastics-prototype/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224636531,"owners_count":17344563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:01:57.151Z","updated_at":"2024-11-14T14:30:54.590Z","avatar_url":"https://github.com/SchmidtDSE.png","language":"JavaScript","funding_links":[],"categories":["Industrial Ecology"],"sub_categories":["Circular Economy and Waste"],"readme":"Plastics Prototype\n===============================================================================\nPrototype for the plastics decision support tool with transparent intervention code / authoring. The tool is primarily available at [https://global-plastics-tool.org/](https://global-plastics-tool.org/). This tool is in pre-release (like preprint), feedback welcome!\n\n\u003cbr\u003e\n\nRelated\n--------------------------------------------------------------------------------\nSee also [source code for \"main\" pipeline](https://github.com/SchmidtDSE/plastics-pipeline) and [source code for the GHG pipeline](https://github.com/SchmidtDSE/plastics-ghg-pipeline). Further documentation for this effort can be found in our [supplemental scripts](https://github.com/SchmidtDSE/plastics-supplemental-scripts) and [documentation](https://github.com/SchmidtDSE/plastics-interventions-doc) repositories. This final repository produces the following documentation chapters:\n\n - [Machine learning base model for business as usual](https://global-plastics-tool.org/pdf/ml.pdf)\n - [Sectorizing secondary material](https://global-plastics-tool.org/pdf/sectorizing_secondary_material.pdf)\n - [Polymer-level estimation and GHG calculations](https://global-plastics-tool.org/pdf/polymers_and_ghg.pdf)\n - [Policy engine overview](https://global-plastics-tool.org/pdf/engine.pdf)\n - [Additives](https://global-plastics-tool.org/pdf/additives.pdf)\n - [Consumption tax](https://global-plastics-tool.org/pdf/consumption_tax.pdf)\n - [Incineration investment](https://global-plastics-tool.org/pdf/incineration_investment.pdf)\n - [Maximum mismanaged rate](https://global-plastics-tool.org/pdf/max_mismanaged_rate.pdf)\n - [Minimum recycled content](https://global-plastics-tool.org/pdf/min_recycled_content.pdf)\n - [Minimum recycling (collection) rate](https://global-plastics-tool.org/pdf/min_recycling_rate.pdf)\n - [Minimum reuse rate](https://global-plastics-tool.org/pdf/min_reuse_rate.pdf)\n - [Recycling investment](https://global-plastics-tool.org/pdf/recycling_investment.pdf)\n - [Reduced packaging](https://global-plastics-tool.org/pdf/reduce_packaging.pdf)\n - [Virgin plastic production cap](https://global-plastics-tool.org/pdf/virgin_plastic_cap.pdf)\n - [Waste management investment](https://global-plastics-tool.org/pdf/waste_management_investment.pdf)\n - [Waste trade](https://global-plastics-tool.org/pdf/waste_trade.pdf)\n\n\u003cbr\u003e\n\nPurpose\n--------------------------------------------------------------------------------\nThis tool allows users to explore potential future plastic outcomes including waste and consumption under different policy scenarios. It does this primarily through an [interactive browser-based tool](https://global-plastics-tool.org/) but also offers some [static visualizations](https://github.com/SchmidtDSE/plastics-prototype/tree/main/image_gen) and the ability to run these policy scenarios through Node [outside the browser](https://github.com/SchmidtDSE/plastics-prototype/tree/main/js_standalone). Altogther, this tool provides new perspective to policy makers and other stakeholders on how to address global plastic waste, hoping to help inform efforts such as [UN INC on Plastic Pollution](https://www.unep.org/inc-plastic-pollution).\n\n\u003cbr\u003e\n\nUsage\n--------------------------------------------------------------------------------\nThere are multiple ways to interact with the tool. Note that many of these require `pt/index.json` rendered via `support/render_index.py`.\n\n### In-browser\nThe primary way to interact with the tool is through the browser. See https://global-plastics-tool.org/ for the publicly available hosted version. To host it yourself or run it on your own machine, see the instructions below.\n\n### Command line\nThe policy simulation engine can also run externally to the browswer through Node. See [js_standlaone](https://github.com/SchmidtDSE/plastics-prototype/tree/main/js_standalone) for more details.\n\n### Writing new interventions\nSee the [pt subdirectory](https://github.com/SchmidtDSE/plastics-prototype/tree/main/pt) (`pt`) for more details on how to add new interventions.\n\n\u003cbr\u003e\n\nModeling\n--------------------------------------------------------------------------------\nNote that the model repository including data and source code is available at [https://github.com/SchmidtDSE/plastics-pipeline](https://github.com/SchmidtDSE/plastics-pipeline).\n\n\u003cbr\u003e\n\nContainer Environment\n--------------------------------------------------------------------------------\nA containerized environment is available for both local execution of the application as well as development.\n\n### Containerized execution\nThe application can be run through a Docker container. This will build the application as well as generate the static [supporting graphs](https://github.com/SchmidtDSE/plastics-prototype/tree/main/image_gen) and selected [static scenario outputs](https://github.com/SchmidtDSE/plastics-prototype/tree/main/js_standalone). \n\n### Containerized development\nNote that a containerized cloud development environment is also available. See `.gitpod.yml` and [GitPod](https://gitpod.io/) for more details. After opening the repository, start running the application with `python -m http.server`.\n\n\u003cbr\u003e\n\nManual Environment\n--------------------------------------------------------------------------------\nTo run the tool locally with a custom or manual environment setup, some prerequisites are required:\n\n - [Java](https://adoptium.net/) allows for ANTLR source generation as required for the plastics intervention language.\n - [Node](https://nodejs.org/en) is required in order to run grunt and webpack, enabling preparation of the front-end.\n - [Python](https://docs.python-guide.org/starting/installation/) acts as automation scripting.\n\nHaving installed the above, execute the following to start the local server:\n\n - Install Python dependencies: `pip install -r requirements.txt`.\n - Setup the local environment with `bash support/setup_local.sh` which includes downloading a copy of the underlying data.\n - Execute a local web server for example `python -m http.server`.\n\nNote that optional static visualizations are also available under [image_gen](https://github.com/SchmidtDSE/plastics-prototype/tree/main/image_gen). See that sub-directory's README for more details.\n\n\u003cbr\u003e\n\nDeployment\n--------------------------------------------------------------------------------\nThere are two options for deploying the application.\n\n### CI / CD\nCI / CD can deploy changes after they merge to `deploy`, releasing to the [public version](https://global-plastics-tool.org/). Note that this tool does not have a backend and the contents of this repository simply need to be hosted as static files after building (see `support/setup_local.sh` for a minimal build).\n\n### Container\nThe Docker container can also be deployed to various different environments. By default, it will use [nginx](https://nginx.org/en/) to host the static files on port 8080 but this may require port forwarding in your hosting environment. Furthermore, it does not run in a daemon. Please adjust `Dockerfile` and `docker-compose.yml` to fit your desired secuirty profile and hosting environment before deployment.\n\n\u003cbr\u003e\n\nDevelopment standards\n--------------------------------------------------------------------------------\nThis project uses the following:\n\n - Primarily, front-end tests are supported through Grunt (`grunt`) and QUnit. Meanwhile style is generally enforced eslint (`npx eslint ./js/*.js`).\n - Note that CI / CD may execute other tests and all pull requests should be passing all test and lint operations before merge.\n - When in doubt, please follow the [JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html).\n - Try to provide docstrings / JSDoc for public members (note that the `support` directory is excluded from this requirement at this time).\n - Reviewers may also impose certain requirements around usability and accessibility as to be discussed during reviews.\n\nPlease be kind. Open source is an act of love.\n\n\u003cbr\u003e\n\nData and Citation\n--------------------------------------------------------------------------------\nPapers are still in process. Please cite preprint at [10.48550/arXiv.2312.11359](https://arxiv.org/abs/2312.11359) for now. Thank you! This tool's other repositories use the following:\n\n - [DESA, World Population Prospects 2022 (2022).](https://population.un.org/wpp/Download)\n - [R. Geyer, J. R. Jambeck, K. L. Law, Production, use, and fate of all plastics ever made. Sci. Adv. 3, e1700782 (2017).](https://www.science.org/doi/10.1126/sciadv.1700782)\n - C. Liu, S. Hu, R. Geyer. Manuscript in Process (2024).\n - [OECD, Real GDP long-term forecast (2023).](https://doi.org/10.1787/d927bc18-en)\n - [J. Zheng, S. Suh, Strategies to reduce the global carbon footprint of plastics. Nat. Clim. Chang. 9, 374–378 (2019).](https://www.nature.com/articles/s41558-019-0459-z)\n\nWe thank the community and authors for their contribution.\n\n\u003cbr\u003e\n\nOpen source\n--------------------------------------------------------------------------------\nThe project uses the following:\n\n - [ANTLR](https://www.antlr.org/index.html) under the [BSD License](https://www.antlr.org/license.html).\n - [Ace Editor](https://ace.c9.io/) under the [BSD License](https://github.com/ajaxorg/ace/blob/master/LICENSE).\n - [Chart.js](https://www.chartjs.org) under the [MIT License](https://github.com/chartjs/Chart.js/blob/master/LICENSE.md).\n - [ColorBrewer](https://colorbrewer2.org) under the [Apache v2 License](https://github.com/axismaps/colorbrewer/blob/master/LICENCE.txt).\n - [d3](https://d3js.org/) under the [ISC License](https://github.com/d3/d3/blob/main/LICENSE).\n - [es-module-shims](https://www.npmjs.com/package/es-module-shims) under the [MIT License](https://github.com/guybedford/es-module-shims/blob/main/LICENSE).\n - [Handlebars](https://handlebarsjs.com/) under the [MIT License](https://github.com/handlebars-lang/handlebars.js/blob/master/LICENSE).\n - [League Spartan](https://www.theleagueofmoveabletype.com/league-spartan) under the [OFL License](https://opensource.org/license/ofl-1-1/).\n - [Matplotlib](https://matplotlib.org/) under the [PSF License](https://matplotlib.org/stable/users/project/license.html).\n - [Pandas](https://pandas.pydata.org/) under the [BSD License](https://github.com/pandas-dev/pandas/blob/main/LICENSE).\n - [Papa Parse](https://www.papaparse.com/) under the [MIT License](https://github.com/mholt/PapaParse/blob/master/LICENSE).\n - [Polyfill.io](https://polyfill.io/v3/) under the [MIT License](https://github.com/JakeChampion/polyfill-service/blob/main/LICENSE.md).\n - [Popper](https://popper.js.org/) under the [MIT License](https://github.com/floating-ui/floating-ui/blob/master/LICENSE).\n - [Pure CSS Custom Dropdown Arrow](https://codepen.io/code-boxx/pen/RwxbpOz) under the [MIT License](https://codepen.io/code-boxx/pen/RwxbpOz).\n - [Qunit](https://qunitjs.com/) under the [MIT License](https://github.com/qunitjs/qunit/blob/main/LICENSE.txt).\n - [Simplebar](https://grsmto.github.io/simplebar/) under the [MIT License](https://github.com/Grsmto/simplebar/blob/master/LICENSE).\n - [Tabby](https://github.com/cferdinandi/tabby) under the [MIT License](https://github.com/cferdinandi/tabby/blob/master/LICENSE.md).\n - [Tippy](https://atomiks.github.io/tippyjs/) under the [MIT License](https://github.com/atomiks/tippyjs/blob/master/LICENSE).\n - [ua-parser 1.0.36](https://uaparser.js.org/) under the [MIT License](https://www.npmjs.com/package/ua-parser-js).\n\nNote that the following may be invoked as executables like via the command line through CI / CD or by users of this tool but are not statically linked with the tool (and are not used during the execution of the web-based interactive tool):\n\n - [Grunt](https://gruntjs.com/) under the [MIT License](https://github.com/gruntjs/grunt/blob/main/LICENSE).\n - [grunt-contrib-connect](https://github.com/gruntjs/grunt-contrib-connect) under the \n - [grunt-contrib-qunit](https://github.com/gruntjs/grunt-contrib-qunit) under the [MIT License](https://github.com/gruntjs/grunt-contrib-qunit/blob/main/LICENSE-MIT).\n - [Node](https://nodejs.org/en) under an [open source set of licenses](https://github.com/nodejs/node/blob/main/LICENSE).\n - [npm](https://www.npmjs.com/) under [Artistic v2 License](https://docs.npmjs.com/policies/npm-license).\n - [OpenJDK](https://openjdk.org/) under the [GPL License](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).\n - [Processing](https://processing.org/) under the [GPL License](https://github.com/benfry/processing4/blob/main/LICENSE.md).\n - [Webpack](https://webpack.js.org/) under the [MIT License](https://github.com/webpack/webpack/blob/main/LICENSE).\n\nOur CI / CD systems via [GitHub Actions](https://docs.github.com/en/actions) also use the libraries described in `build.yml`.\n\nMeanwhile, the optional containerized environment uses the following:\n\n - [Docker](https://docs.docker.com/engine/) under the [Apache v2 License](https://github.com/moby/moby/blob/master/LICENSE).\n - [Docker Compose](https://docs.docker.com/compose/) under the [Apache v2 License](https://github.com/docker/compose/blob/main/LICENSE).\n - [Nginx](https://nginx.org/en/) under a [BSD-like License](https://nginx.org/LICENSE).\n\nFinally, thanks to the following some basic boilerplates / inspiration:\n\n - [ANTLR Mega Tutorial](https://github.com/gabriele-tomassetti/antlr-mega-tutorial) by Gabriele Tomassetti under the [MIT License](https://github.com/gabriele-tomassetti/antlr-mega-tutorial/blob/master/LICENSE.md).\n - [AntlrCalc](https://snorristurluson.github.io/AntlrCalc/) (the article) by Snorri Sturluson under the [MIT License](https://github.com/snorristurluson/snorristurluson.github.io).\n - [arithmetic](https://github.com/antlr/grammars-v4/blob/master/arithmetic/arithmetic.g4) by Tom Everett under inline BSD License.\n - Bret Victor's [Inventing on Principle](https://www.youtube.com/watch?v=PUv66718DII).\n - Fernando Pérez's work on [reproducible research](https://www.youtube.com/watch?t=1521\u0026v=GUyt_VXU8Aw\u0026feature=youtu.be).\n - Maggie Appleton's [Programming Portals](https://maggieappleton.com/programming-portals).\n - [PlantLang](https://github.com/sampottinger/PlantLang) under the [MIT License](https://github.com/sampottinger/PlantLang/blob/main/LICENSE.txt).\n - [Pyafscgap](https://pyafscgap.org/) under the [BSD License](https://github.com/SchmidtDSE/afscgap/blob/main/LICENSE.md).\n - [Tiny ANTLR Language](https://github.com/bkiers/tiny-language-antlr4/tree/master) under the [Unlicense License](https://github.com/bkiers/tiny-language-antlr4/blob/master/UNLICENSE).\n\nNote that additional open source libraries used by the model pipeline are discussed at [https://github.com/SchmidtDSE/plastics-pipeline](https://github.com/SchmidtDSE/plastics-pipeline).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSchmidtDSE%2Fplastics-prototype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSchmidtDSE%2Fplastics-prototype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSchmidtDSE%2Fplastics-prototype/lists"}