From a7932209434c52c44f684ff4e42bef0cdfbd1249 Mon Sep 17 00:00:00 2001 From: Dominic Lee <34794189+dominictwlee@users.noreply.github.com> Date: Sat, 4 May 2019 18:00:22 +0100 Subject: [PATCH] Add y0 data accessor to datable components (#35188) --- types/victory/index.d.ts | 7 +++++++ types/victory/victory-tests.tsx | 1 + 2 files changed, 8 insertions(+) diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index 8131c760c9..2f57c5fff2 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -1087,6 +1087,13 @@ declare module "victory" { * @default "y" */ y?: DataGetterPropType; + /** + * Use y0 data accessor prop to determine how the component defines the baseline y0 data. + * This prop is useful for defining custom baselines for components like VictoryBar or VictoryArea. + * This prop may be given in a variety of formats. + * @example 'last_quarter_profit', () => 10, 1, 'employees.salary', ["employees", "salary"] + */ + y0?: DataGetterPropType; } // Common labable interface diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index 1d45fa49fd..6d8152361e 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -487,6 +487,7 @@ test = ( { y: 6, x: 'B' }, { y: 7, x: 'C' }, ]} + y0={(d) => d.y - 1} /> );