From 08f34f748bc9f705e4fc55f567aa7bf5835fa4e0 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Mon, 6 Mar 2023 15:20:21 +0100 Subject: [PATCH] Apply prettier to css, html, js, md, ts, and yml (#1249) * Apply prettier to css, js, html, md, ts, and yml As a followup I will add prettier to the .pre-commit config. This patch is 100% generated by prettier. I used a forked version of prettier that understands the py-script tag. See https://github.com/hoodmane/pyscript-prettier-precommit for more info. * Apply old pre-commit * Revert some problems * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Revert some changes * More changes * Fix pre-commit * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug-report.yml | 84 +- .github/ISSUE_TEMPLATE/config.yml | 4 +- .github/workflows/build-unstable.yml | 5 +- .github/workflows/docs-release.yml | 9 +- .github/workflows/docs-review.yml | 3 +- .github/workflows/docs-unstable.yml | 5 +- .github/workflows/prepare-release.yml | 5 +- .github/workflows/publish-release.yml | 4 +- .github/workflows/sync-examples.yml | 5 +- CONTRIBUTING.md | 39 +- GOVERNANCE.md | 1 + MAINTAINERS.md | 2 +- README.md | 29 +- TROUBLESHOOTING.md | 3 +- examples/altair.html | 128 +-- examples/antigravity.html | 34 +- examples/assets/css/examples.css | 111 +-- examples/assets/css/index.css | 80 +- examples/assets/css/main.css | 25 +- examples/assets/css/reset.css | 18 +- examples/assets/css/variables.css | 8 +- examples/await/await0.html | 22 +- examples/await/await1.html | 8 +- examples/await/await2.html | 8 +- examples/await/await3.html | 8 +- examples/await/await4.html | 62 +- examples/await/await5.html | 20 +- examples/bokeh.html | 104 ++- examples/bokeh_interactive.html | 174 ++-- examples/d3.html | 182 +++-- examples/folium.html | 67 +- examples/hello_world.html | 10 +- examples/index.html | 289 +++---- examples/mario/css/game.css | 5 +- examples/mario/js/bcoin.js | 22 +- examples/mario/js/block.js | 34 +- examples/mario/js/coin.js | 54 +- examples/mario/js/entity.js | 58 +- examples/mario/js/fireball.js | 68 +- examples/mario/js/fireflower.js | 67 +- examples/mario/js/flag.js | 40 +- examples/mario/js/floor.js | 119 +-- examples/mario/js/game.js | 136 ++-- examples/mario/js/goomba.js | 61 +- examples/mario/js/input.js | 99 +-- examples/mario/js/koopa.js | 82 +- examples/mario/js/levels/11.js | 235 ++++-- examples/mario/js/levels/11tunnel.js | 132 ++- examples/mario/js/levels/level.js | 277 ++++--- examples/mario/js/mushroom.js | 65 +- examples/mario/js/pipe.js | 186 +++-- examples/mario/js/player.js | 882 +++++++++++---------- examples/mario/js/prop.js | 13 +- examples/mario/js/resources.js | 101 ++- examples/mario/js/rubble.js | 43 +- examples/mario/js/sprite.js | 37 +- examples/mario/js/star.js | 63 +- examples/mario/js/util.js | 22 +- examples/markdown-plugin.html | 2 +- examples/matplotlib.html | 66 +- examples/message_passing.html | 73 +- examples/micrograd_ai.html | 353 ++++----- examples/numpy_canvas_fractals.html | 434 +++++----- examples/pandas.html | 192 ++--- examples/panel.html | 30 +- examples/panel_deckgl.html | 349 ++++---- examples/panel_kmeans.html | 121 ++- examples/panel_stream.html | 78 +- examples/repl.css | 26 +- examples/repl.html | 14 +- examples/repl2.html | 12 +- examples/simple_bioinformatics_tool.html | 245 +++--- examples/simple_clock.html | 40 +- examples/todo-pylist.html | 21 +- examples/todo.html | 45 +- examples/toga/README.md | 8 +- examples/toga/freedom.html | 90 ++- examples/toga/static/css/briefcase.css | 28 +- examples/webgl/raycaster/index.html | 306 ++++--- examples/webgl/raycaster/style.css | 22 +- pyscriptjs/__mocks__/cssMock.js | 2 +- pyscriptjs/__mocks__/fileMock.js | 4 +- pyscriptjs/jest.config.js | 2 +- pyscriptjs/package.json | 104 +-- pyscriptjs/public/index.html | 64 +- pyscriptjs/rollup.config.js | 119 +-- pyscriptjs/src/components/pyscript.ts | 14 +- pyscriptjs/src/exceptions.ts | 68 +- pyscriptjs/src/interpreter_client.ts | 3 +- pyscriptjs/src/logger.ts | 2 +- pyscriptjs/src/main.ts | 2 +- pyscriptjs/src/plugin.ts | 15 +- pyscriptjs/src/plugins/fetch.ts | 18 +- pyscriptjs/src/plugins/stdiodirector.ts | 51 +- pyscriptjs/src/pyexec.ts | 4 +- pyscriptjs/src/remote_interpreter.ts | 18 +- pyscriptjs/src/stdio.ts | 54 +- pyscriptjs/src/styles/pyscript_base.css | 50 +- pyscriptjs/src/utils.ts | 14 +- pyscriptjs/tests/unit/exceptions.test.ts | 198 +++-- pyscriptjs/tests/unit/fetch.test.ts | 156 ++-- pyscriptjs/tests/unit/fetch_plugin.test.ts | 88 +- pyscriptjs/tests/unit/logger.test.ts | 25 +- pyscriptjs/tests/unit/main.test.ts | 35 +- pyscriptjs/tests/unit/pyodide.test.ts | 2 +- pyscriptjs/tests/unit/stdio.test.ts | 94 ++- pyscriptjs/tests/unit/utils.test.ts | 121 +-- pyscriptjs/tsconfig.json | 34 +- 108 files changed, 4571 insertions(+), 3802 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index af4bcd5e..2c19cbee 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -2,62 +2,62 @@ name: Bug Report description: Create a report to help us improve labels: ["type: bug", "needs-triage"] body: -- type: markdown + - type: markdown attributes: - value: | - Thanks for helping PyScript! 🐍 + value: | + Thanks for helping PyScript! 🐍 - Going through bugs and issues takes up a lot of time, so please be so kind and take a few minutes to fill out all the areas to the best of your ability. + Going through bugs and issues takes up a lot of time, so please be so kind and take a few minutes to fill out all the areas to the best of your ability. - There will always be more issues than there is time to do them, and so we will need to selectively close issues that don't provide enough information, so we can focus our time on helping people like you who fill out the issue form completely. Thank you for your collaboration! + There will always be more issues than there is time to do them, and so we will need to selectively close issues that don't provide enough information, so we can focus our time on helping people like you who fill out the issue form completely. Thank you for your collaboration! - There are also already a lot of open issues, so please take 2 minutes and search through existing ones to see if what you are experiencing already exists + There are also already a lot of open issues, so please take 2 minutes and search through existing ones to see if what you are experiencing already exists - Thanks for helping PyScript be amazing. We are nothing without people like you helping build a better community 💐! -- type: checkboxes + Thanks for helping PyScript be amazing. We are nothing without people like you helping build a better community 💐! + - type: checkboxes id: checks attributes: - label: Checklist - description: Please confirm and check all the following options. - options: - - label: I added a descriptive title - required: true - - label: I searched for other issues and couldn't find a solution or duplication - required: true - - label: I already searched in Google and didn't find any good information or help - required: true -- type: textarea + label: Checklist + description: Please confirm and check all the following options. + options: + - label: I added a descriptive title + required: true + - label: I searched for other issues and couldn't find a solution or duplication + required: true + - label: I already searched in Google and didn't find any good information or help + required: true + - type: textarea id: what-happened attributes: - label: What happened? - description: And what should have happened instead? This really helps everyone review quicker and greatly increases the chance that someone can get around to solve your issue - placeholder: Tell us what you see! + label: What happened? + description: And what should have happened instead? This really helps everyone review quicker and greatly increases the chance that someone can get around to solve your issue + placeholder: Tell us what you see! validations: - required: true -- type: dropdown + required: true + - type: dropdown id: browsers attributes: - label: What browsers are you seeing the problem on? (if applicable) - multiple: true - options: - - Firefox - - Chrome - - Safari - - Microsoft Edge - - Other + label: What browsers are you seeing the problem on? (if applicable) + multiple: true + options: + - Firefox + - Chrome + - Safari + - Microsoft Edge + - Other validations: - required: false -- type: textarea + required: false + - type: textarea id: list attributes: - label: Console info - description: | - If there are errors in your browser console then its helpful to be able to troubleshoot. - - Chrome , Firefox, and Edge: Right-click on the page and select *Inspect*. Alternatively you can press F12 on your keyboard. - - Safari: Find instructions [here](https://support.apple.com/guide/safari/use-the-developer-tools-in-the-develop-menu-sfri20948/mac). - render: shell -- type: textarea + label: Console info + description: | + If there are errors in your browser console then its helpful to be able to troubleshoot. + - Chrome , Firefox, and Edge: Right-click on the page and select *Inspect*. Alternatively you can press F12 on your keyboard. + - Safari: Find instructions [here](https://support.apple.com/guide/safari/use-the-developer-tools-in-the-develop-menu-sfri20948/mac). + render: shell + - type: textarea id: context attributes: - label: Additional Context - description: Add any additional context information or screenshots you think are useful. + label: Additional Context + description: Add any additional context information or screenshots you think are useful. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 266ac38d..9f18f2db 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ blank_issues_enabled: false contact_links: -- name: Feature Proposals + - name: Feature Proposals url: https://github.com/pyscript/pyscript/discussions/new?category=proposals about: Create a feature request to make PyScript even better -- name: Questions + - name: Questions url: https://github.com/pyscript/pyscript/discussions/new?category=q-a about: For questions or discussions about pyscript diff --git a/.github/workflows/build-unstable.yml b/.github/workflows/build-unstable.yml index bd7b8f65..77b548ea 100644 --- a/.github/workflows/build-unstable.yml +++ b/.github/workflows/build-unstable.yml @@ -28,7 +28,6 @@ jobs: MINICONDA_PYTHON_VERSION: py38 MINICONDA_VERSION: 4.11.0 steps: - - name: Checkout uses: actions/checkout@v3 @@ -42,7 +41,7 @@ jobs: env: cache-name: cache-node-modules with: - # npm cache files are stored in `~/.npm` on Linux/macOS + # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | @@ -97,7 +96,7 @@ jobs: name: pyscript path: ./build/ - # Deploy to S3 + # Deploy to S3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1.6.1 with: diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml index 80030431..3e1b60de 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs-release.yml @@ -13,7 +13,6 @@ jobs: env: SPHINX_HTML_BASE_URL: https://docs.pyscript.net/ steps: - - name: Checkout uses: actions/checkout@v3 with: @@ -40,7 +39,7 @@ jobs: name: pyscript-docs-${{ github.ref_name }} path: docs/_build/html/ - # Deploy to S3 + # Deploy to S3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1.6.1 with: @@ -53,11 +52,11 @@ jobs: - name: Sync to S3 run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/${{ github.ref_name }}/ - # Make sure to remove the latest folder so we sync the full docs upon release + # Make sure to remove the latest folder so we sync the full docs upon release - name: Delete latest directory run: aws s3 rm --recursive s3://docs.pyscript.net/latest/ - # Note that the files are the same as above, but we want to have folders with - # // AND /latest/ which latest will always point to the latest release + # Note that the files are the same as above, but we want to have folders with + # // AND /latest/ which latest will always point to the latest release - name: Sync to /latest run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/latest/ diff --git a/.github/workflows/docs-review.yml b/.github/workflows/docs-review.yml index 057833ba..0635f0c1 100644 --- a/.github/workflows/docs-review.yml +++ b/.github/workflows/docs-review.yml @@ -26,7 +26,6 @@ jobs: env: SPHINX_HTML_BASE_URL: https://docs.pyscript.net/ steps: - - name: Checkout uses: actions/checkout@v3 with: @@ -53,7 +52,7 @@ jobs: name: pyscript-docs-review-${{ github.event.number }} path: docs/_build/html/ - # Deploy to S3 + # Deploy to S3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1.6.1 with: diff --git a/.github/workflows/docs-unstable.yml b/.github/workflows/docs-unstable.yml index 50f0f42f..c1cd427e 100644 --- a/.github/workflows/docs-unstable.yml +++ b/.github/workflows/docs-unstable.yml @@ -16,7 +16,6 @@ jobs: env: SPHINX_HTML_BASE_URL: https://docs.pyscript.net/ steps: - - name: Checkout uses: actions/checkout@v3 with: @@ -43,13 +42,13 @@ jobs: name: pyscript-docs-latest path: docs/_build/html/ - # Deploy to S3 + # Deploy to S3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1.6.1 with: aws-region: ${{ secrets.AWS_REGION }} role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }} - # Sync will only copy changed files + # Sync will only copy changed files - name: Sync to S3 run: aws s3 sync --quiet ./docs/_build/html/ s3://docs.pyscript.net/unstable/ diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 2c3c54ef..7ce0853a 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -3,7 +3,7 @@ name: '[CI] Prepare Release' on: push: tags: - - '[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9]+' # YYYY.MM.MICRO + - '[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9]+' # YYYY.MM.MICRO env: MINICONDA_PYTHON_VERSION: py38 @@ -17,7 +17,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout uses: actions/checkout@v3 @@ -31,7 +30,7 @@ jobs: env: cache-name: cache-node-modules with: - # npm cache files are stored in `~/.npm` on Linux/macOS + # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 071e11ad..30524d62 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -32,7 +32,7 @@ jobs: env: cache-name: cache-node-modules with: - # npm cache files are stored in `~/.npm` on Linux/macOS + # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | @@ -49,7 +49,7 @@ jobs: - name: Build and Test run: make test - # Upload to S3 + # Upload to S3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1.6.1 with: diff --git a/.github/workflows/sync-examples.yml b/.github/workflows/sync-examples.yml index 70c9f5cb..0e012cd6 100644 --- a/.github/workflows/sync-examples.yml +++ b/.github/workflows/sync-examples.yml @@ -15,8 +15,7 @@ jobs: working-directory: examples steps: - - # Deploy to S3 + # Deploy to S3 - name: Checkout uses: actions/checkout@v3 - name: Configure AWS credentials @@ -25,5 +24,5 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }} - name: Sync to S3 - # Sync outdated or new files, delete ones no longer in source + # Sync outdated or new files, delete ones no longer in source run: aws s3 sync --quiet --delete . s3://pyscript.net/examples/ # Sync directory, delete what is not in source diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c01e3dd..4c59be57 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,17 +4,17 @@ Thank you for wanting to contribute to the PyScript project! ## Table of contents -* [Code of Conduct](#code-of-conduct) -* [Contributing](#contributing) - * [Reporting bugs](#reporting-bugs) - * [Reporting security issues](#reporting-security-issues) - * [Asking questions](#asking-questions) - * [Setting up your local environment and developing](#setting-up-your-local-environment-and-developing) - * [Places to start](#places-to-start) - * [Setting up your local environment and developing](#setting-up-your-local-environment-and-developing) -* [License terms for contributions](#license-terms-for-contributions) -* [Becoming a maintainer](#becoming-a-maintainer) -* [Trademarks](#trademarks) +- [Code of Conduct](#code-of-conduct) +- [Contributing](#contributing) + - [Reporting bugs](#reporting-bugs) + - [Reporting security issues](#reporting-security-issues) + - [Asking questions](#asking-questions) + - [Setting up your local environment and developing](#setting-up-your-local-environment-and-developing) + - [Places to start](#places-to-start) + - [Setting up your local environment and developing](#setting-up-your-local-environment-and-developing) +- [License terms for contributions](#license-terms-for-contributions) +- [Becoming a maintainer](#becoming-a-maintainer) +- [Trademarks](#trademarks) # Code of Conduct @@ -28,10 +28,10 @@ Bugs are tracked on the [project issues page](https://github.com/pyscript/pyscri ## Creating useful issues -* Use a clear and descriptive title. -* Describe the specific steps that reproduce the problem with as many details as possible so that someone can verify the issue. -* Describe the behavior you observed, and the behavior you had expected. -* Include screenshots if they help make the issue clear. +- Use a clear and descriptive title. +- Describe the specific steps that reproduce the problem with as many details as possible so that someone can verify the issue. +- Describe the behavior you observed, and the behavior you had expected. +- Include screenshots if they help make the issue clear. ## Reporting security issues @@ -45,10 +45,10 @@ If you have questions about the project, using PyScript, or anything else, pleas If you would like to contribute to PyScript, but you aren't sure where to begin, here are some suggestions. -* **Read over the existing documentation.** Are there things missing, or could they be clearer? Make some changes/additions to those documents. -* **Review the open issues.** Are they clear? Can you reproduce them? You can add comments, clarifications, or additions to those issues. If you think you have an idea of how to address the issue, submit a fix! -* **Look over the open pull requests.** Do you have comments or suggestions for the proposed changes? Add them. -* **Check out the examples.** Is there a use case that would be good to have sample code for? Create an example for it. +- **Read over the existing documentation.** Are there things missing, or could they be clearer? Make some changes/additions to those documents. +- **Review the open issues.** Are they clear? Can you reproduce them? You can add comments, clarifications, or additions to those issues. If you think you have an idea of how to address the issue, submit a fix! +- **Look over the open pull requests.** Do you have comments or suggestions for the proposed changes? Add them. +- **Check out the examples.** Is there a use case that would be good to have sample code for? Create an example for it. ## Setting up your local environment and developing @@ -69,5 +69,6 @@ Contributors are invited to be maintainers of the project by demonstrating good The Project abides by the Organization's [trademark policy](https://github.com/pyscript/governance/blob/main/TRADEMARKS.md). --- + Part of MVG-0.1-beta. Made with love by GitHub. Licensed under the [CC-BY 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 4baa1d88..4a7cc503 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -41,5 +41,6 @@ Any names, trademarks, logos, or goodwill developed by and associated with the P Amendments to this governance policy may be made by affirmative vote of 2/3 of all Maintainers, with approval by the Organization's Steering Committee. --- + Part of MVG-0.1-beta. Made with love by GitHub. Licensed under the [CC-BY 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 327f50d3..d42ec747 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -17,7 +17,7 @@ This document lists the Maintainers of the Project. Maintainers may be added onc | Paul Everitt | --- | | Fabio Rosado | --- | -______________________________________________________________________ +--- Part of MVG-0.1-beta. Made with love by GitHub. Licensed under the [CC-BY 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/). diff --git a/README.md b/README.md index 9fa852c9..e525a307 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,24 @@ To get started see the [getting started tutorial](docs/tutorials/getting-started For examples see [here](examples). ### Longer Version + PyScript is a meta project that aims to combine multiple open technologies into a framework that allows users to create sophisticated browser applications with Python. It integrates seamlessly with the way the DOM works in the browser and allows users to add Python logic in a way that feels natural both to web and Python developers. ## Try PyScript -To try PyScript, import the appropriate pyscript files into the `````` tag of your html page with: +To try PyScript, import the appropriate pyscript files into the `` tag of your html page with: + ```html - - + + ``` + You can then use PyScript components in your html page. PyScript currently implements the following elements: -* ``: can be used to define python code that is executable within the web page. The element itself is not rendered to the page and is only used to add logic -* ``: creates a REPL component that is rendered to the page as a code editor and allows users to write executable code +- ``: can be used to define python code that is executable within the web page. The element itself is not rendered to the page and is only used to add logic +- ``: creates a REPL component that is rendered to the page as a code editor and allows users to write executable code Check out the [the examples directory](examples) folder for more examples on how to use it, all you need to do is open them in Chrome. @@ -33,20 +36,20 @@ Check out the [the examples directory](examples) folder for more examples on how Read the [contributing guide](CONTRIBUTING.md) to learn about our development process, reporting bugs and improvements, creating issues and asking questions. -Check out the [developing process](https://docs.pyscript.net/latest/development/developing.html) documentation for more information on how to setup your development environment. +Check out the [developing process](https://docs.pyscript.net/latest/development/developing.html) documentation for more information on how to setup your development environment. ## Resources -* [Official docs](https://docs.pyscript.net) -* [Discussion board](https://community.anaconda.cloud/c/tech-topics/pyscript) -* [Home Page](https://pyscript.net/) -* [Blog Post](https://engineering.anaconda.com/2022/04/welcome-pyscript.html) -* [Discord Channel](https://discord.gg/BYB2kvyFwm) +- [Official docs](https://docs.pyscript.net) +- [Discussion board](https://community.anaconda.cloud/c/tech-topics/pyscript) +- [Home Page](https://pyscript.net/) +- [Blog Post](https://engineering.anaconda.com/2022/04/welcome-pyscript.html) +- [Discord Channel](https://discord.gg/BYB2kvyFwm) ## Notes -* This is an extremely experimental project, so expect things to break! -* PyScript has been only tested on Chrome at the moment. +- This is an extremely experimental project, so expect things to break! +- PyScript has been only tested on Chrome at the moment. ## Governance diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index a6b7cafb..dfe35ff4 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -3,7 +3,8 @@ This page is meant for troubleshooting common problems with PyScript. ## Table of contents: -* [Make Setup](#make-setup) + +- [Make Setup](#make-setup) ## Make setup diff --git a/examples/altair.html b/examples/altair.html index 57823dde..121f0589 100644 --- a/examples/altair.html +++ b/examples/altair.html @@ -1,78 +1,78 @@ Altair - - + + - - - -
-
- - - packages = [ - "altair", - "pandas", - "vega_datasets" - ] - plugins = [ - "../build/plugins/python/py_tutor.py" - ] - - - import altair as alt - from vega_datasets import data + + + +
+
+ + + packages = [ + "altair", + "pandas", + "vega_datasets" + ] + plugins = [ + "../build/plugins/python/py_tutor.py" + ] + + + import altair as alt + from vega_datasets import data - source = data.movies.url + source = data.movies.url - pts = alt.selection(type="single", encodings=['x']) + pts = alt.selection(type="single", encodings=['x']) - rect = alt.Chart(data.movies.url).mark_rect().encode( - alt.X('IMDB_Rating:Q', bin=True), - alt.Y('Rotten_Tomatoes_Rating:Q', bin=True), - alt.Color('count()', - scale=alt.Scale(scheme='greenblue'), - legend=alt.Legend(title='Total Records') - ) - ) + rect = alt.Chart(data.movies.url).mark_rect().encode( + alt.X('IMDB_Rating:Q', bin=True), + alt.Y('Rotten_Tomatoes_Rating:Q', bin=True), + alt.Color('count()', + scale=alt.Scale(scheme='greenblue'), + legend=alt.Legend(title='Total Records') + ) + ) - circ = rect.mark_point().encode( - alt.ColorValue('grey'), - alt.Size('count()', - legend=alt.Legend(title='Records in Selection') - ) - ).transform_filter( - pts - ) + circ = rect.mark_point().encode( + alt.ColorValue('grey'), + alt.Size('count()', + legend=alt.Legend(title='Records in Selection') + ) + ).transform_filter( + pts + ) - bar = alt.Chart(source).mark_bar().encode( - x='Major_Genre:N', - y='count()', - color=alt.condition(pts, alt.ColorValue("steelblue"), alt.ColorValue("grey")) - ).properties( - width=550, - height=200 - ).add_selection(pts) + bar = alt.Chart(source).mark_bar().encode( + x='Major_Genre:N', + y='count()', + color=alt.condition(pts, alt.ColorValue("steelblue"), alt.ColorValue("grey")) + ).properties( + width=550, + height=200 + ).add_selection(pts) - display(alt.vconcat( - rect + circ, - bar - ).resolve_legend( - color="independent", - size="independent" - ), target="altair") - - -
+ display(alt.vconcat( + rect + circ, + bar + ).resolve_legend( + color="independent", + size="independent" + ), target="altair") +
+
+
diff --git a/examples/antigravity.html b/examples/antigravity.html index 96e91e90..87955189 100644 --- a/examples/antigravity.html +++ b/examples/antigravity.html @@ -1,35 +1,35 @@ Antigravity - - + + -