-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable prettier formatting for stories (#2961)
- Loading branch information
1 parent
3e447f2
commit db01643
Showing
132 changed files
with
9,242 additions
and
9,164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
import React from "react"; | ||
import type { Meta } from "@storybook/react"; | ||
|
||
import { VictoryArea, VictoryChart, VictoryTheme } from "@/victory"; | ||
import { Story, ComponentMeta } from "./config"; | ||
import { getData } from "../../utils/data"; | ||
|
||
const meta: Meta<typeof VictoryArea> = { | ||
...ComponentMeta, | ||
title: "Victory Charts/VictoryArea", | ||
}; | ||
|
||
export const Events: Story = { | ||
args: {}, | ||
render: (props) => ( | ||
<VictoryChart theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea | ||
{...props} | ||
style={{ data: { fill: "tomato" } }} | ||
events={[ | ||
{ | ||
target: "data", | ||
eventHandlers: { | ||
onClick: () => { | ||
return [ | ||
{ | ||
eventKey: "all", | ||
target: "data", | ||
mutation: (eventProps) => { | ||
const fill = eventProps.style && eventProps.style.fill; | ||
return fill === "black" | ||
? null | ||
: { style: { fill: "black" } }; | ||
}, | ||
}, | ||
]; | ||
}, | ||
}, | ||
}, | ||
]} | ||
data={getData(5)} | ||
/> | ||
</VictoryChart> | ||
), | ||
}; | ||
|
||
export default meta; | ||
import React from "react"; | ||
import type { Meta } from "@storybook/react"; | ||
|
||
import { VictoryArea, VictoryChart, VictoryTheme } from "@/victory"; | ||
import { Story, ComponentMeta } from "./config"; | ||
import { getData } from "../../utils/data"; | ||
|
||
const meta: Meta<typeof VictoryArea> = { | ||
...ComponentMeta, | ||
title: "Victory Charts/VictoryArea", | ||
}; | ||
|
||
export const Events: Story = { | ||
args: {}, | ||
render: (props) => ( | ||
<VictoryChart theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea | ||
{...props} | ||
style={{ data: { fill: "tomato" } }} | ||
events={[ | ||
{ | ||
target: "data", | ||
eventHandlers: { | ||
onClick: () => { | ||
return [ | ||
{ | ||
eventKey: "all", | ||
target: "data", | ||
mutation: (eventProps) => { | ||
const fill = eventProps.style && eventProps.style.fill; | ||
return fill === "black" | ||
? null | ||
: { style: { fill: "black" } }; | ||
}, | ||
}, | ||
]; | ||
}, | ||
}, | ||
}, | ||
]} | ||
data={getData(5)} | ||
/> | ||
</VictoryChart> | ||
), | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
import React from "react"; | ||
import type { Meta } from "@storybook/react"; | ||
|
||
import { VictoryArea, VictoryChart } from "@/victory"; | ||
import { Story, ComponentMeta } from "./config"; | ||
import { getData } from "../../utils/data"; | ||
|
||
const meta: Meta<typeof VictoryArea> = { | ||
...ComponentMeta, | ||
title: "Victory Charts/VictoryArea", | ||
}; | ||
|
||
export const Labels: Story = { | ||
args: {}, | ||
render: (props) => ( | ||
<> | ||
<VictoryChart> | ||
<VictoryArea | ||
{...props} | ||
data={getData(7)} | ||
labels={({ datum }) => `x: ${datum.x}`} | ||
/> | ||
</VictoryChart> | ||
<VictoryChart> | ||
<VictoryArea | ||
{...props} | ||
data={getData(7)} | ||
labels={["", "", "three", "four", "5", "six"]} | ||
/> | ||
</VictoryChart> | ||
<VictoryChart> | ||
<VictoryArea | ||
{...props} | ||
data={[ | ||
{ x: 1, y: 2, label: "cat" }, | ||
{ x: 2, y: 5, label: "dog" }, | ||
{ x: 3, y: 3, label: "dog" }, | ||
{ x: 4, y: -2, label: "bird" }, | ||
{ x: 5, y: -5, label: "cat" }, | ||
]} | ||
/> | ||
</VictoryChart> | ||
</> | ||
), | ||
}; | ||
|
||
export default meta; | ||
import React from "react"; | ||
import type { Meta } from "@storybook/react"; | ||
|
||
import { VictoryArea, VictoryChart } from "@/victory"; | ||
import { Story, ComponentMeta } from "./config"; | ||
import { getData } from "../../utils/data"; | ||
|
||
const meta: Meta<typeof VictoryArea> = { | ||
...ComponentMeta, | ||
title: "Victory Charts/VictoryArea", | ||
}; | ||
|
||
export const Labels: Story = { | ||
args: {}, | ||
render: (props) => ( | ||
<> | ||
<VictoryChart> | ||
<VictoryArea | ||
{...props} | ||
data={getData(7)} | ||
labels={({ datum }) => `x: ${datum.x}`} | ||
/> | ||
</VictoryChart> | ||
<VictoryChart> | ||
<VictoryArea | ||
{...props} | ||
data={getData(7)} | ||
labels={["", "", "three", "four", "5", "six"]} | ||
/> | ||
</VictoryChart> | ||
<VictoryChart> | ||
<VictoryArea | ||
{...props} | ||
data={[ | ||
{ x: 1, y: 2, label: "cat" }, | ||
{ x: 2, y: 5, label: "dog" }, | ||
{ x: 3, y: 3, label: "dog" }, | ||
{ x: 4, y: -2, label: "bird" }, | ||
{ x: 5, y: -5, label: "cat" }, | ||
]} | ||
/> | ||
</VictoryChart> | ||
</> | ||
), | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,70 @@ | ||
import React from "react"; | ||
import type { Meta } from "@storybook/react"; | ||
|
||
import { | ||
VictoryArea, | ||
VictoryChart, | ||
VictoryStack, | ||
VictoryTheme, | ||
} from "@/victory"; | ||
import { Story, ComponentMeta } from "./config"; | ||
import { getData } from "../../utils/data"; | ||
|
||
const meta: Meta<typeof VictoryArea> = { | ||
...ComponentMeta, | ||
title: "Victory Charts/VictoryArea", | ||
}; | ||
|
||
export const Polar: Story = { | ||
args: {}, | ||
render: (props) => ( | ||
<> | ||
<VictoryChart polar theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea {...props} data={getData(7)} /> | ||
</VictoryChart> | ||
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea {...props} data={getData(7)} /> | ||
</VictoryChart> | ||
<VictoryChart polar theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea | ||
{...props} | ||
data={[ | ||
{ x: "Cat", y: 62 }, | ||
{ x: "Dog", y: 91 }, | ||
{ x: "Fish", y: 55 }, | ||
{ x: "Bird", y: 55 }, | ||
{ x: "Frog", y: 75 }, | ||
]} | ||
/> | ||
</VictoryChart> | ||
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea | ||
{...props} | ||
data={[ | ||
{ x: "Cat", y: 62 }, | ||
{ x: "Dog", y: 91 }, | ||
{ x: "Fish", y: 55 }, | ||
{ x: "Bird", y: 55 }, | ||
{ x: "Frog", y: 75 }, | ||
]} | ||
/> | ||
</VictoryChart> | ||
<VictoryChart polar theme={VictoryTheme[props.themeKey]}> | ||
<VictoryStack> | ||
<VictoryArea {...props} data={getData(5)} /> | ||
<VictoryArea {...props} data={getData(5, "seed-1")} /> | ||
<VictoryArea {...props} data={getData(5, "seed-2")} /> | ||
</VictoryStack> | ||
</VictoryChart> | ||
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}> | ||
<VictoryStack> | ||
<VictoryArea {...props} data={getData(5)} /> | ||
<VictoryArea {...props} data={getData(5, "seed-1")} /> | ||
<VictoryArea {...props} data={getData(5, "seed-2")} /> | ||
</VictoryStack> | ||
</VictoryChart> | ||
</> | ||
), | ||
}; | ||
|
||
export default meta; | ||
import React from "react"; | ||
import type { Meta } from "@storybook/react"; | ||
|
||
import { | ||
VictoryArea, | ||
VictoryChart, | ||
VictoryStack, | ||
VictoryTheme, | ||
} from "@/victory"; | ||
import { Story, ComponentMeta } from "./config"; | ||
import { getData } from "../../utils/data"; | ||
|
||
const meta: Meta<typeof VictoryArea> = { | ||
...ComponentMeta, | ||
title: "Victory Charts/VictoryArea", | ||
}; | ||
|
||
export const Polar: Story = { | ||
args: {}, | ||
render: (props) => ( | ||
<> | ||
<VictoryChart polar theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea {...props} data={getData(7)} /> | ||
</VictoryChart> | ||
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea {...props} data={getData(7)} /> | ||
</VictoryChart> | ||
<VictoryChart polar theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea | ||
{...props} | ||
data={[ | ||
{ x: "Cat", y: 62 }, | ||
{ x: "Dog", y: 91 }, | ||
{ x: "Fish", y: 55 }, | ||
{ x: "Bird", y: 55 }, | ||
{ x: "Frog", y: 75 }, | ||
]} | ||
/> | ||
</VictoryChart> | ||
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}> | ||
<VictoryArea | ||
{...props} | ||
data={[ | ||
{ x: "Cat", y: 62 }, | ||
{ x: "Dog", y: 91 }, | ||
{ x: "Fish", y: 55 }, | ||
{ x: "Bird", y: 55 }, | ||
{ x: "Frog", y: 75 }, | ||
]} | ||
/> | ||
</VictoryChart> | ||
<VictoryChart polar theme={VictoryTheme[props.themeKey]}> | ||
<VictoryStack> | ||
<VictoryArea {...props} data={getData(5)} /> | ||
<VictoryArea {...props} data={getData(5, "seed-1")} /> | ||
<VictoryArea {...props} data={getData(5, "seed-2")} /> | ||
</VictoryStack> | ||
</VictoryChart> | ||
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}> | ||
<VictoryStack> | ||
<VictoryArea {...props} data={getData(5)} /> | ||
<VictoryArea {...props} data={getData(5, "seed-1")} /> | ||
<VictoryArea {...props} data={getData(5, "seed-2")} /> | ||
</VictoryStack> | ||
</VictoryChart> | ||
</> | ||
), | ||
}; | ||
|
||
export default meta; |
Oops, something went wrong.