chartjs-chart-error-bars
Advanced tools
Comparing version 4.4.1 to 4.4.2
{ | ||
"name": "chartjs-chart-error-bars", | ||
"description": "Chart.js module for charting error bars", | ||
"version": "4.4.1", | ||
"version": "4.4.2", | ||
"author": { | ||
@@ -56,49 +56,37 @@ "name": "Samuel Gratzl", | ||
"@chiogen/rollup-plugin-terser": "^7.1.3", | ||
"@rollup/plugin-commonjs": "^26.0.1", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-replace": "^5.0.7", | ||
"@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.14.2", | ||
"@typescript-eslint/eslint-plugin": "^7.12.0", | ||
"@typescript-eslint/parser": "^7.12.0", | ||
"@yarnpkg/sdks": "^3.1.2", | ||
"@types/node": "^22.7.4", | ||
"@yarnpkg/sdks": "^3.2.0", | ||
"canvas": "^2.11.2", | ||
"canvas-5-polyfill": "^0.1.5", | ||
"chart.js": "^4.4.3", | ||
"chart.js": "^4.4.4", | ||
"chartjs-adapter-date-fns": "^3.0.0", | ||
"date-fns": "^3.6.0", | ||
"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.2", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"date-fns": "^4.1.0", | ||
"eslint": "^9.11.1", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"jest-image-snapshot": "^6.4.0", | ||
"prettier": "^3.3.1", | ||
"rimraf": "^5.0.7", | ||
"rollup": "^4.18.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.1", | ||
"ts-jest": "^29.1.4", | ||
"tslib": "^2.6.3", | ||
"typedoc": "^0.25.13", | ||
"typedoc-plugin-markdown": "^4.0.3", | ||
"typedoc-vitepress-theme": "^1.0.0", | ||
"typescript": "^5.4.5", | ||
"vitepress": "^1.2.3", | ||
"vue": "^3.4.27", | ||
"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" | ||
}, | ||
"resolutions": { | ||
"@typescript-eslint/eslint-plugin": "^7.2.0", | ||
"@typescript-eslint/parser": "^7.2.0" | ||
}, | ||
"scripts": { | ||
@@ -110,3 +98,3 @@ "clean": "rimraf --glob build node_modules \"*.tgz\" \"*.tsbuildinfo\"", | ||
"build": "rollup -c", | ||
"test": "yarn node --experimental-vm-modules $(yarn bin jest) --passWithNoTests --detectOpenHandles --forceExit", | ||
"test": "vitest --passWithNoTests", | ||
"test:watch": "yarn run test --watch", | ||
@@ -118,3 +106,3 @@ "test:coverage": "yarn run test --coverage", | ||
"prettier": "prettier \"*\" \"*/**\" --check", | ||
"eslint": "eslint src --ext .ts,.tsx --cache", | ||
"eslint": "eslint src --cache", | ||
"eslint:fix": "yarn run eslint --fix", | ||
@@ -127,3 +115,3 @@ "prepare": "yarn run build", | ||
}, | ||
"packageManager": "yarn@4.2.2" | ||
"packageManager": "yarn@4.5.0" | ||
} |
@@ -1,4 +0,4 @@ | ||
/// <reference types="jest" /> | ||
/// <reference types="node" /> | ||
import { expect } from 'vitest'; | ||
import { Chart, ChartConfiguration, defaults, ChartType, DefaultDataPoint } from 'chart.js'; | ||
@@ -15,3 +15,3 @@ import { toMatchImageSnapshot, MatchImageSnapshotOptions } from 'jest-image-snapshot'; | ||
file.onload = () => resolve(Buffer.from(file.result as ArrayBuffer)); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
file.readAsArrayBuffer(b!); | ||
@@ -44,3 +44,3 @@ }); | ||
// defaults.color = 'transparent'; | ||
// eslint-disable-next-line no-param-reassign | ||
config.options = { | ||
@@ -61,3 +61,3 @@ responsive: false, | ||
} as any; | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const ctx = canvas.getContext('2d')!; | ||
@@ -64,0 +64,0 @@ |
@@ -6,3 +6,3 @@ import { registry, LinearScale, CategoryScale, TimeScale } from 'chart.js'; | ||
import 'chartjs-adapter-date-fns'; | ||
import { describe, beforeAll, test } from 'vitest'; | ||
describe('bar', () => { | ||
@@ -9,0 +9,0 @@ beforeAll(() => { |
@@ -67,5 +67,4 @@ import { | ||
) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
parseErrorNumberData(parsed, meta.vScale!, data, start, count); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const iScale = meta.iScale as Scale; | ||
@@ -72,0 +71,0 @@ const hasNumberIScale = isNumericScale(iScale); |
@@ -55,9 +55,9 @@ import type { Scale } from 'chart.js'; | ||
const { axis } = scale; | ||
// eslint-disable-next-line no-param-reassign | ||
scale.axis = `${axis}MinMin`; | ||
const { min } = superMethod(scale); | ||
// eslint-disable-next-line no-param-reassign | ||
scale.axis = `${axis}MaxMax`; | ||
const { max } = superMethod(scale); | ||
// eslint-disable-next-line no-param-reassign | ||
scale.axis = axis; | ||
@@ -64,0 +64,0 @@ return { min, max }; |
@@ -14,3 +14,3 @@ import { | ||
import { PointWithErrorBar } from '../elements'; | ||
import { describe, beforeAll, test } from 'vitest'; | ||
describe('line', () => { | ||
@@ -17,0 +17,0 @@ beforeAll(() => { |
@@ -70,5 +70,4 @@ import { | ||
) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
parseErrorNumberData(parsed, meta.vScale!, data, start, count); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const iScale = meta.iScale as Scale; | ||
@@ -75,0 +74,0 @@ const hasNumberIScale = isNumericScale(iScale); |
@@ -5,3 +5,3 @@ import { registry, RadialLinearScale } from 'chart.js'; | ||
import { ArcWithErrorBar } from '../elements'; | ||
import { describe, beforeAll, test } from 'vitest'; | ||
describe('bar', () => { | ||
@@ -8,0 +8,0 @@ beforeAll(() => { |
@@ -109,3 +109,2 @@ import { | ||
) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const scale = meta.rScale!; | ||
@@ -112,0 +111,0 @@ for (let i = 0; i < count; i += 1) { |
@@ -5,3 +5,3 @@ import { registry, LinearScale } from 'chart.js'; | ||
import { PointWithErrorBar } from '../elements'; | ||
import { describe, beforeAll, test } from 'vitest'; | ||
describe('bar', () => { | ||
@@ -8,0 +8,0 @@ beforeAll(() => { |
@@ -54,5 +54,4 @@ import { | ||
) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
parseErrorNumberData(parsed, meta.xScale!, data, start, count); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
parseErrorNumberData(parsed, meta.yScale!, data, start, count); | ||
@@ -59,0 +58,0 @@ } |
@@ -11,3 +11,2 @@ import type { LinearScale, RadialLinearScale, Scale } from 'chart.js'; | ||
export function calculateScale( | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
properties: any, | ||
@@ -25,6 +24,4 @@ data: Partial<IErrorBarXYDataPoint>, | ||
if (Array.isArray(v)) { | ||
// eslint-disable-next-line no-param-reassign | ||
properties[key] = v.map((d) => (reset ? base : scale.getPixelForValue(d, index))); | ||
} else if (typeof v === 'number') { | ||
// eslint-disable-next-line no-param-reassign | ||
properties[key] = reset ? base : scale.getPixelForValue(v, index); | ||
@@ -38,3 +35,2 @@ } else { | ||
export function calculatePolarScale( | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
properties: any, | ||
@@ -44,3 +40,3 @@ data: IErrorBarRDataPoint, | ||
reset: boolean, | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
options: any | ||
@@ -60,6 +56,4 @@ ): void { | ||
if (Array.isArray(v)) { | ||
// eslint-disable-next-line no-param-reassign | ||
properties[key] = v.map(toAngle); | ||
} else if (typeof v === 'number') { | ||
// eslint-disable-next-line no-param-reassign | ||
properties[key] = toAngle(v); | ||
@@ -66,0 +60,0 @@ } else { |
@@ -15,3 +15,3 @@ import { | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
draw(ctx: CanvasRenderingContext2D, area?: any): void { | ||
@@ -18,0 +18,0 @@ (super.draw.call as any)(this, ctx, area); |
@@ -21,3 +21,3 @@ import type { Element, ArcProps } from 'chart.js'; | ||
* @default {v: [1, 3]} | ||
* @scriptable | ||
* scriptable | ||
*/ | ||
@@ -28,3 +28,3 @@ errorBarLineWidth: number | { v: number[] }; | ||
* @default {v: ['#2c2c2c', '#1f1f1f']} | ||
* @scriptable | ||
* scriptable | ||
*/ | ||
@@ -35,3 +35,3 @@ errorBarColor: string | { v: string[] }; | ||
* @default {v: [1, 3]} | ||
* @scriptable | ||
* scriptable | ||
*/ | ||
@@ -42,3 +42,3 @@ errorBarWhiskerLineWidth: number | { v: number[] }; | ||
* @default {v: [0.2, 0.25]} | ||
* @scriptable | ||
* scriptable | ||
*/ | ||
@@ -49,3 +49,3 @@ errorBarWhiskerRatio: number | { v: number[] }; | ||
* @default {v: [20, 24]} | ||
* @scriptable | ||
* scriptable | ||
*/ | ||
@@ -56,3 +56,3 @@ errorBarWhiskerSize: number | { v: number[] }; | ||
* @default {v: ['#2c2c2c', '#1f1f1f']} | ||
* @scriptable | ||
* scriptable | ||
*/ | ||
@@ -253,3 +253,2 @@ errorBarWhiskerColor: string | { v: string[] }; | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
export function renderErrorBarArc(elem: any, ctx: CanvasRenderingContext2D): void { | ||
@@ -256,0 +255,0 @@ const props = elem.getProps(['x', 'y', 'startAngle', 'endAngle', 'rMin', 'rMax', 'outerRadius']); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35
285340
4218