Skip to content

Commit

Permalink
Enable prettier formatting for stories (#2961)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot authored Nov 12, 2024
1 parent 3e447f2 commit db01643
Show file tree
Hide file tree
Showing 132 changed files with 9,242 additions and 9,164 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.cache
.changeset
.docusaurus
.expo
.storybook
.wireit
.vscode
coverage
dist
build
lib
lib-vendor
es
Expand All @@ -21,5 +23,4 @@ tsconfig.*.json
storybook-static
public
artifacts
stories
demo
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export default tseslint.config(
files: ["**/stories/**/*.ts", "**/stories/**/*.stories.tsx"],
rules: {
"no-magic-numbers": "off",
"prettier/prettier": "off",
},
},
);
94 changes: 47 additions & 47 deletions stories/victory-charts/victory-area/events.stories.tsx
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;
94 changes: 47 additions & 47 deletions stories/victory-charts/victory-area/labels.stories.tsx
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;
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export const PolarInterpolation: Story = {
style={{ textAnchor: "middle" }}
text={interpolation}
/>
<VictoryArea {...props} interpolation={interpolation as InterpolationPropType} />
<VictoryArea
{...props}
interpolation={interpolation as InterpolationPropType}
/>
</VictoryChart>
))}
</>
Expand Down
140 changes: 70 additions & 70 deletions stories/victory-charts/victory-area/polar.stories.tsx
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;
Loading

0 comments on commit db01643

Please sign in to comment.