Skip to content

Commit d087564

Browse files
authored
Merge pull request #78 from upsetjs/release/v4.3.2
Release v4.3.2
2 parents c06ae81 + 86a6408 commit d087564

16 files changed

+2920
-6338
lines changed

.eslintrc.cjs

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

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: 'github-actions'
5+
directory: '/'
6+
schedule:
7+
interval: 'monthly'
8+
target-branch: 'dev'
9+
labels:
10+
- 'dependencies'
11+
- 'chore'
12+
- package-ecosystem: 'npm'
13+
directory: '/'
14+
schedule:
15+
interval: 'monthly'
16+
target-branch: 'dev'
17+
labels:
18+
- 'dependencies'
19+
- 'chore'

.yarn/releases/yarn-4.2.2.cjs

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

.yarn/releases/yarn-4.5.0.cjs

Lines changed: 925 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
packageExtensions:
2-
eslint-module-utils@*:
3-
dependencies:
4-
eslint-import-resolver-node: "*"
5-
6-
yarnPath: .yarn/releases/yarn-4.2.2.cjs
1+
yarnPath: .yarn/releases/yarn-4.5.0.cjs

eslint.config.mjs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
import prettier from 'eslint-plugin-prettier';
6+
7+
export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, {
8+
plugins: { prettier },
9+
rules: {
10+
'@typescript-eslint/no-explicit-any': 'off',
11+
'max-classes-per-file': 'off',
12+
'no-underscore-dangle': 'off',
13+
'import/extensions': 'off',
14+
},
15+
});
16+
17+
// import path from "node:path";
18+
// import { fileURLToPath } from "node:url";
19+
// import js from "@eslint/js";
20+
// import { FlatCompat } from "@eslint/eslintrc";
21+
22+
// const __filename = fileURLToPath(import.meta.url);
23+
// const __dirname = path.dirname(__filename);
24+
// const compat = new FlatCompat({
25+
// baseDirectory: __dirname,
26+
// recommendedConfig: js.configs.recommended,
27+
// allConfig: js.configs.all
28+
// });
29+
30+
// export default [...fixupConfigRules(compat.extends(
31+
// "airbnb-typescript",
32+
// "react-app",
33+
// "plugin:prettier/recommended",
34+
// "prettier",
35+
// )), {
36+
// plugins: {
37+
// prettier: fixupPluginRules(prettier),
38+
// },
39+
40+
// languageOptions: {
41+
// ecmaVersion: 5,
42+
// sourceType: "script",
43+
44+
// parserOptions: {
45+
// project: "./tsconfig.eslint.json",
46+
// },
47+
// },
48+
49+
// settings: {
50+
// react: {
51+
// version: "99.99.99",
52+
// },
53+
// },
54+
55+
// rules: {
56+
// "@typescript-eslint/no-explicit-any": "off",
57+
// "max-classes-per-file": "off",
58+
// "no-underscore-dangle": "off",
59+
// "import/extensions": "off",
60+
// },
61+
// }];

jest.config.js

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

package.json

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "chartjs-chart-venn",
33
"description": "Chart.js module for venn diagrams",
4-
"version": "4.3.1",
4+
"version": "4.3.2",
55
"author": {
66
"name": "Samuel Gratzl",
77
"email": "sam@sgratzl.com",
@@ -54,67 +54,56 @@
5454
],
5555
"devDependencies": {
5656
"@chiogen/rollup-plugin-terser": "^7.1.3",
57-
"@rollup/plugin-commonjs": "^26.0.1",
57+
"@eslint/js": "^9.11.1",
58+
"@rollup/plugin-commonjs": "^28.0.0",
5859
"@rollup/plugin-json": "^6.1.0",
59-
"@rollup/plugin-node-resolve": "^15.2.3",
60-
"@rollup/plugin-replace": "^5.0.7",
61-
"@rollup/plugin-typescript": "^11.1.6",
60+
"@rollup/plugin-node-resolve": "^15.3.0",
61+
"@rollup/plugin-replace": "^6.0.1",
62+
"@rollup/plugin-typescript": "^12.1.0",
6263
"@types/d3-selection": "^3.0.10",
63-
"@types/jest": "^29.5.12",
6464
"@types/jest-image-snapshot": "^6.4.0",
65-
"@types/node": "^20.14.2",
66-
"@typescript-eslint/eslint-plugin": "^7.12.0",
67-
"@typescript-eslint/parser": "^7.12.0",
68-
"@yarnpkg/sdks": "^3.1.2",
65+
"@types/node": "^22.7.4",
66+
"@yarnpkg/sdks": "^3.2.0",
6967
"canvas": "^2.11.2",
7068
"canvas-5-polyfill": "^0.1.5",
71-
"chart.js": "^4.4.3",
72-
"eslint": "^8.57.0",
73-
"eslint-config-airbnb-typescript": "^18.0.0",
74-
"eslint-config-prettier": "^9.1.0",
75-
"eslint-config-react-app": "^7.0.1",
76-
"eslint-plugin-flowtype": "^8.0.3",
77-
"eslint-plugin-import": "^2.29.1",
78-
"eslint-plugin-jsx-a11y": "^6.8.0",
79-
"eslint-plugin-prettier": "^5.1.3",
80-
"eslint-plugin-react": "^7.34.2",
81-
"eslint-plugin-react-hooks": "^4.6.2",
82-
"jest": "^29.7.0",
83-
"jest-environment-jsdom": "^29.7.0",
69+
"chart.js": "^4.4.4",
70+
"d3-selection": "^3.0.0",
71+
"eslint": "^9.11.1",
72+
"eslint-plugin-prettier": "^5.2.1",
8473
"jest-image-snapshot": "^6.4.0",
85-
"prettier": "^3.3.1",
86-
"rimraf": "^5.0.7",
87-
"rollup": "^4.18.0",
74+
"jsdom": "^25.0.1",
75+
"prettier": "^3.3.3",
76+
"rimraf": "^6.0.1",
77+
"rollup": "^4.22.5",
8878
"rollup-plugin-cleanup": "^3.2.1",
8979
"rollup-plugin-dts": "^6.1.1",
90-
"ts-jest": "^29.1.4",
91-
"tslib": "^2.6.3",
92-
"typedoc": "^0.25.13",
93-
"typedoc-plugin-markdown": "^4.0.3",
94-
"typedoc-vitepress-theme": "^1.0.0",
95-
"typescript": "^5.4.5",
96-
"vitepress": "^1.2.3",
97-
"vue": "^3.4.27",
80+
"ts-jest": "^29.2.5",
81+
"tslib": "^2.7.0",
82+
"typedoc": "^0.26.7",
83+
"typedoc-plugin-markdown": "^4.2.8",
84+
"typedoc-vitepress-theme": "^1.0.1",
85+
"typescript": "^5.6.2",
86+
"typescript-eslint": "^8.7.0",
87+
"vite": "^5.4.8",
88+
"vitepress": "^1.3.4",
89+
"vitest": "^2.1.1",
90+
"vue": "^3.5.10",
9891
"vue-chartjs": "^5.3.1"
9992
},
100-
"resolutions": {
101-
"@typescript-eslint/eslint-plugin": "^7.2.0",
102-
"@typescript-eslint/parser": "^7.2.0"
103-
},
10493
"scripts": {
10594
"clean": "rimraf --glob build node_modules \"*.tgz\" \"*.tsbuildinfo\"",
10695
"compile": "tsc -b tsconfig.c.json",
10796
"start": "yarn run watch",
10897
"watch": "rollup -c -w",
10998
"build": "rollup -c",
110-
"test": "yarn node --experimental-vm-modules $(yarn bin jest) --passWithNoTests --detectOpenHandles --forceExit",
99+
"test": "vitest --passWithNoTests",
111100
"test:watch": "yarn run test --watch",
112101
"test:coverage": "yarn run test --coverage",
113102
"lint": "yarn run eslint && yarn run prettier",
114103
"fix": "yarn run eslint:fix && yarn run prettier:write",
115104
"prettier:write": "prettier \"*\" \"*/**\" --write",
116105
"prettier": "prettier \"*\" \"*/**\" --check",
117-
"eslint": "eslint src --ext .ts,.tsx --cache",
106+
"eslint": "eslint src --cache",
118107
"eslint:fix": "yarn run eslint --fix",
119108
"prepare": "yarn run build",
120109
"docs:api": "typedoc --options typedoc.json",
@@ -125,5 +114,5 @@
125114
"dependencies": {
126115
"@upsetjs/venn.js": "^1.4.2"
127116
},
128-
"packageManager": "yarn@4.2.2"
117+
"packageManager": "yarn@4.5.0"
129118
}

src/__tests__/createChart.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/// <reference types="jest" />
21
/// <reference types="node" />
32

3+
import { expect } from 'vitest';
44
import { Chart, ChartConfiguration, defaults, ChartType, DefaultDataPoint } from 'chart.js';
55
import { toMatchImageSnapshot, MatchImageSnapshotOptions } from 'jest-image-snapshot';
66
import 'canvas-5-polyfill';
@@ -12,7 +12,7 @@ function toBuffer(canvas: HTMLCanvasElement) {
1212
canvas.toBlob((b) => {
1313
const file = new FileReader();
1414
file.onload = () => resolve(Buffer.from(file.result as ArrayBuffer));
15-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15+
1616
file.readAsArrayBuffer(b!);
1717
});
1818
});
@@ -34,14 +34,13 @@ export default function createChart<
3434
TYPE extends ChartType,
3535
DATA extends unknown[] = DefaultDataPoint<TYPE>,
3636
LABEL = string,
37-
>(config: ChartConfiguration<TYPE, DATA, LABEL>, width = 300, height = 300): ChartHelper<TYPE, DATA, LABEL> {
37+
>(config: ChartConfiguration<TYPE, DATA, LABEL>, width = 800, height = 600): ChartHelper<TYPE, DATA, LABEL> {
3838
const canvas = document.createElement('canvas');
3939
canvas.width = width;
4040
canvas.height = height;
4141
Object.assign(defaults.font, { family: 'Courier New' });
42-
defaults.color = 'transparent';
43-
defaults.borderColor = 'transparent';
44-
// eslint-disable-next-line no-param-reassign
42+
// defaults.color = 'transparent';
43+
4544
config.options = {
4645
responsive: false,
4746
animation: {
@@ -51,16 +50,13 @@ export default function createChart<
5150
legend: {
5251
display: false,
5352
},
54-
colors: {
55-
enabled: false,
56-
},
5753
title: {
5854
display: false,
5955
},
6056
},
6157
...(config.options || {}),
6258
} as any;
63-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
59+
6460
const ctx = canvas.getContext('2d')!;
6561

6662
// remove Path2D since not properly working

src/controllers/EulerDiagramController.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
/// <reference types="jest" />
21
import { LinearScale, registry } from 'chart.js';
32
import { EulerDiagramController } from './EulerDiagramController';
43
import { extractSets } from '../data';
54
import { ArcSlice } from '../elements';
65
import createChart from '../__tests__/createChart';
7-
6+
import { describe, beforeAll, test, expect } from 'vitest';
87
describe('Euler', () => {
98
beforeAll(() => {
109
registry.addControllers(EulerDiagramController);
@@ -27,9 +26,15 @@ describe('Euler', () => {
2726
{
2827
type: EulerDiagramController.id,
2928
data,
29+
options: {
30+
borderColor: 'transparent',
31+
},
3032
},
3133
1000,
3234
500
33-
).toMatchImageSnapshot();
35+
).toMatchImageSnapshot({
36+
failureThreshold: 0.02,
37+
failureThresholdType: 'percent',
38+
});
3439
});
3540
});

0 commit comments

Comments
 (0)