Skip to content

Commit db01643

Browse files
authored
Enable prettier formatting for stories (#2961)
1 parent 3e447f2 commit db01643

File tree

132 files changed

+9242
-9164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+9242
-9164
lines changed

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
.cache
22
.changeset
3+
.docusaurus
34
.expo
45
.storybook
56
.wireit
67
.vscode
78
coverage
89
dist
10+
build
911
lib
1012
lib-vendor
1113
es
@@ -21,5 +23,4 @@ tsconfig.*.json
2123
storybook-static
2224
public
2325
artifacts
24-
stories
2526
demo

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ export default tseslint.config(
144144
files: ["**/stories/**/*.ts", "**/stories/**/*.stories.tsx"],
145145
rules: {
146146
"no-magic-numbers": "off",
147-
"prettier/prettier": "off",
148147
},
149148
},
150149
);
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
import React from "react";
2-
import type { Meta } from "@storybook/react";
3-
4-
import { VictoryArea, VictoryChart, VictoryTheme } from "@/victory";
5-
import { Story, ComponentMeta } from "./config";
6-
import { getData } from "../../utils/data";
7-
8-
const meta: Meta<typeof VictoryArea> = {
9-
...ComponentMeta,
10-
title: "Victory Charts/VictoryArea",
11-
};
12-
13-
export const Events: Story = {
14-
args: {},
15-
render: (props) => (
16-
<VictoryChart theme={VictoryTheme[props.themeKey]}>
17-
<VictoryArea
18-
{...props}
19-
style={{ data: { fill: "tomato" } }}
20-
events={[
21-
{
22-
target: "data",
23-
eventHandlers: {
24-
onClick: () => {
25-
return [
26-
{
27-
eventKey: "all",
28-
target: "data",
29-
mutation: (eventProps) => {
30-
const fill = eventProps.style && eventProps.style.fill;
31-
return fill === "black"
32-
? null
33-
: { style: { fill: "black" } };
34-
},
35-
},
36-
];
37-
},
38-
},
39-
},
40-
]}
41-
data={getData(5)}
42-
/>
43-
</VictoryChart>
44-
),
45-
};
46-
47-
export default meta;
1+
import React from "react";
2+
import type { Meta } from "@storybook/react";
3+
4+
import { VictoryArea, VictoryChart, VictoryTheme } from "@/victory";
5+
import { Story, ComponentMeta } from "./config";
6+
import { getData } from "../../utils/data";
7+
8+
const meta: Meta<typeof VictoryArea> = {
9+
...ComponentMeta,
10+
title: "Victory Charts/VictoryArea",
11+
};
12+
13+
export const Events: Story = {
14+
args: {},
15+
render: (props) => (
16+
<VictoryChart theme={VictoryTheme[props.themeKey]}>
17+
<VictoryArea
18+
{...props}
19+
style={{ data: { fill: "tomato" } }}
20+
events={[
21+
{
22+
target: "data",
23+
eventHandlers: {
24+
onClick: () => {
25+
return [
26+
{
27+
eventKey: "all",
28+
target: "data",
29+
mutation: (eventProps) => {
30+
const fill = eventProps.style && eventProps.style.fill;
31+
return fill === "black"
32+
? null
33+
: { style: { fill: "black" } };
34+
},
35+
},
36+
];
37+
},
38+
},
39+
},
40+
]}
41+
data={getData(5)}
42+
/>
43+
</VictoryChart>
44+
),
45+
};
46+
47+
export default meta;
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
import React from "react";
2-
import type { Meta } from "@storybook/react";
3-
4-
import { VictoryArea, VictoryChart } from "@/victory";
5-
import { Story, ComponentMeta } from "./config";
6-
import { getData } from "../../utils/data";
7-
8-
const meta: Meta<typeof VictoryArea> = {
9-
...ComponentMeta,
10-
title: "Victory Charts/VictoryArea",
11-
};
12-
13-
export const Labels: Story = {
14-
args: {},
15-
render: (props) => (
16-
<>
17-
<VictoryChart>
18-
<VictoryArea
19-
{...props}
20-
data={getData(7)}
21-
labels={({ datum }) => `x: ${datum.x}`}
22-
/>
23-
</VictoryChart>
24-
<VictoryChart>
25-
<VictoryArea
26-
{...props}
27-
data={getData(7)}
28-
labels={["", "", "three", "four", "5", "six"]}
29-
/>
30-
</VictoryChart>
31-
<VictoryChart>
32-
<VictoryArea
33-
{...props}
34-
data={[
35-
{ x: 1, y: 2, label: "cat" },
36-
{ x: 2, y: 5, label: "dog" },
37-
{ x: 3, y: 3, label: "dog" },
38-
{ x: 4, y: -2, label: "bird" },
39-
{ x: 5, y: -5, label: "cat" },
40-
]}
41-
/>
42-
</VictoryChart>
43-
</>
44-
),
45-
};
46-
47-
export default meta;
1+
import React from "react";
2+
import type { Meta } from "@storybook/react";
3+
4+
import { VictoryArea, VictoryChart } from "@/victory";
5+
import { Story, ComponentMeta } from "./config";
6+
import { getData } from "../../utils/data";
7+
8+
const meta: Meta<typeof VictoryArea> = {
9+
...ComponentMeta,
10+
title: "Victory Charts/VictoryArea",
11+
};
12+
13+
export const Labels: Story = {
14+
args: {},
15+
render: (props) => (
16+
<>
17+
<VictoryChart>
18+
<VictoryArea
19+
{...props}
20+
data={getData(7)}
21+
labels={({ datum }) => `x: ${datum.x}`}
22+
/>
23+
</VictoryChart>
24+
<VictoryChart>
25+
<VictoryArea
26+
{...props}
27+
data={getData(7)}
28+
labels={["", "", "three", "four", "5", "six"]}
29+
/>
30+
</VictoryChart>
31+
<VictoryChart>
32+
<VictoryArea
33+
{...props}
34+
data={[
35+
{ x: 1, y: 2, label: "cat" },
36+
{ x: 2, y: 5, label: "dog" },
37+
{ x: 3, y: 3, label: "dog" },
38+
{ x: 4, y: -2, label: "bird" },
39+
{ x: 5, y: -5, label: "cat" },
40+
]}
41+
/>
42+
</VictoryChart>
43+
</>
44+
),
45+
};
46+
47+
export default meta;

stories/victory-charts/victory-area/polar-interpolation.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ export const PolarInterpolation: Story = {
3535
style={{ textAnchor: "middle" }}
3636
text={interpolation}
3737
/>
38-
<VictoryArea {...props} interpolation={interpolation as InterpolationPropType} />
38+
<VictoryArea
39+
{...props}
40+
interpolation={interpolation as InterpolationPropType}
41+
/>
3942
</VictoryChart>
4043
))}
4144
</>
Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
import React from "react";
2-
import type { Meta } from "@storybook/react";
3-
4-
import {
5-
VictoryArea,
6-
VictoryChart,
7-
VictoryStack,
8-
VictoryTheme,
9-
} from "@/victory";
10-
import { Story, ComponentMeta } from "./config";
11-
import { getData } from "../../utils/data";
12-
13-
const meta: Meta<typeof VictoryArea> = {
14-
...ComponentMeta,
15-
title: "Victory Charts/VictoryArea",
16-
};
17-
18-
export const Polar: Story = {
19-
args: {},
20-
render: (props) => (
21-
<>
22-
<VictoryChart polar theme={VictoryTheme[props.themeKey]}>
23-
<VictoryArea {...props} data={getData(7)} />
24-
</VictoryChart>
25-
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}>
26-
<VictoryArea {...props} data={getData(7)} />
27-
</VictoryChart>
28-
<VictoryChart polar theme={VictoryTheme[props.themeKey]}>
29-
<VictoryArea
30-
{...props}
31-
data={[
32-
{ x: "Cat", y: 62 },
33-
{ x: "Dog", y: 91 },
34-
{ x: "Fish", y: 55 },
35-
{ x: "Bird", y: 55 },
36-
{ x: "Frog", y: 75 },
37-
]}
38-
/>
39-
</VictoryChart>
40-
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}>
41-
<VictoryArea
42-
{...props}
43-
data={[
44-
{ x: "Cat", y: 62 },
45-
{ x: "Dog", y: 91 },
46-
{ x: "Fish", y: 55 },
47-
{ x: "Bird", y: 55 },
48-
{ x: "Frog", y: 75 },
49-
]}
50-
/>
51-
</VictoryChart>
52-
<VictoryChart polar theme={VictoryTheme[props.themeKey]}>
53-
<VictoryStack>
54-
<VictoryArea {...props} data={getData(5)} />
55-
<VictoryArea {...props} data={getData(5, "seed-1")} />
56-
<VictoryArea {...props} data={getData(5, "seed-2")} />
57-
</VictoryStack>
58-
</VictoryChart>
59-
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}>
60-
<VictoryStack>
61-
<VictoryArea {...props} data={getData(5)} />
62-
<VictoryArea {...props} data={getData(5, "seed-1")} />
63-
<VictoryArea {...props} data={getData(5, "seed-2")} />
64-
</VictoryStack>
65-
</VictoryChart>
66-
</>
67-
),
68-
};
69-
70-
export default meta;
1+
import React from "react";
2+
import type { Meta } from "@storybook/react";
3+
4+
import {
5+
VictoryArea,
6+
VictoryChart,
7+
VictoryStack,
8+
VictoryTheme,
9+
} from "@/victory";
10+
import { Story, ComponentMeta } from "./config";
11+
import { getData } from "../../utils/data";
12+
13+
const meta: Meta<typeof VictoryArea> = {
14+
...ComponentMeta,
15+
title: "Victory Charts/VictoryArea",
16+
};
17+
18+
export const Polar: Story = {
19+
args: {},
20+
render: (props) => (
21+
<>
22+
<VictoryChart polar theme={VictoryTheme[props.themeKey]}>
23+
<VictoryArea {...props} data={getData(7)} />
24+
</VictoryChart>
25+
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}>
26+
<VictoryArea {...props} data={getData(7)} />
27+
</VictoryChart>
28+
<VictoryChart polar theme={VictoryTheme[props.themeKey]}>
29+
<VictoryArea
30+
{...props}
31+
data={[
32+
{ x: "Cat", y: 62 },
33+
{ x: "Dog", y: 91 },
34+
{ x: "Fish", y: 55 },
35+
{ x: "Bird", y: 55 },
36+
{ x: "Frog", y: 75 },
37+
]}
38+
/>
39+
</VictoryChart>
40+
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}>
41+
<VictoryArea
42+
{...props}
43+
data={[
44+
{ x: "Cat", y: 62 },
45+
{ x: "Dog", y: 91 },
46+
{ x: "Fish", y: 55 },
47+
{ x: "Bird", y: 55 },
48+
{ x: "Frog", y: 75 },
49+
]}
50+
/>
51+
</VictoryChart>
52+
<VictoryChart polar theme={VictoryTheme[props.themeKey]}>
53+
<VictoryStack>
54+
<VictoryArea {...props} data={getData(5)} />
55+
<VictoryArea {...props} data={getData(5, "seed-1")} />
56+
<VictoryArea {...props} data={getData(5, "seed-2")} />
57+
</VictoryStack>
58+
</VictoryChart>
59+
<VictoryChart polar innerRadius={50} theme={VictoryTheme[props.themeKey]}>
60+
<VictoryStack>
61+
<VictoryArea {...props} data={getData(5)} />
62+
<VictoryArea {...props} data={getData(5, "seed-1")} />
63+
<VictoryArea {...props} data={getData(5, "seed-2")} />
64+
</VictoryStack>
65+
</VictoryChart>
66+
</>
67+
),
68+
};
69+
70+
export default meta;

0 commit comments

Comments
 (0)