Skip to content

Commit

Permalink
Merge pull request #64 from sgratzl/release/v4.2.1
Browse files Browse the repository at this point in the history
Release v4.2.1
  • Loading branch information
sgratzl authored Jul 4, 2023
2 parents c3d9abf + 33d833f commit a041fc6
Show file tree
Hide file tree
Showing 58 changed files with 3,858 additions and 2,515 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
*.less text
*.styl text
*.js text
*.jsx text
*.ts text
*.tsx text
*.coffee text
*.json text
*.htm text
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- run: yarn build
- run: yarn lint
- run: yarn test
- run: yarn samples
- uses: actions/upload-artifact@v2
if: failure()
with:
name: diff outputs
path: src/**/__diff_output__/*.png
- run: yarn docs:build
43 changes: 43 additions & 0 deletions .github/workflows/deploy_website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy Website
on:
workflow_dispatch: {}
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- run: npm i -g yarn
- run: yarn config set checksumBehavior ignore
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: |
./.yarn/cache
./.yarn/unplugged
key: ${{ runner.os }}-yarn2-v5-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn2-v5
- run: yarn install
- run: yarn docs:build
- uses: actions/configure-pages@v2
- uses: actions/upload-pages-artifact@v1
with:
path: docs/.vitepress/dist
- name: Deploy
id: deployment
uses: actions/deploy-pages@v1
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ npm-debug.log*

*.tgz
/.vscode/extensions.json
/docs
*.tsbuildinfo
.eslintcache
__diff_output__

/samples/type_test.js
docs/.vitepress/dist
docs/.vitepress/cache
docs/.vitepress/config.ts.timestamp*
docs/api/
7 changes: 5 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
/.yarnrc.yml
/.yarn
/build
/docs
/docs/.vitepress/cache
/docs/.vitepress/dist
/docs/.vitepress/config.ts.timestamp*
/docs/api
/coverage
/.gitattributes
/.gitignore
Expand All @@ -14,4 +17,4 @@
*.tgz
*.tsbuildinfo
.eslintcache
/samples/type_test.js
.nojekyll
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.packageManager": "yarn",
"npm.packageManager": "yarn",
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
Expand All @@ -25,6 +24,5 @@
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"liveServer.settings.port": 5501
}
}
559 changes: 280 additions & 279 deletions .yarn/releases/yarn-3.5.0.cjs → .yarn/releases/yarn-3.6.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ packageExtensions:
dependencies:
eslint-import-resolver-node: "*"

yarnPath: .yarn/releases/yarn-3.5.0.cjs
yarnPath: .yarn/releases/yarn-3.6.1.cjs
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2022 Samuel Gratzl
Copyright (c) 2019-2023 Samuel Gratzl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License: MIT][mit-image]][mit-url] [![NPM Package][npm-image]][npm-url] [![Github Actions][github-actions-image]][github-actions-url]

Chart.js module for charting error bars plots. This plugin extends the several char types (`bar`, `horizontalBar`, `line`, `scatter`, `polarArea`)
Chart.js module for charting error bars plots. This plugin extends the several char types (`bar`, `line`, `scatter`, `polarArea`)
with their error bar equivalent (`barWithErrorBars`, `lineWithErrorBars`, `scatterWithErrorBars`, `polarAreaWithErrorBars`).

Bar Chart
Expand Down Expand Up @@ -45,7 +45,7 @@ npm install --save chart.js chartjs-chart-error-bars

## Usage

see [Samples](https://github.com/sgratzl/chartjs-chart-error-bars/tree/main/samples) on Github
see [Examples](https://www.sgratzl.com/chartjs-chart-error-bars/examples)

and [![Open in CodePen][codepen]](https://codepen.io/sgratzl/pen/ZEbqmqx)

Expand Down
63 changes: 63 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { defineConfig } from 'vitepress';
import { name, description, repository, license, author } from '../../package.json';
import typedocSidebar from '../api/typedoc-sidebar.json';

const cleanName = name.replace('@sgratzl/', '');

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: cleanName,
description,
base: `/${cleanName}/`,
useWebFonts: false,
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Getting Started', link: '/getting-started' },
{ text: 'Examples', link: '/examples/' },
{ text: 'API', link: '/api/' },
{ text: 'Related Plugins', link: '/related' },
],

sidebar: [
{
text: 'Examples',
items: [
{ text: 'Basic', link: '/examples/' },
{ text: 'Bar Chart', link: '/examples/bar' },
{ text: 'Line Chart', link: '/examples/line' },
{ text: 'Scatter Chart', link: '/examples/scatter' },
{ text: 'Polar Area Chart', link: '/examples/polarArea' },
{ text: 'Horizontal Bar Chart', link: '/examples/horizontalBar' },
{ text: 'Multiple Error Bars', link: '/examples/multibar' },
{ text: 'Line As Scatter Chart', link: '/examples/lineScatter' },
{ text: 'Line Timeseries Chart', link: '/examples/lineTime' },
],
},
{
text: 'API',
collapsed: true,
items: typedocSidebar,
},
],

socialLinks: [{ icon: 'github', link: repository.url.replace('.git', '') }],

footer: {
message: `Released under the <a href="${repository.url.replace(
'.git',
''
)}/tree/main/LICENSE">${license} license</a>.`,
copyright: `Copyright © 2019-present <a href="${author.url}">${author.name}</a>`,
},

editLink: {
pattern: `${repository.url.replace('.git', '')}/edit/main/docs/:path`,
},

search: {
provider: 'local',
},
},
});
54 changes: 54 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import Theme from 'vitepress/theme';
import { createTypedChart } from 'vue-chartjs';
import {
LinearScale,
CategoryScale,
RadialLinearScale,
Tooltip,
Colors,
BarElement,
LineElement,
PointElement,
BarController,
LineController,
TimeScale,
} from 'chart.js';
import {
ArcWithErrorBar,
BarWithErrorBar,
BarWithErrorBarsController,
LineWithErrorBarsController,
PolarAreaWithErrorBarsController,
PointWithErrorBar,
ScatterWithErrorBarsController,
} from '../../../src';

export default {
...Theme,
enhanceApp({ app }) {
const deps = [
LinearScale,
CategoryScale,
RadialLinearScale,
TimeScale,
ArcWithErrorBar,
BarWithErrorBar,
BarWithErrorBarsController,
LineWithErrorBarsController,
PolarAreaWithErrorBarsController,
PointWithErrorBar,
ScatterWithErrorBarsController,
Tooltip,
Colors,
BarElement,
LineElement,
PointElement,
BarController,
LineController,
];
app.component('BarWithErrorBarsChart', createTypedChart('barWithErrorBars', deps));
app.component('LineWithErrorBarsChart', createTypedChart('lineWithErrorBars', deps));
app.component('PolarAreaWithErrorBarsChart', createTypedChart('polarAreaWithErrorBars', deps));
app.component('ScatterWithErrorBarsChart', createTypedChart('scatterWithErrorBars', deps));
},
};
18 changes: 18 additions & 0 deletions docs/examples/bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Bar With Error Bars
---

# Bar With Error Bars

<script setup>
import {config as bar} from './bar';
</script>

<BarWithErrorBarsChart
:options="bar.options"
:data="bar.data"
/>

### Code

<<< ./bar.ts#config
27 changes: 27 additions & 0 deletions docs/examples/bar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { ChartConfiguration } from 'chart.js';
import type {} from '../../src';

// #region config
export const config: ChartConfiguration<'barWithErrorBars'> = {
type: 'barWithErrorBars',
data: {
labels: ['A', 'B'],
datasets: [
{
data: [
{
y: 4,
yMin: 1,
yMax: 6,
},
{
y: 2,
yMin: 1,
yMax: 4,
},
],
},
],
},
};
// #endregion config
58 changes: 58 additions & 0 deletions docs/examples/basic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import type { ChartConfiguration } from 'chart.js';
import type {} from '../../src';

// #region bar
export const bar: ChartConfiguration<'barWithErrorBars'> = {
type: 'barWithErrorBars',
data: {
labels: ['A', 'B'],
datasets: [
{
data: [
{
y: 4,
yMin: 1,
yMax: 6,
},
{
y: 2,
yMin: 1,
yMax: 4,
},
],
},
],
},
};
// #endregion bar

// #region scatter
export const scatter: ChartConfiguration<'scatterWithErrorBars'> = {
type: 'scatterWithErrorBars',
data: {
labels: ['A', 'B'],
datasets: [
{
data: [
{
x: 2,
xMin: 1,
xMax: 3,
y: 4,
yMin: 1,
yMax: 6,
},
{
x: 7,
xMin: 6,
xMax: 9,
y: 2,
yMin: 1,
yMax: 4,
},
],
},
],
},
};
// #endregion scatter
18 changes: 18 additions & 0 deletions docs/examples/horizontalBar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Horizontal Bar With Error Bars
---

# Horizontal Bar With Error Bars

<script setup>
import {config as bar} from './horizontalBar';
</script>

<BarWithErrorBarsChart
:options="bar.options"
:data="bar.data"
/>

### Code

<<< ./horizontalBar.ts#config
Loading

0 comments on commit a041fc6

Please sign in to comment.