From d9f956ee9c277f8fa70c0daea80237ea6ab986ff Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Tue, 1 Dec 2026 23:54:12 +1300 Subject: [PATCH 1/3] Demo: deploy our demo app to GitHub Pages whenever `main` gets updated. --- .github/workflows/demo.yml | 50 ++++++++++++++++++++++++++++++++++++++ vite.config.ts | 7 ++++-- 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/demo.yml diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml new file mode 100644 index 0000000..51b1c34 --- /dev/null +++ b/.github/workflows/demo.yml @@ -0,0 +1,50 @@ +name: Demo + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# Only deploy one version of our demo app at a time, letting a deployment that has started finish, since cancelling it +# could leave GitHub Pages in an inconsistent state. + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + if: ${{ github.repository == 'opencor/plot' }} + name: Build + runs-on: ubuntu-26.04 + steps: + - name: Check out OpenCOR Plot + uses: actions/checkout@v7 + - name: Install bun + uses: oven-sh/setup-bun@v2 + - name: OpenCOR Plot dependencies + run: bun install --frozen-lockfile + - name: Build OpenCOR Plot's demo app + run: bun build:demo + - name: Configure GitHub Pages + uses: actions/configure-pages@v6 + - name: Upload OpenCOR Plot's demo app + uses: actions/upload-pages-artifact@v5 + with: + path: demo/dist + deploy: + name: Deploy + needs: build + runs-on: ubuntu-26.04 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy OpenCOR Plot's demo app to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/vite.config.ts b/vite.config.ts index 16c2e3a..42046c4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,10 +1,13 @@ import vuePlugin from '@vitejs/plugin-vue'; import * as vite from 'vite'; -// Note: this configuration is for our demo app, which uses our component from its sources (rather than from our library -// build, see vite.lib.config.ts), so that changes to our component get hot-reloaded. +// Note #1: this configuration is for our demo app, which uses our component from its sources (rather than from our +// library build, see vite.lib.config.ts), so that changes to our component get hot-reloaded. +// Note #2: our demo app refers to its assets using relative paths, so that it works wherever it is served from (e.g., +// https://opencor.github.io/plot/, see .github/workflows/demo.yml). export default vite.defineConfig({ + base: './', root: 'demo', plugins: [vuePlugin()] }); From 81f18ceb9369358fdfeee52680f369044ca4e326 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Tue, 1 Dec 2026 23:54:22 +1300 Subject: [PATCH 2/3] New version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9206471..16d03c7 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ ], "type": "module", "types": "dist/index.d.ts", - "version": "0.20261201.0", + "version": "0.20261202.0", "exports": { ".": { "types": "./dist/index.d.ts", From 64536d38b3a151f4eeea5ec5792cb80bcb7e3512 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Tue, 1 Dec 2026 23:55:48 +1300 Subject: [PATCH 3/3] README: added a link to our demo app on GitHub Pages. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cc81ba3..db3ee82 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ `@opencor/plot` is a [Vue 3](https://vuejs.org/) component for plotting data. It is used by [OpenCOR](https://opencor.ws/), but it can be used by any Vue 3 application. +Try it out in our [demo app](https://opencor.github.io/plot/), e.g. with millions of points, live data, or several plots whose axes are aligned and synchronised. + Key characteristics: - Built as a [Vue 3](https://vuejs.org/) component using the [Composition API](https://vuejs.org/guide/extras/composition-api-faq). - Uses [uPlot](https://github.com/leeoniya/uPlot) under the hood, and draws traces using Canvas 2D. @@ -316,6 +318,8 @@ bun dependencies:update # Check for and update outdated dependencies. bun version:new # Bump the version number. ``` +Our [demo app](https://opencor.github.io/plot/) gets deployed to GitHub Pages whenever `main` gets updated (see our [demo workflow](.github/workflows/demo.yml)). + ### Benchmarking `bun benchmark` builds the demo app, serves it, and runs its benchmark (i.e. what its **Benchmark** button does) in one or more browsers, for a set of scenarios. Its results get saved as a report in `benchmark-results/`, named after when the benchmark was run, as HTML (to be opened in a browser), Markdown (e.g., to be pasted in an issue), and JSON (e.g., to be compared with other results). The report is updated as results come in, so it is there even if the benchmark gets interrupted.