FIN INIT
This commit is contained in:
75
node_modules/chart.js/dist/helpers/helpers.canvas.d.ts
generated
vendored
Normal file
75
node_modules/chart.js/dist/helpers/helpers.canvas.d.ts
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
import type { Chart, Point, FontSpec, CanvasFontSpec, PointStyle, RenderTextOpts } from '../types/index.js';
|
||||
import type { TRBL, SplinePoint, RoundedRect, TRBLCorners } from '../types/geometric.js';
|
||||
/**
|
||||
* Converts the given font object into a CSS font string.
|
||||
* @param font - A font object.
|
||||
* @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font
|
||||
* @private
|
||||
*/
|
||||
export declare function toFontString(font: FontSpec): string;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _measureText(ctx: CanvasRenderingContext2D, data: Record<string, number>, gc: string[], longest: number, string: string): number;
|
||||
type Thing = string | undefined | null;
|
||||
type Things = (Thing | Thing[])[];
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _longestText(ctx: CanvasRenderingContext2D, font: string, arrayOfThings: Things, cache?: {
|
||||
data?: Record<string, number>;
|
||||
garbageCollect?: string[];
|
||||
font?: string;
|
||||
}): number;
|
||||
/**
|
||||
* Returns the aligned pixel value to avoid anti-aliasing blur
|
||||
* @param chart - The chart instance.
|
||||
* @param pixel - A pixel value.
|
||||
* @param width - The width of the element.
|
||||
* @returns The aligned pixel value.
|
||||
* @private
|
||||
*/
|
||||
export declare function _alignPixel(chart: Chart, pixel: number, width: number): number;
|
||||
/**
|
||||
* Clears the entire canvas.
|
||||
*/
|
||||
export declare function clearCanvas(canvas?: HTMLCanvasElement, ctx?: CanvasRenderingContext2D): void;
|
||||
export interface DrawPointOptions {
|
||||
pointStyle: PointStyle;
|
||||
rotation?: number;
|
||||
radius: number;
|
||||
borderWidth: number;
|
||||
}
|
||||
export declare function drawPoint(ctx: CanvasRenderingContext2D, options: DrawPointOptions, x: number, y: number): void;
|
||||
export declare function drawPointLegend(ctx: CanvasRenderingContext2D, options: DrawPointOptions, x: number, y: number, w: number): void;
|
||||
/**
|
||||
* Returns true if the point is inside the rectangle
|
||||
* @param point - The point to test
|
||||
* @param area - The rectangle
|
||||
* @param margin - allowed margin
|
||||
* @private
|
||||
*/
|
||||
export declare function _isPointInArea(point: Point, area: TRBL, margin?: number): boolean;
|
||||
export declare function clipArea(ctx: CanvasRenderingContext2D, area: TRBL): void;
|
||||
export declare function unclipArea(ctx: CanvasRenderingContext2D): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _steppedLineTo(ctx: CanvasRenderingContext2D, previous: Point, target: Point, flip?: boolean, mode?: string): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _bezierCurveTo(ctx: CanvasRenderingContext2D, previous: SplinePoint, target: SplinePoint, flip?: boolean): void;
|
||||
/**
|
||||
* Render text onto the canvas
|
||||
*/
|
||||
export declare function renderText(ctx: CanvasRenderingContext2D, text: string | string[], x: number, y: number, font: CanvasFontSpec, opts?: RenderTextOpts): void;
|
||||
/**
|
||||
* Add a path of a rectangle with rounded corners to the current sub-path
|
||||
* @param ctx - Context
|
||||
* @param rect - Bounding rect
|
||||
*/
|
||||
export declare function addRoundedRectPath(ctx: CanvasRenderingContext2D, rect: RoundedRect & {
|
||||
radius: TRBLCorners;
|
||||
}): void;
|
||||
export {};
|
68
node_modules/chart.js/dist/helpers/helpers.collection.d.ts
generated
vendored
Normal file
68
node_modules/chart.js/dist/helpers/helpers.collection.d.ts
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
/**
|
||||
* Binary search
|
||||
* @param table - the table search. must be sorted!
|
||||
* @param value - value to find
|
||||
* @param cmp
|
||||
* @private
|
||||
*/
|
||||
export declare function _lookup(table: number[], value: number, cmp?: (value: number) => boolean): {
|
||||
lo: number;
|
||||
hi: number;
|
||||
};
|
||||
export declare function _lookup<T>(table: T[], value: number, cmp: (value: number) => boolean): {
|
||||
lo: number;
|
||||
hi: number;
|
||||
};
|
||||
/**
|
||||
* Binary search
|
||||
* @param table - the table search. must be sorted!
|
||||
* @param key - property name for the value in each entry
|
||||
* @param value - value to find
|
||||
* @param last - lookup last index
|
||||
* @private
|
||||
*/
|
||||
export declare const _lookupByKey: (table: Record<string, number>[], key: string, value: number, last?: boolean) => {
|
||||
lo: number;
|
||||
hi: number;
|
||||
};
|
||||
/**
|
||||
* Reverse binary search
|
||||
* @param table - the table search. must be sorted!
|
||||
* @param key - property name for the value in each entry
|
||||
* @param value - value to find
|
||||
* @private
|
||||
*/
|
||||
export declare const _rlookupByKey: (table: Record<string, number>[], key: string, value: number) => {
|
||||
lo: number;
|
||||
hi: number;
|
||||
};
|
||||
/**
|
||||
* Return subset of `values` between `min` and `max` inclusive.
|
||||
* Values are assumed to be in sorted order.
|
||||
* @param values - sorted array of values
|
||||
* @param min - min value
|
||||
* @param max - max value
|
||||
*/
|
||||
export declare function _filterBetween(values: number[], min: number, max: number): number[];
|
||||
export interface ArrayListener<T> {
|
||||
_onDataPush?(...item: T[]): void;
|
||||
_onDataPop?(): void;
|
||||
_onDataShift?(): void;
|
||||
_onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;
|
||||
_onDataUnshift?(...item: T[]): void;
|
||||
}
|
||||
/**
|
||||
* Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',
|
||||
* 'unshift') and notify the listener AFTER the array has been altered. Listeners are
|
||||
* called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.
|
||||
*/
|
||||
export declare function listenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;
|
||||
/**
|
||||
* Removes the given array event listener and cleanup extra attached properties (such as
|
||||
* the _chartjs stub and overridden methods) if array doesn't have any more listeners.
|
||||
*/
|
||||
export declare function unlistenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;
|
||||
/**
|
||||
* @param items
|
||||
*/
|
||||
export declare function _arrayUnique<T>(items: T[]): T[];
|
13
node_modules/chart.js/dist/helpers/helpers.color.d.ts
generated
vendored
Normal file
13
node_modules/chart.js/dist/helpers/helpers.color.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
import { Color } from '@kurkle/color';
|
||||
export declare function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient;
|
||||
export declare function color(value: CanvasGradient): CanvasGradient;
|
||||
export declare function color(value: CanvasPattern): CanvasPattern;
|
||||
export declare function color(value: string | {
|
||||
r: number;
|
||||
g: number;
|
||||
b: number;
|
||||
a: number;
|
||||
} | [number, number, number] | [number, number, number, number]): Color;
|
||||
export declare function getHoverColor(value: CanvasGradient): CanvasGradient;
|
||||
export declare function getHoverColor(value: CanvasPattern): CanvasPattern;
|
||||
export declare function getHoverColor(value: string): string;
|
31
node_modules/chart.js/dist/helpers/helpers.config.d.ts
generated
vendored
Normal file
31
node_modules/chart.js/dist/helpers/helpers.config.d.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
import type { AnyObject } from '../types/basic.js';
|
||||
import type { ChartMeta } from '../types/index.js';
|
||||
import type { ResolverObjectKey, ResolverCache, ResolverProxy, DescriptorDefaults, Descriptor, ContextProxy } from './helpers.config.types.js';
|
||||
export * from './helpers.config.types.js';
|
||||
/**
|
||||
* Creates a Proxy for resolving raw values for options.
|
||||
* @param scopes - The option scopes to look for values, in resolution order
|
||||
* @param prefixes - The prefixes for values, in resolution order.
|
||||
* @param rootScopes - The root option scopes
|
||||
* @param fallback - Parent scopes fallback
|
||||
* @param getTarget - callback for getting the target for changed values
|
||||
* @returns Proxy
|
||||
* @private
|
||||
*/
|
||||
export declare function _createResolver<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T>(scopes: T, prefixes?: string[], rootScopes?: R, fallback?: ResolverObjectKey, getTarget?: () => AnyObject): any;
|
||||
/**
|
||||
* Returns an Proxy for resolving option values with context.
|
||||
* @param proxy - The Proxy returned by `_createResolver`
|
||||
* @param context - Context object for scriptable/indexable options
|
||||
* @param subProxy - The proxy provided for scriptable options
|
||||
* @param descriptorDefaults - Defaults for descriptors
|
||||
* @private
|
||||
*/
|
||||
export declare function _attachContext<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T>(proxy: ResolverProxy<T, R>, context: AnyObject, subProxy?: ResolverProxy<T, R>, descriptorDefaults?: DescriptorDefaults): ContextProxy<T, R>;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _descriptors(proxy: ResolverCache, defaults?: DescriptorDefaults): Descriptor;
|
||||
export declare function _parseObjectDataRadialScale(meta: ChartMeta<'line' | 'scatter'>, data: AnyObject[], start: number, count: number): {
|
||||
r: unknown;
|
||||
}[];
|
41
node_modules/chart.js/dist/helpers/helpers.config.types.d.ts
generated
vendored
Normal file
41
node_modules/chart.js/dist/helpers/helpers.config.types.d.ts
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
import type { AnyObject } from '../types/basic.js';
|
||||
import type { Merge } from '../types/utils.js';
|
||||
export type ResolverObjectKey = string | boolean;
|
||||
export interface ResolverCache<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> {
|
||||
[Symbol.toStringTag]: 'Object';
|
||||
_cacheable: boolean;
|
||||
_scopes: T;
|
||||
_rootScopes: T | R;
|
||||
_fallback: ResolverObjectKey;
|
||||
_keys?: string[];
|
||||
_scriptable?: boolean;
|
||||
_indexable?: boolean;
|
||||
_allKeys?: boolean;
|
||||
_storage?: T[number];
|
||||
_getTarget(): T[number];
|
||||
override<S extends AnyObject>(scope: S): ResolverProxy<(T[number] | S)[], T | R>;
|
||||
}
|
||||
export type ResolverProxy<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> = Merge<T[number]> & ResolverCache<T, R>;
|
||||
export interface DescriptorDefaults {
|
||||
scriptable: boolean;
|
||||
indexable: boolean;
|
||||
allKeys?: boolean;
|
||||
}
|
||||
export interface Descriptor {
|
||||
allKeys: boolean;
|
||||
scriptable: boolean;
|
||||
indexable: boolean;
|
||||
isScriptable(key: string): boolean;
|
||||
isIndexable(key: string): boolean;
|
||||
}
|
||||
export interface ContextCache<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> {
|
||||
_cacheable: boolean;
|
||||
_proxy: ResolverProxy<T, R>;
|
||||
_context: AnyObject;
|
||||
_subProxy: ResolverProxy<T, R>;
|
||||
_stack: Set<string>;
|
||||
_descriptors: Descriptor;
|
||||
setContext(ctx: AnyObject): ContextProxy<T, R>;
|
||||
override<S extends AnyObject>(scope: S): ContextProxy<(T[number] | S)[], T | R>;
|
||||
}
|
||||
export type ContextProxy<T extends AnyObject[] = AnyObject[], R extends AnyObject[] = T> = Merge<T[number]> & ContextCache<T, R>;
|
147
node_modules/chart.js/dist/helpers/helpers.core.d.ts
generated
vendored
Normal file
147
node_modules/chart.js/dist/helpers/helpers.core.d.ts
generated
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
/**
|
||||
* @namespace Chart.helpers
|
||||
*/
|
||||
import type { AnyObject } from '../types/basic.js';
|
||||
import type { ActiveDataPoint, ChartEvent } from '../types/index.js';
|
||||
/**
|
||||
* An empty function that can be used, for example, for optional callback.
|
||||
*/
|
||||
export declare function noop(): void;
|
||||
/**
|
||||
* Returns a unique id, sequentially generated from a global variable.
|
||||
*/
|
||||
export declare const uid: () => number;
|
||||
/**
|
||||
* Returns true if `value` is neither null nor undefined, else returns false.
|
||||
* @param value - The value to test.
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function isNullOrUndef(value: unknown): value is null | undefined;
|
||||
/**
|
||||
* Returns true if `value` is an array (including typed arrays), else returns false.
|
||||
* @param value - The value to test.
|
||||
* @function
|
||||
*/
|
||||
export declare function isArray<T = unknown>(value: unknown): value is T[];
|
||||
/**
|
||||
* Returns true if `value` is an object (excluding null), else returns false.
|
||||
* @param value - The value to test.
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function isObject(value: unknown): value is AnyObject;
|
||||
/**
|
||||
* Returns true if `value` is a finite number, else returns false
|
||||
* @param value - The value to test.
|
||||
*/
|
||||
declare function isNumberFinite(value: unknown): value is number;
|
||||
export { isNumberFinite as isFinite, };
|
||||
/**
|
||||
* Returns `value` if finite, else returns `defaultValue`.
|
||||
* @param value - The value to return if defined.
|
||||
* @param defaultValue - The value to return if `value` is not finite.
|
||||
*/
|
||||
export declare function finiteOrDefault(value: unknown, defaultValue: number): number;
|
||||
/**
|
||||
* Returns `value` if defined, else returns `defaultValue`.
|
||||
* @param value - The value to return if defined.
|
||||
* @param defaultValue - The value to return if `value` is undefined.
|
||||
*/
|
||||
export declare function valueOrDefault<T>(value: T | undefined, defaultValue: T): T;
|
||||
export declare const toPercentage: (value: number | string, dimension: number) => number;
|
||||
export declare const toDimension: (value: number | string, dimension: number) => number;
|
||||
/**
|
||||
* Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the
|
||||
* value returned by `fn`. If `fn` is not a function, this method returns undefined.
|
||||
* @param fn - The function to call.
|
||||
* @param args - The arguments with which `fn` should be called.
|
||||
* @param [thisArg] - The value of `this` provided for the call to `fn`.
|
||||
*/
|
||||
export declare function callback<T extends (this: TA, ...restArgs: unknown[]) => R, TA, R>(fn: T | undefined, args: unknown[], thisArg?: TA): R | undefined;
|
||||
/**
|
||||
* Note(SB) for performance sake, this method should only be used when loopable type
|
||||
* is unknown or in none intensive code (not called often and small loopable). Else
|
||||
* it's preferable to use a regular for() loop and save extra function calls.
|
||||
* @param loopable - The object or array to be iterated.
|
||||
* @param fn - The function to call for each item.
|
||||
* @param [thisArg] - The value of `this` provided for the call to `fn`.
|
||||
* @param [reverse] - If true, iterates backward on the loopable.
|
||||
*/
|
||||
export declare function each<T, TA>(loopable: Record<string, T>, fn: (this: TA, v: T, i: string) => void, thisArg?: TA, reverse?: boolean): void;
|
||||
export declare function each<T, TA>(loopable: T[], fn: (this: TA, v: T, i: number) => void, thisArg?: TA, reverse?: boolean): void;
|
||||
/**
|
||||
* Returns true if the `a0` and `a1` arrays have the same content, else returns false.
|
||||
* @param a0 - The array to compare
|
||||
* @param a1 - The array to compare
|
||||
* @private
|
||||
*/
|
||||
export declare function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]): boolean;
|
||||
/**
|
||||
* Returns a deep copy of `source` without keeping references on objects and arrays.
|
||||
* @param source - The value to clone.
|
||||
*/
|
||||
export declare function clone<T>(source: T): T;
|
||||
/**
|
||||
* The default merger when Chart.helpers.merge is called without merger option.
|
||||
* Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.
|
||||
* @private
|
||||
*/
|
||||
export declare function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject): void;
|
||||
export interface MergeOptions {
|
||||
merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;
|
||||
}
|
||||
/**
|
||||
* Recursively deep copies `source` properties into `target` with the given `options`.
|
||||
* IMPORTANT: `target` is not cloned and will be updated with `source` properties.
|
||||
* @param target - The target object in which all sources are merged into.
|
||||
* @param source - Object(s) to merge into `target`.
|
||||
* @param [options] - Merging options:
|
||||
* @param [options.merger] - The merge method (key, target, source, options)
|
||||
* @returns The `target` object.
|
||||
*/
|
||||
export declare function merge<T>(target: T, source: [], options?: MergeOptions): T;
|
||||
export declare function merge<T, S1>(target: T, source: S1, options?: MergeOptions): T & S1;
|
||||
export declare function merge<T, S1>(target: T, source: [S1], options?: MergeOptions): T & S1;
|
||||
export declare function merge<T, S1, S2>(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;
|
||||
export declare function merge<T, S1, S2, S3>(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;
|
||||
export declare function merge<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4], options?: MergeOptions): T & S1 & S2 & S3 & S4;
|
||||
export declare function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;
|
||||
/**
|
||||
* Recursively deep copies `source` properties into `target` *only* if not defined in target.
|
||||
* IMPORTANT: `target` is not cloned and will be updated with `source` properties.
|
||||
* @param target - The target object in which all sources are merged into.
|
||||
* @param source - Object(s) to merge into `target`.
|
||||
* @returns The `target` object.
|
||||
*/
|
||||
export declare function mergeIf<T>(target: T, source: []): T;
|
||||
export declare function mergeIf<T, S1>(target: T, source: S1): T & S1;
|
||||
export declare function mergeIf<T, S1>(target: T, source: [S1]): T & S1;
|
||||
export declare function mergeIf<T, S1, S2>(target: T, source: [S1, S2]): T & S1 & S2;
|
||||
export declare function mergeIf<T, S1, S2, S3>(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;
|
||||
export declare function mergeIf<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;
|
||||
export declare function mergeIf<T>(target: T, source: AnyObject[]): AnyObject;
|
||||
/**
|
||||
* Merges source[key] in target[key] only if target[key] is undefined.
|
||||
* @private
|
||||
*/
|
||||
export declare function _mergerIf(key: string, target: AnyObject, source: AnyObject): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _deprecated(scope: string, value: unknown, previous: string, current: string): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _splitKey(key: string): string[];
|
||||
export declare function resolveObjectKey(obj: AnyObject, key: string): any;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _capitalize(str: string): string;
|
||||
export declare const defined: (value: unknown) => boolean;
|
||||
export declare const isFunction: (value: unknown) => value is (...args: any[]) => any;
|
||||
export declare const setsEqual: <T>(a: Set<T>, b: Set<T>) => boolean;
|
||||
/**
|
||||
* @param e - The event
|
||||
* @private
|
||||
*/
|
||||
export declare function _isClickEvent(e: ChartEvent): boolean;
|
17
node_modules/chart.js/dist/helpers/helpers.curve.d.ts
generated
vendored
Normal file
17
node_modules/chart.js/dist/helpers/helpers.curve.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import type { ChartArea } from '../types/index.js';
|
||||
import type { SplinePoint } from '../types/geometric.js';
|
||||
export declare function splineCurve(firstPoint: SplinePoint, middlePoint: SplinePoint, afterPoint: SplinePoint, t: number): {
|
||||
previous: SplinePoint;
|
||||
next: SplinePoint;
|
||||
};
|
||||
/**
|
||||
* This function calculates Bézier control points in a similar way than |splineCurve|,
|
||||
* but preserves monotonicity of the provided data and ensures no local extremums are added
|
||||
* between the dataset discrete points due to the interpolation.
|
||||
* See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
|
||||
*/
|
||||
export declare function splineCurveMonotone(points: SplinePoint[], indexAxis?: 'x' | 'y'): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _updateBezierControlPoints(points: SplinePoint[], options: any, area: ChartArea, loop: boolean, indexAxis: 'x' | 'y'): void;
|
2
node_modules/chart.js/dist/helpers/helpers.dataset.d.ts
generated
vendored
Normal file
2
node_modules/chart.js/dist/helpers/helpers.dataset.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import type { Chart, ChartMeta, TRBL } from '../types/index.js';
|
||||
export declare function getDatasetClipArea(chart: Chart, meta: ChartMeta): TRBL | false;
|
48
node_modules/chart.js/dist/helpers/helpers.dom.d.ts
generated
vendored
Normal file
48
node_modules/chart.js/dist/helpers/helpers.dom.d.ts
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
import type PrivateChart from '../core/core.controller.js';
|
||||
import type { Chart, ChartEvent } from '../types.js';
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _isDomSupported(): boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement;
|
||||
export declare function getStyle(el: HTMLElement, property: string): string;
|
||||
/**
|
||||
* Gets an event's x, y coordinates, relative to the chart area
|
||||
* @param event
|
||||
* @param chart
|
||||
* @returns x and y coordinates of the event
|
||||
*/
|
||||
export declare function getRelativePosition(event: Event | ChartEvent | TouchEvent | MouseEvent, chart: Chart | PrivateChart): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
export declare function getMaximumSize(canvas: HTMLCanvasElement, bbWidth?: number, bbHeight?: number, aspectRatio?: number): {
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
/**
|
||||
* @param chart
|
||||
* @param forceRatio
|
||||
* @param forceStyle
|
||||
* @returns True if the canvas context size or transformation has changed.
|
||||
*/
|
||||
export declare function retinaScale(chart: Chart | PrivateChart, forceRatio: number, forceStyle?: boolean): boolean | void;
|
||||
/**
|
||||
* Detects support for options object argument in addEventListener.
|
||||
* https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
|
||||
* @private
|
||||
*/
|
||||
export declare const supportsEventListenerOptions: boolean;
|
||||
/**
|
||||
* The "used" size is the final value of a dimension property after all calculations have
|
||||
* been performed. This method uses the computed style of `element` but returns undefined
|
||||
* if the computed style is not expressed in pixels. That can happen in some cases where
|
||||
* `element` has a size relative to its parent and this last one is not yet displayed,
|
||||
* for example because of `display: none` on a parent node.
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value
|
||||
* @returns Size in pixels or undefined if unknown.
|
||||
*/
|
||||
export declare function readUsedSize(element: HTMLElement, property: 'width' | 'height'): number | undefined;
|
40
node_modules/chart.js/dist/helpers/helpers.easing.d.ts
generated
vendored
Normal file
40
node_modules/chart.js/dist/helpers/helpers.easing.d.ts
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Easing functions adapted from Robert Penner's easing equations.
|
||||
* @namespace Chart.helpers.easing.effects
|
||||
* @see http://www.robertpenner.com/easing/
|
||||
*/
|
||||
declare const effects: {
|
||||
readonly linear: (t: number) => number;
|
||||
readonly easeInQuad: (t: number) => number;
|
||||
readonly easeOutQuad: (t: number) => number;
|
||||
readonly easeInOutQuad: (t: number) => number;
|
||||
readonly easeInCubic: (t: number) => number;
|
||||
readonly easeOutCubic: (t: number) => number;
|
||||
readonly easeInOutCubic: (t: number) => number;
|
||||
readonly easeInQuart: (t: number) => number;
|
||||
readonly easeOutQuart: (t: number) => number;
|
||||
readonly easeInOutQuart: (t: number) => number;
|
||||
readonly easeInQuint: (t: number) => number;
|
||||
readonly easeOutQuint: (t: number) => number;
|
||||
readonly easeInOutQuint: (t: number) => number;
|
||||
readonly easeInSine: (t: number) => number;
|
||||
readonly easeOutSine: (t: number) => number;
|
||||
readonly easeInOutSine: (t: number) => number;
|
||||
readonly easeInExpo: (t: number) => number;
|
||||
readonly easeOutExpo: (t: number) => number;
|
||||
readonly easeInOutExpo: (t: number) => number;
|
||||
readonly easeInCirc: (t: number) => number;
|
||||
readonly easeOutCirc: (t: number) => number;
|
||||
readonly easeInOutCirc: (t: number) => number;
|
||||
readonly easeInElastic: (t: number) => number;
|
||||
readonly easeOutElastic: (t: number) => number;
|
||||
readonly easeInOutElastic: (t: number) => number;
|
||||
readonly easeInBack: (t: number) => number;
|
||||
readonly easeOutBack: (t: number) => number;
|
||||
readonly easeInOutBack: (t: number) => number;
|
||||
readonly easeInBounce: (t: number) => number;
|
||||
readonly easeOutBounce: (t: number) => number;
|
||||
readonly easeInOutBounce: (t: number) => number;
|
||||
};
|
||||
export type EasingFunction = keyof typeof effects;
|
||||
export default effects;
|
45
node_modules/chart.js/dist/helpers/helpers.extras.d.ts
generated
vendored
Normal file
45
node_modules/chart.js/dist/helpers/helpers.extras.d.ts
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
import type { ChartMeta, PointElement } from '../types/index.js';
|
||||
export declare function fontString(pixelSize: number, fontStyle: string, fontFamily: string): string;
|
||||
/**
|
||||
* Request animation polyfill
|
||||
*/
|
||||
export declare const requestAnimFrame: (((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame) | ((callback: any) => any);
|
||||
/**
|
||||
* Throttles calling `fn` once per animation frame
|
||||
* Latest arguments are used on the actual call
|
||||
*/
|
||||
export declare function throttled<TArgs extends Array<any>>(fn: (...args: TArgs) => void, thisArg: any): (...args: TArgs) => void;
|
||||
/**
|
||||
* Debounces calling `fn` for `delay` ms
|
||||
*/
|
||||
export declare function debounce<TArgs extends Array<any>>(fn: (...args: TArgs) => void, delay: number): (...args: TArgs) => number;
|
||||
/**
|
||||
* Converts 'start' to 'left', 'end' to 'right' and others to 'center'
|
||||
* @private
|
||||
*/
|
||||
export declare const _toLeftRightCenter: (align: 'start' | 'end' | 'center') => "center" | "left" | "right";
|
||||
/**
|
||||
* Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`
|
||||
* @private
|
||||
*/
|
||||
export declare const _alignStartEnd: (align: 'start' | 'end' | 'center', start: number, end: number) => number;
|
||||
/**
|
||||
* Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`
|
||||
* @private
|
||||
*/
|
||||
export declare const _textX: (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => number;
|
||||
/**
|
||||
* Return start and count of visible points.
|
||||
* @private
|
||||
*/
|
||||
export declare function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean): {
|
||||
start: number;
|
||||
count: number;
|
||||
};
|
||||
/**
|
||||
* Checks if the scale ranges have changed.
|
||||
* @param {object} meta - dataset meta.
|
||||
* @returns {boolean}
|
||||
* @private
|
||||
*/
|
||||
export declare function _scaleRangesChanged(meta: any): boolean;
|
22
node_modules/chart.js/dist/helpers/helpers.interpolation.d.ts
generated
vendored
Normal file
22
node_modules/chart.js/dist/helpers/helpers.interpolation.d.ts
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
import type { Point, SplinePoint } from '../types/geometric.js';
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _pointInLine(p1: Point, p2: Point, t: number, mode?: any): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _steppedInterpolation(p1: Point, p2: Point, t: number, mode: 'middle' | 'after' | unknown): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?: any): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
1
node_modules/chart.js/dist/helpers/helpers.intl.d.ts
generated
vendored
Normal file
1
node_modules/chart.js/dist/helpers/helpers.intl.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions): string;
|
84
node_modules/chart.js/dist/helpers/helpers.math.d.ts
generated
vendored
Normal file
84
node_modules/chart.js/dist/helpers/helpers.math.d.ts
generated
vendored
Normal file
@ -0,0 +1,84 @@
|
||||
import type { Point } from '../types/geometric.js';
|
||||
/**
|
||||
* @alias Chart.helpers.math
|
||||
* @namespace
|
||||
*/
|
||||
export declare const PI: number;
|
||||
export declare const TAU: number;
|
||||
export declare const PITAU: number;
|
||||
export declare const INFINITY: number;
|
||||
export declare const RAD_PER_DEG: number;
|
||||
export declare const HALF_PI: number;
|
||||
export declare const QUARTER_PI: number;
|
||||
export declare const TWO_THIRDS_PI: number;
|
||||
export declare const log10: (x: number) => number;
|
||||
export declare const sign: (x: number) => number;
|
||||
export declare function almostEquals(x: number, y: number, epsilon: number): boolean;
|
||||
/**
|
||||
* Implementation of the nice number algorithm used in determining where axis labels will go
|
||||
*/
|
||||
export declare function niceNum(range: number): number;
|
||||
/**
|
||||
* Returns an array of factors sorted from 1 to sqrt(value)
|
||||
* @private
|
||||
*/
|
||||
export declare function _factorize(value: number): number[];
|
||||
export declare function isNumber(n: unknown): n is number;
|
||||
export declare function almostWhole(x: number, epsilon: number): boolean;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _setMinAndMaxByKey(array: Record<string, number>[], target: {
|
||||
min: number;
|
||||
max: number;
|
||||
}, property: string): void;
|
||||
export declare function toRadians(degrees: number): number;
|
||||
export declare function toDegrees(radians: number): number;
|
||||
/**
|
||||
* Returns the number of decimal places
|
||||
* i.e. the number of digits after the decimal point, of the value of this Number.
|
||||
* @param x - A number.
|
||||
* @returns The number of decimal places.
|
||||
* @private
|
||||
*/
|
||||
export declare function _decimalPlaces(x: number): number;
|
||||
export declare function getAngleFromPoint(centrePoint: Point, anglePoint: Point): {
|
||||
angle: number;
|
||||
distance: number;
|
||||
};
|
||||
export declare function distanceBetweenPoints(pt1: Point, pt2: Point): number;
|
||||
/**
|
||||
* Shortest distance between angles, in either direction.
|
||||
* @private
|
||||
*/
|
||||
export declare function _angleDiff(a: number, b: number): number;
|
||||
/**
|
||||
* Normalize angle to be between 0 and 2*PI
|
||||
* @private
|
||||
*/
|
||||
export declare function _normalizeAngle(a: number): number;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export declare function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean): boolean;
|
||||
/**
|
||||
* Limit `value` between `min` and `max`
|
||||
* @param value
|
||||
* @param min
|
||||
* @param max
|
||||
* @private
|
||||
*/
|
||||
export declare function _limitValue(value: number, min: number, max: number): number;
|
||||
/**
|
||||
* @param {number} value
|
||||
* @private
|
||||
*/
|
||||
export declare function _int16Range(value: number): number;
|
||||
/**
|
||||
* @param value
|
||||
* @param start
|
||||
* @param end
|
||||
* @param [epsilon]
|
||||
* @private
|
||||
*/
|
||||
export declare function _isBetween(value: number, start: number, end: number, epsilon?: number): boolean;
|
97
node_modules/chart.js/dist/helpers/helpers.options.d.ts
generated
vendored
Normal file
97
node_modules/chart.js/dist/helpers/helpers.options.d.ts
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
import type { ChartArea, FontSpec, Point } from '../types/index.js';
|
||||
import type { TRBL, TRBLCorners } from '../types/geometric.js';
|
||||
/**
|
||||
* @alias Chart.helpers.options
|
||||
* @namespace
|
||||
*/
|
||||
/**
|
||||
* Converts the given line height `value` in pixels for a specific font `size`.
|
||||
* @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').
|
||||
* @param size - The font size (in pixels) used to resolve relative `value`.
|
||||
* @returns The effective line height in pixels (size * 1.2 if value is invalid).
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function toLineHeight(value: number | string, size: number): number;
|
||||
/**
|
||||
* @param value
|
||||
* @param props
|
||||
*/
|
||||
export declare function _readValueToProps<K extends string>(value: number | Record<K, number>, props: K[]): Record<K, number>;
|
||||
export declare function _readValueToProps<K extends string, T extends string>(value: number | Record<K & T, number>, props: Record<T, K>): Record<T, number>;
|
||||
/**
|
||||
* Converts the given value into a TRBL object.
|
||||
* @param value - If a number, set the value to all TRBL component,
|
||||
* else, if an object, use defined properties and sets undefined ones to 0.
|
||||
* x / y are shorthands for same value for left/right and top/bottom.
|
||||
* @returns The padding values (top, right, bottom, left)
|
||||
* @since 3.0.0
|
||||
*/
|
||||
export declare function toTRBL(value: number | TRBL | Point): Record<"left" | "top" | "bottom" | "right", number>;
|
||||
/**
|
||||
* Converts the given value into a TRBL corners object (similar with css border-radius).
|
||||
* @param value - If a number, set the value to all TRBL corner components,
|
||||
* else, if an object, use defined properties and sets undefined ones to 0.
|
||||
* @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)
|
||||
* @since 3.0.0
|
||||
*/
|
||||
export declare function toTRBLCorners(value: number | TRBLCorners): Record<"topLeft" | "topRight" | "bottomLeft" | "bottomRight", number>;
|
||||
/**
|
||||
* Converts the given value into a padding object with pre-computed width/height.
|
||||
* @param value - If a number, set the value to all TRBL component,
|
||||
* else, if an object, use defined properties and sets undefined ones to 0.
|
||||
* x / y are shorthands for same value for left/right and top/bottom.
|
||||
* @returns The padding values (top, right, bottom, left, width, height)
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function toPadding(value?: number | TRBL): ChartArea;
|
||||
/**
|
||||
* Parses font options and returns the font object.
|
||||
* @param options - A object that contains font options to be parsed.
|
||||
* @param fallback - A object that contains fallback font options.
|
||||
* @return The font object.
|
||||
* @private
|
||||
*/
|
||||
export declare function toFont(options: Partial<FontSpec>, fallback?: Partial<FontSpec>): {
|
||||
family: string;
|
||||
lineHeight: number;
|
||||
size: number;
|
||||
style: "normal" | "inherit" | "italic" | "oblique" | "initial";
|
||||
weight: number | "bold" | "normal" | "lighter" | "bolder";
|
||||
string: string;
|
||||
};
|
||||
/**
|
||||
* Evaluates the given `inputs` sequentially and returns the first defined value.
|
||||
* @param inputs - An array of values, falling back to the last value.
|
||||
* @param context - If defined and the current value is a function, the value
|
||||
* is called with `context` as first argument and the result becomes the new input.
|
||||
* @param index - If defined and the current value is an array, the value
|
||||
* at `index` become the new input.
|
||||
* @param info - object to return information about resolution in
|
||||
* @param info.cacheable - Will be set to `false` if option is not cacheable.
|
||||
* @since 2.7.0
|
||||
*/
|
||||
export declare function resolve(inputs: Array<unknown>, context?: object, index?: number, info?: {
|
||||
cacheable: boolean;
|
||||
}): unknown;
|
||||
/**
|
||||
* @param minmax
|
||||
* @param grace
|
||||
* @param beginAtZero
|
||||
* @private
|
||||
*/
|
||||
export declare function _addGrace(minmax: {
|
||||
min: number;
|
||||
max: number;
|
||||
}, grace: number | string, beginAtZero: boolean): {
|
||||
min: number;
|
||||
max: number;
|
||||
};
|
||||
/**
|
||||
* Create a context inheriting parentContext
|
||||
* @param parentContext
|
||||
* @param context
|
||||
* @returns
|
||||
*/
|
||||
export declare function createContext<T extends object>(parentContext: null, context: T): T;
|
||||
export declare function createContext<T extends object, P extends T>(parentContext: P, context: T): P & T;
|
10
node_modules/chart.js/dist/helpers/helpers.rtl.d.ts
generated
vendored
Normal file
10
node_modules/chart.js/dist/helpers/helpers.rtl.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
export interface RTLAdapter {
|
||||
x(x: number): number;
|
||||
setWidth(w: number): void;
|
||||
textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';
|
||||
xPlus(x: number, value: number): number;
|
||||
leftForLtr(x: number, itemWidth: number): number;
|
||||
}
|
||||
export declare function getRtlAdapter(rtl: boolean, rectX: number, width: number): RTLAdapter;
|
||||
export declare function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl'): void;
|
||||
export declare function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]): void;
|
65
node_modules/chart.js/dist/helpers/helpers.segment.d.ts
generated
vendored
Normal file
65
node_modules/chart.js/dist/helpers/helpers.segment.d.ts
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Returns the sub-segment(s) of a line segment that fall in the given bounds
|
||||
* @param {object} segment
|
||||
* @param {number} segment.start - start index of the segment, referring the points array
|
||||
* @param {number} segment.end - end index of the segment, referring the points array
|
||||
* @param {boolean} segment.loop - indicates that the segment is a loop
|
||||
* @param {object} [segment.style] - segment style
|
||||
* @param {PointElement[]} points - the points that this segment refers to
|
||||
* @param {object} [bounds]
|
||||
* @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.
|
||||
* @param {number} bounds.start - start value of the property
|
||||
* @param {number} bounds.end - end value of the property
|
||||
* @private
|
||||
**/
|
||||
export function _boundSegment(segment: {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
style?: object;
|
||||
}, points: PointElement[], bounds?: {
|
||||
property: string;
|
||||
start: number;
|
||||
end: number;
|
||||
}): {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
style?: object;
|
||||
}[];
|
||||
/**
|
||||
* Returns the segments of the line that are inside given bounds
|
||||
* @param {LineElement} line
|
||||
* @param {object} [bounds]
|
||||
* @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.
|
||||
* @param {number} bounds.start - start value of the `property`
|
||||
* @param {number} bounds.end - end value of the `property`
|
||||
* @private
|
||||
*/
|
||||
export function _boundSegments(line: LineElement, bounds?: {
|
||||
property: string;
|
||||
start: number;
|
||||
end: number;
|
||||
}): {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
style?: object;
|
||||
}[];
|
||||
/**
|
||||
* Compute the continuous segments that define the whole line
|
||||
* There can be skipped points within a segment, if spanGaps is true.
|
||||
* @param {LineElement} line
|
||||
* @param {object} [segmentOptions]
|
||||
* @return {Segment[]}
|
||||
* @private
|
||||
*/
|
||||
export function _computeSegments(line: LineElement, segmentOptions?: object): Segment[];
|
||||
export type LineElement = import('../elements/element.line.js').default;
|
||||
export type PointElement = import('../elements/element.point.js').default;
|
||||
export type Segment = {
|
||||
start: number;
|
||||
end: number;
|
||||
loop: boolean;
|
||||
style?: any;
|
||||
};
|
16
node_modules/chart.js/dist/helpers/index.d.ts
generated
vendored
Normal file
16
node_modules/chart.js/dist/helpers/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
export * from './helpers.color.js';
|
||||
export * from './helpers.core.js';
|
||||
export * from './helpers.canvas.js';
|
||||
export * from './helpers.collection.js';
|
||||
export * from './helpers.config.js';
|
||||
export * from './helpers.curve.js';
|
||||
export * from './helpers.dom.js';
|
||||
export { default as easingEffects } from './helpers.easing.js';
|
||||
export * from './helpers.extras.js';
|
||||
export * from './helpers.interpolation.js';
|
||||
export * from './helpers.intl.js';
|
||||
export * from './helpers.options.js';
|
||||
export * from './helpers.math.js';
|
||||
export * from './helpers.rtl.js';
|
||||
export * from './helpers.segment.js';
|
||||
export * from './helpers.dataset.js';
|
Reference in New Issue
Block a user