diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..285b020
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,30 @@
+name: CI
+
+on:
+ pull_request:
+ branches: [main]
+
+ workflow_dispatch:
+
+jobs:
+ ci:
+ name: CI
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v7
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: '24.20.0'
+ cache: npm
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Check code formatting
+ run: npm run format:check
+
+ - name: Check code linting
+ run: npm run lint
diff --git a/.github/workflows/cross-platform-test.yml b/.github/workflows/cross-platform-test.yml
index 08a1a12..11a76df 100644
--- a/.github/workflows/cross-platform-test.yml
+++ b/.github/workflows/cross-platform-test.yml
@@ -2,9 +2,9 @@ name: Cross-Platform Compatibility Test
on:
push:
- branches: [ main ]
+ branches: [main]
pull_request:
- branches: [ main ]
+ branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
index 5fa492e..ffa4141 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -3,7 +3,7 @@ name: Deploy Docs to Pages
on:
# Runs on pushes targeting the `docs` branch and `main` branch.
push:
- branches: ["docs", "main"]
+ branches: ['docs', 'main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
diff --git a/.prettierrc b/.prettierrc
index c6ace34..3608d59 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,10 +1,14 @@
{
- "semi": false,
+ "semi": true,
"singleQuote": true,
"tabWidth": 2,
- "printWidth": 150,
- "trailingComma": "none",
- "arrowParens": "avoid",
+ "useTabs": false,
+ "printWidth": 100,
+ "trailingComma": "all",
"bracketSpacing": true,
- "spaceAfterFunction": true
+ "arrowParens": "always",
+ "endOfLine": "lf",
+ "vueIndentScriptAndStyle": false,
+ "singleAttributePerLine": false,
+ "htmlWhitespaceSensitivity": "ignore"
}
diff --git a/README.md b/README.md
index 7e1a144..77eee78 100644
--- a/README.md
+++ b/README.md
@@ -18,29 +18,35 @@ Demo the site functionality of this app [here](https://plotvuer-demo.herokuapp.c
**Don't feel like coding? See how to copy and paste plotvuer as an HTML widget [here](https://github.com/ABI-Software/plotvuer/blob/master/README.md#copy-and-paste-as-an-html-widget)**
## Project installation
+
```
npm i @abi-software/plotvuer
```
-
## Project setup
+
```
npm install
npm run serve
```
### Compiles and minifies for production
+
```
npm run build-bundle
```
## How to use
+
Include the package in your script.
+
```javascript
-import { PlotVuer } from '@abi-software/plotvuer'
-import '@abi-software/plotvuer/dist/plotvuer.css'
+import { PlotVuer } from '@abi-software/plotvuer';
+import '@abi-software/plotvuer/dist/plotvuer.css';
```
+
Local registration in vue component:
+
```javascript
export default {
...
@@ -94,39 +100,40 @@ let metadata = {
}
```
+
Note that these are the same inputs for data and layout as plotly normally takes in [`Plotly.newPlot()`](https://plotly.com/javascript/plotlyjs-function-reference/)
##### Sending plotly a csv file url
```javascript
let data = {
- url : 'https://example.com/myfile.csv'
-}
+ url: 'https://example.com/myfile.csv',
+};
-
-let metadata= {
+let metadata = {
version: '1.1.0',
type: 'plot',
attrs: {
'x-axis-column': 2, // **Optional**
style: 'timeseries',
'y-axes-columns': [3, 4, 5, 6, 7, 8, 9, 10], // **Optional**
- 'plot-layout': { // **Optional**
+ 'plot-layout': {
+ // **Optional**
height: '700px',
margin: {
t: 35,
l: 85,
r: 55,
b: 190,
- pad: 4
- }
- }
- }
-}
+ pad: 4,
+ },
+ },
+ },
+};
let supplementalData = {
- url : 'https://example.com/mySupplementalFile.json'
-}
+ url: 'https://example.com/mySupplementalFile.json',
+};
```
## CSV file formatting
@@ -135,25 +142,24 @@ let supplementalData = {
### Example 1. Heatmap data
-| | Gene 1 | Gene 2 |
-| :------------ |:--------| ------|
-| Sample 1 | -1.54 | -3.40 |
-| Sample 2 | 0.68 | 1.22 |
-| Sample 3 | 0.05 | 0.66 |
-
+| | Gene 1 | Gene 2 |
+| :------- | :----- | ------ |
+| Sample 1 | -1.54 | -3.40 |
+| Sample 2 | 0.68 | 1.22 |
+| Sample 3 | 0.05 | 0.66 |
### Example 2. Timeseries data
-
-| time (seconds)| Sweep 0_Membrane Potential (mV) |
-| :------------ |:--------|
-| 0 | -70.12939453 |
-| 0.0002 | -70.12939453 |
-| 0.0004 | -70.34301758 |
-
+| time (seconds) | Sweep 0_Membrane Potential (mV) |
+| :------------- | :------------------------------ |
+| 0 | -70.12939453 |
+| 0.0002 | -70.12939453 |
+| 0.0004 | -70.34301758 |
## Copy and paste as an HTML widget
+
Paste the following lines in the `
` of you HTML
+
```HTML
@@ -162,8 +168,11 @@ Paste the following lines in the `` of you HTML
```
+
### Modifying input file for widget
+
Change this line to point at a csv file for display
+
```HTML
@@ -174,6 +183,7 @@ Change this line to point at a csv file for display
The documentation is developed with `vitepress` and `vuese`. Documentation pages are in the `docs` folder.
### To run in local development mode
+
```bash
npm run docs:watch
```
diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js
index 8576292..94b6652 100644
--- a/docs/.vitepress/config.js
+++ b/docs/.vitepress/config.js
@@ -1,15 +1,15 @@
-import { resolve } from "node:path";
-import { defineConfig } from 'vitepress'
-import Components from 'unplugin-vue-components/vite'
-import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
+import { resolve } from 'node:path';
+import { defineConfig } from 'vitepress';
+import Components from 'unplugin-vue-components/vite';
+import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
// Version number
-const versionNumber = process.env.npm_package_version
+const versionNumber = process.env.npm_package_version;
// https://vitepress.dev/reference/site-config
export default defineConfig({
- title: "PlotVuer",
- description: "API documentation for PlotVuer",
+ title: 'PlotVuer',
+ description: 'API documentation for PlotVuer',
base: '/plotvuer/',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
@@ -17,41 +17,42 @@ export default defineConfig({
{ text: 'Home', link: '/' },
{
text: 'API Reference',
- link: '/components/PlotVuer'
- }
+ link: '/components/PlotVuer',
+ },
],
sidebar: [
{
text: 'Live Demo',
- link: '/demo'
+ link: '/demo',
},
{
text: 'API Reference',
- link: '/components/PlotVuer'
+ link: '/components/PlotVuer',
},
{
text: 'Version',
items: [
{
- text: `${versionNumber}`
- }
- ]
- }
+ text: `${versionNumber}`,
+ },
+ ],
+ },
],
- socialLinks: [
- { icon: 'github', link: 'https://github.com/ABI-Software/plotvuer' }
- ]
+ socialLinks: [{ icon: 'github', link: 'https://github.com/ABI-Software/plotvuer' }],
},
markdown: { attrs: { disable: true } },
vite: {
resolve: {
- alias: [{ find: "@", replacement: resolve(__dirname, "../../src") }, {
- // this is required for the SCSS modules
- find: /^~(.*)$/,
- replacement: '$1',
- }],
+ alias: [
+ { find: '@', replacement: resolve(__dirname, '../../src') },
+ {
+ // this is required for the SCSS modules
+ find: /^~(.*)$/,
+ replacement: '$1',
+ },
+ ],
},
css: {
preprocessorOptions: {
@@ -75,6 +76,6 @@ export default defineConfig({
// https://github.com/antfu/unocss
// see unocss.config.ts for config
- ]
- }
-})
+ ],
+ },
+});
diff --git a/docs/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css
index 11b41cb..67c0898 100644
--- a/docs/.vitepress/theme/custom.css
+++ b/docs/.vitepress/theme/custom.css
@@ -20,7 +20,8 @@
}
& table tr {
- th, td {
+ th,
+ td {
vertical-align: top;
}
diff --git a/docs/.vitepress/theme/index.js b/docs/.vitepress/theme/index.js
index 1118b56..149273e 100644
--- a/docs/.vitepress/theme/index.js
+++ b/docs/.vitepress/theme/index.js
@@ -1,4 +1,4 @@
-import DefaultTheme from "vitepress/theme"
-import './custom.css'
+import DefaultTheme from 'vitepress/theme';
+import './custom.css';
-export default DefaultTheme
+export default DefaultTheme;
diff --git a/docs/index.md b/docs/index.md
index 19971da..4e480aa 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -3,8 +3,8 @@
layout: home
hero:
- name: "PlotVuer"
- text: "API documentation"
+ name: 'PlotVuer'
+ text: 'API documentation'
tagline: PlotVuer is a Vue component used in the SPARC portal.
actions:
- theme: brand
diff --git a/eslint.config.js b/eslint.config.js
index 91e47a4..9c49248 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -1,31 +1,52 @@
-import js from "@eslint/js";
-import prettier from "eslint-plugin-prettier";
-import prettierConfig from "eslint-config-prettier";
-import vue from "eslint-plugin-vue";
-import globals from "globals";
+import js from '@eslint/js';
+import { includeIgnoreFile } from 'eslint/config';
+import prettier from 'eslint-plugin-prettier';
+import prettierConfig from 'eslint-config-prettier';
+import vue from 'eslint-plugin-vue';
+import globals from 'globals';
+import { fileURLToPath } from 'node:url';
+
+const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url));
export default [
+ includeIgnoreFile(gitignorePath, { gitignoreResolution: true }),
{
- ignores: ["dist/**", "docs/.vitepress/**", "docs/components/**"],
+ ignores: ['dist/**', 'docs/.vitepress/**', 'docs/components/**'],
},
js.configs.recommended,
- ...vue.configs["flat/essential"],
+ ...vue.configs['flat/essential'],
prettierConfig,
{
- files: ["**/*.{js,vue}"],
+ files: ['**/*.{js,vue}'],
plugins: {
prettier,
},
languageOptions: {
- ecmaVersion: "latest",
- sourceType: "module",
+ ecmaVersion: 'latest',
+ sourceType: 'module',
globals: {
...globals.node,
...globals.browser,
},
},
rules: {
- "prettier/prettier": "error",
+ 'prettier/prettier': [
+ 'error',
+ {
+ singleQuote: true,
+ trailingComma: 'all',
+ },
+ ],
+ 'arrow-body-style': 'off',
+ 'prefer-arrow-callback': 'off',
+ 'no-unused-vars': [
+ 'error',
+ {
+ argsIgnorePattern: '^_',
+ caughtErrorsIgnorePattern: '^_',
+ },
+ ],
+ 'vue/multi-word-component-names': 'off',
},
},
];
diff --git a/index.html b/index.html
index ab944a0..5b00edd 100644
--- a/index.html
+++ b/index.html
@@ -1,18 +1,21 @@
-
+
-
-
-
-
+
+
+
+
plotvuer
-
\ No newline at end of file
+
diff --git a/package-lock.json b/package-lock.json
index b1fe62a..f35918e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -30,8 +30,9 @@
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-vue": "^10.10.0",
"globals": "^17.11.0",
- "prettier": "^3.9.6",
+ "prettier": "3.9.6",
"sass": "^1.103.1",
+ "unplugin-auto-import": "^21.1.0",
"unplugin-vue-components": "^32.1.0",
"vite": "^8.2.1",
"vite-plugin-node-polyfills": "^0.28.0",
@@ -6208,6 +6209,13 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/js-tokens": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz",
+ "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/json-buffer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
@@ -7719,16 +7727,22 @@
}
},
"node_modules/pkg-types": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.1.tgz",
- "integrity": "sha512-y+ichcgc2LrADuhLNAx8DFjVfgz91pRxfZdI3UDhxHvcVEZsenLO+7XaU5vOp0u/7V/wZ+plyuQxtrDlZJ+yeg==",
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.3.tgz",
+ "integrity": "sha512-j/lCFdcppV0JxWpCEITdbDltBxPP6cHT+yNJ6Go2OgoSA9518X847X9z0p6LtA4Nc16+eQzCZjRrWanTGvHJ5w==",
"license": "MIT",
"dependencies": {
- "confbox": "^0.2.4",
- "exsolve": "^1.0.8",
+ "confbox": "^0.3.1",
+ "exsolve": "^1.1.1",
"pathe": "^2.0.3"
}
},
+ "node_modules/pkg-types/node_modules/confbox": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.3.1.tgz",
+ "integrity": "sha512-cKUSoKa8YxFZZSmraVi7onONx3amu77ngK3kGpsYHDH7drPwCRkQE1RYMPlLRrMtnciRj274XNRxcHxnKmDSnA==",
+ "license": "MIT"
+ },
"node_modules/plotly.js": {
"version": "2.35.3",
"resolved": "https://registry.npmjs.org/plotly.js/-/plotly.js-2.35.3.tgz",
@@ -9243,6 +9257,19 @@
"node": ">=8"
}
},
+ "node_modules/strip-literal": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-4.0.0.tgz",
+ "integrity": "sha512-PaqAvfUZKBwc/SLmNZtHmzK+v19Z4O4eS3cKPeGvbIv/U3pnyEq4Tuw3/4v/FwfM8VQaEawsyCcOQ0P+kpwWWw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "js-tokens": "^10.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
"node_modules/strongly-connected-components": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/strongly-connected-components/-/strongly-connected-components-1.0.1.tgz",
@@ -9635,6 +9662,77 @@
"license": "MIT",
"peer": true
},
+ "node_modules/unimport": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/unimport/-/unimport-6.5.0.tgz",
+ "integrity": "sha512-t0KLJLRbebz3f7NrQe+vy2ObeugVeM1XqI2oeYnauddmHSglYj3U6bxOJ65IbXmOFkcAGFJK2OyGH7aqHPM6Ug==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.18.0",
+ "escape-string-regexp": "^5.0.0",
+ "estree-walker": "^3.0.3",
+ "local-pkg": "^1.2.1",
+ "magic-string": "^1.2.3",
+ "mlly": "^1.8.2",
+ "pathe": "^2.0.3",
+ "picomatch": "^4.0.7",
+ "pkg-types": "^2.3.3",
+ "scule": "^1.3.0",
+ "strip-literal": "^4.0.0",
+ "tinyglobby": "^0.2.17",
+ "unplugin": "^3.3.0",
+ "unplugin-utils": "^0.3.2"
+ },
+ "engines": {
+ "node": ">=18.12.0"
+ },
+ "peerDependencies": {
+ "oxc-parser": "*",
+ "rolldown": "^1.0.0"
+ },
+ "peerDependenciesMeta": {
+ "oxc-parser": {
+ "optional": true
+ },
+ "rolldown": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/unimport/node_modules/escape-string-regexp": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
+ "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/unimport/node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0"
+ }
+ },
+ "node_modules/unimport/node_modules/magic-string": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.3.2.tgz",
+ "integrity": "sha512-rZJrVxZ8cnWz3Mlor980ckHFN60rm/eyjVOpeDAH2z1DsRNbve2o4AB7bGafQvGSdCK90gEfUdiMct4BCKSZTw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.6.0"
+ }
+ },
"node_modules/unist-util-is": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",
@@ -9762,6 +9860,49 @@
}
}
},
+ "node_modules/unplugin-auto-import": {
+ "version": "21.1.0",
+ "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-21.1.0.tgz",
+ "integrity": "sha512-EzrSqWIBulEqCuP7idADXH+tVKYrbwKlR5+r/lOWik0o+Ksny1kitmtryHGNSv7puzzORlcIwT/x2JStiszlHA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "local-pkg": "^1.2.1",
+ "magic-string": "^1.1.0",
+ "picomatch": "^4.0.5",
+ "unimport": "^6.4.0",
+ "unplugin": "^3.3.0",
+ "unplugin-utils": "^0.3.2"
+ },
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ },
+ "peerDependencies": {
+ "@nuxt/kit": "^4.0.0",
+ "@vueuse/core": "*"
+ },
+ "peerDependenciesMeta": {
+ "@nuxt/kit": {
+ "optional": true
+ },
+ "@vueuse/core": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/unplugin-auto-import/node_modules/magic-string": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.3.2.tgz",
+ "integrity": "sha512-rZJrVxZ8cnWz3Mlor980ckHFN60rm/eyjVOpeDAH2z1DsRNbve2o4AB7bGafQvGSdCK90gEfUdiMct4BCKSZTw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.6.0"
+ }
+ },
"node_modules/unplugin-utils": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/unplugin-utils/-/unplugin-utils-0.3.2.tgz",
diff --git a/package.json b/package.json
index 532cca8..5346158 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,8 @@
"serve": "vite --host",
"build": "vite build",
"lint": "eslint .",
+ "format": "prettier --write .",
+ "format:check": "prettier --check .",
"build-bundle": "vite build",
"start": "vite --host --port 8081",
"version": "npm run build-bundle",
@@ -66,8 +68,9 @@
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-vue": "^10.10.0",
"globals": "^17.11.0",
- "prettier": "^3.9.6",
+ "prettier": "3.9.6",
"sass": "^1.103.1",
+ "unplugin-auto-import": "^21.1.0",
"unplugin-vue-components": "^32.1.0",
"vite": "^8.2.1",
"vite-plugin-node-polyfills": "^0.28.0",
diff --git a/public/index.html b/public/index.html
index 9d59ac0..f14a6c1 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,4 +1,4 @@
-
+
@@ -9,7 +9,10 @@
diff --git a/src/App-original.vue b/src/App-original.vue
index 3d13700..7a5dc7b 100644
--- a/src/App-original.vue
+++ b/src/App-original.vue
@@ -3,80 +3,90 @@
-
+
-
-
+
+
Change data
-
+
@@ -584,7 +608,7 @@ export default {
font-family: Arial, Helvetica, sans-serif;
}
-.zoomSelect :deep( .el-input__inner ){
+.zoomSelect :deep(.el-input__inner) {
padding: 0px;
height: 24px;
padding-left: 4px;
@@ -592,7 +616,7 @@ export default {
margin-left: 8px;
}
-.zoomSelect :deep( .el-select__caret ){
+.zoomSelect :deep(.el-select__caret) {
width: 8px;
margin-right: 2px;
margin-top: 2px;
diff --git a/src/components/PlotVuer.vue b/src/components/PlotVuer.vue
index 8221d4c..1f7b1db 100644
--- a/src/components/PlotVuer.vue
+++ b/src/components/PlotVuer.vue
@@ -15,9 +15,9 @@
-
diff --git a/src/views/Home.vue b/src/views/Home.vue
index ac5e842..3209481 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -8,6 +8,6 @@
diff --git a/src/views/Timeseries.vue b/src/views/Timeseries.vue
index 5353bfd..bf8bf7f 100644
--- a/src/views/Timeseries.vue
+++ b/src/views/Timeseries.vue
@@ -1,29 +1,29 @@
-
+
Plot of timeseries data
-
+