Merge pull request #33360 from frysztak/victoryscatter-size-active

[victory] Add (data, active) alternative to VictoryScatter
This commit is contained in:
Nathan Shively-Sanders
2019-03-06 08:02:21 -08:00
committed by GitHub
2 changed files with 27 additions and 1 deletions

View File

@@ -2057,7 +2057,7 @@ declare module "victory" {
/**
* The size prop determines how to scale each data point
*/
size?: number | { (data: any): number };
size?: number | { (data: any): number } | { (data: any, active: boolean): number };
/**
* The style prop specifies styles for your VictoryScatter. Any valid inline style properties
* will be applied. Height, width, and padding should be specified via the height,

View File

@@ -642,6 +642,32 @@ test = (
/>
);
test = (
<VictoryScatter
data={[
{x: 1, y: 3},
{x: 2, y: 5},
{x: 3, y: 4},
{x: 4, y: 2},
{x: 5, y: 5}
]}
size={(d: any) => 5}
/>
);
test = (
<VictoryScatter
data={[
{x: 1, y: 3},
{x: 2, y: 5},
{x: 3, y: 4},
{x: 4, y: 2},
{x: 5, y: 5}
]}
size={(d, a) => (a ? 5 : 3)}
/>
);
// VictoryPie test
test = (
<VictoryPie