Skip to content

Commit

Permalink
Merge pull request #118 from sgratzl/release/v4.3.2
Browse files Browse the repository at this point in the history
Release v4.3.2
  • Loading branch information
sgratzl authored Oct 1, 2024
2 parents 052d2b8 + 40a6363 commit a562ad4
Show file tree
Hide file tree
Showing 18 changed files with 4,253 additions and 8,409 deletions.
25 changes: 0 additions & 25 deletions .eslintrc.cjs

This file was deleted.

19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'monthly'
target-branch: 'dev'
labels:
- 'dependencies'
- 'chore'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'monthly'
target-branch: 'dev'
labels:
- 'dependencies'
- 'chore'
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.1.1.cjs

This file was deleted.

925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.5.0.cjs

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
packageExtensions:
eslint-module-utils@*:
dependencies:
eslint-import-resolver-node: "*"

yarnPath: .yarn/releases/yarn-4.1.1.cjs
yarnPath: .yarn/releases/yarn-4.5.0.cjs
61 changes: 61 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-plugin-prettier';

export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, {
plugins: { prettier },
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'max-classes-per-file': 'off',
'no-underscore-dangle': 'off',
'import/extensions': 'off',
},
});

// import path from "node:path";
// import { fileURLToPath } from "node:url";
// import js from "@eslint/js";
// import { FlatCompat } from "@eslint/eslintrc";

// const __filename = fileURLToPath(import.meta.url);
// const __dirname = path.dirname(__filename);
// const compat = new FlatCompat({
// baseDirectory: __dirname,
// recommendedConfig: js.configs.recommended,
// allConfig: js.configs.all
// });

// export default [...fixupConfigRules(compat.extends(
// "airbnb-typescript",
// "react-app",
// "plugin:prettier/recommended",
// "prettier",
// )), {
// plugins: {
// prettier: fixupPluginRules(prettier),
// },

// languageOptions: {
// ecmaVersion: 5,
// sourceType: "script",

// parserOptions: {
// project: "./tsconfig.eslint.json",
// },
// },

// settings: {
// react: {
// version: "99.99.99",
// },
// },

// rules: {
// "@typescript-eslint/no-explicit-any": "off",
// "max-classes-per-file": "off",
// "no-underscore-dangle": "off",
// "import/extensions": "off",
// },
// }];
6 changes: 0 additions & 6 deletions jest.config.js

This file was deleted.

81 changes: 33 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chartjs-chart-graph",
"description": "Chart.js module for charting graphs",
"version": "4.3.1",
"version": "4.3.2",
"author": {
"name": "Samuel Gratzl",
"email": "[email protected]",
Expand Down Expand Up @@ -54,8 +54,8 @@
"last 2 Firefox versions"
],
"dependencies": {
"@types/d3-force": "^3.0.9",
"@types/d3-hierarchy": "^3.1.6",
"@types/d3-force": "^3.0.10",
"@types/d3-hierarchy": "^3.1.7",
"d3-dispatch": "^3.0.1",
"d3-force": "^3.0.0",
"d3-hierarchy": "^3.1.2",
Expand All @@ -64,75 +64,60 @@
},
"devDependencies": {
"@chiogen/rollup-plugin-terser": "^7.1.3",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-typescript": "^11.1.6",
"@types/jest": "^29.5.12",
"@eslint/js": "^9.11.1",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-replace": "^6.0.1",
"@rollup/plugin-typescript": "^12.1.0",
"@types/jest-image-snapshot": "^6.4.0",
"@types/node": "^20.11.27",
"@types/seedrandom": "^3.0.8",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@yarnpkg/sdks": "^3.1.0",
"@types/node": "^22.7.4",
"@yarnpkg/sdks": "^3.2.0",
"canvas": "^2.11.2",
"canvas-5-polyfill": "^0.1.5",
"chart.js": "^4.4.2",
"chart.js": "^4.4.4",
"chartjs-plugin-datalabels": "^2.2.0",
"chartjs-plugin-zoom": "^2.0.1",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.0",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"eslint": "^9.11.1",
"eslint-plugin-prettier": "^5.2.1",
"jest-image-snapshot": "^6.4.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"rollup": "~4.13.0",
"jsdom": "^25.0.1",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"rollup": "^4.22.5",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^6.1.0",
"seedrandom": "^3.0.5",
"ts-jest": "^29.1.2",
"tslib": "^2.6.2",
"typedoc": "^0.25.12",
"typedoc-plugin-markdown": "^4.0.0-next.16",
"typedoc-vitepress-theme": "^1.0.0-next.9",
"typescript": "^5.4.2",
"vitepress": "^1.0.0-rc.45",
"vue": "^3.4.21",
"vue-chartjs": "^5.3.0"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0"
"rollup-plugin-dts": "^6.1.1",
"ts-jest": "^29.2.5",
"tslib": "^2.7.0",
"typedoc": "^0.26.7",
"typedoc-plugin-markdown": "^4.2.8",
"typedoc-vitepress-theme": "^1.0.1",
"typescript": "^5.6.2",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8",
"vitepress": "^1.3.4",
"vitest": "^2.1.1",
"vue": "^3.5.10",
"vue-chartjs": "^5.3.1"
},
"scripts": {
"clean": "rimraf --glob build node_modules \"*.tgz\" \"*.tsbuildinfo\"",
"compile": "tsc -b tsconfig.c.json",
"start": "yarn run watch",
"watch": "rollup -c -w",
"build": "rollup -c",
"test": "yarn node --experimental-vm-modules $(yarn bin jest) --passWithNoTests --detectOpenHandles --forceExit",
"test": "vitest --passWithNoTests",
"test:watch": "yarn run test --watch",
"test:coverage": "yarn run test --coverage",
"lint": "yarn run eslint && yarn run prettier",
"fix": "yarn run eslint:fix && yarn run prettier:write",
"prettier:write": "prettier \"*\" \"*/**\" --write",
"prettier": "prettier \"*\" \"*/**\" --check",
"eslint": "eslint src --ext .ts,.tsx --cache",
"eslint": "eslint src --cache",
"eslint:fix": "yarn run eslint --fix",
"prepare": "yarn run build",
"docs:api": "typedoc --options typedoc.json",
"docs:dev": "vitepress dev docs",
"docs:build": "yarn run docs:api && vitepress build docs",
"docs:preview": "vitepress preview docs"
},
"packageManager": "yarn@4.1.1"
"packageManager": "yarn@4.5.0"
}
8 changes: 4 additions & 4 deletions src/__tests__/createChart.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="jest" />
/// <reference types="node" />

import { expect } from 'vitest';
import { Chart, ChartConfiguration, defaults, ChartType, DefaultDataPoint } from 'chart.js';
import { toMatchImageSnapshot, MatchImageSnapshotOptions } from 'jest-image-snapshot';
import 'canvas-5-polyfill';
Expand All @@ -12,7 +12,7 @@ function toBuffer(canvas: HTMLCanvasElement) {
canvas.toBlob((b) => {
const file = new FileReader();
file.onload = () => resolve(Buffer.from(file.result as ArrayBuffer));
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

file.readAsArrayBuffer(b!);
});
});
Expand Down Expand Up @@ -40,7 +40,7 @@ export default function createChart<
canvas.height = height;
Object.assign(defaults.font, { family: 'Courier New' });
// defaults.color = 'transparent';
// eslint-disable-next-line no-param-reassign

config.options = {
responsive: false,
animation: {
Expand All @@ -56,7 +56,7 @@ export default function createChart<
},
...(config.options || {}),
} as any;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

const ctx = canvas.getContext('2d')!;

const t = new Chart<TYPE, DATA, LABEL>(ctx, config);
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/DendrogramController.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import createChart from '../__tests__/createChart';
import { DendrogramController } from './DendrogramController';
import nodes from './__tests__/tree';
import { EdgeLine } from '../elements';

import { describe, beforeAll, test } from 'vitest';
describe('dendrogram', () => {
beforeAll(() => {
registry.addControllers(DendrogramController);
Expand Down
17 changes: 6 additions & 11 deletions src/controllers/DendrogramController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ export class DendrogramController extends GraphController {
/**
* @hidden
*/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types

updateEdgeElement(line: EdgeLine, index: number, properties: any, mode: UpdateMode): void {
// eslint-disable-next-line no-param-reassign
properties._orientation = this.options.tree.orientation;
super.updateEdgeElement(line, index, properties, mode);
}
Expand All @@ -62,10 +61,9 @@ export class DendrogramController extends GraphController {
/**
* @hidden
*/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types

updateElement(point: Element<AnyObject, AnyObject>, index: number, properties: any, mode: UpdateMode): void {
if (index != null) {
// eslint-disable-next-line no-param-reassign
properties.angle = (this.getParsed(index) as { angle: number }).angle;
}
super.updateElement(point, index, properties, mode);
Expand Down Expand Up @@ -112,23 +110,20 @@ export class DendrogramController extends GraphController {

const orientation = {
horizontal: (d: { x: number; y: number; data: { x: number; y: number } }) => {
// eslint-disable-next-line no-param-reassign
d.data.x = d.y - 1;
// eslint-disable-next-line no-param-reassign

d.data.y = -d.x + 1;
},
vertical: (d: { x: number; y: number; data: { x: number; y: number } }) => {
// eslint-disable-next-line no-param-reassign
d.data.x = d.x - 1;
// eslint-disable-next-line no-param-reassign

d.data.y = -d.y + 1;
},
radial: (d: { x: number; y: number; data: { x: number; y: number; angle?: number } }) => {
// eslint-disable-next-line no-param-reassign
d.data.x = Math.cos(d.x) * d.y;
// eslint-disable-next-line no-param-reassign

d.data.y = Math.sin(d.x) * d.y;
// eslint-disable-next-line no-param-reassign

d.data.angle = d.y === 0 ? Number.NaN : d.x;
},
};
Expand Down
8 changes: 3 additions & 5 deletions src/controllers/ForceDirectedGraphController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,8 @@ export class ForceDirectedGraphController extends GraphController {

nodes.forEach((node) => {
if (node._sim) {
// eslint-disable-next-line no-param-reassign
node.x = rescaleX(node._sim.x ?? 0);
// eslint-disable-next-line no-param-reassign

node.y = rescaleY(node._sim.y ?? 0);
}
});
Expand All @@ -284,7 +283,7 @@ export class ForceDirectedGraphController extends GraphController {
const nodes = (this._cachedMeta._parsed as ITreeSimNode[]).map((node, i) => {
const simNode: ITreeSimNode['_sim'] = { ...node };
simNode.index = i;
// eslint-disable-next-line no-param-reassign

node._sim = simNode;
if (!node.reset) {
return simNode;
Expand All @@ -308,7 +307,7 @@ export class ForceDirectedGraphController extends GraphController {
const nodes = (meta._parsed as ITreeSimNode[]).map((node, i) => {
const simNode: ITreeSimNode['_sim'] = { ...node };
simNode.index = i;
// eslint-disable-next-line no-param-reassign

node._sim = simNode;
if (simNode.x === null) {
delete simNode.x;
Expand All @@ -317,7 +316,6 @@ export class ForceDirectedGraphController extends GraphController {
delete simNode.y;
}
if (simNode.x == null && simNode.y == null) {
// eslint-disable-next-line no-param-reassign
node.reset = true;
}
return simNode;
Expand Down
Loading

0 comments on commit a562ad4

Please sign in to comment.