Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1 from sgratzl/release/v3.2.0
Browse files Browse the repository at this point in the history
Release v3.2.0
  • Loading branch information
sgratzl authored Jun 11, 2022
2 parents 6a674e2 + f1b4175 commit e23c859
Show file tree
Hide file tree
Showing 9 changed files with 3,748 additions and 2,505 deletions.
10 changes: 2 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@
const pkg = require('./package.json');

module.exports = {
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'airbnb-typescript',
'react-app',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'prettier',
],
plugins: ['prettier'],
extends: ['airbnb-typescript', 'react-app', 'plugin:prettier/recommended', 'prettier'],
parserOptions: {
project: './tsconfig.eslint.json',
},
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/.pnp.cjs
/.pnp*
/.yarnrc.yml
/.yarn
/build
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = {
testEnvironment: 'jsdom',
preset: 'ts-jest',
preset: 'ts-jest/presets/js-with-ts-esm',
rootDir: './src',
testRegex: '((\\.|/)(test|spec))\\.tsx?$',
};
83 changes: 42 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chartjs-chart-graph-dagre",
"description": "Chart.js graph chart extension using the dagre layout",
"version": "3.1.0",
"version": "3.2.0",
"author": {
"name": "Samuel Gratzl",
"email": "sam@sgratzl.com",
Expand Down Expand Up @@ -35,59 +35,60 @@
"src/**/*.ts"
],
"peerDependencies": {
"chart.js": "^3.5.0",
"chartjs-chart-graph": "^3.1.0"
"chart.js": "^3.8.0",
"chartjs-chart-graph": "^3.7.1"
},
"browserslist": [
"Firefox ESR",
"last 2 Chrome versions",
"last 2 Firefox versions"
],
"dependencies": {
"@types/dagre": "^0.7.46",
"@types/dagre": "^0.7.47",
"@types/graphlib": "^2.1.8",
"dagre": "^0.8.5",
"graphlib": "^2.1.8"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@rollup/plugin-replace": "^3.0.0",
"@rollup/plugin-typescript": "^8.2.5",
"@types/jest": "^26.0.24",
"@chiogen/rollup-plugin-terser": "^7.0.2",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-typescript": "^8.3.3",
"@types/jest": "^28.1.1",
"@types/jest-image-snapshot": "^4.3.1",
"@types/node": "^16.4.13",
"@types/seedrandom": "^3.0.1",
"@typescript-eslint/eslint-plugin": "^4.29.0",
"@typescript-eslint/parser": "^4.29.0",
"@yarnpkg/sdks": "^2.4.2-rc.2",
"canvas": "^2.8.0",
"@types/node": "^17.0.42",
"@types/seedrandom": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"@yarnpkg/sdks": "^2.6.2",
"canvas": "^2.9.1",
"canvas-5-polyfill": "^0.1.5",
"chart.js": "^3.5.0",
"chartjs-chart-graph": "^3.1.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.9.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"jest": "^27.0.6",
"jest-image-snapshot": "^4.5.1",
"prettier": "^2.3.2",
"chart.js": "^3.8.0",
"chartjs-chart-graph": "^3.7.1",
"eslint": "^8.17.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"jest": "^28.1.1",
"jest-environment-jsdom": "^28.1.1",
"jest-image-snapshot": "^5.1.0",
"prettier": "^2.6.2",
"rimraf": "^3.0.2",
"rollup": "^2.56.0",
"rollup": "~2.75.6",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^3.0.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-dts": "^4.2.2",
"seedrandom": "^3.0.5",
"ts-jest": "^27.0.4",
"tslib": "^2.3.0",
"typedoc": "^0.21.5",
"typescript": "^4.3.5"
"ts-jest": "^28.0.4",
"tslib": "^2.4.0",
"typedoc": "^0.22.17",
"typescript": "^4.7.3"
},
"scripts": {
"clean": "rimraf build docs node_modules \"*.tgz\" \"*.tsbuildinfo\"",
Expand All @@ -96,9 +97,9 @@
"start": "yarn run watch",
"watch": "rollup -c -w",
"build": "rollup -c",
"test": "jest --passWithNoTests",
"test:watch": "jest --passWithNoTests --watch",
"test:coverage": "jest --passWithNoTests --coverage",
"test": "jest --passWithNoTests --detectOpenHandles --forceExit",
"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",
Expand All @@ -108,5 +109,5 @@
"docs": "typedoc src/index.ts",
"prepare": "yarn run build"
},
"packageManager": "yarn@3.0.0"
"packageManager": "yarn@3.2.1"
}
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import resolve from '@rollup/plugin-node-resolve';
import cleanup from 'rollup-plugin-cleanup';
import dts from 'rollup-plugin-dts';
import typescript from '@rollup/plugin-typescript';
import { terser } from 'rollup-plugin-terser';
import { terser } from '@chiogen/rollup-plugin-terser';
import replace from '@rollup/plugin-replace';

import fs from 'fs';
Expand Down
4 changes: 2 additions & 2 deletions samples/default.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.5.0/dist/chart.js"></script>
<script src="https://unpkg.com/chartjs-chart-graph@3.0.0/build/index.umd.js"></script>
<script src="https://unpkg.com/chart.js@3.8.0/dist/chart.js"></script>
<script src="https://unpkg.com/chartjs-chart-graph@3.6.0/build/index.umd.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/createChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function createChart<
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
defaults.font.family = 'Courier New';
Object.assign(defaults.font, { family: 'Courier New' });
// defaults.color = 'transparent';
// eslint-disable-next-line no-param-reassign
config.options = {
Expand Down
4 changes: 3 additions & 1 deletion src/controllers/DagreGraphController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
IGraphChartControllerDatasetOptions,
IGraphDataPoint,
ITreeNode,
IExtendedChartMeta,
} from 'chartjs-chart-graph';
import Graph from 'graphlib/lib/graph';
import layout from 'dagre/lib/layout';
Expand All @@ -32,7 +33,7 @@ export class DagreGraphController extends GraphController {

const meta = this._cachedMeta;
const nodes = meta._parsed as ITreeNode[];
const edges = meta._parsedEdges;
const edges = (meta as unknown as IExtendedChartMeta)._parsedEdges;
nodes.forEach((_, i) => {
g.setNode(i.toString(), typeof options.node === 'function' ? options.node(i) : { ...options.node });
});
Expand Down Expand Up @@ -103,6 +104,7 @@ declare module 'chart.js' {
chartOptions: CoreChartOptions<'dagre'>;
datasetOptions: IDagreGraphChartControllerDatasetOptions;
defaultDataPoint: IGraphDataPoint;
metaExtensions: Record<string, never>;
parsedDataType: ITreeNode;
scales: keyof CartesianScaleTypeRegistry;
};
Expand Down
Loading

0 comments on commit e23c859

Please sign in to comment.