diff --git a/victory/victory-tests.tsx b/victory/victory-tests.tsx
new file mode 100644
index 0000000000..6be99c875a
--- /dev/null
+++ b/victory/victory-tests.tsx
@@ -0,0 +1,607 @@
+///
+///
+
+import * as React from "react";
+import {
+ VictoryAnimation,
+ VictoryLabel,
+ AnimationStyle,
+ VictoryArea,
+ VictoryAxis,
+ VictoryStack,
+ VictoryBar,
+ VictoryLine,
+ VictoryChart,
+ VictoryScatter,
+ VictoryPie
+} from "victory";
+
+// VictoryAnimation test
+let test = {}}
+>
+ {(style: AnimationStyle) =>
+ Hello!
+ }
+
+
+// VictoryLabel test
+test = 50}
+ textAnchor="middle"
+ verticalAnchor="start"
+ events={{
+ onClick: () => {}
+ }}
+ text="test"
+ transform="scale(1.2)"
+ dx={10}
+ dy={10}
+ lineHeight={1.5}>
+ {"data viz \n is \n fun!"}
+
+
+// VictoryArea test
+test = (
+ (data.yield + data.error)}
+ />
+);
+
+test = (
+ {
+ return {
+ mutation: (props) => {
+ return { style: { fill: "orange" } }
+ }
+ }
+ },
+ onMouseEnter: () => {
+ return [
+ {
+ target: "labels",
+ mutation: (props) => {
+ return { text: "hey" }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ]}
+ />
+);
+
+test = (
+
+
+
+
+
+);
+
+test = (
+
+);
+
+test = (
+ x.getFullYear()}/>
+);
+
+test = (
+
+);
+
+// VictoryBar test
+test = (
+
+);
+
+test = (
+ (data.yield + data.error)}
+ />
+);
+
+test = (
+
+);
+
+test = (
+ data.y > 2 ?
+ "red" : "blue"
+ }
+ }}
+ data={[
+ {x: 1, y: 1},
+ {x: 2, y: 2},
+ {x: 3, y: 3},
+ {x: 4, y: 2},
+ {x: 5, y: 1}
+ ]}
+ />
+);
+
+test = (
+ {
+ evt.stopPropagation();
+ return [
+ {
+ mutation: () => {
+ return {style: {fill: "orange", width: 20}};
+ }
+ },
+ {
+ target: "labels",
+ eventKey: 3,
+ mutation: () => {
+ return {text: "now click me"};
+ }
+ }
+ ];
+ }
+ }
+ }, {
+ target: "parent",
+ eventHandlers: {
+ onClick: () => {
+ return [
+ {
+ target: "data",
+ mutation: () => {
+ return {style: {fill: "tomato", width: 10}};
+ }
+ }
+ ];
+ }
+ }
+ }
+ ]}
+ />
+);
+
+
+// VictoryChart test
+test = (
+
+ 0.5 * data.x * data.x}/>
+
+);
+
+test = (
+
+
+ Math.sin(2 * Math.PI * data.x)
+ }
+ />
+
+ Math.cos(2 * Math.PI * data.x)
+ }
+ />
+
+);
+
+test = (
+
+
+
+ data.y > 3 ?
+ "gold" : "orange"
+ }
+ }}
+ data={[
+ {x: 1, y: 1},
+ {x: 2, y: 2.5},
+ {x: 3, y: 4},
+ {x: 4, y: 2.5},
+ {x: 5, y: 1},
+ ]}/>
+
+);
+
+test = (
+
+ x.getFullYear()}/>
+
+
+);
+
+// VictoryLine test
+test = (
+
+);
+
+test = (
+ (data.yield + data.error)}
+ />
+);
+
+test = (
+
+);
+
+// VictoryScatter test
+test = (
+ (data.yield + data.error)}
+ />
+);
+
+test = (
+
+);
+
+// VictoryPie test
+test = (
+ data.pet + data.wild}
+ />
+);
+
+test = (
+
+);
+
+test = (
+ {
+ return [
+ {
+ mutation: (props) => {
+ return {
+ style: {fill: "orange"}
+ };
+ }
+ }, {
+ target: "labels",
+ eventKey: [1, 2, 3],
+ mutation: () => {
+ return {text: "KITTEN"};
+ }
+ }
+ ];
+ }
+ }
+ }]}
+ />
+);
+
+test = (
+
+ ({y: 0, label: " "}),
+ after: (datum) =>
+ ({y: datum.y, label: "NEW"})
+ }
+ }}
+ />
+);
\ No newline at end of file
diff --git a/victory/victory.d.ts b/victory/victory.d.ts
new file mode 100644
index 0000000000..852fde5f7d
--- /dev/null
+++ b/victory/victory.d.ts
@@ -0,0 +1,1494 @@
+// Type definitions for Victory 0.9.0
+// Project: https://github.com/FormidableLabs/victory
+// Definitions by: Alexey Svetliakov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+declare module "victory" {
+ import * as React from "react";
+ /**
+ * Single animation object to interpolate
+ */
+ export type AnimationStyle = { [key: string ]: string | number };
+ /**
+ * Animation styles to interpolate
+ */
+ export type AnimationData = AnimationStyle | AnimationStyle[];
+ export type AnimationEasing =
+ "back" | "backIn" | "backOut" | "backInOut" | "bounce" | "bounceIn" | "bounceOut" |
+ "bounceInOut" | "circle" | "circleIn" | "circleOut" | "circleInOut" | "linear" |
+ "linearIn" | "linearOut" | "linearInOut" | "cubic" | "cubicIn" | "cubicOut" |
+ "cubicInOut" | "elastic" | "elasticIn" | "elasticOut" | "elasticInOut" | "exp" |
+ "expIn" | "expOut" | "expInOut" | "poly" | "polyIn" | "polyOut" | "polyInOut" |
+ "quad" | "quadIn" | "quadOut" | "quadInOut" | "sin" | "sinIn" | "sinOut" | "sinInOut";
+
+ // Many victory components accept string or number or callback which returns string or number
+ type StringOrNumberOrCallback = string | number | { (): string | number };
+
+ /**
+ * Style interface used in components/themeing
+ */
+ export interface VictoryStyleInterface {
+ parent?: React.CSSProperties;
+ data?: React.CSSProperties;
+ labels?: React.CSSProperties;
+ }
+
+ export interface VictoryAnimationProps {
+ /**
+ * The child of should be a function that takes an object of tweened values and returns a component to render.
+ * @param style
+ */
+ children?: (style: AnimationStyle) => React.ReactElement;
+ /**
+ * The number of milliseconds the animation should take to complete.
+ * @default 1000
+ */
+ duration?: number;
+ /**
+ * The easing prop specifies an easing function name to use for tweening.
+ * @default "quadInOut"
+ */
+ easing?: AnimationEasing;
+ /**
+ * The delay prop specifies a delay in milliseconds before the animation begins.
+ * If multiple values are in the animation queue, it is the delay between each animation.
+ * @default 0
+ */
+ delay?: number;
+ /**
+ * The onEnd prop specifies a function to run when the animation ends. If multiple animations are in the queue, it is called after the last animation.
+ */
+ onEnd?: () => void;
+ /**
+ * The data prop specifies the latest set of values to tween to.
+ * When this prop changes, VictoryAnimation will begin animating from the current value to the new value.
+ * When given an array of values, VictoryAnimation will use it as an animation queue.
+ * @default {}
+ */
+ data?: AnimationData;
+ }
+
+ /**
+ * VictoryAnimation animates prop changes for any React component.
+ * Just use a child function inside VictoryAnimation that accepts an object of tweened values and returns a component to render.
+ */
+ export class VictoryAnimation extends React.Component {}
+
+ /**
+ * Text anchor type
+ */
+ type TextAnchorType = "start" | "middle" | "end" | "inherit";
+ /**
+ * Vertical anchor type
+ */
+ type VerticalAnchorType = "start" | "middle" | "end";
+
+ export interface VictoryLabelProps {
+ /**
+ * Specifies the angle to rotate the text by.
+ */
+ angle?: string | number;
+ /**
+ * The capHeight prop defines a text metric for the font being used: the expected height of capital letters.
+ * This is necessary because of SVG, which (a) positions the *bottom* of the text at `y`, and (b) has no notion of line height.
+ * The value should ideally use the same units as `lineHeight` and `dy`, preferably ems. If given a unitless number, it is assumed to be ems.
+ * @default "0.71em"
+ */
+ capHeight?: StringOrNumberOrCallback;
+ /**
+ * Victory components can pass a datum prop to their label component. This can be used to calculate functional styles, and determine child text
+ */
+ datum?: {};
+ /**
+ * Labels that apply to an entire data series will recieve the entire series as `data` instead of an individual datum prop.
+ */
+ data?: any[];
+ /**
+ * The events prop attaches arbitrary event handlers to the label component.
+ * Event handlers are currently only called with their corresponding events.
+ */
+ events?: React.DOMAttributes;
+ /**
+ * All Victory components will pass a text prop to their label component.
+ * This defines the content of the label when child nodes are absent. It will be ignored if children are provided.
+ */
+ text?: StringOrNumberOrCallback;
+ /**
+ * The children of this component define the content of the label.
+ * This makes using the component similar to normal HTML spans or labels. strings, numbers, and functions of data / value are supported.
+ */
+ children?: StringOrNumberOrCallback;
+ /**
+ * The lineHeight prop defines how much space a single line of text should take up.
+ * Note that SVG has no notion of line-height, so the positioning may differ slightly from what you would expect with CSS,
+ * but the result is similar: a roughly equal amount of extra space is distributed above and below the line of text.
+ * The value should ideally use the same units as `capHeight` and `dy`, preferably ems.
+ * If given a unitless number, it is assumed to be ems.
+ * @default 1
+ */
+ lineHeight?: StringOrNumberOrCallback;
+ /**
+ * The style prop applies CSS properties to the rendered `` element.
+ */
+ style?: React.CSSProperties;
+ /**
+ * The textAnchor prop defines how the text is horizontally positioned relative to the given `x` and `y` coordinates.
+ */
+ textAnchor?: TextAnchorType | { (): TextAnchorType };
+ /**
+ * The verticalAnchor prop defines how the text is vertically positioned relative to the given `x` and `y` coordinates.
+ */
+ verticalAnchor?: VerticalAnchorType | { (): VerticalAnchorType };
+ /**
+ * The transform prop applies a transform to the rendered `` element.
+ * In addition to being a string, it can be an object containing transform definitions for easier authoring.
+ */
+ transform?: string | {} | { (): string | {} };
+ /**
+ * The x prop defines the x coordinate to use as a basis for horizontal positioning.
+ */
+ x?: number;
+ /**
+ * The y prop defines the y coordinate to use as a basis for vertical positioning.
+ */
+ y?: number;
+ /**
+ * The dx prop defines a horizontal shift from the `x` coordinate.
+ */
+ dx?: StringOrNumberOrCallback;
+ /**
+ * The dy prop defines a vertical shift from the `y` coordinate.
+ * Since this component already accounts for `capHeight`, `lineHeight`, and `verticalAnchor`, this will usually not be necessary.
+ */
+ dy?: StringOrNumberOrCallback;
+ }
+
+ /**
+ * VictoryLabel is a text component that provides several enhancements over SVG’s element.
+ */
+ export class VictoryLabel extends React.Component {}
+
+ export interface VictoryContainerProps {
+ /**
+ * The style prop specifies styles for your VictoryContainer. Any valid inline style properties
+ * will be applied. Height and width should be specified via the height
+ * and width props, as they are used to calculate the alignment of
+ * components within the container. Styles from the child component will
+ * also be passed, if any exist.
+ * @examples {border: 1px solid red}
+ */
+ style?: React.CSSProperties;
+ /**
+ * The height props specifies the height the svg viewBox of the container.
+ * This value should be given as a number of pixels. If no height prop
+ * is given, the height prop from the child component passed will be used.
+ */
+ height?: number;
+ /**
+ * The width props specifies the width of the svg viewBox of the container
+ * This value should be given as a number of pixels. If no width prop
+ * is given, the width prop from the child component passed will be used.
+ */
+ width?: number;
+ /**
+ * The events prop attaches arbitrary event handlers to the container component.
+ * Event handlers passed from other Victory components are called with their
+ * corresponding events as well as scale, style, width, height, and data when
+ * applicable. Use the invert method to convert event coordinate information to
+ * data. `scale.x.invert(evt.offsetX)`.
+ * @examples {{ onClick: (evt) => alert(`x: ${evt.clientX}, y: ${evt.clientY}`)}}
+ */
+ events?: React.DOMAttributes;
+ /**
+ * The title prop specifies the title to be applied to the SVG to assist
+ * accessibility for screen readers. The more descriptive this title is, the more
+ * useful it will be. If no title prop is passed, it will default to Victory Chart.
+ * @example "Popularity of Dog Breeds by Percentage"
+ * @default "Victory Chart"
+ */
+ title?: string;
+ /**
+ * The desc prop specifies the description of the chart/SVG to assist with
+ * accessibility for screen readers. The more info about the chart provided in
+ * the description, the more usable it will be for people using screen readers.
+ * This prop defaults to an empty string.
+ * @example "Golden retreivers make up 30%, Labs make up 25%, and other dog breeds are
+ * not represented above 5% each."
+ * @default ""
+ */
+ desc?: string;
+ }
+ export class VictoryContainer extends React.Component {}
+
+ // Note: Many SVG attributes are missed in CSSProperties interface
+ export interface VictoryThemeDefinition {
+ area?: VictoryStyleInterface;
+ axis?: {
+ axis: React.CSSProperties;
+ axisLabel: React.CSSProperties;
+ grid: React.CSSProperties;
+ ticks: React.CSSProperties;
+ tickLabels: React.CSSProperties;
+ };
+ bar?: VictoryStyleInterface;
+ candlestick?: VictoryStyleInterface & {
+ props: {
+ width: number;
+ height: number;
+ candleColors: {
+ positive: string;
+ negative: string;
+ };
+ };
+ };
+ line?: VictoryStyleInterface;
+ pie?: {
+ props: {
+ width: number;
+ height: number;
+ colorScale: string[];
+ };
+ style: VictoryStyleInterface;
+ };
+ scatter?: VictoryStyleInterface;
+ props?: {
+ width: number;
+ height: number;
+ colorScale: string[];
+ };
+ }
+
+ interface VictoryThemeInterface {
+ /**
+ * Default theme
+ */
+ material: VictoryThemeDefinition;
+ }
+ /**
+ * Available themes
+ */
+ export const VictoryTheme: VictoryThemeInterface;
+
+ /**
+ * Animate object used in components
+ */
+ export interface AnimatePropTypeInterface {
+ /**
+ * Animation duration
+ */
+ duration: number;
+ /**
+ * Animation end callback
+ */
+ onEnd?: () => void;
+ /**
+ * Animation exit transition configuration
+ */
+ onExit?: {
+ duration?: number;
+ before?: (datum: any) => AnimationStyle;
+ };
+ /**
+ * Animation enter transition configuration
+ */
+ onEnter?: {
+ duration?: number;
+ before?: (datum: any) => AnimationStyle;
+ after?: (datum: any) => AnimationStyle;
+ };
+ }
+
+ /**
+ * Return value for eventHandlers values
+ */
+ interface EventCallbackInterface {
+ /**
+ * Use only in:
+ * - VictoryChart
+ * - VictoryStack
+ */
+ childName?: string;
+ target?: TTarget;
+ eventKey?: TEventKey;
+ /**
+ * Will be called with the calculated props for the individual selected element and result will override
+ * props of selected element via object assignment
+ * @param props
+ */
+ mutation: (props: any) => any;
+ }
+
+ export interface EventPropTypeInterface {
+ /**
+ * Use only in:
+ * - VictoryChart
+ * - VictoryStack
+ */
+ childName?: string;
+ /**
+ * Targets may be any valid style namespace for a given component
+ */
+ target: TTarget;
+ /**
+ *
+ */
+ eventKey?: TEventKey;
+ /**
+ * Event handlers map. Keys are standard event names (such as onClick) and values are event callbacks
+ */
+ eventHandlers: {
+ [key: string]: {
+ (event: React.SyntheticEvent): EventCallbackInterface } |
+ { (event: React.SyntheticEvent): EventCallbackInterface[]
+ }
+ };
+ }
+
+ /**
+ * Data domain type
+ */
+ type DomainPropType = [number, number] | {
+ x: [number, number];
+ y: [number, number];
+ };
+ /**
+ * Domain padding
+ */
+ type DomainPaddingPropType = number | {
+ x?: number;
+ y?: number;
+ };
+
+ /**
+ * D3 scale function shape. Don't want to introduce typing dependency to d3
+ */
+ interface D3Scale {
+ domain: () => any;
+ range: () => any;
+ copy: () => any;
+ }
+ /**
+ * Acceptable scale types
+ */
+ type ScalePropType = "linear" | "time" | "log" | "sqrt";
+
+ /**
+ * Category prop type
+ */
+ type CategoryPropType = string[] | {
+ x: string[]
+ y: string[]
+ };
+
+ /**
+ * Data getter property type
+ */
+ type DataGetterPropType = number | string | string[] | { (data: any): number | string | string[] };
+
+ type InterpolationPropType = "basis" | "basisClosed" | "basisOpen" | "bundle" |
+ "cardinal" | "cardinalClosed" | "cardinalOpen" |
+ "catmullRom" | "catmullRomClosed" | "catmullRomOpen" |
+ "linear" | "linearClosed" | "monotoneX" | "monotoneY" |
+ "natural" | "radial" | "step" | "stepAfter" | "stepBefore";
+
+ type ColorScalePropType = "greyscale" | "qualitative" | "heatmap" | "warm" | "cool" | "red" | "green" | "blue" | string[];
+ /**
+ * Common properties
+ */
+ interface VictoryCommonProps {
+ /**
+ * The animate prop specifies props for VictoryAnimation to use.
+ * 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})})}
+ */
+ animate?: AnimatePropTypeInterface;
+ /**
+ * The name prop is used to reference a component instance when defining shared events.
+ */
+ name?: string;
+ /**
+ * The height props specifies the height the svg viewBox of the chart container.
+ * This value should be given as a number of pixels
+ */
+ height?: 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
+ * as a number or as an object with padding specified for top, bottom, left
+ * and right.
+ * @default 50
+ */
+ padding?: number | {
+ top?: number;
+ bottom?: number;
+ left?: number;
+ right?: number;
+ };
+ /**
+ * The scale prop determines which scales your chart should use. This prop can be
+ * given as a string specifying a supported scale ("linear", "time", "log", "sqrt"),
+ * as a d3 scale function, or as an object with scales specified for x and y
+ * @example d3Scale.time(), {x: "linear", y: "log"}
+ * @default "linear"
+ */
+ scale?: ScalePropType | D3Scale | {
+ x?: ScalePropType | D3Scale;
+ y?: ScalePropType | D3Scale;
+ };
+ /**
+ * The standalone prop determines whether the component will render a standalone svg
+ * or a tag that will be included in an external svg. Set standalone to false to
+ * compose VictoryAxis with other components within an enclosing