Skip to content

Commit ec7d392

Browse files
committed
feat: compatible with chart.js 3.5.0
1 parent 93626bc commit ec7d392

14 files changed

+189
-1319
lines changed

.github/release-drafter.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
labels:
6+
- 'enhancement'
7+
- 'feature'
8+
- title: '🐛 Bugs Fixes'
9+
labels:
10+
- 'bug'
11+
- title: 'Documentation'
12+
labels:
13+
- 'documentation'
14+
- title: '🧰 Development'
15+
labels:
16+
- 'chore'
17+
change-template: '- #$NUMBER $TITLE'
18+
change-title-escapes: '\<*_&`#@'
19+
template: |
20+
$CHANGES
21+
22+
Thanks to $CONTRIBUTORS

.github/workflows/create_release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Create Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
versionName:
6+
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)'
7+
required: true
8+
default: patch
9+
jobs:
10+
create_release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v2
15+
with:
16+
ref: main
17+
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
18+
- name: Reset main branch
19+
run: |
20+
git fetch origin dev:dev
21+
git reset --hard origin/dev
22+
- name: Change version number
23+
id: version
24+
run: |
25+
echo -n "::set-output name=next_tag::"
26+
npm version --no-git-tag-version ${{ github.event.inputs.versionName }}
27+
- name: Create pull request into main
28+
uses: peter-evans/create-pull-request@v3
29+
with:
30+
branch: release/${{ steps.version.outputs.next_tag }}
31+
commit-message: 'chore: release ${{ steps.version.outputs.next_tag }}'
32+
base: main
33+
title: Release ${{ steps.version.outputs.next_tag }}
34+
labels: chore
35+
assignees: sgratzl
36+
body: |
37+
Releasing ${{ steps.version.outputs.next_tag }}.

.github/workflows/release_helper.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Release Helper
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
correct_repository:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: fail on fork
12+
if: github.repository_owner != 'sgratzl'
13+
run: exit 1
14+
15+
create_release:
16+
needs: correct_repository
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v2
21+
- uses: actions/setup-node@v2
22+
with:
23+
node-version: '14'
24+
- name: Extract version
25+
id: extract_version
26+
run: node -pe "'::set-output name=version::' + require('./package.json').version"
27+
- name: Create Release
28+
id: create_release
29+
uses: release-drafter/release-drafter@v5
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
version: ${{ steps.extract_version.outputs.version }}
34+
publish: true
35+
outputs:
36+
version: ${{ steps.extract_version.outputs.version }}
37+
upload_url: ${{ steps.create_release.outputs.upload_url }}
38+
tag_name: ${{ steps.create_release.outputs.tag_name }}
39+
40+
build_assets:
41+
needs: create_release
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Check out code
45+
uses: actions/checkout@v2
46+
- uses: actions/setup-node@v2.1.5
47+
with:
48+
node-version: 14
49+
- run: npm i -g yarn
50+
- run: yarn set version 2
51+
- run: cat .yarnrc_patch.yml >> .yarnrc.yml
52+
- run: yarn config set checksumBehavior ignore
53+
- name: Cache Node.js modules
54+
uses: actions/cache@v2.1.4
55+
with:
56+
path: ./.yarn
57+
key: ${{ runner.os }}-yarn2-${{ hashFiles('**/yarn.lock') }}
58+
restore-keys: |
59+
${{ runner.os }}-yarn2-
60+
- run: yarn install
61+
- run: yarn build
62+
- run: yarn pack
63+
- name: Upload Release Asset
64+
uses: AButler/upload-release-assets@v2.0
65+
with:
66+
files: 'package.tgz'
67+
repo-token: ${{ secrets.GITHUB_TOKEN }}
68+
release-tag: ${{ needs.create_release.outputs.tag_name }}
69+
- name: Publish to NPM
70+
uses: JS-DevTools/npm-publish@v1
71+
with:
72+
token: ${{ secrets.NPM_TOKEN }}
73+
access: public
74+
check-version: true
75+
76+
sync_dev:
77+
needs: correct_repository
78+
runs-on: ubuntu-latest
79+
steps:
80+
- name: Check out code
81+
uses: actions/checkout@v2
82+
with:
83+
ref: dev
84+
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
85+
- name: Reset dev branch
86+
run: |
87+
git fetch origin main:main
88+
git merge main
89+
git push

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/.pnp.js
1+
/.pnp.cjs
22
/.yarnrc.yml
33
/.yarn
44
/build

.release-it.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ yarn lint
145145
yarn fix
146146
yarn build
147147
yarn docs
148-
yarn release
149-
yarn release:pre
150148
```
151149

152150
[npm-image]: https://badge.fury.io/js/chartjs-chart-pcp.svg

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"jest": "^27.0.6",
6868
"jest-image-snapshot": "^4.5.1",
6969
"prettier": "^2.3.2",
70-
"release-it": "^14.10.1",
7170
"rimraf": "^3.0.2",
7271
"rollup": "^2.56.0",
7372
"rollup-plugin-cleanup": "^3.2.1",
@@ -95,9 +94,7 @@
9594
"eslint": "eslint src --ext .ts,.tsx",
9695
"eslint:fix": "yarn run eslint --fix",
9796
"docs": "typedoc src/index.ts",
98-
"prepare": "yarn run build",
99-
"release": "release-it --disable-metrics --npm.skipChecks",
100-
"release:pre": "release-it --disable-metrics --npm.skipChecks --preRelease=alpha --npm.tag=next"
97+
"prepare": "yarn run build"
10198
},
10299
"packageManager": "yarn@3.0.0"
103100
}

samples/basic.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<script src="https://unpkg.com/chart.js@3.3.2/dist/chart.js"></script>
4+
<script src="https://unpkg.com/chart.js@3.5.0/dist/chart.js"></script>
55
<script src="../build/index.umd.js"></script>
66
</head>
77

samples/basicLog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<script src="https://unpkg.com/chart.js@3.3.2"></script>
4+
<script src="https://unpkg.com/chart.js@3.5.0"></script>
55
<script src="../build/index.umd.js"></script>
66
</head>
77

samples/default_esm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<script type="importmap-shim">
1212
{
1313
"imports": {
14-
"chart.js": "https://unpkg.com/chart.js@3.3.2?module",
15-
"chart.js/helpers": "https://unpkg.com/chart.js@3.3.2/helpers/helpers.esm.js?module",
14+
"chart.js": "https://unpkg.com/chart.js@3.5.0?module",
15+
"chart.js/helpers": "https://unpkg.com/chart.js@3.5.0/helpers/helpers.esm.js?module",
1616
"chartjs-chart-pcp": "../build/index.js"
1717
}
1818
}

samples/tension.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<script src="https://unpkg.com/chart.js@3.3.2"></script>
4+
<script src="https://unpkg.com/chart.js@3.5.0"></script>
55
<script src="../build/index.umd.js"></script>
66
</head>
77

src/controllers/LogarithmicParallelCoordinatesController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ declare module 'chart.js' {
3838
chartOptions: ILogarithmicParallelCoordinatesChartOptions;
3939
datasetOptions: ILogarithmicParallelCoordinatesControllerDatasetOptions;
4040
defaultDataPoint: number;
41+
metaExtensions: Record<string, never>;
4142
parsedDataType: { y: number };
4243
scales: keyof CartesianScaleTypeRegistry;
4344
};

src/controllers/ParallelCoordinatesController.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ export class ParallelCoordinatesController extends DatasetController<'pcp', Line
6161
chart: this.chart,
6262
ctx: this.chart.ctx,
6363
});
64-
scale.init(this.resolveAxisOptions('reset'));
64+
const options = this.resolveAxisOptions('reset');
65+
// workaround for now
66+
Object.assign(options, { setContext: () => 0 });
67+
scale.init(options);
6568
}
6669

6770
update(mode: UpdateMode): void {
@@ -272,6 +275,7 @@ declare module 'chart.js' {
272275
chartOptions: IParallelCoordinatesChartOptions;
273276
datasetOptions: IParallelCoordinatesControllerDatasetOptions;
274277
defaultDataPoint: number;
278+
metaExtensions: Record<string, never>;
275279
parsedDataType: { y: number };
276280
scales: keyof CartesianScaleTypeRegistry;
277281
};

0 commit comments

Comments
 (0)