Skip to content

Commit

Permalink
feat: upgrade to beta.9
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Jan 17, 2021
1 parent bf6d5e6 commit a23c129
Show file tree
Hide file tree
Showing 13 changed files with 311 additions and 212 deletions.
37 changes: 19 additions & 18 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.0.0-beta.6",
"version": "3.0.0-beta.8",
"author": {
"name": "Samuel Gratzl",
"email": "sam@sgratzl.com",
Expand Down Expand Up @@ -49,41 +49,42 @@
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-node-resolve": "^11.1.0",
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-typescript": "^8.0.0",
"@types/jest": "^26.0.18",
"@rollup/plugin-typescript": "^8.1.0",
"@types/jest": "^26.0.20",
"@types/jest-image-snapshot": "^4.1.3",
"@types/node": "^14.14.11",
"@types/node": "^14.14.21",
"@types/seedrandom": "^2.4.28",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"@typescript-eslint/eslint-plugin": "^4.13.0",
"@typescript-eslint/parser": "^4.13.0",
"@yarnpkg/pnpify": "^2.4.0",
"canvas": "^2.6.1",
"chart.js": "^3.0.0-beta.7",
"eslint": "^7.15.0",
"eslint-config-prettier": "^7.0.0",
"canvas-5-polyfill": "^0.1.5",
"chart.js": "^3.0.0-beta.9",
"eslint": "^7.18.0",
"eslint-config-prettier": "^7.1.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.2.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"jest": "^26.6.3",
"jest-image-snapshot": "^4.2.0",
"jest-image-snapshot": "^4.3.0",
"prettier": "^2.2.1",
"release-it": "^14.2.2",
"rimraf": "^3.0.2",
"rollup": "^2.34.2",
"rollup": "^2.36.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^2.0.0",
"rollup-plugin-dts": "^2.0.1",
"rollup-plugin-terser": "^7.0.2",
"seedrandom": "^3.0.5",
"ts-jest": "^26.4.4",
"tslib": "^2.0.3",
"typedoc": "^0.19.2",
"typescript": "^4.1.2"
"tslib": "^2.1.0",
"typedoc": "^0.20.16",
"typescript": "^4.1.3"
},
"scripts": {
"clean": "rimraf build node_modules \"*.tgz\"",
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.0.0-beta.7?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.0.0-beta.7/helpers/helpers.esm.js?module",
"chart.js": "https://unpkg.com/chart.js@3.0.0-beta.9?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.0.0-beta.9/helpers/helpers.esm.js?module",
"chartjs-chart-graph": "../build/index.esm.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.0.0-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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.0.0-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
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.0.0-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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.0.0-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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.0.0-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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.0.0-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/dist/chart.js"></script>
<!-- <script src="https://unpkg.com/chartjs-plugin-datalabels"></script> -->
<script src="../build/index.umd.js"></script>
</head>
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.0.0-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion 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.0.0-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/dist/chart.js"></script>
<!-- <script src="https://unpkg.com/chartjs-plugin-datalabels"></script>
<script src="https://unpkg.com/chartjs-plugin-dragdata"></script> -->
<script src="../build/index.umd.js"></script>
Expand Down
9 changes: 6 additions & 3 deletions src/__tests__/createChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { Chart, ChartConfiguration, defaults, ChartType, DefaultDataPoint } from 'chart.js';
import { toMatchImageSnapshot, MatchImageSnapshotOptions } from 'jest-image-snapshot';
import 'canvas-5-polyfill';

expect.extend({ toMatchImageSnapshot });

Expand Down Expand Up @@ -30,11 +31,13 @@ export default function createChart<
canvas.width = width;
canvas.height = height;
defaults.font.family = 'Courier New';
defaults.font.color = 'transparent';
defaults.color = 'transparent';
config.options = Object.assign(
{
responsive: false,
animation: false,
animation: {
duration: 1,
},
plugins: {
legend: {
display: false,
Expand All @@ -55,7 +58,7 @@ export default function createChart<
canvas,
ctx,
async toMatchImageSnapshot(options?: MatchImageSnapshotOptions) {
await new Promise((resolve) => setTimeout(resolve, 100));
await new Promise((resolve) => setTimeout(resolve, 500));

const image = await toBuffer(canvas);
expect(image).toMatchImageSnapshot(options);
Expand Down
13 changes: 7 additions & 6 deletions src/controllers/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
PointPrefixedHoverOptions,
CartesianScaleTypeRegistry,
CoreChartOptions,
ScriptableContext,
} from 'chart.js';
import { merge } from 'chart.js/helpers';
import { clipArea, unclipArea } from 'chart.js/helpers';
Expand Down Expand Up @@ -116,8 +117,8 @@ export class GraphController extends ScatterController {
meta._parsed.splice(data.length, meta._parsed.length - data.length);
}
this._cachedMeta._sorted = false;
iScale.invalidateCaches();
vScale.invalidateCaches();
(iScale as any)._dataLimitsCached = false;
(vScale as any)._dataLimitsCached = false;

this._parseEdges();
}
Expand Down Expand Up @@ -522,10 +523,10 @@ export interface IGraphEdgeDataPoint {

export interface IGraphChartControllerDatasetOptions
extends ControllerDatasetOptions,
ScriptableAndArrayOptions<PointPrefixedOptions>,
ScriptableAndArrayOptions<PointPrefixedHoverOptions>,
ScriptableAndArrayOptions<IEdgeLineOptions>,
ScriptableAndArrayOptions<LineHoverOptions> {
ScriptableAndArrayOptions<PointPrefixedOptions, ScriptableContext>,
ScriptableAndArrayOptions<PointPrefixedHoverOptions, ScriptableContext>,
ScriptableAndArrayOptions<IEdgeLineOptions, ScriptableContext>,
ScriptableAndArrayOptions<LineHoverOptions, ScriptableContext> {
edges: IGraphEdgeDataPoint[];
}

Expand Down
Loading

0 comments on commit a23c129

Please sign in to comment.