Skip to content

Commit

Permalink
Merge pull request #31 from sgratzl/release/v3.7.1
Browse files Browse the repository at this point in the history
Release v3.7.1
  • Loading branch information
sgratzl authored May 3, 2022
2 parents 7582f3c + 7feb8c6 commit df94c46
Show file tree
Hide file tree
Showing 19 changed files with 1,902 additions and 1,712 deletions.
13 changes: 2 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +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
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.1.cjs

This file was deleted.

785 changes: 785 additions & 0 deletions .yarn/releases/yarn-3.2.0.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.1.1.cjs
yarnPath: .yarn/releases/yarn-3.2.0.cjs
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?$',
};
67 changes: 34 additions & 33 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 error bars",
"version": "3.7.0",
"version": "3.7.1",
"author": {
"name": "Samuel Gratzl",
"email": "sam@sgratzl.com",
Expand Down Expand Up @@ -35,7 +35,7 @@
"src/**/*.ts"
],
"peerDependencies": {
"chart.js": "^3.7.0"
"chart.js": "^3.7.1"
},
"browserslist": [
"Firefox ESR",
Expand All @@ -49,43 +49,44 @@
"d3-hierarchy": "^2.0.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-replace": "^3.0.1",
"@rollup/plugin-typescript": "^8.3.0",
"@types/jest": "^27.4.0",
"@chiogen/rollup-plugin-terser": "^7.0.2",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-typescript": "^8.3.2",
"@types/jest": "^27.4.1",
"@types/jest-image-snapshot": "^4.3.1",
"@types/node": "^17.0.16",
"@types/seedrandom": "^3.0.1",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"@yarnpkg/sdks": "^2.5.0",
"canvas": "^2.9.0",
"@types/node": "^17.0.31",
"@types/seedrandom": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"@yarnpkg/sdks": "^2.6.0",
"canvas": "^2.9.1",
"canvas-5-polyfill": "^0.1.5",
"chart.js": "^3.7.0",
"eslint": "^8.8.0",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^7.0.0",
"chart.js": "^3.7.1",
"eslint": "^8.14.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.25.4",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.5.0",
"jest": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
"jest-image-snapshot": "^4.5.1",
"prettier": "^2.5.1",
"prettier": "^2.6.2",
"rimraf": "^3.0.2",
"rollup": "^2.67.1",
"rollup": "^2.71.1",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^4.1.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-dts": "^4.2.1",
"seedrandom": "^3.0.5",
"ts-jest": "^27.1.3",
"tslib": "^2.3.1",
"typedoc": "^0.22.11",
"typescript": "^4.5.5"
"ts-jest": "^27.1.4",
"tslib": "^2.4.0",
"typedoc": "^0.22.15",
"typescript": "^4.6.4"
},
"scripts": {
"clean": "rimraf build docs node_modules \"*.tgz\" \"*.tsbuildinfo\"",
Expand All @@ -94,9 +95,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",
"samples": "yarn tsc samples/type_test.ts",
"lint": "yarn run eslint && yarn run prettier",
"fix": "yarn run eslint:fix && yarn run prettier:write",
Expand All @@ -107,5 +108,5 @@
"docs": "typedoc src/index.ts",
"prepare": "yarn run build"
},
"packageManager": "yarn@3.1.1"
"packageManager": "yarn@3.2.0"
}
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_esm.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<script type="importmap-shim">
{
"imports": {
"chart.js": "https://unpkg.com/chart.js@3.7.0?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.7.0/helpers/helpers.esm.js?module",
"chart.js": "https://unpkg.com/chart.js@3.7.1?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.7.1/helpers/helpers.esm.js?module",
"chartjs-chart-graph": "../build/index.js",
"d3-force": "https://unpkg.com/d3-force?module",
"d3-hierarchy": "https://unpkg.com/d3-hierarchy?module"
Expand Down
2 changes: 1 addition & 1 deletion samples/directed.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.7.0/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.7.1/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/forceDirectedGraph.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.7.0/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.7.1/dist/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/hammerjs@2.0.8"></script>
<script src="https://unpkg.com/chartjs-plugin-zoom/dist/chartjs-plugin-zoom"></script>
<script src="../build/index.umd.js"></script>
Expand Down
89 changes: 89 additions & 0 deletions samples/forceDirectedLabel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3/dist/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.js"></script>
<script src="../build/index.umd.js"></script>
</head>

<body>
<div style="width: 75%">
<canvas id="graph"></canvas>
</div>
<script>
requestAnimationFrame(() => {
nodes = [
{ name: '1' },
{ name: '11', parent: 0 },
{ name: '111', parent: 1 },
{ name: '1111', parent: 2 },
{ name: '1112', parent: 2 },
{ name: '112', parent: 1 },
{ name: '1121', parent: 5 },
{ name: '1122', parent: 5 },
{ name: '113', parent: 1 },
{ name: '1131', parent: 8 },
{ name: '1132', parent: 8 },
{ name: '12', parent: 0 },
{ name: '121', parent: 11 },
{ name: '1211', parent: 12 },
{ name: '1212', parent: 12 },
{ name: '122', parent: 11 },
{ name: '1221', parent: 15 },
{ name: '1222', parent: 15 },
{ name: '123', parent: 11 },
{ name: '1231', parent: 18 },
{ name: '1232', parent: 18 },
{ name: '13', parent: 0 },
{ name: '131', parent: 21 },
];

Chart.register(ChartDataLabels);
chart = new Chart(document.getElementById('graph').getContext('2d'), {
plugins: [ChartDataLabels],
type: 'forceDirectedGraph',
data: {
labels: nodes.map((d) => d.name),
datasets: [
{
pointBackgroundColor: ['#002838', '#ed7d00', '#395c6b', '#d94d15', '#889da6'],
pointRadius: 10,
data: nodes.map((d) => Object.assign({}, d)),
},
],
},
options: {
// dragData: true,
// dragX: true,
tree: {
orientation: 'radial',
},
layout: {
padding: {
left: 20,
top: 20,
bottom: 20,
right: 20,
},
},
plugins: {
legend: {
display: false,
},
datalabels: {
// display: true,
align: 'right',
offset: 6,
formatter: function (value, context) {
return '' + value.name + '';
},
color: 'black',
backgroundColor: 'steelblue',
},
},
},
});
});
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion samples/graphChange.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.7.0/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.7.1/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/multi.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.7.0/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.7.1/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
<style>
body {
Expand Down
2 changes: 1 addition & 1 deletion samples/radial.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.7.0/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.7.1/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/radiallabel.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.7.0/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.7.1/dist/chart.js"></script>
<script src="https://unpkg.com/chartjs-plugin-datalabels@next"></script>
<!-- <script src="https://unpkg.com/chartjs-plugin-datalabels"></script> -->
<script src="../build/index.umd.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion samples/tree.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.7.0/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.7.1/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
5 changes: 3 additions & 2 deletions samples/treelabel.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.7.0/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.7.1/dist/chart.js"></script>
<script src="https://unpkg.com/chartjs-plugin-datalabels@next"></script>
<script src="https://cdn.jsdelivr.net/npm/hammerjs@2.0.8"></script>
<script src="https://unpkg.com/chartjs-plugin-zoom/dist/chartjs-plugin-zoom"></script>
Expand All @@ -27,7 +27,7 @@
.then((r) => r.json())
.then((nodes) => {
const chart = new Chart(document.getElementById('canvas').getContext('2d'), {
type: 'dendogram',
type: 'forceDirectedGraph',
data: {
labels: nodes.map((d) => d.name),
datasets: [
Expand All @@ -51,6 +51,7 @@
},
plugins: {
datalabels: {
display: true,
align: 'right',
offset: 6,
backgroundColor: 'white',
Expand Down
2 changes: 2 additions & 0 deletions src/controllers/ForceDirectedGraphController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export class ForceDirectedGraphController extends GraphController {
.on('end', () => {
this._copyPosition();
this.chart.render();
// trigger a full update
this.chart.update('normal');
});
const sim = this.options.simulation;

Expand Down
Loading

0 comments on commit df94c46

Please sign in to comment.