Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Demo

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write
Comment thread
agarny marked this conversation as resolved.
Resolved

# 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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -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()]
});