From 9af5b40259dea5e55eca434608e44fd53dcb8822 Mon Sep 17 00:00:00 2001 From: jlismore <37339984+jlismore@users.noreply.github.com> Date: Tue, 26 Nov 2019 23:05:23 +0000 Subject: [PATCH] Add min and max domain props (#40612) Add alternative animate prop --- types/victory/index.d.ts | 38 ++++++++++++++++++++++++++------- types/victory/victory-tests.tsx | 2 +- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index 3d9c0983f7..e3499e4a6e 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -1068,9 +1068,9 @@ declare module 'victory' { * The animate prop should also be used to specify enter and exit * transition configurations with the `onExit` and `onEnter` namespaces respectively. * @example - * {duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})} + * {duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})}} */ - animate?: AnimatePropTypeInterface; + animate?: boolean | AnimatePropTypeInterface; /** * The name prop is used to reference a component instance when defining shared events. */ @@ -1087,6 +1087,28 @@ declare module 'victory' { * @default false */ horizontal?: boolean; + /** + * The maxDomain prop defines a maximum domain value for a chart. This prop is useful in + * situations where the maximum domain of a chart is static, while the minimum value + * depends on data or other variable information. + * If the domain prop is set in addition to maximumDomain, domain will be used. + * + * note: The x value supplied to the maxDomain prop refers to the independent variable, + * and the y value refers to the dependent variable. This may cause confusion in + * horizontal charts, as the independent variable will corresponds to the y axis. + */ + maxDomain?: number | { x?: number; y?: number }; + /** + * The minDomain prop defines a minimum domain value for a chart. This prop is useful in + * situations where the minimum domain of a chart is static, while the maximum value + * depends on data or other variable information. If the domain prop is set in addition + * to minimumDomain, domain will be used. + * + * note: The x value supplied to the minDomain prop refers to the independent variable, + * and the y value refers to the dependent variable. This may cause confusion in + * horizontal charts, as the independent variable will corresponds to the y axis. + */ + minDomain?: number | { x?: number; y?: number }; /** * The padding props specifies the amount of padding in number of pixels between * the edge of the chart and any rendered child components. This prop can be given @@ -1585,12 +1607,12 @@ declare module 'victory' { cornerRadius?: | NumberOrCallback | { - top?: number | (NumberOrCallback); - topLeft?: number | (NumberOrCallback); - topRight?: number | (NumberOrCallback); - bottom?: number | (NumberOrCallback); - bottomLeft?: number | (NumberOrCallback); - bottomRight?: number | (NumberOrCallback); + top?: number | NumberOrCallback; + topLeft?: number | NumberOrCallback; + topRight?: number | NumberOrCallback; + bottom?: number | NumberOrCallback; + bottomLeft?: number | NumberOrCallback; + bottomRight?: number | NumberOrCallback; }; /** * The event prop take an array of event objects. Event objects are composed of diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index 4bed7566f1..28943c4d5a 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -362,7 +362,7 @@ test = ( // VictoryChart test test = ( - + 0.5 * data.x * data.x} /> );