declarations
Version:
[](https://www.npmjs.com/package/declarations)
815 lines (783 loc) • 220 kB
TypeScript
// Type definitions for nvd3 1.8.1
// Project: https://github.com/novus/nvd3
// Definitions by: Peter Mitchell <https://github.com/PjMitchell/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../d3/d3.d.ts" />
declare namespace nv {
//#region Core Interfaces
interface Margin {
left?: number,
right?: number,
top?: number,
bottom?: number
}
interface Size {
height: number;
width: number;
}
interface ArcsRadius {
inner: number;
outer: number;
}
interface Offset {
left?: number;
top?: number;
}
interface State {
dispatch: d3.Dispatch;
}
interface InteractiveLayer {
tooltip: Tooltip
}
interface SymbolMap {
set(name:string,func: (size: any)=>void): void
}
interface Utils {
/* Default color chooser uses a color scale of 20 colors from D3 https://github.com/mbostock/d3/wiki/Ordinal-Scales#categorical-colors */
defaultColor(): string[];
getColor(arg: any): string[];
/* Binds callback function to run when window is resized */
windowResize(listener: (ev: Event) => any): void;
/* Gets the browser window size */
windowSize(): Size;
state(): State;
symbolMap: SymbolMap;
}
interface ChartFactory<TChart extends Nvd3Element> {
generate: () => TChart;
callback?: (chart: TChart) => void;
}
interface Nvd3TooltipStatic {
show([left, top]: [number, number], content: string, gravity?: string): void; //todo sort out use on nv.tooltip.
cleanup(): void; //todo sort out use on nv.tooltip.
}
interface Nvd3Element {
dispatch: d3.Dispatch;
options(options: any): this;
update(): void;
(transition: d3.Transition<any[]>, ...args: any[]): any;
(selection: d3.Selection<any[]>, ...args: any[]): any;
(transition: d3.Transition<any>, ...args: any[]): any;
(selection: d3.Selection<any>, ...args: any[]): any;
}
interface Chart extends Nvd3Element {
state: State;
interactiveLayer: InteractiveLayer;
}
//#endregion
//#region Chart Component
interface Legend extends Nvd3Element {
align(): boolean;
align(value: boolean): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
expanded(): boolean;
expanded(value: boolean): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
key(): any;
key(value: any): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
/*Specifies how much spacing there is between legend items.*/
padding(): number;
/*Specifies how much spacing there is between legend items.*/
padding(value: number): this;
radioButtonMode(): boolean;
//If true, clicking legend items will cause it to behave like a radio button. (only one can be selected at
radioButtonMode(value: boolean): this;
rightAlign(): boolean;
rightAlign(value: boolean): this;
//If true, legend will update data.disabled and trigger a 'stateChange' dispatch.
updateState(): boolean;
//If true, legend will update data.disabled and trigger a 'stateChange' dispatch.
updateState(value: boolean): this;
//Options are "classic" and "furious"
vers(): string;
//Options are "classic" and "furious"
vers(value: string): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
}
interface Focus extends Nvd3Element {
color(value: string[]): this;
color(func: (d: any, i: number) => string): this;
width(): number;
width(value: number): this;
height(): number;
height(value: number): this;
margin(): Margin;
margin(value: Margin): this;
x(): (d: any) => any;
x(func: (d: any) => any): this;
y(): (d: any) => number;
y(func: (d: any) => number): this;
showXAxis(): boolean;
showXAxis(value: boolean): this;
showYAxis(): boolean;
showYAxis(value: boolean): this;
brushExtent(): [number, number] | [[number, number], [number, number]];
brushExtent(value: [number, number] | [[number, number], [number, number]]) : this;
duration(): number;
duration(value: number): this;
xTickFormat(): (d: any) => string;
xTickFormat(format: (t: any) => string): this;
xTickFormat(format: string): this;
xTickFormat(format: (d: any, i: any) => string): this;
yTickFormat(): (d: any) => string;
yTickFormat(format: (t: any) => string): this;
yTickFormat(format: string): this;
yTickFormat(format: (d: any, i: any) => string): this;
interpolate(): string;
interpolate(value: string): this;
rightAlignYAxis(): boolean;
rightAlignYAxis(value: boolean): this;
}
interface Nvd3Axis extends d3.svg.Axis {
axisLabel(): string;
axisLabel(value: string): this;
axisLabelDistance(): number;
axisLabelDistance(value: number): this;
domain(): number[];
domain(domain: number[]): this;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(): number;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(value: number): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
orient(): string;
orient(orientation: string): this;
range(): number[];
range(range: number[]): this;
rangeBand(): number;
rangeBands(interval: [number, number], padding?: number, outerPadding?: number): this;
/*Rotates the X axis labels by the specified degree.*/
rotateLabels(): number;
/*Rotates the X axis labels by the specified degree.*/
rotateLabels(range: number): this;
rotateYLabels(): number;
rotateYLabels(range: number): this;
scale(): any;
scale(scale: any): this;
showMaxMin(value: boolean): this;
staggerLabels(): boolean;
staggerLabels(value: boolean): this;
tickFormat(): (d: any) => string;
tickFormat(format: (t: any) => string): this;
tickFormat(format: string): this;
tickFormat(format: (d: any, i: any) => string): this;
tickPadding(): number;
tickPadding(padding: number): this;
tickSize(): number;
tickSize(size: number): this;
tickSize(inner: number, outer: number): this;
tickValues(): any[];
tickValues(values: any[]): this;
ticks(): any[];
ticks(...args: any[]): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
}
interface BoxPlot extends Nvd3Element {
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(): number;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(value: number): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
id(): any;
id(value: number|string): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
maxBoxWidth(): number;
maxBoxWidth(value: number): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(): (d: any) => any;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(func: (d: any) => any): this;
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(): number[];
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(value: number[]): this;
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(): number[];
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(value: number[]): this;
/* Override the default scale type for the X axis*/
xScale(): any;
/* Override the default scale type for the X axis*/
xScale(value: any): this;
y(): (d: any) => number;
/* Proxy function to return the y value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
y(func: (d: any) => number): this;
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(): number[];
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(value: number[]): this;
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(): number[];
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(value: number[]): this;
/* Override the default scale type for the y axis*/
yScale(): any;
/* Override the default scale type for the y axis*/
yScale(value: any): this;
}
interface Bullet extends Nvd3Element {
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
/*List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the xDomain option*/
forceX(): number[];
/*List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the xDomain option*/
forceX(value: number[]): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
markers(): (d: any) => any //todo;
markers(func: (d: any) => any): this //todo;
measures(): (d: any) => any //todo;
measures(func: (d: any) => any): this //todo;
orient(): string;
orient(orientation: string): this;
ranges(): (d: any) => any //todo;
ranges(func: (d: any) => any): this //todo;
tickFormat(): (d: any) => string;
tickFormat(format: (d: any) => string): this;
tickFormat(format: string): this;
tickFormat(format: (d: any, i: any) => string): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
}
interface CandlestickBar extends Nvd3Element {
/*If true, masks lines within the X and Y scales using a clip-path*/
clipEdge(): boolean;
/*If true, masks lines within the X and Y scales using a clip-path*/
clipEdge(value: boolean): this;
close(): (d: any) => number;
close(func: (d:any) => number): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
/*List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the xDomain option*/
forceX(): number[];
/*List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the xDomain option*/
forceX(value: number[]): this;
/*List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option*/
forceY(): number[];
/*List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option*/
forceY(value: number[]): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
high(): (d: any) => number;
high(func: (d: any) => number): this;
id(): any;
id(value: number|string): this;
/*A master flag for turning chart interaction on and off. This overrides all tooltip, voronoi, and guideline options.*/
interactive(): boolean;
/*A master flag for turning chart interaction on and off. This overrides all tooltip, voronoi, and guideline options.*/
interactive(value: boolean): this;
low(): (d: any) => number;
low(func: (d: any) => number): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
open(): (d: any) => number;
open(func: (d: any) => number): this;
padData(): boolean;
padData(value: boolean): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(): (d: any) => any;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(func: (d: any) => any): this;
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(): number[];
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(value: number[]): this;
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(): number[];
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(value: number[]): this;
/* Override the default scale type for the X axis*/
xScale(): any;
/* Override the default scale type for the X axis*/
xScale(value: any): this;
y(): (d: any) => number;
/* Proxy function to return the y value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
y(func: (d: any) => number): this;
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(): number[];
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(value: number[]): this;
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(): number[];
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(value: number[]): this;
/* Override the default scale type for the y axis*/
yScale(): any;
/* Override the default scale type for the y axis*/
yScale(value: any): this;
}
interface DiscreteBar extends Nvd3Element {
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(): number;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(value: number): this;
/* List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceY(): number[];
/* List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceY(value: number[]): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
id(): any;
id(value: number|string): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
rectClass(): string;
rectClass(value: string): this;
/*Prints the Y values on the top of the bars. Only recommended to use if there aren't many bars.*/
showValues(): boolean;
/*Prints the Y values on the top of the bars. Only recommended to use if there aren't many bars.*/
showValues(value: boolean): this;
/*D3 Format object for the label of pie/donut, discrete bar and multibar charts.*/
valueFormat(): string;
/*D3 Format object for the label of pie/donut, discrete bar and multibar charts.*/
valueFormat(value: string): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(): (d: any) => any;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(func: (d: any) => any): this;
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(): number[];
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(value: number[]): this;
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(): number[];
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(value: number[]): this;
/* Override the default scale type for the X axis*/
xScale(): any;
/* Override the default scale type for the X axis*/
xScale(value: any): this;
y(): (d: any) => number;
/* Proxy function to return the y value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
y(func: (d: any) => number): this;
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(): number[];
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(value: number[]): this;
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(): number[];
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(value: number[]): this;
/* Override the default scale type for the y axis*/
yScale(): any;
/* Override the default scale type for the y axis*/
yScale(value: any): this;
}
interface Distribution extends Nvd3Element {
axis(): string;
axis(value: 'x'): this;
axis(value: 'y'): this;
axis(value: string): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
domain(): number[];
domain(value: number[]): this;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(): number;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(value: number): this;
getData(func: (d: any) => number): this;
scale(): any;
scale(value: any): this;
size(): number;
size(value: number): this;
width(): number;
width(value: number): this;
}
interface HistoricalBar extends Nvd3Element {
/*If true, masks lines within the X and Y scales using a clip-path*/
clipEdge(): boolean;
/*If true, masks lines within the X and Y scales using a clip-path*/
clipEdge(value: boolean): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(): number;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(value: number): this;
/* List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceX(): number[];
/* List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceX(value: number[]): this;
/* List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceY(): number[];
/* List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceY(value: number[]): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
id(): any;
id(value: number|string): this;
/*A master flag for turning chart interaction on and off. This overrides all tooltip, voronoi, and guideline options.*/
interactive(): boolean;
/*A master flag for turning chart interaction on and off. This overrides all tooltip, voronoi, and guideline options.*/
interactive(value: boolean): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
/*.*/
padData(): boolean;
/**/
padData(value: boolean): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(): (d: any) => any;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(func: (d: any) => any): this;
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(): number[];
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(value: number[]): this;
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(): number[];
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(value: number[]): this;
/* Override the default scale type for the X axis*/
xScale(): any;
/* Override the default scale type for the X axis*/
xScale(value: any): this;
y(): (d: any) => number;
/* Proxy function to return the y value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
y(func: (d: any) => number): this;
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(): number[];
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(value: number[]): this;
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(): number[];
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(value: number[]): this;
/* Override the default scale type for the y axis*/
yScale(): any;
/* Override the default scale type for the y axis*/
yScale(value: any): this;
}
interface Line extends Scatter {
scatter: Scatter;
/*A provided function that allows a line to be non-continuous when not defined.*/
defined(): (d: any, i: number) => boolean;
/*A provided function that allows a line to be non-continuous when not defined.*/
defined(func: (d: any, i: number) => boolean): this;
/*controls the line interpolation between points, many options exist, see the D3 reference:*/
interpolate(): string;
/*controls the line interpolation between points, many options exist, see the D3 reference:*/
interpolate(value: string): this;
/*Function to define if a line is a normal line or if it fills in the area. Notice the default gets the value from the line's definition in data. If a non-function is given, it the value is used for all lines.*/
isArea(): (d: any) => boolean;
/*Function to define if a line is a normal line or if it fills in the area. Notice the default gets the value from the line's definition in data. If a non-function is given, it the value is used for all lines.*/
isArea(value: boolean): this;
/*Function to define if a line is a normal line or if it fills in the area. Notice the default gets the value from the line's definition in data. If a non-function is given, it the value is used for all lines.*/
isArea(func: (d: any) => boolean): this;
}
interface MultiBar extends Nvd3Element {
/*this option lets you specific a color for each bar group to have the same color but differentiated by shading.*/
barColor(value: string[]): this;
/*this option lets you specific a color for each bar group to have the same color but differentiated by shading.*/
barColor(func: (d: any, i: number) => string): this;
/*If true, masks lines within the X and Y scales using a clip-path*/
clipEdge(): boolean;
/*If true, masks lines within the X and Y scales using a clip-path*/
clipEdge(value: boolean): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
/**/
disabled(): boolean[];
/**/
disabled(value: boolean[]): this;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(): number;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(value: number): this;
/* List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceY(): number[];
/* List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceY(value: number[]): this;
/*The padding between bar groups, this is passed as the padding attribute of rangeBands*/
groupSpacing(): number;
/*The padding between bar groups, this is passed as the padding attribute of rangeBands*/
groupSpacing(value: number): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
/*.*/
hideable(): boolean;
/**/
hideable(value: boolean): this;
id(): any;
id(value: number|string): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
/*.*/
stacked(): boolean;
/**/
stacked(value: boolean): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: 'silhouette'): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: 'wiggle'): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: 'expand'): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: 'zero'): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: string): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: (data: Array<[number, number]>) => number[]): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(): (d: any) => any;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(func: (d: any) => any): this;
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(): number[];
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(value: number[]): this;
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(): number[];
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(value: number[]): this;
/* Override the default scale type for the X axis*/
xScale(): any;
/* Override the default scale type for the X axis*/
xScale(value: any): this;
y(): (d: any) => number;
/* Proxy function to return the y value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
y(func: (d: any) => number): this;
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(): number[];
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(value: number[]): this;
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(): number[];
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(value: number[]): this;
/* Override the default scale type for the y axis*/
yScale(): any;
/* Override the default scale type for the y axis*/
yScale(value: any): this;
}
interface MultiBarHorizontal extends Nvd3Element {
/*this option lets you specific a color for each bar group to have the same color but differentiated by shading.*/
barColor(value: string[]): this;
/*this option lets you specific a color for each bar group to have the same color but differentiated by shading.*/
barColor(func: (d: any, i: number) => string): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
/**/
disabled(): boolean[];
/**/
disabled(value: boolean[]): this;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(): number;
/*Duration in ms to take when updating chart. For things like bar charts, each bar can animate by itself but the total time taken should be this value.*/
duration(value: number): this;
/* List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceY(): number[];
/* List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the Y domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option.*/
forceY(value: number[]): this;
/*The padding between bar groups, this is passed as the padding attribute of rangeBands*/
groupSpacing(): number;
/*The padding between bar groups, this is passed as the padding attribute of rangeBands*/
groupSpacing(value: number): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
id(): any;
id(value: number|string): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(value: Margin): this;
/*Prints the Y values on the top of the bars. Only recommended to use if there aren't many bars.*/
showValues(): boolean;
/*Prints the Y values on the top of the bars. Only recommended to use if there aren't many bars.*/
showValues(value: boolean): this;
/*.*/
stacked(): boolean;
/**/
stacked(value: boolean): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: 'silhouette'): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: 'wiggle'): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: 'expand'): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: 'zero'): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: string): this;
/* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/
stackOffset(offset: (data: Array<[number, number]>) => number[]): this;
/*D3 Format object for the label of pie/donut, discrete bar and multibar charts.*/
valueFormat(): string;
/*D3 Format object for the label of pie/donut, discrete bar and multibar charts.*/
valueFormat(value: string): this;
/*.*/
valuePadding(): number;
/**/
valuePadding(value: number): this;
/* The width the graph or component created inside the SVG should be made*/
width(): number;
/*The width the graph or component created inside the SVG should be made.*/
width(value: number): this;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(): (d: any) => any;
/* Proxy function to return the X value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
x(func: (d: any) => any): this;
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(): number[];
/* Defines the whole X scale's domain. Using this will disable calculating the domain based on the data.*/
xDomain(value: number[]): this;
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(): number[];
/* Override the X scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
xRange(value: number[]): this;
/* Override the default scale type for the X axis*/
xScale(): any;
/* Override the default scale type for the X axis*/
xScale(value: any): this;
y(): (d: any) => number;
/* Proxy function to return the y value so adjustments can be made if needed. For pie/donut chart this returns the key for the slice.*/
y(func: (d: any) => number): this;
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(): number[];
/* Defines the whole y scale's domain. Using this will disable calculating the domain based on the data.*/
yDomain(value: number[]): this;
/**/
yErr(): (d: any, i: number) => number|number[];
/**/
yErr(func: (d: any, i: number) => number | number[]): this;
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(): number[];
/* Override the y scale's range. Using this will disable calculating the range based on the data and chart width/height.*/
yRange(value: number[]): this;
/* Override the default scale type for the y axis*/
yScale(): any;
/* Override the default scale type for the y axis*/
yScale(value: any): this;
}
interface OhlcBar extends Nvd3Element {
/*If true, masks lines within the X and Y scales using a clip-path*/
clipEdge(): boolean;
/*If true, masks lines within the X and Y scales using a clip-path*/
clipEdge(value: boolean): this;
close(): (d: any) => number;
close(func: (d: any) => number): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(value: string[]): this;
/*Colors to use for the different data. If an array is given, it is converted to a function automatically.*/
color(func: (d: any, i: number) => string): this;
/*List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the xDomain option*/
forceX(): number[];
/*List of numbers to Force into the X scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the xDomain option*/
forceX(value: number[]): this;
/*List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option*/
forceY(): number[];
/*List of numbers to Force into the Y scale (ie. 0, or a max / min, etc.). This ensures the numbers are in the X domain but doesn't override the whole domain. This option only applies if you have not overridden the whole domain with the yDomain option*/
forceY(value: number[]): this;
/*The height the graph or component created inside the SVG should be made*/
height(): number;
/*The height the graph or component created inside the SVG should be made.*/
height(value: number): this;
high(): (d: any) => number;
high(func: (d: any) => number): this;
id(): any;
id(value: number|string): this;
/*A master flag for turning chart interaction on and off. This overrides all tooltip, voronoi, and guideline options.*/
interactive(): boolean;
/*A master flag for turning chart interaction on and off. This overrides all tooltip, voronoi, and guideline options.*/
interactive(value: boolean): this;
low(): (d: any) => number;
low(func: (d: any) => number): this;
/*Object containing the margins for the chart or component. You can specify only certain margins in the object to change just those parts.*/
margin(): Margin;
/*Object containing the margins fo