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 a5e55c7 commit f48c342
Show file tree
Hide file tree
Showing 10 changed files with 307 additions and 206 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-pcp",
"description": "Chart.js module for charting parallel coordinate plots",
"version": "3.0.0-beta.7",
"version": "3.0.0-beta.8",
"author": {
"name": "Samuel Gratzl",
"email": "sam@sgratzl.com",
Expand Down Expand Up @@ -41,39 +41,40 @@
],
"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",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"@types/node": "^14.14.21",
"@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",
"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
2 changes: 1 addition & 1 deletion samples/basic.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"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/basicLog.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"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9"></script>
<script src="../build/index.umd.js"></script>
</head>

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-pcp": "../build/index.esm.js"
}
}
Expand Down
2 changes: 1 addition & 1 deletion samples/tension.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"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
7 changes: 5 additions & 2 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 Down
5 changes: 3 additions & 2 deletions src/controllers/LogarithmicParallelCoordinatesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ChartItem,
ChartConfiguration,
CartesianScaleTypeRegistry,
ScriptableContext,
} from 'chart.js';
import { LineSegment, LogarithmicAxis, ILineSegmentOptions, ILogarithmicAxisOptions } from '../elements';
import { ParallelCoordinatesController } from './ParallelCoordinatesController';
Expand All @@ -22,8 +23,8 @@ export class LogarithmicParallelCoordinatesController extends ParallelCoordinate
export interface ILogarithmicParallelCoordinatesControllerDatasetOptions
extends ControllerDatasetOptions,
ILogarithmicAxisOptions,
ScriptableAndArrayOptions<ILineSegmentOptions>,
ScriptableAndArrayOptions<CommonHoverOptions> {}
ScriptableAndArrayOptions<ILineSegmentOptions, ScriptableContext>,
ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext> {}

export type ILogarithmicParallelCoordinatesChartOptions = ILogarithmicAxisOptions;

Expand Down
7 changes: 4 additions & 3 deletions src/controllers/ParallelCoordinatesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
ChartComponent,
ChartMeta,
ChartConfiguration,
ScriptableContext,
} from 'chart.js';
import { merge } from 'chart.js/helpers';
import { splineCurve } from 'chart.js/helpers';
Expand All @@ -37,7 +38,7 @@ export class ParallelCoordinatesController extends DatasetController<LineSegment
const ds = this.getDataset() as any;
ds.yAxisID = ds.label;
super.linkScales();
this._cachedMeta.vScale = this._cachedMeta.dataset;
this._cachedMeta.vScale = this._cachedMeta.dataset as any;
}

addElements() {
Expand Down Expand Up @@ -258,8 +259,8 @@ export class ParallelCoordinatesController extends DatasetController<LineSegment
export interface IParallelCoordinatesControllerDatasetOptions
extends ControllerDatasetOptions,
ILinearAxisOptions,
ScriptableAndArrayOptions<ILineSegmentOptions>,
ScriptableAndArrayOptions<CommonHoverOptions> {}
ScriptableAndArrayOptions<ILineSegmentOptions, ScriptableContext>,
ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext> {}

export type IParallelCoordinatesChartOptions = ILinearAxisOptions;

Expand Down
3 changes: 2 additions & 1 deletion src/elements/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ function BaseMixin<O extends IAxisOptions>(superClass: { new (...args: any[]): S
this.top = props.top;
this.bottom = props.bottom;

super.update(w, h, null);
const r = super.update(w, h);

this.top = props.top;
this.bottom = props.bottom;
this.configure();
return r;
}

draw(c: any) {
Expand Down
Loading

0 comments on commit f48c342

Please sign in to comment.