victory-core
Advanced tools
Comparing version 34.1.3 to 34.2.0
@@ -1,12 +0,1 @@ | ||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov> | ||
// snerks <https://github.com/snerks> | ||
// Krzysztof Cebula <https://github.com/Havret> | ||
// Vitaliy Polyanskiy <https://github.com/alreadyExisted> | ||
// James Lismore <https://github.com/jlismore> | ||
// Stack Builders <https://github.com/stackbuilders> | ||
// Esteban Ibarra <https://github.com/ibarrae> | ||
// Dominic Lee <https://github.com/dominictwlee> | ||
// Dave Vedder <https://github.com/veddermatic> | ||
// Alec Flett <https://github.com/alecf> | ||
import * as React from "react"; | ||
@@ -71,2 +60,3 @@ | ||
| "plus" | ||
| "minus" | ||
| "square" | ||
@@ -119,3 +109,5 @@ | "star" | ||
export type CursorData = { | ||
export type StringOrNumberOrList = string | number | (string | number)[]; | ||
export type CoordinatesPropType = { | ||
x: number; | ||
@@ -137,2 +129,4 @@ y: number; | ||
// #endregion | ||
// #region Victory Animation | ||
@@ -153,2 +147,45 @@ | ||
// #region Victory Axis props | ||
export type TickLabelProps = React.CSSProperties & { | ||
angle?: number; | ||
verticalAnchor?: VerticalAnchorType; | ||
}; | ||
export interface VictoryAxisCommonProps { | ||
axisComponent?: React.ReactElement; | ||
axisLabelComponent?: React.ReactElement; | ||
axisValue?: number | string | object | Date; | ||
dependentAxis?: boolean; | ||
gridComponent?: React.ReactElement; | ||
invertAxis?: boolean; | ||
style?: { | ||
parent?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
axis?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
axisLabel?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
grid?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
ticks?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
tickLabels?: { | ||
[K in keyof TickLabelProps]: string | number | ((tick?: any) => string | number) | ||
}; | ||
}; | ||
tickComponent?: React.ReactElement; | ||
tickCount?: number; | ||
tickLabelComponent?: React.ReactElement; | ||
tickFormat?: any[] | { (tick: any, index: number, ticks: any[]): string | number }; | ||
tickValues?: any[]; | ||
} | ||
// #endregion | ||
// #region Victory Label | ||
@@ -158,2 +195,4 @@ | ||
export type VerticalAnchorType = "start" | "middle" | "end"; | ||
export type OriginType = { x: number; y: number }; | ||
export type LabelOrientationType = "parallel" | "perpendicular" | "vertical"; | ||
@@ -168,5 +207,5 @@ export interface VictoryLabelProps { | ||
children?: StringOrNumberOrCallback; | ||
labelPlacement?: "parallel" | "perpendicular" | "vertical"; | ||
labelPlacement?: LabelOrientationType; | ||
lineHeight?: StringOrNumberOrCallback; | ||
origin?: { x: number; y: number }; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -192,9 +231,19 @@ renderInPortal?: boolean; | ||
export interface VictoryContainerProps { | ||
children?: React.ReactElement | React.ReactElement[]; | ||
className?: string; | ||
containerId?: number | string; | ||
desc?: string; | ||
events?: React.DOMAttributes<any>; | ||
height?: number; | ||
name?: string; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
portalComponent?: React.ReactElement; | ||
portalZIndex?: number; | ||
responsive?: boolean; | ||
style?: React.CSSProperties; | ||
height?: number; | ||
tabIndex?: number; | ||
theme?: VictoryThemeDefinition; | ||
title?: string; | ||
width?: number; | ||
events?: React.DOMAttributes<any>; | ||
title?: string; | ||
desc?: string; | ||
} | ||
@@ -219,6 +268,3 @@ | ||
groupComponent?: React.ReactElement; | ||
origin?: { | ||
x?: number; | ||
y?: number; | ||
}; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -403,10 +449,11 @@ radius?: number; | ||
export interface EventCallbackInterface<TTarget, TEventKey> { | ||
childName?: string; | ||
childName?: string | string[]; | ||
target?: TTarget; | ||
eventKey?: TEventKey; | ||
mutation: (props: any) => any; | ||
callback?: (props: any) => any; | ||
} | ||
export interface EventPropTypeInterface<TTarget, TEventKey> { | ||
childName?: string; | ||
childName?: string | Array<StringOrNumberOrCallback>; | ||
target: TTarget; | ||
@@ -426,14 +473,18 @@ eventKey?: TEventKey; | ||
export type DomainTuple = [number, number] | [Date, Date]; | ||
export type DomainPropType = | ||
| DomainTuple | ||
export type DomainPropObjectType = | ||
| { x?: DomainTuple; y: DomainTuple } | ||
| { x: DomainTuple; y?: DomainTuple }; | ||
export type DomainPropType = DomainPropObjectType | DomainTuple; | ||
export type PaddingType = number | [number, number]; | ||
export type DomainPaddingPropType = | ||
| number | ||
| PaddingType | ||
| { | ||
x?: number | [number, number]; | ||
y?: number | [number, number]; | ||
x?: PaddingType; | ||
y?: PaddingType; | ||
}; | ||
export type RangeTuple = [number, number]; | ||
export type RangePropType = RangeTuple | { x?: RangeTuple; y?: RangeTuple }; | ||
/** | ||
@@ -464,3 +515,4 @@ * D3 scale function shape. Don"t want to introduce typing dependency to d3 | ||
| string[] | ||
| { (data: any): number | string | string[] }; | ||
| { (data: any): number | string | string[] } | ||
| Function; | ||
@@ -499,5 +551,12 @@ export type InterpolationPropType = | ||
export type SortOrderPropType = "ascending" | "descending"; | ||
export type SVGCoordinateType = { x: number; y: number }; | ||
export interface VictoryCommonProps { | ||
animate?: boolean | AnimatePropTypeInterface; | ||
name?: string; | ||
containerComponent?: React.ReactElement; | ||
domainPadding?: DomainPaddingPropType; | ||
externalEventMutations?: EventCallbackInterface<string | string[], StringOrNumberOrList>[]; | ||
groupComponent?: React.ReactElement; | ||
height?: number; | ||
@@ -507,3 +566,7 @@ horizontal?: boolean; | ||
minDomain?: number | { x?: number; y?: number }; | ||
name?: string; | ||
origin?: OriginType; | ||
padding?: PaddingProps; | ||
polar?: boolean; | ||
range?: RangePropType; | ||
scale?: | ||
@@ -516,8 +579,7 @@ | ScalePropType | ||
}; | ||
sharedEvents?: { events: any[]; getEventState: Function }; | ||
singleQuadrantDomainPadding?: boolean | { x?: boolean; y?: boolean }; | ||
standalone?: boolean; | ||
width?: number; | ||
containerComponent?: React.ReactElement; | ||
theme?: VictoryThemeDefinition; | ||
groupComponent?: React.ReactElement; | ||
} | ||
@@ -534,6 +596,3 @@ | ||
index?: number | string; | ||
origin?: { | ||
x: number; | ||
y: number; | ||
}; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -553,2 +612,6 @@ role?: string; | ||
domain?: DomainPropType; | ||
domainPadding?: DomainPaddingPropType; | ||
samples?: number; | ||
sortKey?: DataGetterPropType; | ||
sortOrder?: SortOrderPropType; | ||
x?: DataGetterPropType; | ||
@@ -559,14 +622,44 @@ y?: DataGetterPropType; | ||
export interface VictoryLabableProps { | ||
export interface VictoryLabelableProps { | ||
labelComponent?: React.ReactElement; | ||
} | ||
export interface VictoryMultiLabeableProps extends VictoryLabableProps { | ||
labels?: string[] | { (data: any): string | null }; | ||
export interface VictoryMultiLabelableProps extends VictoryLabelableProps { | ||
labels?: string[] | number[] | { (data: any): string | number | null }; | ||
} | ||
export interface VictorySingleLabableProps extends VictoryLabableProps { | ||
label?: string | { (data: any): string }; | ||
export interface VictorySingleLabelableProps extends VictoryLabelableProps { | ||
label?: string | { (data: any): string | number | null }; | ||
} | ||
export namespace Selection { | ||
export function getParentSVG(evt: React.SyntheticEvent): string; | ||
export function getSVGEventCoordinates( | ||
evt: React.SyntheticEvent, | ||
svg?: SVGElement | ||
): SVGCoordinateType; | ||
export function getDomainCoordinates(props: any, domain?: DomainPropType): DomainPropType; | ||
export function getDataCoordinates( | ||
props: any, | ||
scale: ScalePropType, | ||
x: number, | ||
y: number | ||
): SVGCoordinateType; | ||
export function getBounds(props: any): SVGCoordinateType; | ||
} | ||
export interface TextSizeStyleInterface { | ||
angle?: number; | ||
characterConstant?: string; | ||
fontFamily?: string; | ||
fontSize?: number | string; | ||
letterSpacing?: string; | ||
lineHeight?: number; | ||
} | ||
export namespace TextSize { | ||
export function approximateTextSize(text: string, style: TextSizeStyleInterface): number; | ||
export function convertLengthToPixels(length: string, fontSize: number): number; | ||
} | ||
// #endregion | ||
@@ -592,12 +685,3 @@ | ||
size?: number | Function; | ||
symbol?: | ||
| "circle" | ||
| "diamond" | ||
| "plus" | ||
| "minus" | ||
| "square" | ||
| "star" | ||
| "triangleDown" | ||
| "triangleUp" | ||
| Function; | ||
symbol?: ScatterSymbolType | Function; | ||
x?: number; | ||
@@ -604,0 +688,0 @@ y?: number; |
@@ -1,12 +0,1 @@ | ||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov> | ||
// snerks <https://github.com/snerks> | ||
// Krzysztof Cebula <https://github.com/Havret> | ||
// Vitaliy Polyanskiy <https://github.com/alreadyExisted> | ||
// James Lismore <https://github.com/jlismore> | ||
// Stack Builders <https://github.com/stackbuilders> | ||
// Esteban Ibarra <https://github.com/ibarrae> | ||
// Dominic Lee <https://github.com/dominictwlee> | ||
// Dave Vedder <https://github.com/veddermatic> | ||
// Alec Flett <https://github.com/alecf> | ||
import * as React from "react"; | ||
@@ -71,2 +60,3 @@ | ||
| "plus" | ||
| "minus" | ||
| "square" | ||
@@ -119,3 +109,5 @@ | "star" | ||
export type CursorData = { | ||
export type StringOrNumberOrList = string | number | (string | number)[]; | ||
export type CoordinatesPropType = { | ||
x: number; | ||
@@ -137,2 +129,4 @@ y: number; | ||
// #endregion | ||
// #region Victory Animation | ||
@@ -153,2 +147,45 @@ | ||
// #region Victory Axis props | ||
export type TickLabelProps = React.CSSProperties & { | ||
angle?: number; | ||
verticalAnchor?: VerticalAnchorType; | ||
}; | ||
export interface VictoryAxisCommonProps { | ||
axisComponent?: React.ReactElement; | ||
axisLabelComponent?: React.ReactElement; | ||
axisValue?: number | string | object | Date; | ||
dependentAxis?: boolean; | ||
gridComponent?: React.ReactElement; | ||
invertAxis?: boolean; | ||
style?: { | ||
parent?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
axis?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
axisLabel?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
grid?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
ticks?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
tickLabels?: { | ||
[K in keyof TickLabelProps]: string | number | ((tick?: any) => string | number) | ||
}; | ||
}; | ||
tickComponent?: React.ReactElement; | ||
tickCount?: number; | ||
tickLabelComponent?: React.ReactElement; | ||
tickFormat?: any[] | { (tick: any, index: number, ticks: any[]): string | number }; | ||
tickValues?: any[]; | ||
} | ||
// #endregion | ||
// #region Victory Label | ||
@@ -158,2 +195,4 @@ | ||
export type VerticalAnchorType = "start" | "middle" | "end"; | ||
export type OriginType = { x: number; y: number }; | ||
export type LabelOrientationType = "parallel" | "perpendicular" | "vertical"; | ||
@@ -168,5 +207,5 @@ export interface VictoryLabelProps { | ||
children?: StringOrNumberOrCallback; | ||
labelPlacement?: "parallel" | "perpendicular" | "vertical"; | ||
labelPlacement?: LabelOrientationType; | ||
lineHeight?: StringOrNumberOrCallback; | ||
origin?: { x: number; y: number }; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -192,9 +231,19 @@ renderInPortal?: boolean; | ||
export interface VictoryContainerProps { | ||
children?: React.ReactElement | React.ReactElement[]; | ||
className?: string; | ||
containerId?: number | string; | ||
desc?: string; | ||
events?: React.DOMAttributes<any>; | ||
height?: number; | ||
name?: string; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
portalComponent?: React.ReactElement; | ||
portalZIndex?: number; | ||
responsive?: boolean; | ||
style?: React.CSSProperties; | ||
height?: number; | ||
tabIndex?: number; | ||
theme?: VictoryThemeDefinition; | ||
title?: string; | ||
width?: number; | ||
events?: React.DOMAttributes<any>; | ||
title?: string; | ||
desc?: string; | ||
} | ||
@@ -219,6 +268,3 @@ | ||
groupComponent?: React.ReactElement; | ||
origin?: { | ||
x?: number; | ||
y?: number; | ||
}; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -403,10 +449,11 @@ radius?: number; | ||
export interface EventCallbackInterface<TTarget, TEventKey> { | ||
childName?: string; | ||
childName?: string | string[]; | ||
target?: TTarget; | ||
eventKey?: TEventKey; | ||
mutation: (props: any) => any; | ||
callback?: (props: any) => any; | ||
} | ||
export interface EventPropTypeInterface<TTarget, TEventKey> { | ||
childName?: string; | ||
childName?: string | Array<StringOrNumberOrCallback>; | ||
target: TTarget; | ||
@@ -426,14 +473,18 @@ eventKey?: TEventKey; | ||
export type DomainTuple = [number, number] | [Date, Date]; | ||
export type DomainPropType = | ||
| DomainTuple | ||
export type DomainPropObjectType = | ||
| { x?: DomainTuple; y: DomainTuple } | ||
| { x: DomainTuple; y?: DomainTuple }; | ||
export type DomainPropType = DomainPropObjectType | DomainTuple; | ||
export type PaddingType = number | [number, number]; | ||
export type DomainPaddingPropType = | ||
| number | ||
| PaddingType | ||
| { | ||
x?: number | [number, number]; | ||
y?: number | [number, number]; | ||
x?: PaddingType; | ||
y?: PaddingType; | ||
}; | ||
export type RangeTuple = [number, number]; | ||
export type RangePropType = RangeTuple | { x?: RangeTuple; y?: RangeTuple }; | ||
/** | ||
@@ -464,3 +515,4 @@ * D3 scale function shape. Don"t want to introduce typing dependency to d3 | ||
| string[] | ||
| { (data: any): number | string | string[] }; | ||
| { (data: any): number | string | string[] } | ||
| Function; | ||
@@ -499,5 +551,12 @@ export type InterpolationPropType = | ||
export type SortOrderPropType = "ascending" | "descending"; | ||
export type SVGCoordinateType = { x: number; y: number }; | ||
export interface VictoryCommonProps { | ||
animate?: boolean | AnimatePropTypeInterface; | ||
name?: string; | ||
containerComponent?: React.ReactElement; | ||
domainPadding?: DomainPaddingPropType; | ||
externalEventMutations?: EventCallbackInterface<string | string[], StringOrNumberOrList>[]; | ||
groupComponent?: React.ReactElement; | ||
height?: number; | ||
@@ -507,3 +566,7 @@ horizontal?: boolean; | ||
minDomain?: number | { x?: number; y?: number }; | ||
name?: string; | ||
origin?: OriginType; | ||
padding?: PaddingProps; | ||
polar?: boolean; | ||
range?: RangePropType; | ||
scale?: | ||
@@ -516,8 +579,7 @@ | ScalePropType | ||
}; | ||
sharedEvents?: { events: any[]; getEventState: Function }; | ||
singleQuadrantDomainPadding?: boolean | { x?: boolean; y?: boolean }; | ||
standalone?: boolean; | ||
width?: number; | ||
containerComponent?: React.ReactElement; | ||
theme?: VictoryThemeDefinition; | ||
groupComponent?: React.ReactElement; | ||
} | ||
@@ -534,6 +596,3 @@ | ||
index?: number | string; | ||
origin?: { | ||
x: number; | ||
y: number; | ||
}; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -553,2 +612,6 @@ role?: string; | ||
domain?: DomainPropType; | ||
domainPadding?: DomainPaddingPropType; | ||
samples?: number; | ||
sortKey?: DataGetterPropType; | ||
sortOrder?: SortOrderPropType; | ||
x?: DataGetterPropType; | ||
@@ -559,14 +622,44 @@ y?: DataGetterPropType; | ||
export interface VictoryLabableProps { | ||
export interface VictoryLabelableProps { | ||
labelComponent?: React.ReactElement; | ||
} | ||
export interface VictoryMultiLabeableProps extends VictoryLabableProps { | ||
labels?: string[] | { (data: any): string | null }; | ||
export interface VictoryMultiLabelableProps extends VictoryLabelableProps { | ||
labels?: string[] | number[] | { (data: any): string | number | null }; | ||
} | ||
export interface VictorySingleLabableProps extends VictoryLabableProps { | ||
label?: string | { (data: any): string }; | ||
export interface VictorySingleLabelableProps extends VictoryLabelableProps { | ||
label?: string | { (data: any): string | number | null }; | ||
} | ||
export namespace Selection { | ||
export function getParentSVG(evt: React.SyntheticEvent): string; | ||
export function getSVGEventCoordinates( | ||
evt: React.SyntheticEvent, | ||
svg?: SVGElement | ||
): SVGCoordinateType; | ||
export function getDomainCoordinates(props: any, domain?: DomainPropType): DomainPropType; | ||
export function getDataCoordinates( | ||
props: any, | ||
scale: ScalePropType, | ||
x: number, | ||
y: number | ||
): SVGCoordinateType; | ||
export function getBounds(props: any): SVGCoordinateType; | ||
} | ||
export interface TextSizeStyleInterface { | ||
angle?: number; | ||
characterConstant?: string; | ||
fontFamily?: string; | ||
fontSize?: number | string; | ||
letterSpacing?: string; | ||
lineHeight?: number; | ||
} | ||
export namespace TextSize { | ||
export function approximateTextSize(text: string, style: TextSizeStyleInterface): number; | ||
export function convertLengthToPixels(length: string, fontSize: number): number; | ||
} | ||
// #endregion | ||
@@ -592,12 +685,3 @@ | ||
size?: number | Function; | ||
symbol?: | ||
| "circle" | ||
| "diamond" | ||
| "plus" | ||
| "minus" | ||
| "square" | ||
| "star" | ||
| "triangleDown" | ||
| "triangleUp" | ||
| Function; | ||
symbol?: ScatterSymbolType | Function; | ||
x?: number; | ||
@@ -604,0 +688,0 @@ y?: number; |
{ | ||
"name": "victory-core", | ||
"version": "34.1.3", | ||
"version": "34.2.0", | ||
"description": "Victory Core", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,12 +0,1 @@ | ||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov> | ||
// snerks <https://github.com/snerks> | ||
// Krzysztof Cebula <https://github.com/Havret> | ||
// Vitaliy Polyanskiy <https://github.com/alreadyExisted> | ||
// James Lismore <https://github.com/jlismore> | ||
// Stack Builders <https://github.com/stackbuilders> | ||
// Esteban Ibarra <https://github.com/ibarrae> | ||
// Dominic Lee <https://github.com/dominictwlee> | ||
// Dave Vedder <https://github.com/veddermatic> | ||
// Alec Flett <https://github.com/alecf> | ||
import * as React from "react"; | ||
@@ -71,2 +60,3 @@ | ||
| "plus" | ||
| "minus" | ||
| "square" | ||
@@ -119,3 +109,5 @@ | "star" | ||
export type CursorData = { | ||
export type StringOrNumberOrList = string | number | (string | number)[]; | ||
export type CoordinatesPropType = { | ||
x: number; | ||
@@ -137,2 +129,4 @@ y: number; | ||
// #endregion | ||
// #region Victory Animation | ||
@@ -153,2 +147,45 @@ | ||
// #region Victory Axis props | ||
export type TickLabelProps = React.CSSProperties & { | ||
angle?: number; | ||
verticalAnchor?: VerticalAnchorType; | ||
}; | ||
export interface VictoryAxisCommonProps { | ||
axisComponent?: React.ReactElement; | ||
axisLabelComponent?: React.ReactElement; | ||
axisValue?: number | string | object | Date; | ||
dependentAxis?: boolean; | ||
gridComponent?: React.ReactElement; | ||
invertAxis?: boolean; | ||
style?: { | ||
parent?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
axis?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
axisLabel?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
grid?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
ticks?: { | ||
[K in keyof React.CSSProperties]: string | number | ((tick?: any) => string | number) | ||
}; | ||
tickLabels?: { | ||
[K in keyof TickLabelProps]: string | number | ((tick?: any) => string | number) | ||
}; | ||
}; | ||
tickComponent?: React.ReactElement; | ||
tickCount?: number; | ||
tickLabelComponent?: React.ReactElement; | ||
tickFormat?: any[] | { (tick: any, index: number, ticks: any[]): string | number }; | ||
tickValues?: any[]; | ||
} | ||
// #endregion | ||
// #region Victory Label | ||
@@ -158,2 +195,4 @@ | ||
export type VerticalAnchorType = "start" | "middle" | "end"; | ||
export type OriginType = { x: number; y: number }; | ||
export type LabelOrientationType = "parallel" | "perpendicular" | "vertical"; | ||
@@ -168,5 +207,5 @@ export interface VictoryLabelProps { | ||
children?: StringOrNumberOrCallback; | ||
labelPlacement?: "parallel" | "perpendicular" | "vertical"; | ||
labelPlacement?: LabelOrientationType; | ||
lineHeight?: StringOrNumberOrCallback; | ||
origin?: { x: number; y: number }; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -192,9 +231,19 @@ renderInPortal?: boolean; | ||
export interface VictoryContainerProps { | ||
children?: React.ReactElement | React.ReactElement[]; | ||
className?: string; | ||
containerId?: number | string; | ||
desc?: string; | ||
events?: React.DOMAttributes<any>; | ||
height?: number; | ||
name?: string; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
portalComponent?: React.ReactElement; | ||
portalZIndex?: number; | ||
responsive?: boolean; | ||
style?: React.CSSProperties; | ||
height?: number; | ||
tabIndex?: number; | ||
theme?: VictoryThemeDefinition; | ||
title?: string; | ||
width?: number; | ||
events?: React.DOMAttributes<any>; | ||
title?: string; | ||
desc?: string; | ||
} | ||
@@ -219,6 +268,3 @@ | ||
groupComponent?: React.ReactElement; | ||
origin?: { | ||
x?: number; | ||
y?: number; | ||
}; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -403,10 +449,11 @@ radius?: number; | ||
export interface EventCallbackInterface<TTarget, TEventKey> { | ||
childName?: string; | ||
childName?: string | string[]; | ||
target?: TTarget; | ||
eventKey?: TEventKey; | ||
mutation: (props: any) => any; | ||
callback?: (props: any) => any; | ||
} | ||
export interface EventPropTypeInterface<TTarget, TEventKey> { | ||
childName?: string; | ||
childName?: string | Array<StringOrNumberOrCallback>; | ||
target: TTarget; | ||
@@ -426,14 +473,18 @@ eventKey?: TEventKey; | ||
export type DomainTuple = [number, number] | [Date, Date]; | ||
export type DomainPropType = | ||
| DomainTuple | ||
export type DomainPropObjectType = | ||
| { x?: DomainTuple; y: DomainTuple } | ||
| { x: DomainTuple; y?: DomainTuple }; | ||
export type DomainPropType = DomainPropObjectType | DomainTuple; | ||
export type PaddingType = number | [number, number]; | ||
export type DomainPaddingPropType = | ||
| number | ||
| PaddingType | ||
| { | ||
x?: number | [number, number]; | ||
y?: number | [number, number]; | ||
x?: PaddingType; | ||
y?: PaddingType; | ||
}; | ||
export type RangeTuple = [number, number]; | ||
export type RangePropType = RangeTuple | { x?: RangeTuple; y?: RangeTuple }; | ||
/** | ||
@@ -464,3 +515,4 @@ * D3 scale function shape. Don"t want to introduce typing dependency to d3 | ||
| string[] | ||
| { (data: any): number | string | string[] }; | ||
| { (data: any): number | string | string[] } | ||
| Function; | ||
@@ -499,5 +551,12 @@ export type InterpolationPropType = | ||
export type SortOrderPropType = "ascending" | "descending"; | ||
export type SVGCoordinateType = { x: number; y: number }; | ||
export interface VictoryCommonProps { | ||
animate?: boolean | AnimatePropTypeInterface; | ||
name?: string; | ||
containerComponent?: React.ReactElement; | ||
domainPadding?: DomainPaddingPropType; | ||
externalEventMutations?: EventCallbackInterface<string | string[], StringOrNumberOrList>[]; | ||
groupComponent?: React.ReactElement; | ||
height?: number; | ||
@@ -507,3 +566,7 @@ horizontal?: boolean; | ||
minDomain?: number | { x?: number; y?: number }; | ||
name?: string; | ||
origin?: OriginType; | ||
padding?: PaddingProps; | ||
polar?: boolean; | ||
range?: RangePropType; | ||
scale?: | ||
@@ -516,8 +579,7 @@ | ScalePropType | ||
}; | ||
sharedEvents?: { events: any[]; getEventState: Function }; | ||
singleQuadrantDomainPadding?: boolean | { x?: boolean; y?: boolean }; | ||
standalone?: boolean; | ||
width?: number; | ||
containerComponent?: React.ReactElement; | ||
theme?: VictoryThemeDefinition; | ||
groupComponent?: React.ReactElement; | ||
} | ||
@@ -534,6 +596,3 @@ | ||
index?: number | string; | ||
origin?: { | ||
x: number; | ||
y: number; | ||
}; | ||
origin?: OriginType; | ||
polar?: boolean; | ||
@@ -553,2 +612,6 @@ role?: string; | ||
domain?: DomainPropType; | ||
domainPadding?: DomainPaddingPropType; | ||
samples?: number; | ||
sortKey?: DataGetterPropType; | ||
sortOrder?: SortOrderPropType; | ||
x?: DataGetterPropType; | ||
@@ -559,14 +622,44 @@ y?: DataGetterPropType; | ||
export interface VictoryLabableProps { | ||
export interface VictoryLabelableProps { | ||
labelComponent?: React.ReactElement; | ||
} | ||
export interface VictoryMultiLabeableProps extends VictoryLabableProps { | ||
labels?: string[] | { (data: any): string | null }; | ||
export interface VictoryMultiLabelableProps extends VictoryLabelableProps { | ||
labels?: string[] | number[] | { (data: any): string | number | null }; | ||
} | ||
export interface VictorySingleLabableProps extends VictoryLabableProps { | ||
label?: string | { (data: any): string }; | ||
export interface VictorySingleLabelableProps extends VictoryLabelableProps { | ||
label?: string | { (data: any): string | number | null }; | ||
} | ||
export namespace Selection { | ||
export function getParentSVG(evt: React.SyntheticEvent): string; | ||
export function getSVGEventCoordinates( | ||
evt: React.SyntheticEvent, | ||
svg?: SVGElement | ||
): SVGCoordinateType; | ||
export function getDomainCoordinates(props: any, domain?: DomainPropType): DomainPropType; | ||
export function getDataCoordinates( | ||
props: any, | ||
scale: ScalePropType, | ||
x: number, | ||
y: number | ||
): SVGCoordinateType; | ||
export function getBounds(props: any): SVGCoordinateType; | ||
} | ||
export interface TextSizeStyleInterface { | ||
angle?: number; | ||
characterConstant?: string; | ||
fontFamily?: string; | ||
fontSize?: number | string; | ||
letterSpacing?: string; | ||
lineHeight?: number; | ||
} | ||
export namespace TextSize { | ||
export function approximateTextSize(text: string, style: TextSizeStyleInterface): number; | ||
export function convertLengthToPixels(length: string, fontSize: number): number; | ||
} | ||
// #endregion | ||
@@ -592,12 +685,3 @@ | ||
size?: number | Function; | ||
symbol?: | ||
| "circle" | ||
| "diamond" | ||
| "plus" | ||
| "minus" | ||
| "square" | ||
| "star" | ||
| "triangleDown" | ||
| "triangleUp" | ||
| Function; | ||
symbol?: ScatterSymbolType | Function; | ||
x?: number; | ||
@@ -604,0 +688,0 @@ y?: number; |
1979983
27386