Socket
Socket
Sign inDemoInstall

@types/chart.js

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/chart.js - npm Package Compare versions

Comparing version 2.4.4 to 2.4.5

215

chart.js/index.d.ts

@@ -1,4 +0,5 @@

// Type definitions for Chart.js 2.4.0
// Type definitions for Chart.js 2.4
// Project: https://github.com/nnnick/Chart.js
// Definitions by: Alberto Nuti <https://github.com/anuti>
// Fabien Lavocat <https://github.com/FabienLavocat>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

@@ -26,4 +27,4 @@ // TypeScript Version: 2.3

getElementAtEvent: (e: any) => {};
getElementsAtEvent: (e: any) => {}[];
getDatasetAtEvent: (e: any) => {}[];
getElementsAtEvent: (e: any) => Array<{}>;
getDatasetAtEvent: (e: any) => Array<{}>;
static pluginService: PluginServiceStatic;

@@ -33,3 +34,3 @@

global: Chart.ChartOptions;
}
};
}

@@ -40,33 +41,33 @@ declare class PluginServiceStatic {

declare interface PluginServiceRegistrationOptions {
beforeInit?: (chartInstance: Chart) => void,
afterInit?: (chartInstance: Chart) => void,
interface PluginServiceRegistrationOptions {
beforeInit?(chartInstance: Chart): void;
afterInit?(chartInstance: Chart): void;
resize?: (chartInstance: Chart, newChartSize: Size) => void,
resize?(chartInstance: Chart, newChartSize: Size): void;
beforeUpdate?: (chartInstance: Chart) => void,
afterScaleUpdate?: (chartInstance: Chart) => void,
beforeDatasetsUpdate?: (chartInstance: Chart) => void,
afterDatasetsUpdate?: (chartInstance: Chart) => void,
afterUpdate?: (chartInstance: Chart) => void,
beforeUpdate?(chartInstance: Chart): void;
afterScaleUpdate?(chartInstance: Chart): void;
beforeDatasetsUpdate?(chartInstance: Chart): void;
afterDatasetsUpdate?(chartInstance: Chart): void;
afterUpdate?(chartInstance: Chart): void;
// This is called at the start of a render. It is only called once, even if the animation will run for a number of frames. Use beforeDraw or afterDraw
// to do something on each animation frame
beforeRender?: (chartInstance: Chart) => void,
beforeRender?(chartInstance: Chart): void;
// Easing is for animation
beforeDraw?: (chartInstance: Chart, easing: string) => void,
afterDraw?: (chartInstance: Chart, easing: string) => void,
beforeDraw?(chartInstance: Chart, easing: string): void;
afterDraw?(chartInstance: Chart, easing: string): void;
// Before the datasets are drawn but after scales are drawn
beforeDatasetsDraw?: (chartInstance: Chart, easing: string) => void,
afterDatasetsDraw?: (chartInstance: Chart, easing: string) => void,
beforeDatasetsDraw?(chartInstance: Chart, easing: string): void;
afterDatasetsDraw?(chartInstance: Chart, easing: string): void;
destroy?: (chartInstance: Chart) => void,
destroy?(chartInstance: Chart): void;
// Called when an event occurs on the chart
beforeEvent?: (chartInstance: Chart, event: Event) => void,
afterEvent?: (chartInstance: Chart, event: Event) => void
beforeEvent?(chartInstance: Chart, event: Event): void;
afterEvent?(chartInstance: Chart, event: Event): void;
}
declare interface Size {
interface Size {
height: number;

@@ -77,11 +78,11 @@ width: number;

declare namespace Chart {
export type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble';
type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble';
export type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
export type ScaleType = 'category' | 'linear' | 'logarithmic' | 'time' | 'radialLinear';
type ScaleType = 'category' | 'linear' | 'logarithmic' | 'time' | 'radialLinear';
export type PositionType = 'left' | 'right' | 'top' | 'bottom';
type PositionType = 'left' | 'right' | 'top' | 'bottom';
export interface ChartLegendItem {
interface ChartLegendItem {
text?: string;

@@ -98,3 +99,3 @@ fillStyle?: string;

export interface ChartTooltipItem {
interface ChartTooltipItem {
xLabel?: string;

@@ -106,17 +107,17 @@ yLabel?: string;

export interface ChartTooltipCallback {
beforeTitle?: (item?: ChartTooltipItem[], data?: any) => void;
title?: (item?: ChartTooltipItem[], data?: any) => void;
afterTitle?: (item?: ChartTooltipItem[], data?: any) => void;
beforeBody?: (item?: ChartTooltipItem[], data?: any) => void;
beforeLabel?: (tooltipItem?: ChartTooltipItem, data?: any) => void;
label?: (tooltipItem?: ChartTooltipItem, data?: any) => void;
afterLabel?: (tooltipItem?: ChartTooltipItem, data?: any) => void;
afterBody?: (item?: ChartTooltipItem[], data?: any) => void;
beforeFooter?: (item?: ChartTooltipItem[], data?: any) => void;
footer?: (item?: ChartTooltipItem[], data?: any) => void;
afterFooter?: (item?: ChartTooltipItem[], data?: any) => void;
interface ChartTooltipCallback {
beforeTitle?(item?: ChartTooltipItem[], data?: any): void;
title?(item?: ChartTooltipItem[], data?: any): void;
afterTitle?(item?: ChartTooltipItem[], data?: any): void;
beforeBody?(item?: ChartTooltipItem[], data?: any): void;
beforeLabel?(tooltipItem?: ChartTooltipItem, data?: any): void;
label?(tooltipItem?: ChartTooltipItem, data?: any): void;
afterLabel?(tooltipItem?: ChartTooltipItem, data?: any): void;
afterBody?(item?: ChartTooltipItem[], data?: any): void;
beforeFooter?(item?: ChartTooltipItem[], data?: any): void;
footer?(item?: ChartTooltipItem[], data?: any): void;
afterFooter?(item?: ChartTooltipItem[], data?: any): void;
}
export interface ChartAnimationParameter {
interface ChartAnimationParameter {
chartInstance?: any;

@@ -126,3 +127,3 @@ animationObject?: any;

export interface ChartPoint {
interface ChartPoint {
x?: number | string | Date;

@@ -132,3 +133,3 @@ y?: number;

export interface ChartConfiguration {
interface ChartConfiguration {
type?: ChartType | string;

@@ -139,7 +140,3 @@ data?: ChartData;

export interface ChartData {
}
export interface LinearChartData extends ChartData {
interface ChartData {
labels?: string[];

@@ -149,3 +146,3 @@ datasets?: ChartDataSets[];

export interface ChartOptions {
interface ChartOptions {
responsive?: boolean;

@@ -155,3 +152,3 @@ responsiveAnimationDuration?: number;

events?: string[];
onClick?: (any?: any) => any;
onClick?(any?: any): any;
title?: ChartTitleOptions;

@@ -167,3 +164,3 @@ legend?: ChartLegendOptions;

export interface ChartFontOptions {
interface ChartFontOptions {
defaultFontColor?: ChartColor;

@@ -175,3 +172,3 @@ defaultFontFamily?: string;

export interface ChartTitleOptions {
interface ChartTitleOptions {
display?: boolean;

@@ -188,11 +185,11 @@ position?: string;

export interface ChartLegendOptions {
interface ChartLegendOptions {
display?: boolean;
position?: string;
fullWidth?: boolean;
onClick?: (event: any, legendItem: any) => void;
onClick?(event: any, legendItem: any): void;
labels?: ChartLegendLabelOptions;
}
export interface ChartLegendLabelOptions {
interface ChartLegendLabelOptions {
boxWidth?: number;

@@ -204,8 +201,8 @@ fontSize?: number;

padding?: number;
generateLabels?: (chart: any) => any;
generateLabels?(chart: any): any;
}
export interface ChartTooltipOptions {
interface ChartTooltipOptions {
enabled?: boolean;
custom?: (a: any) => void;
custom?(a: any): void;
mode?: string;

@@ -238,25 +235,25 @@ backgroundColor?: ChartColor;

export interface ChartHoverOptions {
interface ChartHoverOptions {
mode?: string;
animationDuration?: number;
onHover?: (active: any) => void;
onHover?(active: any): void;
}
export interface ChartAnimationObject {
interface ChartAnimationObject {
currentStep?: number;
numSteps?: number;
easing?: string;
render?: (arg: any) => void;
onAnimationProgress?: (arg: any) => void;
onAnimationComplete?: (arg: any) => void;
render?(arg: any): void;
onAnimationProgress?(arg: any): void;
onAnimationComplete?(arg: any): void;
}
export interface ChartAnimationOptions {
interface ChartAnimationOptions {
duration?: number;
easing?: string;
onProgress?: (chart: any) => void;
onComplete?: (chart: any) => void;
onProgress?(chart: any): void;
onComplete?(chart: any): void;
}
export interface ChartElementsOptions {
interface ChartElementsOptions {
point?: ChartPointOptions;

@@ -268,3 +265,3 @@ line?: ChartLineOptions;

export interface ChartArcOptions {
interface ChartArcOptions {
backgroundColor?: ChartColor;

@@ -275,3 +272,3 @@ borderColor?: ChartColor;

export interface ChartLineOptions {
interface ChartLineOptions {
tension?: number;

@@ -285,5 +282,8 @@ backgroundColor?: ChartColor;

borderJoinStyle?: string;
capBezierPoints?: boolean;
fill?: 'zero' | 'top' | 'bottom' | boolean;
stepped?: boolean;
}
export interface ChartPointOptions {
interface ChartPointOptions {
radius?: number;

@@ -299,3 +299,3 @@ pointStyle?: string;

export interface ChartRectangleOptions {
interface ChartRectangleOptions {
backgroundColor?: ChartColor;

@@ -306,3 +306,3 @@ borderWidth?: number;

}
export interface GridLineOptions {
interface GridLineOptions {
display?: boolean;

@@ -320,3 +320,3 @@ color?: ChartColor;

export interface ScaleTitleOptions {
interface ScaleTitleOptions {
display?: boolean;

@@ -330,5 +330,5 @@ labelString?: string;

export interface TickOptions {
interface TickOptions {
autoSkip?: boolean;
callback?: (value: any, index: any, values: any) => string;
callback?(value: any, index: any, values: any): string;
display?: boolean;

@@ -348,3 +348,3 @@ fontColor?: ChartColor;

}
export interface AngleLineOptions {
interface AngleLineOptions {
display?: boolean;

@@ -355,4 +355,4 @@ color?: ChartColor;

export interface PointLabelOptions {
callback?: (arg: any) => any;
interface PointLabelOptions {
callback?(arg: any): any;
fontColor?: ChartColor;

@@ -364,3 +364,3 @@ fontFamily?: string;

export interface TickOptions {
interface TickOptions {
backdropColor?: ChartColor;

@@ -372,3 +372,3 @@ backdropPaddingX?: number;

}
export interface LinearTickOptions extends TickOptions {
interface LinearTickOptions extends TickOptions {
beginAtZero?: boolean;

@@ -383,3 +383,3 @@ min?: number;

export interface LogarithmicTickOptions extends TickOptions {
interface LogarithmicTickOptions extends TickOptions {
min?: number;

@@ -391,4 +391,4 @@ max?: number;

export interface ChartDataSets {
backgroundColor?: ChartColor;
interface ChartDataSets {
backgroundColor?: ChartColor | ChartColor[];
borderWidth?: number;

@@ -418,20 +418,20 @@ borderColor?: ChartColor;

export interface ChartScales {
interface ChartScales {
type?: ScaleType | string;
display?: boolean;
position?: PositionType | string;
beforeUpdate?: (scale?: any) => void;
beforeSetDimension?: (scale?: any) => void;
beforeDataLimits?: (scale?: any) => void;
beforeBuildTicks?: (scale?: any) => void;
beforeTickToLabelConversion?: (scale?: any) => void;
beforeCalculateTickRotation?: (scale?: any) => void;
beforeFit?: (scale?: any) => void;
afterUpdate?: (scale?: any) => void;
afterSetDimension?: (scale?: any) => void;
afterDataLimits?: (scale?: any) => void;
afterBuildTicks?: (scale?: any) => void;
afterTickToLabelConversion?: (scale?: any) => void;
afterCalculateTickRotation?: (scale?: any) => void;
afterFit?: (scale?: any) => void;
beforeUpdate?(scale?: any): void;
beforeSetDimension?(scale?: any): void;
beforeDataLimits?(scale?: any): void;
beforeBuildTicks?(scale?: any): void;
beforeTickToLabelConversion?(scale?: any): void;
beforeCalculateTickRotation?(scale?: any): void;
beforeFit?(scale?: any): void;
afterUpdate?(scale?: any): void;
afterSetDimension?(scale?: any): void;
afterDataLimits?(scale?: any): void;
afterBuildTicks?(scale?: any): void;
afterTickToLabelConversion?(scale?: any): void;
afterCalculateTickRotation?(scale?: any): void;
afterFit?(scale?: any): void;
gridLines?: GridLineOptions;

@@ -444,3 +444,3 @@ scaleLabel?: ScaleTitleOptions;

export interface CommonAxe {
interface CommonAxe {
type?: ScaleType | string;

@@ -457,3 +457,3 @@ display?: boolean;

export interface ChartXAxe extends CommonAxe {
interface ChartXAxe extends CommonAxe {
categoryPercentage?: number;

@@ -464,14 +464,15 @@ barPercentage?: number;

export interface ChartYAxe extends CommonAxe {
// tslint:disable-next-line no-empty-interface
interface ChartYAxe extends CommonAxe {
}
export interface LinearScale extends ChartScales {
interface LinearScale extends ChartScales {
ticks?: LinearTickOptions;
}
export interface LogarithmicScale extends ChartScales {
interface LogarithmicScale extends ChartScales {
ticks?: LogarithmicTickOptions;
}
export interface TimeDisplayFormat {
interface TimeDisplayFormat {
millisecond?: string;

@@ -488,3 +489,3 @@ second?: string;

export interface TimeScale extends ChartScales {
interface TimeScale extends ChartScales {
displayFormats?: TimeDisplayFormat;

@@ -502,3 +503,3 @@ isoWeekday?: boolean;

export interface RadialLinearScale {
interface RadialLinearScale {
lineArc?: boolean;

@@ -505,0 +506,0 @@ angleLines?: AngleLineOptions;

{
"name": "@types/chart.js",
"version": "2.4.4",
"version": "2.4.5",
"description": "TypeScript definitions for Chart.js",

@@ -10,2 +10,6 @@ "license": "MIT",

"url": "https://github.com/anuti"
},
{
"name": "Fabien Lavocat",
"url": "https://github.com/FabienLavocat"
}

@@ -23,4 +27,4 @@ ],

"peerDependencies": {},
"typesPublisherContentHash": "57a92ce7c22d77d36327d898744344db2b07ec77125a589b4ca883c50cac359c",
"typesPublisherContentHash": "52f1fbf25e3910544b8c06219478b3bc5c7f3dfe00e1842854aec01f0cdc6759",
"typeScriptVersion": "2.3"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Thu, 15 Jun 2017 20:12:14 GMT
* Last updated: Fri, 16 Jun 2017 16:37:50 GMT
* Dependencies: jquery

@@ -17,2 +17,2 @@ * Global values: Chart

# Credits
These definitions were written by Alberto Nuti <https://github.com/anuti>.
These definitions were written by Alberto Nuti <https://github.com/anuti>, Fabien Lavocat <https://github.com/FabienLavocat>.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc