From db01643dc7f80a119c95e2cf9b53f4eb4321035d Mon Sep 17 00:00:00 2001 From: Charlie Brown Date: Tue, 12 Nov 2024 12:33:32 -0600 Subject: [PATCH] Enable prettier formatting for stories (#2961) --- .prettierignore | 3 +- eslint.config.mjs | 1 - .../victory-area/events.stories.tsx | 94 ++-- .../victory-area/labels.stories.tsx | 94 ++-- .../polar-interpolation.stories.tsx | 5 +- .../victory-area/polar.stories.tsx | 140 +++--- .../victory-area/stacked.stories.tsx | 166 +++--- .../victory-area/styles.stories.tsx | 124 ++--- .../victory-area/time-scale.stories.tsx | 110 ++-- .../victory-area/tooltips.stories.tsx | 112 ++--- .../victory-axis/axis-value.stories.tsx | 112 ++--- .../brush-axis-grid-line-width.stories.tsx | 78 +-- .../fix-label-overlap.stories.tsx | 118 ++--- .../victory-axis/orientation.stories.tsx | 112 ++--- .../victory-axis/tick-values.stories.tsx | 148 +++--- .../victory-axis/with-domain.stories.tsx | 152 +++--- .../victory-bar/alignment.stories.tsx | 108 ++-- .../victory-bar/bar-ratio.stories.tsx | 138 ++--- .../victory-bar/corner-radius.stories.tsx | 256 +++++----- .../victory-bar/data.stories.tsx | 134 ++--- .../victory-bar/focus-with-refs.stories.tsx | 128 ++--- .../victory-bar/get-path.stories.tsx | 94 ++-- .../victory-bar/grouped-bars.stories.tsx | 436 ++++++++-------- .../victory-bar/labels.stories.tsx | 140 +++--- .../victory-bar/polar-bars.stories.tsx | 234 ++++----- .../victory-bar/regressions.stories.tsx | 152 +++--- .../victory-bar/scale.stories.tsx | 186 +++---- .../victory-bar/sorting.stories.tsx | 78 +-- .../victory-bar/stacked-bars.stories.tsx | 252 +++++----- .../victory-bar/style.stories.tsx | 108 ++-- .../victory-bar/theme.stories.tsx | 124 ++--- .../victory-bar/tooltips.stories.tsx | 172 +++---- .../victory-box-plot/box-width.stories.tsx | 86 ++-- .../victory-box-plot/data.stories.tsx | 136 ++--- .../victory-box-plot/group.stories.tsx | 84 ++-- .../victory-box-plot/labels.stories.tsx | 154 +++--- .../victory-box-plot/style.stories.tsx | 120 ++--- .../victory-box-plot/tooltips.stories.tsx | 118 ++--- .../victory-candlestick/data.stories.tsx | 128 ++--- .../victory-candlestick/domain.stories.tsx | 162 +++--- .../victory-candlestick/labels.stories.tsx | 156 +++--- .../victory-candlestick/style.stories.tsx | 100 ++-- .../victory-candlestick/tooltips.stories.tsx | 206 ++++---- .../domain-from-data.stories.tsx | 238 ++++----- .../victory-chart/domain-padding.stories.tsx | 138 ++--- .../victory-chart/domain.stories.tsx | 172 +++---- .../victory-chart/orientations.stories.tsx | 92 ++-- .../victory-chart/style.stories.tsx | 476 +++++++++--------- ...victory-zoom-container-default.stories.tsx | 104 ++-- .../preserve-aspect-ratio.stories.tsx | 138 ++--- .../victory-errorbar/data.stories.tsx | 150 +++--- .../victory-errorbar/domain.stories.tsx | 140 +++--- .../victory-errorbar/labels.stories.tsx | 160 +++--- .../victory-errorbar/style.stories.tsx | 100 ++-- .../victory-errorbar/theme.stories.tsx | 2 +- .../victory-histogram/bin-spacing.stories.tsx | 10 +- .../corner-radius.stories.tsx | 94 ++-- .../victory-histogram/data.stories.tsx | 139 ++--- .../victory-histogram/date-bins.stories.tsx | 173 +++---- .../disable-inline-styles.stories.tsx | 5 +- .../victory-histogram/empty-data.stories.tsx | 102 ++-- .../victory-histogram/get-path.stories.tsx | 98 ++-- .../victory-histogram/labels.stories.tsx | 154 +++--- .../mixed-charts.stories.tsx | 116 ++--- .../numeric-bins.stories.tsx | 116 ++--- .../victory-histogram/scale.stories.tsx | 128 ++--- .../victory-histogram/stacked.stories.tsx | 198 ++++---- .../victory-histogram/styles.stories.tsx | 88 ++-- .../victory-label/anchors.stories.tsx | 256 +++++----- .../victory-label/angles.stories.tsx | 182 +++---- .../background-padding.stories.tsx | 312 ++++++------ .../background-styles.stories.tsx | 229 ++++----- .../victory-label/inline.stories.tsx | 149 +++--- .../victory-label/line-height.stories.tsx | 216 ++++---- .../victory-label/positioning.stories.tsx | 112 ++--- .../victory-label/styles.stories.tsx | 384 +++++++------- .../victory-legend/line-height.stories.tsx | 94 ++-- .../victory-legend/title.stories.tsx | 206 ++++---- .../victory-line/data-accessors.stories.tsx | 179 +++---- .../victory-line/events.stories.tsx | 95 ++-- .../victory-line/interpolation.stories.tsx | 116 ++--- .../victory-line/labels.stories.tsx | 94 ++-- .../plotting-functions.stories.tsx | 102 ++-- .../victory-line/polar.stories.tsx | 150 +++--- .../victory-line/stacked.stories.tsx | 154 +++--- .../victory-line/styles.stories.tsx | 88 ++-- .../victory-line/theme.stories.tsx | 150 +++--- .../victory-line/time-scale.stories.tsx | 110 ++-- .../victory-line/tooltips.stories.tsx | 118 ++--- .../victory-pie/corner-radius.stories.tsx | 114 ++--- .../victory-pie/data.stories.tsx | 104 ++-- .../victory-pie/inner-radius.stories.tsx | 124 ++--- .../victory-pie/label-indicator.stories.tsx | 144 +++--- .../victory-pie/label-placement.stories.tsx | 134 ++--- .../victory-pie/label-radius.stories.tsx | 140 +++--- .../victory-pie/labels.stories.tsx | 84 ++-- .../victory-pie/origin.stories.tsx | 90 ++-- .../victory-pie/pad-angle.stories.tsx | 114 ++--- .../victory-pie/radius.stories.tsx | 136 ++--- .../start-and-end-angles.stories.tsx | 152 +++--- .../victory-pie/styles.stories.tsx | 148 +++--- .../victory-pie/tooltips.stories.tsx | 140 +++--- .../victory-polar-axis/axis-angle.stories.tsx | 100 ++-- .../victory-polar-axis/axis-value.stories.tsx | 100 ++-- .../victory-polar-axis/domain.stories.tsx | 142 +++--- .../label-placement.stories.tsx | 97 ++-- .../victory-polar-axis/scale.stories.tsx | 94 ++-- .../victory-polar-axis/style.stories.tsx | 86 ++-- .../tick-format.stories.tsx | 98 ++-- .../tick-values.stories.tsx | 114 ++--- .../victory-portal/default.stories.tsx | 120 ++--- .../victory-scatter/bubble-charts.stories.tsx | 160 +++--- .../data-accessors.stories.tsx | 170 +++---- .../victory-scatter/domain.stories.tsx | 4 +- .../functional-symbols.stories.tsx | 158 +++--- .../victory-scatter/labels.stories.tsx | 91 ++-- .../victory-scatter/polar.stories.tsx | 148 +++--- .../victory-scatter/stacked.stories.tsx | 152 +++--- .../victory-scatter/styles.stories.tsx | 98 ++-- .../victory-scatter/theme.stories.tsx | 142 +++--- .../victory-scatter/time-scale.stories.tsx | 108 ++-- .../victory-scatter/tooltips.stories.tsx | 114 +++-- .../victory-tooltip/center-offset.stories.tsx | 324 ++++++------ .../constrain-to-visible-area.stories.tsx | 172 +++---- .../victory-tooltip/corner-radius.stories.tsx | 176 +++---- .../victory-tooltip/flyout-height.stories.tsx | 176 +++---- .../flyout-padding.stories.tsx | 134 ++--- .../victory-tooltip/flyout-style.stories.tsx | 132 ++--- .../victory-tooltip/flyout-width.stories.tsx | 176 +++---- .../pointer-length.stories.tsx | 192 +++---- .../pointer-orientation.stories.tsx | 226 ++++----- .../victory-tooltip/pointer-width.stories.tsx | 192 +++---- 132 files changed, 9242 insertions(+), 9164 deletions(-) diff --git a/.prettierignore b/.prettierignore index ed5b91cfe..95314853a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,11 +1,13 @@ .cache .changeset +.docusaurus .expo .storybook .wireit .vscode coverage dist +build lib lib-vendor es @@ -21,5 +23,4 @@ tsconfig.*.json storybook-static public artifacts -stories demo diff --git a/eslint.config.mjs b/eslint.config.mjs index 3b80801fa..a23e2deb3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -144,7 +144,6 @@ export default tseslint.config( files: ["**/stories/**/*.ts", "**/stories/**/*.stories.tsx"], rules: { "no-magic-numbers": "off", - "prettier/prettier": "off", }, }, ); diff --git a/stories/victory-charts/victory-area/events.stories.tsx b/stories/victory-charts/victory-area/events.stories.tsx index bb9ccaa62..34a1a6ee3 100644 --- a/stories/victory-charts/victory-area/events.stories.tsx +++ b/stories/victory-charts/victory-area/events.stories.tsx @@ -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 = { - ...ComponentMeta, - title: "Victory Charts/VictoryArea", -}; - -export const Events: Story = { - args: {}, - render: (props) => ( - - { - return [ - { - eventKey: "all", - target: "data", - mutation: (eventProps) => { - const fill = eventProps.style && eventProps.style.fill; - return fill === "black" - ? null - : { style: { fill: "black" } }; - }, - }, - ]; - }, - }, - }, - ]} - data={getData(5)} - /> - - ), -}; - -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 = { + ...ComponentMeta, + title: "Victory Charts/VictoryArea", +}; + +export const Events: Story = { + args: {}, + render: (props) => ( + + { + return [ + { + eventKey: "all", + target: "data", + mutation: (eventProps) => { + const fill = eventProps.style && eventProps.style.fill; + return fill === "black" + ? null + : { style: { fill: "black" } }; + }, + }, + ]; + }, + }, + }, + ]} + data={getData(5)} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-area/labels.stories.tsx b/stories/victory-charts/victory-area/labels.stories.tsx index db218f368..7c12da1c2 100644 --- a/stories/victory-charts/victory-area/labels.stories.tsx +++ b/stories/victory-charts/victory-area/labels.stories.tsx @@ -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 = { - ...ComponentMeta, - title: "Victory Charts/VictoryArea", -}; - -export const Labels: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - /> - - - - - - - - - ), -}; - -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 = { + ...ComponentMeta, + title: "Victory Charts/VictoryArea", +}; + +export const Labels: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + /> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-area/polar-interpolation.stories.tsx b/stories/victory-charts/victory-area/polar-interpolation.stories.tsx index f3831db92..b694b92e8 100644 --- a/stories/victory-charts/victory-area/polar-interpolation.stories.tsx +++ b/stories/victory-charts/victory-area/polar-interpolation.stories.tsx @@ -35,7 +35,10 @@ export const PolarInterpolation: Story = { style={{ textAnchor: "middle" }} text={interpolation} /> - + ))} diff --git a/stories/victory-charts/victory-area/polar.stories.tsx b/stories/victory-charts/victory-area/polar.stories.tsx index 1e7914a68..b8edbdfc4 100644 --- a/stories/victory-charts/victory-area/polar.stories.tsx +++ b/stories/victory-charts/victory-area/polar.stories.tsx @@ -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 = { - ...ComponentMeta, - title: "Victory Charts/VictoryArea", -}; - -export const Polar: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -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 = { + ...ComponentMeta, + title: "Victory Charts/VictoryArea", +}; + +export const Polar: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-area/stacked.stories.tsx b/stories/victory-charts/victory-area/stacked.stories.tsx index ff41ab1d6..1abea9472 100644 --- a/stories/victory-charts/victory-area/stacked.stories.tsx +++ b/stories/victory-charts/victory-area/stacked.stories.tsx @@ -1,83 +1,83 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryArea, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData, getDataWithBaseline } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryArea", -}; - -export const Stacked: Story = { - args: {}, - render: (props) => ( - <> - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - - - - - - - - ), -}; - -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, getDataWithBaseline } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryArea", +}; + +export const Stacked: Story = { + args: {}, + render: (props) => ( + <> + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-area/styles.stories.tsx b/stories/victory-charts/victory-area/styles.stories.tsx index ee702ba12..aec65b3ef 100644 --- a/stories/victory-charts/victory-area/styles.stories.tsx +++ b/stories/victory-charts/victory-area/styles.stories.tsx @@ -1,62 +1,62 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryArea, - VictoryChart, - VictoryLabelStyleObject, - VictoryTheme, -} from "@/victory"; - -import { getData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryArea", -}; - -const labelStyle: VictoryLabelStyleObject = { - fill: ({ datum }) => (datum.x === "Dog" ? "red" : "black"), -}; - -export const Styles: Story = { - args: {}, - render: (props) => ( - <> - - datum.x} - style={{ - labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, - data: { - fill: "tomato", - fillOpacity: 0.7, - stroke: "tomato", - strokeWidth: 2, - }, - }} - /> - - - datum.x} - data={[ - { x: "Cat", y: 62 }, - { x: "Dog", y: 91 }, - { x: "Fish", y: 55 }, - { x: "Bird", y: 55 }, - ]} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryArea, + VictoryChart, + VictoryLabelStyleObject, + VictoryTheme, +} from "@/victory"; + +import { getData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryArea", +}; + +const labelStyle: VictoryLabelStyleObject = { + fill: ({ datum }) => (datum.x === "Dog" ? "red" : "black"), +}; + +export const Styles: Story = { + args: {}, + render: (props) => ( + <> + + datum.x} + style={{ + labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, + data: { + fill: "tomato", + fillOpacity: 0.7, + stroke: "tomato", + strokeWidth: 2, + }, + }} + /> + + + datum.x} + data={[ + { x: "Cat", y: 62 }, + { x: "Dog", y: 91 }, + { x: "Fish", y: 55 }, + { x: "Bird", y: 55 }, + ]} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-area/time-scale.stories.tsx b/stories/victory-charts/victory-area/time-scale.stories.tsx index 7958232f4..90d9fe4ef 100644 --- a/stories/victory-charts/victory-area/time-scale.stories.tsx +++ b/stories/victory-charts/victory-area/time-scale.stories.tsx @@ -1,55 +1,55 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryArea, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getTimeData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryArea", -}; - -export const TimeScale: Story = { - args: {}, - render: (props) => ( - <> - - datum.x.getFullYear()} - /> - - - datum.x.getFullYear()} - /> - - - datum.x.getFullYear()}> - - - - - - - datum.x.getFullYear()}> - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryArea, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getTimeData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryArea", +}; + +export const TimeScale: Story = { + args: {}, + render: (props) => ( + <> + + datum.x.getFullYear()} + /> + + + datum.x.getFullYear()} + /> + + + datum.x.getFullYear()}> + + + + + + + datum.x.getFullYear()}> + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-area/tooltips.stories.tsx b/stories/victory-charts/victory-area/tooltips.stories.tsx index 4818bc1a4..c608867b2 100644 --- a/stories/victory-charts/victory-area/tooltips.stories.tsx +++ b/stories/victory-charts/victory-area/tooltips.stories.tsx @@ -1,56 +1,56 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryArea, - VictoryChart, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData, getMixedData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryArea", -}; - -export const Tooltips: Story = { - args: { - labelComponent: , - }, - render: (props) => ( - <> - - `x: ${datum.x}`} - /> - - - `x: ${datum.x}`} - /> - - - `x: ${datum.x}`} - /> - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryArea, + VictoryChart, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData, getMixedData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryArea", +}; + +export const Tooltips: Story = { + args: { + labelComponent: , + }, + render: (props) => ( + <> + + `x: ${datum.x}`} + /> + + + `x: ${datum.x}`} + /> + + + `x: ${datum.x}`} + /> + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-axis/axis-value.stories.tsx b/stories/victory-charts/victory-axis/axis-value.stories.tsx index e1e706d98..e628c1e73 100644 --- a/stories/victory-charts/victory-axis/axis-value.stories.tsx +++ b/stories/victory-charts/victory-axis/axis-value.stories.tsx @@ -1,56 +1,56 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryAxis, VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryAxis", -}; - -export const AxisValue: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - t.getFullYear()} - /> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryAxis, VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryAxis", +}; + +export const AxisValue: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + t.getFullYear()} + /> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-axis/brush-axis-grid-line-width.stories.tsx b/stories/victory-charts/victory-axis/brush-axis-grid-line-width.stories.tsx index 537db68c8..f12e091b4 100644 --- a/stories/victory-charts/victory-axis/brush-axis-grid-line-width.stories.tsx +++ b/stories/victory-charts/victory-axis/brush-axis-grid-line-width.stories.tsx @@ -1,39 +1,39 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryAxis, VictoryBrushLine } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryAxis", -}; - -export const BrushAxisGridLineWidth: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryAxis, VictoryBrushLine } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryAxis", +}; + +export const BrushAxisGridLineWidth: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-axis/fix-label-overlap.stories.tsx b/stories/victory-charts/victory-axis/fix-label-overlap.stories.tsx index e5728c2a2..85977985e 100644 --- a/stories/victory-charts/victory-axis/fix-label-overlap.stories.tsx +++ b/stories/victory-charts/victory-axis/fix-label-overlap.stories.tsx @@ -1,59 +1,59 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryAxis, VictoryTheme } from "@/victory"; - -import { getRandomValues, getTimeValues, getValues } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryAxis", -}; - -export const FixLabelOverlap: Story = { - args: { - fixLabelOverlap: true, - }, - render: (props) => ( - <> - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryAxis, VictoryTheme } from "@/victory"; + +import { getRandomValues, getTimeValues, getValues } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryAxis", +}; + +export const FixLabelOverlap: Story = { + args: { + fixLabelOverlap: true, + }, + render: (props) => ( + <> + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-axis/orientation.stories.tsx b/stories/victory-charts/victory-axis/orientation.stories.tsx index 651a4fdf1..54b95a014 100644 --- a/stories/victory-charts/victory-axis/orientation.stories.tsx +++ b/stories/victory-charts/victory-axis/orientation.stories.tsx @@ -1,56 +1,56 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryAxis, VictoryChart, VictoryTheme } from "@/victory"; - -import { getValues } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryAxis", -}; - -export const Orientation: Story = { - args: { - tickValues: getValues(5), - }, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryAxis, VictoryChart, VictoryTheme } from "@/victory"; + +import { getValues } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryAxis", +}; + +export const Orientation: Story = { + args: { + tickValues: getValues(5), + }, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-axis/tick-values.stories.tsx b/stories/victory-charts/victory-axis/tick-values.stories.tsx index eb4e7f261..e5294a880 100644 --- a/stories/victory-charts/victory-axis/tick-values.stories.tsx +++ b/stories/victory-charts/victory-axis/tick-values.stories.tsx @@ -1,74 +1,74 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryAxis, VictoryChart, VictoryTheme } from "@/victory"; - -import { getRandomValues, getTimeValues, getValues } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryAxis", -}; - -export const TickValues: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryAxis, VictoryChart, VictoryTheme } from "@/victory"; + +import { getRandomValues, getTimeValues, getValues } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryAxis", +}; + +export const TickValues: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-axis/with-domain.stories.tsx b/stories/victory-charts/victory-axis/with-domain.stories.tsx index 9c542e7c3..5f25036dc 100644 --- a/stories/victory-charts/victory-axis/with-domain.stories.tsx +++ b/stories/victory-charts/victory-axis/with-domain.stories.tsx @@ -1,76 +1,76 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryAxis, - VictoryChart, - VictoryScatter, - VictoryTheme, -} from "@/victory"; - -import { getValues } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryAxis", -}; - -export const WithDomain: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryAxis, + VictoryChart, + VictoryScatter, + VictoryTheme, +} from "@/victory"; + +import { getValues } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryAxis", +}; + +export const WithDomain: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/alignment.stories.tsx b/stories/victory-charts/victory-bar/alignment.stories.tsx index ef72fd4e8..d01fbba92 100644 --- a/stories/victory-charts/victory-bar/alignment.stories.tsx +++ b/stories/victory-charts/victory-bar/alignment.stories.tsx @@ -1,54 +1,54 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; - -import { getData, getMixedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Alignment: Story = { - args: { - data: getData(7), - }, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; + +import { getData, getMixedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Alignment: Story = { + args: { + data: getData(7), + }, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/bar-ratio.stories.tsx b/stories/victory-charts/victory-bar/bar-ratio.stories.tsx index 8487a5e38..5f07a2bd7 100644 --- a/stories/victory-charts/victory-bar/bar-ratio.stories.tsx +++ b/stories/victory-charts/victory-bar/bar-ratio.stories.tsx @@ -1,69 +1,69 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const BarRatio: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const BarRatio: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/corner-radius.stories.tsx b/stories/victory-charts/victory-bar/corner-radius.stories.tsx index 66bbcdd87..1eeee6471 100644 --- a/stories/victory-charts/victory-bar/corner-radius.stories.tsx +++ b/stories/victory-charts/victory-bar/corner-radius.stories.tsx @@ -1,128 +1,128 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryPolarAxis, - VictoryTheme, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData, getMixedData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const CornerRadius: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryPolarAxis, + VictoryTheme, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData, getMixedData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const CornerRadius: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/data.stories.tsx b/stories/victory-charts/victory-bar/data.stories.tsx index 06bdde779..0269741c7 100644 --- a/stories/victory-charts/victory-bar/data.stories.tsx +++ b/stories/victory-charts/victory-bar/data.stories.tsx @@ -1,67 +1,67 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Data: Story = { - args: {}, - render: (props) => ( - <> - - data.pet + data.wild} - /> - - - d.y - d.x} /> - - - d.y - d.x} /> - - - d.y - d.x} /> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Data: Story = { + args: {}, + render: (props) => ( + <> + + data.pet + data.wild} + /> + + + d.y - d.x} /> + + + d.y - d.x} /> + + + d.y - d.x} /> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/focus-with-refs.stories.tsx b/stories/victory-charts/victory-bar/focus-with-refs.stories.tsx index e4a86effe..e1654b15d 100644 --- a/stories/victory-charts/victory-bar/focus-with-refs.stories.tsx +++ b/stories/victory-charts/victory-bar/focus-with-refs.stories.tsx @@ -1,64 +1,64 @@ -/* eslint-disable react-hooks/rules-of-hooks */ -import React, { useEffect, useCallback, useRef } from "react"; -import type { Meta } from "@storybook/react"; - -import { - Bar, - VictoryBar, - VictoryChart, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const FocusWithRefs: Story = { - args: {}, - render: (props) => { - const barsRef = useRef(new Map()); - - const focusOnBar = (id) => { - const map = barsRef.current; - const node = map.get(id); - node.focus(); - }; - - useEffect(() => { - if (barsRef.current) { - focusOnBar("1"); - } - }, []); - - const setRef = useCallback((node) => { - const map = barsRef.current; - if (node) { - map.set(node.attributes.index.value, node); - } - }, []); - - return ( - <> - - `x: ${datum.x}`} - labelComponent={} - dataComponent={} - /> - - - ); - }, -}; - -export default meta; +/* eslint-disable react-hooks/rules-of-hooks */ +import React, { useEffect, useCallback, useRef } from "react"; +import type { Meta } from "@storybook/react"; + +import { + Bar, + VictoryBar, + VictoryChart, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const FocusWithRefs: Story = { + args: {}, + render: (props) => { + const barsRef = useRef(new Map()); + + const focusOnBar = (id) => { + const map = barsRef.current; + const node = map.get(id); + node.focus(); + }; + + useEffect(() => { + if (barsRef.current) { + focusOnBar("1"); + } + }, []); + + const setRef = useCallback((node) => { + const map = barsRef.current; + if (node) { + map.set(node.attributes.index.value, node); + } + }, []); + + return ( + <> + + `x: ${datum.x}`} + labelComponent={} + dataComponent={} + /> + + + ); + }, +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/get-path.stories.tsx b/stories/victory-charts/victory-bar/get-path.stories.tsx index 0c78494d5..ba8528fc1 100644 --- a/stories/victory-charts/victory-bar/get-path.stories.tsx +++ b/stories/victory-charts/victory-bar/get-path.stories.tsx @@ -1,47 +1,47 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const GetPath: Story = { - args: { - data: getData(7), - }, - render: (props) => { - const verticalPathFn = (callbackArgs) => { - const { x0, x1, y0, y1 } = callbackArgs; - return `M ${x0}, ${y0} - L ${(x1 + x0) / 2}, ${y1} - L ${x1}, ${y0} - z`; - }; - - const horizontalPathFn = (callbackArgs) => { - const { x0, x1, y0, y1 } = callbackArgs; - return `M ${x0}, ${y1} - L ${x1}, ${(y0 + y1) / 2} - L ${x0}, ${y0} - z`; - }; - - return ( - <> - - - - - - - - ); - }, -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const GetPath: Story = { + args: { + data: getData(7), + }, + render: (props) => { + const verticalPathFn = (callbackArgs) => { + const { x0, x1, y0, y1 } = callbackArgs; + return `M ${x0}, ${y0} + L ${(x1 + x0) / 2}, ${y1} + L ${x1}, ${y0} + z`; + }; + + const horizontalPathFn = (callbackArgs) => { + const { x0, x1, y0, y1 } = callbackArgs; + return `M ${x0}, ${y1} + L ${x1}, ${(y0 + y1) / 2} + L ${x0}, ${y0} + z`; + }; + + return ( + <> + + + + + + + + ); + }, +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/grouped-bars.stories.tsx b/stories/victory-charts/victory-bar/grouped-bars.stories.tsx index ee165712f..1a19df707 100644 --- a/stories/victory-charts/victory-bar/grouped-bars.stories.tsx +++ b/stories/victory-charts/victory-bar/grouped-bars.stories.tsx @@ -1,218 +1,218 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryGroup, - VictoryStack, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData, getMixedData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const GroupedBars: Story = { - args: {}, - render: (props) => ( - <> - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x} - labelComponent={} - > - - - - - - - datum.x} - labelComponent={} - > - - - - - - - datum.x} - style={{ data: { width: 15 } }} - > - - - - - - - - - - - - - - - - - - - datum.x} - style={{ data: { width: 15 } }} - > - - - - - - - - - - - - - - - - - - - datum.x} - labelComponent={} - > - - - - - - - - - - - - - - - - - - - datum.x} - labelComponent={} - > - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryGroup, + VictoryStack, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData, getMixedData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const GroupedBars: Story = { + args: {}, + render: (props) => ( + <> + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x} + labelComponent={} + > + + + + + + + datum.x} + labelComponent={} + > + + + + + + + datum.x} + style={{ data: { width: 15 } }} + > + + + + + + + + + + + + + + + + + + + datum.x} + style={{ data: { width: 15 } }} + > + + + + + + + + + + + + + + + + + + + datum.x} + labelComponent={} + > + + + + + + + + + + + + + + + + + + + datum.x} + labelComponent={} + > + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/labels.stories.tsx b/stories/victory-charts/victory-bar/labels.stories.tsx index e327f6fca..7ea5cbcc3 100644 --- a/stories/victory-charts/victory-bar/labels.stories.tsx +++ b/stories/victory-charts/victory-bar/labels.stories.tsx @@ -1,70 +1,70 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryPolarAxis, - VictoryTheme, -} from "@/victory"; - -import { getData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Labels: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - /> - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryPolarAxis, + VictoryTheme, +} from "@/victory"; + +import { getData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Labels: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + /> + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/polar-bars.stories.tsx b/stories/victory-charts/victory-bar/polar-bars.stories.tsx index 3f55e994f..b882def0c 100644 --- a/stories/victory-charts/victory-bar/polar-bars.stories.tsx +++ b/stories/victory-charts/victory-bar/polar-bars.stories.tsx @@ -1,117 +1,117 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryGroup, - VictoryPolarAxis, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const PolarBars: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryGroup, + VictoryPolarAxis, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const PolarBars: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/regressions.stories.tsx b/stories/victory-charts/victory-bar/regressions.stories.tsx index 1da76b1fe..262e6e4d5 100644 --- a/stories/victory-charts/victory-bar/regressions.stories.tsx +++ b/stories/victory-charts/victory-bar/regressions.stories.tsx @@ -1,76 +1,76 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryGroup, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getData, getStackedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Regressions: Story = { - args: {}, - render: (props) => ( - <> - - - - {getStackedData(5, 3, "useStrings").map((data, index) => { - return ( - - ); - })} - - - {getStackedData(5, 3, "useStrings").map((data, index) => { - return ( - - ); - })} - - - {getStackedData(5, 3, "useStrings").map((data, index) => { - return ( - - ); - })} - - - - - datum.x} - > - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryGroup, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getData, getStackedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Regressions: Story = { + args: {}, + render: (props) => ( + <> + + + + {getStackedData(5, 3, "useStrings").map((data, index) => { + return ( + + ); + })} + + + {getStackedData(5, 3, "useStrings").map((data, index) => { + return ( + + ); + })} + + + {getStackedData(5, 3, "useStrings").map((data, index) => { + return ( + + ); + })} + + + + + datum.x} + > + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/scale.stories.tsx b/stories/victory-charts/victory-bar/scale.stories.tsx index e855b0a34..3f763797d 100644 --- a/stories/victory-charts/victory-bar/scale.stories.tsx +++ b/stories/victory-charts/victory-bar/scale.stories.tsx @@ -1,93 +1,93 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryGroup, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getLogData, getTimeData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Scale: Story = { - args: {}, - render: (props) => ( - <> - - datum.y.toPrecision(1)} - /> - - - datum.y.toPrecision(1)} - /> - - - datum.x.getFullYear()} - /> - - - datum.x.getFullYear()} - /> - - - datum.x.getFullYear()}> - - - - - - - datum.x.getFullYear()}> - - - - - - - datum.x.getFullYear()}> - - - - - - - datum.x.getFullYear()}> - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryGroup, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getLogData, getTimeData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Scale: Story = { + args: {}, + render: (props) => ( + <> + + datum.y.toPrecision(1)} + /> + + + datum.y.toPrecision(1)} + /> + + + datum.x.getFullYear()} + /> + + + datum.x.getFullYear()} + /> + + + datum.x.getFullYear()}> + + + + + + + datum.x.getFullYear()}> + + + + + + + datum.x.getFullYear()}> + + + + + + + datum.x.getFullYear()}> + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/sorting.stories.tsx b/stories/victory-charts/victory-bar/sorting.stories.tsx index c33405f86..193ed9c9d 100644 --- a/stories/victory-charts/victory-bar/sorting.stories.tsx +++ b/stories/victory-charts/victory-bar/sorting.stories.tsx @@ -1,39 +1,39 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Sorting: Story = { - args: { - data: [ - { x: "low", y: 1 }, - { x: "med", y: 2 }, - { x: "high", y: 3 }, - ], - sortKey: "sort", - }, - render: (props) => ( - <> - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Sorting: Story = { + args: { + data: [ + { x: "low", y: 1 }, + { x: "med", y: 2 }, + { x: "high", y: 3 }, + ], + sortKey: "sort", + }, + render: (props) => ( + <> + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/stacked-bars.stories.tsx b/stories/victory-charts/victory-bar/stacked-bars.stories.tsx index 59db80104..07a386aed 100644 --- a/stories/victory-charts/victory-bar/stacked-bars.stories.tsx +++ b/stories/victory-charts/victory-bar/stacked-bars.stories.tsx @@ -1,126 +1,126 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryLabel, - VictoryStack, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; - -import { getData, getDataWithBaseline, getMixedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const StackedBars: Story = { - args: {}, - render: (props) => ( - <> - - datum._y1.toPrecision(2)}> - - - - - - - - datum.y.toPrecision(2)} - labelComponent={} - /> - datum.y.toPrecision(2)} - labelComponent={} - /> - datum.y.toPrecision(2)} - labelComponent={} - /> - - - - datum._y1.toPrecision(2)}> - - - - - - - datum._y1.toPrecision(2)}> - - - - - - - datum._y1.toPrecision(2)}> - - - - - - - datum._y1.toPrecision(2)} - labelComponent={} - > - - - - - - - datum._y1.toPrecision(2)} - labelComponent={} - > - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryLabel, + VictoryStack, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; + +import { getData, getDataWithBaseline, getMixedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const StackedBars: Story = { + args: {}, + render: (props) => ( + <> + + datum._y1.toPrecision(2)}> + + + + + + + + datum.y.toPrecision(2)} + labelComponent={} + /> + datum.y.toPrecision(2)} + labelComponent={} + /> + datum.y.toPrecision(2)} + labelComponent={} + /> + + + + datum._y1.toPrecision(2)}> + + + + + + + datum._y1.toPrecision(2)}> + + + + + + + datum._y1.toPrecision(2)}> + + + + + + + datum._y1.toPrecision(2)} + labelComponent={} + > + + + + + + + datum._y1.toPrecision(2)} + labelComponent={} + > + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/style.stories.tsx b/stories/victory-charts/victory-bar/style.stories.tsx index 11bcae763..ac257218b 100644 --- a/stories/victory-charts/victory-bar/style.stories.tsx +++ b/stories/victory-charts/victory-bar/style.stories.tsx @@ -1,54 +1,54 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Style: Story = { - args: {}, - render: (props) => ( - <> - - datum.y} - style={{ - labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, - data: { - fill: "tomato", - fillOpacity: 0.7, - stroke: "tomato", - strokeWidth: 2, - }, - }} - /> - - - (datum.y > 75 ? "red" : "transparent"), - strokeWidth: 3, - opacity: ({ datum }) => (datum.y > 75 ? 1 : 0.4), - }, - }} - labels={({ datum }) => datum.x} - data={[ - { x: "Cat", y: 62 }, - { x: "Dog", y: 91 }, - { x: "Fish", y: 55 }, - { x: "Bird", y: 55 }, - ]} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Style: Story = { + args: {}, + render: (props) => ( + <> + + datum.y} + style={{ + labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, + data: { + fill: "tomato", + fillOpacity: 0.7, + stroke: "tomato", + strokeWidth: 2, + }, + }} + /> + + + (datum.y > 75 ? "red" : "transparent"), + strokeWidth: 3, + opacity: ({ datum }) => (datum.y > 75 ? 1 : 0.4), + }, + }} + labels={({ datum }) => datum.x} + data={[ + { x: "Cat", y: 62 }, + { x: "Dog", y: 91 }, + { x: "Fish", y: 55 }, + { x: "Bird", y: 55 }, + ]} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/theme.stories.tsx b/stories/victory-charts/victory-bar/theme.stories.tsx index 723e5056f..3ef66e922 100644 --- a/stories/victory-charts/victory-bar/theme.stories.tsx +++ b/stories/victory-charts/victory-bar/theme.stories.tsx @@ -1,62 +1,62 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Theme: Story = { - args: {}, - render: (props) => ( - <> - - - - - datum.x}> - - - - - - - - - - - - datum.x}> - - - - - - - - - - - - datum.x}> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Theme: Story = { + args: {}, + render: (props) => ( + <> + + + + + datum.x}> + + + + + + + + + + + + datum.x}> + + + + + + + + + + + + datum.x}> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-bar/tooltips.stories.tsx b/stories/victory-charts/victory-bar/tooltips.stories.tsx index 18b5b65b5..14a983e9f 100644 --- a/stories/victory-charts/victory-bar/tooltips.stories.tsx +++ b/stories/victory-charts/victory-bar/tooltips.stories.tsx @@ -1,86 +1,86 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryPolarAxis, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; - -import { getData, getMixedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBar", -}; - -export const Tooltips: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - labelComponent={} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - } - /> - - - } - /> - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryPolarAxis, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; + +import { getData, getMixedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBar", +}; + +export const Tooltips: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + labelComponent={} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + } + /> + + + } + /> + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-box-plot/box-width.stories.tsx b/stories/victory-charts/victory-box-plot/box-width.stories.tsx index 622e4b72b..11c683ce6 100644 --- a/stories/victory-charts/victory-box-plot/box-width.stories.tsx +++ b/stories/victory-charts/victory-box-plot/box-width.stories.tsx @@ -1,43 +1,43 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBoxPlot, VictoryChart, VictoryTheme } from "@/victory"; - -import { getBoxPlotData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBoxPlot", -}; - -export const BoxWidth: Story = { - args: { - data: getBoxPlotData(5), - domainPadding: 20, - }, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBoxPlot, VictoryChart, VictoryTheme } from "@/victory"; + +import { getBoxPlotData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBoxPlot", +}; + +export const BoxWidth: Story = { + args: { + data: getBoxPlotData(5), + domainPadding: 20, + }, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-box-plot/data.stories.tsx b/stories/victory-charts/victory-box-plot/data.stories.tsx index 12f2e275a..bc8409b60 100644 --- a/stories/victory-charts/victory-box-plot/data.stories.tsx +++ b/stories/victory-charts/victory-box-plot/data.stories.tsx @@ -1,68 +1,68 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBoxPlot, VictoryChart, VictoryTheme } from "@/victory"; - -import { getArrayData, getBoxPlotRepeatData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBoxPlot", -}; - -export const Data: Story = { - args: { - domainPadding: 20, - }, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBoxPlot, VictoryChart, VictoryTheme } from "@/victory"; + +import { getArrayData, getBoxPlotRepeatData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBoxPlot", +}; + +export const Data: Story = { + args: { + domainPadding: 20, + }, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-box-plot/group.stories.tsx b/stories/victory-charts/victory-box-plot/group.stories.tsx index bfab546e2..f8c230060 100644 --- a/stories/victory-charts/victory-box-plot/group.stories.tsx +++ b/stories/victory-charts/victory-box-plot/group.stories.tsx @@ -1,42 +1,42 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBoxPlot, VictoryGroup } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBoxPlot", -}; - -export const Group: Story = { - args: { - domainPadding: 20, - }, - render: (props) => ( - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBoxPlot, VictoryGroup } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBoxPlot", +}; + +export const Group: Story = { + args: { + domainPadding: 20, + }, + render: (props) => ( + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-box-plot/labels.stories.tsx b/stories/victory-charts/victory-box-plot/labels.stories.tsx index addeaa6e9..dfb5da728 100644 --- a/stories/victory-charts/victory-box-plot/labels.stories.tsx +++ b/stories/victory-charts/victory-box-plot/labels.stories.tsx @@ -1,77 +1,77 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBoxPlot, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getBoxPlotData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBoxPlot", -}; - -export const Labels: Story = { - args: { - data: getBoxPlotData(3), - domainPadding: 20, - }, - render: (props) => ( - <> - - - - - - - - - - - - - - `min: ${datum.min}`} - maxLabels={({ datum }) => `max: ${datum.max}`} - medianLabels={({ datum }) => `med: ${datum.median}`} - {...props} - /> - - - `q1: ${datum.q1}`} - q3Labels={({ datum }) => `q3: ${datum.q3}`} - {...props} - /> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBoxPlot, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getBoxPlotData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBoxPlot", +}; + +export const Labels: Story = { + args: { + data: getBoxPlotData(3), + domainPadding: 20, + }, + render: (props) => ( + <> + + + + + + + + + + + + + + `min: ${datum.min}`} + maxLabels={({ datum }) => `max: ${datum.max}`} + medianLabels={({ datum }) => `med: ${datum.median}`} + {...props} + /> + + + `q1: ${datum.q1}`} + q3Labels={({ datum }) => `q3: ${datum.q3}`} + {...props} + /> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-box-plot/style.stories.tsx b/stories/victory-charts/victory-box-plot/style.stories.tsx index 4c9c64e47..5905e2167 100644 --- a/stories/victory-charts/victory-box-plot/style.stories.tsx +++ b/stories/victory-charts/victory-box-plot/style.stories.tsx @@ -1,60 +1,60 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBoxPlot, VictoryChart, VictoryTheme } from "@/victory"; - -import { getBoxPlotData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBoxPlot", -}; - -export const Style: Story = { - args: { - data: getBoxPlotData(4), - domainPadding: 20, - labels: true, - }, - render: (props) => ( - <> - - - - - (datum.q1 < 10 ? 1 : 0.5), - }, - q3: { - fill: "#2bbee0", - fillOpacity: ({ datum }) => (datum.q3 > 15 ? 1 : 0.5), - }, - median: { stroke: "#fff", strokeWidth: 2 }, - minLabels: { fill: "#FF530D", padding: 10 }, - maxLabels: { fill: "#2bbee0", padding: 10 }, - }} - {...props} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBoxPlot, VictoryChart, VictoryTheme } from "@/victory"; + +import { getBoxPlotData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBoxPlot", +}; + +export const Style: Story = { + args: { + data: getBoxPlotData(4), + domainPadding: 20, + labels: true, + }, + render: (props) => ( + <> + + + + + (datum.q1 < 10 ? 1 : 0.5), + }, + q3: { + fill: "#2bbee0", + fillOpacity: ({ datum }) => (datum.q3 > 15 ? 1 : 0.5), + }, + median: { stroke: "#fff", strokeWidth: 2 }, + minLabels: { fill: "#FF530D", padding: 10 }, + maxLabels: { fill: "#2bbee0", padding: 10 }, + }} + {...props} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-box-plot/tooltips.stories.tsx b/stories/victory-charts/victory-box-plot/tooltips.stories.tsx index 8f11fe984..77b264a98 100644 --- a/stories/victory-charts/victory-box-plot/tooltips.stories.tsx +++ b/stories/victory-charts/victory-box-plot/tooltips.stories.tsx @@ -1,59 +1,59 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBoxPlot, - VictoryChart, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; - -import { getBoxPlotData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryBoxPlot", -}; - -export const Tooltips: Story = { - args: { - data: getBoxPlotData(3), - domainPadding: 20, - labels: true, - }, - render: (props) => ( - <> - - } - q3LabelComponent={} - labelOrientation={{ - q1: "left", - q3: "left", - min: "right", - max: "right", - median: "right", - }} - {...props} - /> - - - } - q3LabelComponent={} - labelOrientation={{ - q1: "top", - q3: "top", - min: "bottom", - max: "bottom", - median: "bottom", - }} - {...props} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBoxPlot, + VictoryChart, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; + +import { getBoxPlotData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryBoxPlot", +}; + +export const Tooltips: Story = { + args: { + data: getBoxPlotData(3), + domainPadding: 20, + labels: true, + }, + render: (props) => ( + <> + + } + q3LabelComponent={} + labelOrientation={{ + q1: "left", + q3: "left", + min: "right", + max: "right", + median: "right", + }} + {...props} + /> + + + } + q3LabelComponent={} + labelOrientation={{ + q1: "top", + q3: "top", + min: "bottom", + max: "bottom", + median: "bottom", + }} + {...props} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-candlestick/data.stories.tsx b/stories/victory-charts/victory-candlestick/data.stories.tsx index 00dfa4f56..2a41f3dfc 100644 --- a/stories/victory-charts/victory-candlestick/data.stories.tsx +++ b/stories/victory-charts/victory-candlestick/data.stories.tsx @@ -1,64 +1,64 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryCandlestick, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryCandlestick", -}; - -export const Data: Story = { - args: { - domainPadding: 20, - }, - render: (props) => ( - <> - - data.big /10 } - /> - - - data.big / 10} - /> - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryCandlestick, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryCandlestick", +}; + +export const Data: Story = { + args: { + domainPadding: 20, + }, + render: (props) => ( + <> + + data.big / 10} + /> + + + data.big / 10} + /> + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-candlestick/domain.stories.tsx b/stories/victory-charts/victory-candlestick/domain.stories.tsx index ce7109bff..2857c4a32 100644 --- a/stories/victory-charts/victory-candlestick/domain.stories.tsx +++ b/stories/victory-charts/victory-candlestick/domain.stories.tsx @@ -1,81 +1,81 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryCandlestick, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryCandlestick", -}; - -export const Domain: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryCandlestick, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryCandlestick", +}; + +export const Domain: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-candlestick/labels.stories.tsx b/stories/victory-charts/victory-candlestick/labels.stories.tsx index 2b030cf80..af976e34a 100644 --- a/stories/victory-charts/victory-candlestick/labels.stories.tsx +++ b/stories/victory-charts/victory-candlestick/labels.stories.tsx @@ -1,78 +1,78 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryCandlestick, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getCandlestickData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryCandlestick", -}; - -const sampleData = [ - { x: 1, open: 9, close: 30, high: 56, low: 7 }, - { x: 2, open: 80, close: 40, high: 120, low: 10 }, - { x: 3, open: 50, close: 80, high: 90, low: 20 }, - { x: 4, open: 70, close: 22, high: 70, low: 5 }, -]; - -export const Labels: Story = { - args: { - domainPadding: 20, - }, - render: (props) => ( - <> - - `x: ${datum.x}`} - /> - - - `x: ${datum.x}`} - /> - - - datum.open} - closeLabels={({ datum }) => datum.close} - /> - - - datum.open} - closeLabels={({ datum }) => datum.close} - labelOrientation={{ open: "top", close: "bottom" }} - /> - - - datum.high} - lowLabels={({ datum }) => datum.low} - /> - - - datum.high} - lowLabels={({ datum }) => datum.low} - labelOrientation={{ low: "left", high: "right" }} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryCandlestick, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getCandlestickData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryCandlestick", +}; + +const sampleData = [ + { x: 1, open: 9, close: 30, high: 56, low: 7 }, + { x: 2, open: 80, close: 40, high: 120, low: 10 }, + { x: 3, open: 50, close: 80, high: 90, low: 20 }, + { x: 4, open: 70, close: 22, high: 70, low: 5 }, +]; + +export const Labels: Story = { + args: { + domainPadding: 20, + }, + render: (props) => ( + <> + + `x: ${datum.x}`} + /> + + + `x: ${datum.x}`} + /> + + + datum.open} + closeLabels={({ datum }) => datum.close} + /> + + + datum.open} + closeLabels={({ datum }) => datum.close} + labelOrientation={{ open: "top", close: "bottom" }} + /> + + + datum.high} + lowLabels={({ datum }) => datum.low} + /> + + + datum.high} + lowLabels={({ datum }) => datum.low} + labelOrientation={{ low: "left", high: "right" }} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-candlestick/style.stories.tsx b/stories/victory-charts/victory-candlestick/style.stories.tsx index 88ab9351d..ed5e67c43 100644 --- a/stories/victory-charts/victory-candlestick/style.stories.tsx +++ b/stories/victory-charts/victory-candlestick/style.stories.tsx @@ -1,50 +1,50 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryCandlestick, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getCandlestickData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryCandlestick", -}; - -export const Style: Story = { - args: { - data: getCandlestickData(7), - }, - render: (props) => ( - <> - - datum.x} - style={{ - labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, - data: { - fill: "tomato", - fillOpacity: 0.7, - stroke: "tomato", - strokeWidth: 2, - }, - }} - /> - - - - datum.open > datum.close ? "red" : "black", - }, - }} - labels={({ datum }) => datum.x} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryCandlestick, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getCandlestickData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryCandlestick", +}; + +export const Style: Story = { + args: { + data: getCandlestickData(7), + }, + render: (props) => ( + <> + + datum.x} + style={{ + labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, + data: { + fill: "tomato", + fillOpacity: 0.7, + stroke: "tomato", + strokeWidth: 2, + }, + }} + /> + + + + datum.open > datum.close ? "red" : "black", + }, + }} + labels={({ datum }) => datum.x} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-candlestick/tooltips.stories.tsx b/stories/victory-charts/victory-candlestick/tooltips.stories.tsx index 68574ea8a..73b3ac354 100644 --- a/stories/victory-charts/victory-candlestick/tooltips.stories.tsx +++ b/stories/victory-charts/victory-candlestick/tooltips.stories.tsx @@ -1,103 +1,103 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryCandlestick, - VictoryChart, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getCandlestickData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryCandlestick", -}; - -const sampleData = [ - { x: 1, open: 9, close: 30, high: 56, low: 7 }, - { x: 2, open: 80, close: 40, high: 120, low: 10 }, - { x: 3, open: 50, close: 80, high: 90, low: 20 }, - { x: 4, open: 70, close: 22, high: 70, low: 5 }, -]; - -export const Tooltips: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - labelComponent={} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - datum.open} - closeLabels={({ datum }) => datum.close} - openLabelComponent={} - closeLabelComponent={} - /> - - - datum.open} - closeLabels={({ datum }) => datum.close} - openLabelComponent={} - closeLabelComponent={} - labelOrientation={{ open: "top", close: "bottom" }} - /> - - - datum.high} - lowLabels={({ datum }) => datum.low} - highLabelComponent={} - lowLabelComponent={} - /> - - - datum.high} - lowLabels={({ datum }) => datum.low} - highLabelComponent={} - lowLabelComponent={} - labelOrientation={{ low: "left", high: "right" }} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryCandlestick, + VictoryChart, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getCandlestickData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryCandlestick", +}; + +const sampleData = [ + { x: 1, open: 9, close: 30, high: 56, low: 7 }, + { x: 2, open: 80, close: 40, high: 120, low: 10 }, + { x: 3, open: 50, close: 80, high: 90, low: 20 }, + { x: 4, open: 70, close: 22, high: 70, low: 5 }, +]; + +export const Tooltips: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + labelComponent={} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + datum.open} + closeLabels={({ datum }) => datum.close} + openLabelComponent={} + closeLabelComponent={} + /> + + + datum.open} + closeLabels={({ datum }) => datum.close} + openLabelComponent={} + closeLabelComponent={} + labelOrientation={{ open: "top", close: "bottom" }} + /> + + + datum.high} + lowLabels={({ datum }) => datum.low} + highLabelComponent={} + lowLabelComponent={} + /> + + + datum.high} + lowLabels={({ datum }) => datum.low} + highLabelComponent={} + lowLabelComponent={} + labelOrientation={{ low: "left", high: "right" }} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-chart/domain-from-data.stories.tsx b/stories/victory-charts/victory-chart/domain-from-data.stories.tsx index b34ffc349..308faa652 100644 --- a/stories/victory-charts/victory-chart/domain-from-data.stories.tsx +++ b/stories/victory-charts/victory-chart/domain-from-data.stories.tsx @@ -1,119 +1,119 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryAxis, - VictoryBoxPlot, - VictoryChart, - VictoryLine, - VictoryScatter, - VictoryTheme, -} from "@/victory"; - -import { getArrayData, getData, getFourQuadrantData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryChart", -}; - -export const DomainFromData: Story = { - args: {}, - render: (props) => ( - <> - - - - 10 * Math.sin(13 * Math.PI * d.x)} - /> - - - - - 10 * Math.sin(13 * Math.PI * d.x)} - /> - - - - - - Math.sin(Math.PI * d.x)} /> - - - - - - Math.sin(Math.PI * d.x)} /> - - - - - - - - - - - - 5 + 3 * Math.sin(Math.PI * d.x)} /> - - - - 5 + 3 * Math.sin(Math.PI * d.x)} /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryAxis, + VictoryBoxPlot, + VictoryChart, + VictoryLine, + VictoryScatter, + VictoryTheme, +} from "@/victory"; + +import { getArrayData, getData, getFourQuadrantData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryChart", +}; + +export const DomainFromData: Story = { + args: {}, + render: (props) => ( + <> + + + + 10 * Math.sin(13 * Math.PI * d.x)} + /> + + + + + 10 * Math.sin(13 * Math.PI * d.x)} + /> + + + + + + Math.sin(Math.PI * d.x)} /> + + + + + + Math.sin(Math.PI * d.x)} /> + + + + + + + + + + + + 5 + 3 * Math.sin(Math.PI * d.x)} /> + + + + 5 + 3 * Math.sin(Math.PI * d.x)} /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-chart/domain-padding.stories.tsx b/stories/victory-charts/victory-chart/domain-padding.stories.tsx index 8c1b8fb0d..f122a20e5 100644 --- a/stories/victory-charts/victory-chart/domain-padding.stories.tsx +++ b/stories/victory-charts/victory-chart/domain-padding.stories.tsx @@ -1,69 +1,69 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; - -import { getData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryChart", -}; - -export const DomainPadding: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBar, VictoryChart, VictoryTheme } from "@/victory"; + +import { getData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryChart", +}; + +export const DomainPadding: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-chart/domain.stories.tsx b/stories/victory-charts/victory-chart/domain.stories.tsx index 4ab58e8b8..b80942c21 100644 --- a/stories/victory-charts/victory-chart/domain.stories.tsx +++ b/stories/victory-charts/victory-chart/domain.stories.tsx @@ -1,86 +1,86 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryBar, VictoryChart, VictoryLine, VictoryTheme } from "@/victory"; - -import { getData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryChart", -}; - -export const Domain: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryBar, VictoryChart, VictoryLine, VictoryTheme } from "@/victory"; + +import { getData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryChart", +}; + +export const Domain: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-chart/orientations.stories.tsx b/stories/victory-charts/victory-chart/orientations.stories.tsx index 883e92b81..e2d062a27 100644 --- a/stories/victory-charts/victory-chart/orientations.stories.tsx +++ b/stories/victory-charts/victory-chart/orientations.stories.tsx @@ -1,46 +1,46 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryAxis, VictoryBar, VictoryChart } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryChart", -}; - -export const Orientations: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryAxis, VictoryBar, VictoryChart } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryChart", +}; + +export const Orientations: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-chart/style.stories.tsx b/stories/victory-charts/victory-chart/style.stories.tsx index 41dff9d63..696d255f8 100644 --- a/stories/victory-charts/victory-chart/style.stories.tsx +++ b/stories/victory-charts/victory-chart/style.stories.tsx @@ -1,238 +1,238 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryChart, - VictoryGroup, - VictoryPolarAxis, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryChart", -}; - -export const Style: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryChart, + VictoryGroup, + VictoryPolarAxis, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryChart", +}; + +export const Style: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-chart/victory-zoom-container-default.stories.tsx b/stories/victory-charts/victory-chart/victory-zoom-container-default.stories.tsx index f0daabc86..c264713a2 100644 --- a/stories/victory-charts/victory-chart/victory-zoom-container-default.stories.tsx +++ b/stories/victory-charts/victory-chart/victory-zoom-container-default.stories.tsx @@ -1,52 +1,52 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryChart, - VictoryLine, - VictoryZoomContainer, - VictoryTheme, -} from "@/victory"; - -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryChart", -}; - -export const VictoryZoomContainerDefault: Story = { - args: {}, - render: (props) => ( - <> - - } - > - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryChart, + VictoryLine, + VictoryZoomContainer, + VictoryTheme, +} from "@/victory"; + +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryChart", +}; + +export const VictoryZoomContainerDefault: Story = { + args: {}, + render: (props) => ( + <> + + } + > + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-container/preserve-aspect-ratio.stories.tsx b/stories/victory-charts/victory-container/preserve-aspect-ratio.stories.tsx index 46a10d356..4e34cdce5 100644 --- a/stories/victory-charts/victory-container/preserve-aspect-ratio.stories.tsx +++ b/stories/victory-charts/victory-container/preserve-aspect-ratio.stories.tsx @@ -1,69 +1,69 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryContainer, - VictoryChart, - VictoryLabel, - VictoryLine, - VictoryTheme, -} from "@/victory"; - -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryContainer", -}; - -export const PreserveAspectRatio: Story = { - args: { - height: 250, - width: 500, - }, - render: (props) => ( - <> - - - - - - } - > - - - - - } - > - - - - - } - > - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryContainer, + VictoryChart, + VictoryLabel, + VictoryLine, + VictoryTheme, +} from "@/victory"; + +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryContainer", +}; + +export const PreserveAspectRatio: Story = { + args: { + height: 250, + width: 500, + }, + render: (props) => ( + <> + + + + + + } + > + + + + + } + > + + + + + } + > + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-errorbar/data.stories.tsx b/stories/victory-charts/victory-errorbar/data.stories.tsx index 99d084d5d..79c2cd6a9 100644 --- a/stories/victory-charts/victory-errorbar/data.stories.tsx +++ b/stories/victory-charts/victory-errorbar/data.stories.tsx @@ -1,75 +1,75 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryErrorBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryErrorBar", -}; - -export const Data: Story = { - args: {}, - render: (props) => ( - <> - - - - - [d.error, d.error + 2]} - /> - - - [d.error, d.error + 2]} - /> - - - [d.error, d.error + 2]} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryErrorBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryErrorBar", +}; + +export const Data: Story = { + args: {}, + render: (props) => ( + <> + + + + + [d.error, d.error + 2]} + /> + + + [d.error, d.error + 2]} + /> + + + [d.error, d.error + 2]} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-errorbar/domain.stories.tsx b/stories/victory-charts/victory-errorbar/domain.stories.tsx index 40250583f..8be5ed043 100644 --- a/stories/victory-charts/victory-errorbar/domain.stories.tsx +++ b/stories/victory-charts/victory-errorbar/domain.stories.tsx @@ -1,70 +1,70 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryErrorBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryErrorBar", -}; - -export const Domain: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryErrorBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryErrorBar", +}; + +export const Domain: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-errorbar/labels.stories.tsx b/stories/victory-charts/victory-errorbar/labels.stories.tsx index 3f10a455d..d7cd65e39 100644 --- a/stories/victory-charts/victory-errorbar/labels.stories.tsx +++ b/stories/victory-charts/victory-errorbar/labels.stories.tsx @@ -1,80 +1,80 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryErrorBar, - VictoryChart, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; - -import { getErrorBarData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryErrorBar", -}; - -export const Labels: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - - - - } - /> - - - [d.error, d.error + 2]} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryErrorBar, + VictoryChart, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; + +import { getErrorBarData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryErrorBar", +}; + +export const Labels: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + + + + } + /> + + + [d.error, d.error + 2]} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-errorbar/style.stories.tsx b/stories/victory-charts/victory-errorbar/style.stories.tsx index e2db38cee..43fccd8e8 100644 --- a/stories/victory-charts/victory-errorbar/style.stories.tsx +++ b/stories/victory-charts/victory-errorbar/style.stories.tsx @@ -1,50 +1,50 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryErrorBar, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getErrorBarData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryErrorBar", -}; - -export const Style: Story = { - args: {}, - render: (props) => ( - <> - - datum.x} - style={{ - labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, - data: { - fill: "tomato", - fillOpacity: 0.7, - stroke: "tomato", - strokeWidth: 2, - }, - }} - /> - - - - datum.errorX > datum.errorY ? "red" : "black", - }, - }} - labels={({ datum }) => datum.x} - data={getErrorBarData(4, true)} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryErrorBar, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getErrorBarData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryErrorBar", +}; + +export const Style: Story = { + args: {}, + render: (props) => ( + <> + + datum.x} + style={{ + labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, + data: { + fill: "tomato", + fillOpacity: 0.7, + stroke: "tomato", + strokeWidth: 2, + }, + }} + /> + + + + datum.errorX > datum.errorY ? "red" : "black", + }, + }} + labels={({ datum }) => datum.x} + data={getErrorBarData(4, true)} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-errorbar/theme.stories.tsx b/stories/victory-charts/victory-errorbar/theme.stories.tsx index cadbe1f12..7f03dcd85 100644 --- a/stories/victory-charts/victory-errorbar/theme.stories.tsx +++ b/stories/victory-charts/victory-errorbar/theme.stories.tsx @@ -13,7 +13,7 @@ const meta: Meta = { export const Theme: Story = { args: { - data: getErrorBarData(5) + data: getErrorBarData(5), }, render: (props) => ( <> diff --git a/stories/victory-charts/victory-histogram/bin-spacing.stories.tsx b/stories/victory-charts/victory-histogram/bin-spacing.stories.tsx index 10d67c712..91086afef 100644 --- a/stories/victory-charts/victory-histogram/bin-spacing.stories.tsx +++ b/stories/victory-charts/victory-histogram/bin-spacing.stories.tsx @@ -13,21 +13,21 @@ const meta: Meta = { export const BinSpacing: Story = { args: { - data + data, }, render: (props) => ( <> - + - + - + - + ), diff --git a/stories/victory-charts/victory-histogram/corner-radius.stories.tsx b/stories/victory-charts/victory-histogram/corner-radius.stories.tsx index d46ad0535..b63a4daa4 100644 --- a/stories/victory-charts/victory-histogram/corner-radius.stories.tsx +++ b/stories/victory-charts/victory-histogram/corner-radius.stories.tsx @@ -1,46 +1,48 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; - -import { data } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const CornerRadius: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; + +import { data } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const CornerRadius: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/data.stories.tsx b/stories/victory-charts/victory-histogram/data.stories.tsx index 69fc1b570..48ddf68e6 100644 --- a/stories/victory-charts/victory-histogram/data.stories.tsx +++ b/stories/victory-charts/victory-histogram/data.stories.tsx @@ -1,69 +1,70 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; - -import { data, timeData } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const Data: Story = { - args: {}, - render: (props) => { - const oneYear = timeData.map(({ x }) => { - const newDate = new Date(x); - newDate.setFullYear(2020); - return { x: newDate }; - }); - - const fourMonths = timeData.map(({ x }, index) => { - const newDate = new Date(x); - newDate.setFullYear(2020); - newDate.setMonth(Math.ceil(index / 200)); - return { x: newDate }; - }); - - const oneMonth = timeData.map(({ x }) => { - const newDate = new Date(x); - newDate.setMonth(4); - newDate.setFullYear(2020); - return { x: newDate }; - }); - - return ( - <> - - - - - - - - - - - - - - ({ value: x }))} - x={({ value }) => value} - /> - - {/* - ({ value: x }))} - x={({ value }) => value} - /> - */} - - ); - }, -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; + +import { data, timeData } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const Data: Story = { + args: {}, + render: (props) => { + const oneYear = timeData.map(({ x }) => { + const newDate = new Date(x); + newDate.setFullYear(2020); + return { x: newDate }; + }); + + const fourMonths = timeData.map(({ x }, index) => { + const newDate = new Date(x); + newDate.setFullYear(2020); + newDate.setMonth(Math.ceil(index / 200)); + return { x: newDate }; + }); + + const oneMonth = timeData.map(({ x }) => { + const newDate = new Date(x); + newDate.setMonth(4); + newDate.setFullYear(2020); + return { x: newDate }; + }); + + return ( + <> + + + + + + + + + + + + + + ({ value: x }))} + x={({ value }) => value} + /> + + {/* + ({ value: x }))} + x={({ value }) => value} + /> + */} + + ); + }, +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/date-bins.stories.tsx b/stories/victory-charts/victory-histogram/date-bins.stories.tsx index ca24b6512..f3bd62c5e 100644 --- a/stories/victory-charts/victory-histogram/date-bins.stories.tsx +++ b/stories/victory-charts/victory-histogram/date-bins.stories.tsx @@ -1,84 +1,89 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; -import * as d3Array from "@/victory-vendor/d3-array"; -import * as d3Scale from "@/victory-vendor/d3-scale"; -import * as d3Time from "@/victory-vendor/d3-time"; - -import { timeData } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const DateBins: Story = { - args: {}, - render: (props) => { - // HACK: d3scale has a scaleTime function but the types - // are whack coming through the build - const niceTimeScale = (d3Scale as any) - .scaleTime() - .domain(d3Array.extent(timeData, ({ x }) => x)) - .nice(); - - return ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); - }, -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; +import * as d3Array from "@/victory-vendor/d3-array"; +import * as d3Scale from "@/victory-vendor/d3-scale"; +import * as d3Time from "@/victory-vendor/d3-time"; + +import { timeData } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const DateBins: Story = { + args: {}, + render: (props) => { + // HACK: d3scale has a scaleTime function but the types + // are whack coming through the build + const niceTimeScale = (d3Scale as any) + .scaleTime() + .domain(d3Array.extent(timeData, ({ x }) => x)) + .nice(); + + return ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); + }, +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/disable-inline-styles.stories.tsx b/stories/victory-charts/victory-histogram/disable-inline-styles.stories.tsx index 010c0134d..7bce30d4b 100644 --- a/stories/victory-charts/victory-histogram/disable-inline-styles.stories.tsx +++ b/stories/victory-charts/victory-histogram/disable-inline-styles.stories.tsx @@ -16,10 +16,11 @@ export const DisableInlineStyles: Story = { render: (props) => ( <> - + - } /> diff --git a/stories/victory-charts/victory-histogram/empty-data.stories.tsx b/stories/victory-charts/victory-histogram/empty-data.stories.tsx index 5d3bb1c1b..4669e599d 100644 --- a/stories/victory-charts/victory-histogram/empty-data.stories.tsx +++ b/stories/victory-charts/victory-histogram/empty-data.stories.tsx @@ -1,51 +1,51 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; - -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const EmptyData: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; + +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const EmptyData: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/get-path.stories.tsx b/stories/victory-charts/victory-histogram/get-path.stories.tsx index 7f7b1f68a..50ba4c845 100644 --- a/stories/victory-charts/victory-histogram/get-path.stories.tsx +++ b/stories/victory-charts/victory-histogram/get-path.stories.tsx @@ -1,49 +1,49 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; - -import { data } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const GetPath: Story = { - args: {}, - render: (props) => { - // const verticalPathFn = (callbackArgs) => { - // const { x0, x1, y0, y1 } = callbackArgs; - // return `M ${x0}, ${y0} - // L ${(x1 + x0) / 2}, ${y1} - // L ${x1}, ${y0} - // z`; - // }; - - // const horizontalPathFn = (callbackArgs) => { - // const { x0, x1, y0, y1 } = callbackArgs; - // return `M ${x0}, ${y1} - // L ${x1}, ${(y0 + y1) / 2} - // L ${x0}, ${y0} - // z`; - // }; - - // TODO: revert this when the getPath types are fixed. - return ( - <> - - {/* */} - - - - {/* */} - - - - ); - }, -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; + +import { data } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const GetPath: Story = { + args: {}, + render: (props) => { + // const verticalPathFn = (callbackArgs) => { + // const { x0, x1, y0, y1 } = callbackArgs; + // return `M ${x0}, ${y0} + // L ${(x1 + x0) / 2}, ${y1} + // L ${x1}, ${y0} + // z`; + // }; + + // const horizontalPathFn = (callbackArgs) => { + // const { x0, x1, y0, y1 } = callbackArgs; + // return `M ${x0}, ${y1} + // L ${x1}, ${(y0 + y1) / 2} + // L ${x0}, ${y0} + // z`; + // }; + + // TODO: revert this when the getPath types are fixed. + return ( + <> + + {/* */} + + + + {/* */} + + + + ); + }, +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/labels.stories.tsx b/stories/victory-charts/victory-histogram/labels.stories.tsx index e8a1ed8e7..4b2ce322f 100644 --- a/stories/victory-charts/victory-histogram/labels.stories.tsx +++ b/stories/victory-charts/victory-histogram/labels.stories.tsx @@ -1,77 +1,77 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryHistogram, - VictoryChart, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; - -import { data } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const Labels: Story = { - args: {}, - render: (props) => ( - <> - - `${datum.x0} - ${datum.x1}`} - /> - - - `${datum.x0} - ${datum.x1}`} - /> - - - - - - - - - `${datum.x0} - ${datum.x1}`} - labelComponent={} - /> - - - } - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryHistogram, + VictoryChart, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; + +import { data } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const Labels: Story = { + args: {}, + render: (props) => ( + <> + + `${datum.x0} - ${datum.x1}`} + /> + + + `${datum.x0} - ${datum.x1}`} + /> + + + + + + + + + `${datum.x0} - ${datum.x1}`} + labelComponent={} + /> + + + } + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/mixed-charts.stories.tsx b/stories/victory-charts/victory-histogram/mixed-charts.stories.tsx index b7d565352..847eea73d 100644 --- a/stories/victory-charts/victory-histogram/mixed-charts.stories.tsx +++ b/stories/victory-charts/victory-histogram/mixed-charts.stories.tsx @@ -1,58 +1,58 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryHistogram, - VictoryLine, - VictoryChart, - VictoryScatter, - VictoryTheme, -} from "@/victory"; - -import { data } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const MixedCharts: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryHistogram, + VictoryLine, + VictoryChart, + VictoryScatter, + VictoryTheme, +} from "@/victory"; + +import { data } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const MixedCharts: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/numeric-bins.stories.tsx b/stories/victory-charts/victory-histogram/numeric-bins.stories.tsx index 77efa4f0f..5bb727e44 100644 --- a/stories/victory-charts/victory-histogram/numeric-bins.stories.tsx +++ b/stories/victory-charts/victory-histogram/numeric-bins.stories.tsx @@ -1,58 +1,58 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; - -import { data } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const NumericBins: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; + +import { data } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const NumericBins: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/scale.stories.tsx b/stories/victory-charts/victory-histogram/scale.stories.tsx index 3c850a652..40b5dc3df 100644 --- a/stories/victory-charts/victory-histogram/scale.stories.tsx +++ b/stories/victory-charts/victory-histogram/scale.stories.tsx @@ -1,64 +1,64 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; - -import { data, timeData } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const Scale: Story = { - args: {}, - render: (props) => ( - <> - - - `${datum.x0.getFullYear()}\n|\n${datum.x1.getFullYear()}` - } - /> - - - - `${datum.x0.getFullYear()} - ${datum.x1.getFullYear()}` - } - /> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; + +import { data, timeData } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const Scale: Story = { + args: {}, + render: (props) => ( + <> + + + `${datum.x0.getFullYear()}\n|\n${datum.x1.getFullYear()}` + } + /> + + + + `${datum.x0.getFullYear()} - ${datum.x1.getFullYear()}` + } + /> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/stacked.stories.tsx b/stories/victory-charts/victory-histogram/stacked.stories.tsx index 1fda72963..7b8aaf1f5 100644 --- a/stories/victory-charts/victory-histogram/stacked.stories.tsx +++ b/stories/victory-charts/victory-histogram/stacked.stories.tsx @@ -1,99 +1,99 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryHistogram, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getData } from "../../utils/data"; -import { data } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const Stacked: Story = { - args: {}, - render: (props) => { - const stackedData = [ - ...[50, 30, 100, 32, 50, 10, 49, 78, 20].map((count) => - getData(count, count.toString(), 100), - ), - [{ x: 1 }, { x: 3 }, { x: 1 }, { x: 2 }], - ]; - - return ( - <> - - - {stackedData.map((d, index) => ( - - ))} - - - - - {stackedData.map((d, index) => ( - - ))} - - - - - {stackedData.map((d, index) => ( - - ))} - - - - - {stackedData.map((d, index) => ( - - ))} - - - - - ({ a: { b: { c: x } } }))} - x="a.b.c" - /> - {stackedData.map((d, index) => ( - - ))} - - - - - ({ a: { b: { c: x } } }))} - x="a.b.c" - /> - {stackedData.map((d, index) => ( - - ))} - - - - ); - }, -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryHistogram, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getData } from "../../utils/data"; +import { data } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const Stacked: Story = { + args: {}, + render: (props) => { + const stackedData = [ + ...[50, 30, 100, 32, 50, 10, 49, 78, 20].map((count) => + getData(count, count.toString(), 100), + ), + [{ x: 1 }, { x: 3 }, { x: 1 }, { x: 2 }], + ]; + + return ( + <> + + + {stackedData.map((d, index) => ( + + ))} + + + + + {stackedData.map((d, index) => ( + + ))} + + + + + {stackedData.map((d, index) => ( + + ))} + + + + + {stackedData.map((d, index) => ( + + ))} + + + + + ({ a: { b: { c: x } } }))} + x="a.b.c" + /> + {stackedData.map((d, index) => ( + + ))} + + + + + ({ a: { b: { c: x } } }))} + x="a.b.c" + /> + {stackedData.map((d, index) => ( + + ))} + + + + ); + }, +}; + +export default meta; diff --git a/stories/victory-charts/victory-histogram/styles.stories.tsx b/stories/victory-charts/victory-histogram/styles.stories.tsx index 2cbd4b62e..8ecf777b3 100644 --- a/stories/victory-charts/victory-histogram/styles.stories.tsx +++ b/stories/victory-charts/victory-histogram/styles.stories.tsx @@ -1,43 +1,45 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; - -import { data } from "./data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryHistogram", -}; - -export const Styles: Story = { - args: {}, - render: (props) => ( - <> - - - - - (datum.y > 3 ? "red" : "transparent"), - strokeWidth: 3, - opacity: ({ datum }) => (datum.y > 3 ? 1 : 0.4), - }, - }} - labels={["one", "two", "three", "four", "five"]} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryHistogram, VictoryChart, VictoryTheme } from "@/victory"; + +import { data } from "./data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryHistogram", +}; + +export const Styles: Story = { + args: {}, + render: (props) => ( + <> + + + + + (datum.y > 3 ? "red" : "transparent"), + strokeWidth: 3, + opacity: ({ datum }) => (datum.y > 3 ? 1 : 0.4), + }, + }} + labels={["one", "two", "three", "four", "five"]} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-label/anchors.stories.tsx b/stories/victory-charts/victory-label/anchors.stories.tsx index 3efcec564..05a0e1f02 100644 --- a/stories/victory-charts/victory-label/anchors.stories.tsx +++ b/stories/victory-charts/victory-label/anchors.stories.tsx @@ -1,128 +1,128 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLabel, VictoryScatter } from "@/victory"; -import { defaultScatterProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLabel", -}; - -export const Anchors: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLabel, VictoryScatter } from "@/victory"; +import { defaultScatterProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLabel", +}; + +export const Anchors: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-label/angles.stories.tsx b/stories/victory-charts/victory-label/angles.stories.tsx index ab0e3b7e5..d18762c3d 100644 --- a/stories/victory-charts/victory-label/angles.stories.tsx +++ b/stories/victory-charts/victory-label/angles.stories.tsx @@ -1,88 +1,94 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLabel, VictoryScatter } from "@/victory"; -import { defaultScatterProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLabel", -}; - -export const Angles: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLabel, VictoryScatter } from "@/victory"; +import { defaultScatterProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLabel", +}; + +export const Angles: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-label/background-padding.stories.tsx b/stories/victory-charts/victory-label/background-padding.stories.tsx index 12561ca38..f64b6eb01 100644 --- a/stories/victory-charts/victory-label/background-padding.stories.tsx +++ b/stories/victory-charts/victory-label/background-padding.stories.tsx @@ -1,153 +1,159 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLabel, VictoryScatter } from "@/victory"; -import { defaultScatterProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLabel", -}; - -export const BackgroundPadding: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLabel, VictoryScatter } from "@/victory"; +import { defaultScatterProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLabel", +}; + +export const BackgroundPadding: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-label/background-styles.stories.tsx b/stories/victory-charts/victory-label/background-styles.stories.tsx index bf0e8446c..951e5ffd7 100644 --- a/stories/victory-charts/victory-label/background-styles.stories.tsx +++ b/stories/victory-charts/victory-label/background-styles.stories.tsx @@ -1,112 +1,117 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLabel, VictoryScatter } from "@/victory"; -import { defaultScatterProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLabel", -}; - -export const BackgroundStyles: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - (datum.y > 0 ? -5 : 8)} - verticalAnchor="end" - backgroundPadding={{ top: 5, right: 5, bottom: 5, left: 5 }} - backgroundStyle={{ fill: "plum", stroke: "#000000" }} - text={[ - "Victory is awesome.", - "background styles", - "work with dy functions", - ]} - /> - } - /> - (datum.y > 0 ? -5 : 8)} - verticalAnchor="end" - backgroundPadding={{ top: 5, right: 5, bottom: 5, left: 5 }} - backgroundStyle={{ fill: "thistle", stroke: "#000000" }} - text={[ - "Victory is awesome.", - "background styles", - "work with dx functions", - ]} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLabel, VictoryScatter } from "@/victory"; +import { defaultScatterProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLabel", +}; + +export const BackgroundStyles: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + (datum.y > 0 ? -5 : 8)} + verticalAnchor="end" + backgroundPadding={{ top: 5, right: 5, bottom: 5, left: 5 }} + backgroundStyle={{ fill: "plum", stroke: "#000000" }} + text={[ + "Victory is awesome.", + "background styles", + "work with dy functions", + ]} + /> + } + /> + (datum.y > 0 ? -5 : 8)} + verticalAnchor="end" + backgroundPadding={{ top: 5, right: 5, bottom: 5, left: 5 }} + backgroundStyle={{ fill: "thistle", stroke: "#000000" }} + text={[ + "Victory is awesome.", + "background styles", + "work with dx functions", + ]} + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-label/inline.stories.tsx b/stories/victory-charts/victory-label/inline.stories.tsx index 77530a596..43c0a0a41 100644 --- a/stories/victory-charts/victory-label/inline.stories.tsx +++ b/stories/victory-charts/victory-label/inline.stories.tsx @@ -1,73 +1,76 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLabel, VictoryScatter } from "@/victory"; -import { defaultScatterProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLabel", -}; - -export const Inline: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLabel, VictoryScatter } from "@/victory"; +import { defaultScatterProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLabel", +}; + +export const Inline: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-label/line-height.stories.tsx b/stories/victory-charts/victory-label/line-height.stories.tsx index d4f4d6466..f7f3889cf 100644 --- a/stories/victory-charts/victory-label/line-height.stories.tsx +++ b/stories/victory-charts/victory-label/line-height.stories.tsx @@ -1,104 +1,112 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLabel, VictoryScatter } from "@/victory"; -import { defaultScatterProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLabel", -}; - -export const LineHeight: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLabel, VictoryScatter } from "@/victory"; +import { defaultScatterProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLabel", +}; + +export const LineHeight: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-label/positioning.stories.tsx b/stories/victory-charts/victory-label/positioning.stories.tsx index 8b93fb6ec..5b6a6750f 100644 --- a/stories/victory-charts/victory-label/positioning.stories.tsx +++ b/stories/victory-charts/victory-label/positioning.stories.tsx @@ -1,56 +1,56 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLabel, VictoryScatter } from "@/victory"; -import { defaultScatterProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLabel", -}; - -export const Positioning: Story = { - args: {}, - render: (props) => ( - <> - } - /> - } - /> - } - /> - } - /> - datum.x + 50} - text="dx function" - /> - } - /> - datum.x - 20} - text="dy function" - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLabel, VictoryScatter } from "@/victory"; +import { defaultScatterProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLabel", +}; + +export const Positioning: Story = { + args: {}, + render: (props) => ( + <> + } + /> + } + /> + } + /> + } + /> + datum.x + 50} + text="dx function" + /> + } + /> + datum.x - 20} + text="dy function" + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-label/styles.stories.tsx b/stories/victory-charts/victory-label/styles.stories.tsx index 1ec887534..c42eed4dc 100644 --- a/stories/victory-charts/victory-label/styles.stories.tsx +++ b/stories/victory-charts/victory-label/styles.stories.tsx @@ -1,192 +1,192 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLabel, VictoryScatter } from "@/victory"; -import { defaultScatterProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLabel", -}; - -export const Styles: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - (datum.y === 0 ? 12 : 15), - fontFamily: "arial", - }} - text={["object", "with", "functions"]} - backgroundStyle={{ stroke: "blue", fill: "none" }} - /> - } - /> - (datum.y === 0 ? 12 : 15), - fontFamily: "arial", - }, - ]} - text={["single array", "with", "functions"]} - backgroundStyle={{ stroke: "blue", fill: "none" }} - /> - } - /> - (datum.y === 0 ? 12 : 15), - fontFamily: "arial", - }, - { - fill: ({ datum }) => (datum.y === 0 ? "red" : "blue"), - fontFamily: "arial", - }, - ]} - text={["multi array", "with", "functions"]} - backgroundStyle={{ stroke: "blue", fill: "none" }} - /> - } - /> - (datum.y === 0 ? 12 : 15), - fontFamily: "arial", - }} - text={["object", "with", "functions"]} - backgroundStyle={[{ stroke: "blue", fill: "none" }]} - /> - } - /> - (datum.y === 0 ? 12 : 15), - fontFamily: "arial", - }, - ]} - text={["single array", "with", "functions"]} - backgroundStyle={[{ stroke: "blue", fill: "none" }]} - /> - } - /> - (datum.y === 0 ? 12 : 15), - fontFamily: "arial", - }, - { - fill: ({ datum }) => (datum.y === 0 ? "red" : "blue"), - fontFamily: "arial", - }, - ]} - text={["multi array", "with", "functions"]} - backgroundStyle={[{ stroke: "blue", fill: "none" }]} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLabel, VictoryScatter } from "@/victory"; +import { defaultScatterProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLabel", +}; + +export const Styles: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + (datum.y === 0 ? 12 : 15), + fontFamily: "arial", + }} + text={["object", "with", "functions"]} + backgroundStyle={{ stroke: "blue", fill: "none" }} + /> + } + /> + (datum.y === 0 ? 12 : 15), + fontFamily: "arial", + }, + ]} + text={["single array", "with", "functions"]} + backgroundStyle={{ stroke: "blue", fill: "none" }} + /> + } + /> + (datum.y === 0 ? 12 : 15), + fontFamily: "arial", + }, + { + fill: ({ datum }) => (datum.y === 0 ? "red" : "blue"), + fontFamily: "arial", + }, + ]} + text={["multi array", "with", "functions"]} + backgroundStyle={{ stroke: "blue", fill: "none" }} + /> + } + /> + (datum.y === 0 ? 12 : 15), + fontFamily: "arial", + }} + text={["object", "with", "functions"]} + backgroundStyle={[{ stroke: "blue", fill: "none" }]} + /> + } + /> + (datum.y === 0 ? 12 : 15), + fontFamily: "arial", + }, + ]} + text={["single array", "with", "functions"]} + backgroundStyle={[{ stroke: "blue", fill: "none" }]} + /> + } + /> + (datum.y === 0 ? 12 : 15), + fontFamily: "arial", + }, + { + fill: ({ datum }) => (datum.y === 0 ? "red" : "blue"), + fontFamily: "arial", + }, + ]} + text={["multi array", "with", "functions"]} + backgroundStyle={[{ stroke: "blue", fill: "none" }]} + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-legend/line-height.stories.tsx b/stories/victory-charts/victory-legend/line-height.stories.tsx index 01fbe417a..0faa422a8 100644 --- a/stories/victory-charts/victory-legend/line-height.stories.tsx +++ b/stories/victory-charts/victory-legend/line-height.stories.tsx @@ -1,47 +1,47 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryAxis, - VictoryLegend, - VictoryChart, - VictoryTheme, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLegend", -}; - -export const LineHeight: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryAxis, + VictoryLegend, + VictoryChart, + VictoryTheme, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLegend", +}; + +export const LineHeight: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-legend/title.stories.tsx b/stories/victory-charts/victory-legend/title.stories.tsx index c3e24c3c4..75a8e8b2f 100644 --- a/stories/victory-charts/victory-legend/title.stories.tsx +++ b/stories/victory-charts/victory-legend/title.stories.tsx @@ -1,103 +1,103 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; -import { range } from "lodash"; - -import { - VictoryAxis, - VictoryLegend, - VictoryChart, - VictoryTheme, -} from "@/victory"; - -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLegend", -}; - -const getData = (num) => { - return range(num).map((v) => ({ - name: `Series ${v + 1}`, - symbol: { - size: 5, - type: "circle", - fill: undefined, - }, - })); -}; - -export const Title: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; +import { range } from "lodash"; + +import { + VictoryAxis, + VictoryLegend, + VictoryChart, + VictoryTheme, +} from "@/victory"; + +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLegend", +}; + +const getData = (num) => { + return range(num).map((v) => ({ + name: `Series ${v + 1}`, + symbol: { + size: 5, + type: "circle", + fill: undefined, + }, + })); +}; + +export const Title: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/data-accessors.stories.tsx b/stories/victory-charts/victory-line/data-accessors.stories.tsx index 2349f7819..e5a142bff 100644 --- a/stories/victory-charts/victory-line/data-accessors.stories.tsx +++ b/stories/victory-charts/victory-line/data-accessors.stories.tsx @@ -1,87 +1,92 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const DataAccessors: Story = { - args: {}, - render: (props) => ( - <> - - data.pet + data.wild} - /> - - - data.pet + data.wild} - /> - - - data.pet + data.wild} - /> - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const DataAccessors: Story = { + args: {}, + render: (props) => ( + <> + + data.pet + data.wild} + /> + + + data.pet + data.wild} + /> + + + data.pet + data.wild} + /> + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/events.stories.tsx b/stories/victory-charts/victory-line/events.stories.tsx index f570bdcf1..cb28747e2 100644 --- a/stories/victory-charts/victory-line/events.stories.tsx +++ b/stories/victory-charts/victory-line/events.stories.tsx @@ -1,47 +1,48 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const Events: Story = { - args: {}, - render: (props) => ( - - { - return [ - { - target: "data", - eventKey: "all", - mutation: ({ style }) => { - return style.stroke === "black" - ? null - : { style: { stroke: "black", strokeWidth: 5 } }; - }, - }, - ]; - }, - }, - }, - ]} - data={getData(5, "seed-1")} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const Events: Story = { + args: {}, + render: (props) => ( + + { + return [ + { + target: "data", + eventKey: "all", + mutation: ({ style }) => { + return style.stroke === "black" + ? null + : { style: { stroke: "black", strokeWidth: 5 } }; + }, + }, + ]; + }, + }, + }, + ]} + data={getData(5, "seed-1")} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/interpolation.stories.tsx b/stories/victory-charts/victory-line/interpolation.stories.tsx index 29961f367..65da19b45 100644 --- a/stories/victory-charts/victory-line/interpolation.stories.tsx +++ b/stories/victory-charts/victory-line/interpolation.stories.tsx @@ -1,58 +1,58 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - InterpolationPropType, - VictoryLine, - VictoryChart, - VictoryLabel, - VictoryTheme, -} from "@/victory"; - -import { getData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const Interpolation: Story = { - args: {}, - render: (props) => { - const makeInterpolationChart = (interpolation) => ( - - - - - ); - - return ( - <> - {[ - "basis", - "cardinal", - "catmullRom", - "linear", - "monotoneX", - "monotoneY", - "natural", - "step", - "stepAfter", - "stepBefore", - ].map((interpolation) => makeInterpolationChart(interpolation))} - - ); - }, -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + InterpolationPropType, + VictoryLine, + VictoryChart, + VictoryLabel, + VictoryTheme, +} from "@/victory"; + +import { getData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const Interpolation: Story = { + args: {}, + render: (props) => { + const makeInterpolationChart = (interpolation) => ( + + + + + ); + + return ( + <> + {[ + "basis", + "cardinal", + "catmullRom", + "linear", + "monotoneX", + "monotoneY", + "natural", + "step", + "stepAfter", + "stepBefore", + ].map((interpolation) => makeInterpolationChart(interpolation))} + + ); + }, +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/labels.stories.tsx b/stories/victory-charts/victory-line/labels.stories.tsx index 48a7c2300..a00df6bec 100644 --- a/stories/victory-charts/victory-line/labels.stories.tsx +++ b/stories/victory-charts/victory-line/labels.stories.tsx @@ -1,47 +1,47 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const Labels: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - /> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const Labels: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + /> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/plotting-functions.stories.tsx b/stories/victory-charts/victory-line/plotting-functions.stories.tsx index 479182b9d..fab0c6c06 100644 --- a/stories/victory-charts/victory-line/plotting-functions.stories.tsx +++ b/stories/victory-charts/victory-line/plotting-functions.stories.tsx @@ -1,51 +1,51 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const PlottingFunctions: Story = { - args: {}, - render: (props) => ( - <> - - Math.sin(2 * Math.PI * d.x)} /> - - - Math.sin(2 * Math.PI * d.x)} /> - - - - Math.sin(2 * Math.PI * d.x)} - y0={(d) => Math.sin(2 * Math.PI * d.x) - 0.5} - /> - - - Math.sin(2 * Math.PI * d.x)} - y0={(d) => Math.sin(2 * Math.PI * d.x) - 0.5} - /> - - - Math.sin(Math.PI * d.x)} /> - - - Math.sin(Math.PI * d.x)} - y0={(d) => Math.sin(Math.PI * d.x) - 0.5} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const PlottingFunctions: Story = { + args: {}, + render: (props) => ( + <> + + Math.sin(2 * Math.PI * d.x)} /> + + + Math.sin(2 * Math.PI * d.x)} /> + + + + Math.sin(2 * Math.PI * d.x)} + y0={(d) => Math.sin(2 * Math.PI * d.x) - 0.5} + /> + + + Math.sin(2 * Math.PI * d.x)} + y0={(d) => Math.sin(2 * Math.PI * d.x) - 0.5} + /> + + + Math.sin(Math.PI * d.x)} /> + + + Math.sin(Math.PI * d.x)} + y0={(d) => Math.sin(Math.PI * d.x) - 0.5} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/polar.stories.tsx b/stories/victory-charts/victory-line/polar.stories.tsx index 4aa44e5a0..85ad1f097 100644 --- a/stories/victory-charts/victory-line/polar.stories.tsx +++ b/stories/victory-charts/victory-line/polar.stories.tsx @@ -1,75 +1,75 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryLine, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const Polar: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryLine, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const Polar: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/stacked.stories.tsx b/stories/victory-charts/victory-line/stacked.stories.tsx index e2d994119..f45f26717 100644 --- a/stories/victory-charts/victory-line/stacked.stories.tsx +++ b/stories/victory-charts/victory-line/stacked.stories.tsx @@ -1,77 +1,77 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryLine, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const Stacked: Story = { - args: {}, - render: (props) => ( - <> - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryLine, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const Stacked: Story = { + args: {}, + render: (props) => ( + <> + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/styles.stories.tsx b/stories/victory-charts/victory-line/styles.stories.tsx index aa7a46bd1..d069d56f4 100644 --- a/stories/victory-charts/victory-line/styles.stories.tsx +++ b/stories/victory-charts/victory-line/styles.stories.tsx @@ -1,44 +1,44 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const Styles: Story = { - args: {}, - render: (props) => ( - <> - - datum.x} - style={{ - labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, - data: { stroke: "tomato", strokeWidth: 2 }, - }} - /> - - - datum.x} - data={[ - { x: "Cat", y: 62 }, - { x: "Dog", y: 91 }, - { x: "Fish", y: 55 }, - { x: "Bird", y: 55 }, - ]} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryLine, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const Styles: Story = { + args: {}, + render: (props) => ( + <> + + datum.x} + style={{ + labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, + data: { stroke: "tomato", strokeWidth: 2 }, + }} + /> + + + datum.x} + data={[ + { x: "Cat", y: 62 }, + { x: "Dog", y: 91 }, + { x: "Fish", y: 55 }, + { x: "Bird", y: 55 }, + ]} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/theme.stories.tsx b/stories/victory-charts/victory-line/theme.stories.tsx index dc860ca0a..e28ceffaa 100644 --- a/stories/victory-charts/victory-line/theme.stories.tsx +++ b/stories/victory-charts/victory-line/theme.stories.tsx @@ -1,75 +1,75 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryLine, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getData, getMixedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const Theme: Story = { - args: {}, - render: (props) => ( - <> - - datum.x} - /> - - - datum.x}> - - - - - - - - - datum.x} - /> - - - datum.x}> - - - - - - - - - datum.x} - /> - - - datum.x}> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryLine, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getData, getMixedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const Theme: Story = { + args: {}, + render: (props) => ( + <> + + datum.x} + /> + + + datum.x}> + + + + + + + + + datum.x} + /> + + + datum.x}> + + + + + + + + + datum.x} + /> + + + datum.x}> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/time-scale.stories.tsx b/stories/victory-charts/victory-line/time-scale.stories.tsx index 8d8c5c1a1..8d8b81e22 100644 --- a/stories/victory-charts/victory-line/time-scale.stories.tsx +++ b/stories/victory-charts/victory-line/time-scale.stories.tsx @@ -1,55 +1,55 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryLine, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; - -import { getTimeData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const TimeScale: Story = { - args: {}, - render: (props) => ( - <> - - datum.x.getFullYear()} - /> - - - datum.x.getFullYear()} - /> - - - datum.x.getFullYear()}> - - - - - - - datum.x.getFullYear()}> - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryLine, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getTimeData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const TimeScale: Story = { + args: {}, + render: (props) => ( + <> + + datum.x.getFullYear()} + /> + + + datum.x.getFullYear()} + /> + + + datum.x.getFullYear()}> + + + + + + + datum.x.getFullYear()}> + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-line/tooltips.stories.tsx b/stories/victory-charts/victory-line/tooltips.stories.tsx index 7e1f2b507..5cd48b889 100644 --- a/stories/victory-charts/victory-line/tooltips.stories.tsx +++ b/stories/victory-charts/victory-line/tooltips.stories.tsx @@ -1,59 +1,59 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryLine, - VictoryChart, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; - -import { getData, getMixedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryLine", -}; - -export const Tooltips: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - labelComponent={} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - } - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryLine, + VictoryChart, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; + +import { getData, getMixedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryLine", +}; + +export const Tooltips: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + labelComponent={} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + } + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/corner-radius.stories.tsx b/stories/victory-charts/victory-pie/corner-radius.stories.tsx index de44e715e..595e58164 100644 --- a/stories/victory-charts/victory-pie/corner-radius.stories.tsx +++ b/stories/victory-charts/victory-pie/corner-radius.stories.tsx @@ -1,57 +1,57 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const CornerRadius: Story = { - args: {}, - render: (props) => ( - <> - - - datum.x * 5} - innerRadius={100} - data={[ - { x: 1, y: 1 }, - { x: 2, y: 3 }, - { x: 3, y: 5 }, - { x: 4, y: 2 }, - { x: 5, y: 3 }, - ]} - /> - datum.r} - innerRadius={100} - data={[ - { x: 1, y: 1 }, - { x: 2, y: 3 }, - { x: 3, y: 5, r: 15 }, - { x: 4, y: 2 }, - { x: 5, y: 3 }, - ]} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const CornerRadius: Story = { + args: {}, + render: (props) => ( + <> + + + datum.x * 5} + innerRadius={100} + data={[ + { x: 1, y: 1 }, + { x: 2, y: 3 }, + { x: 3, y: 5 }, + { x: 4, y: 2 }, + { x: 5, y: 3 }, + ]} + /> + datum.r} + innerRadius={100} + data={[ + { x: 1, y: 1 }, + { x: 2, y: 3 }, + { x: 3, y: 5, r: 15 }, + { x: 4, y: 2 }, + { x: 5, y: 3 }, + ]} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/data.stories.tsx b/stories/victory-charts/victory-pie/data.stories.tsx index f84964016..bfbea78c6 100644 --- a/stories/victory-charts/victory-pie/data.stories.tsx +++ b/stories/victory-charts/victory-pie/data.stories.tsx @@ -1,52 +1,52 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const Data: Story = { - args: {}, - render: (props) => ( - <> - - data.pet + data.wild} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const Data: Story = { + args: {}, + render: (props) => ( + <> + + data.pet + data.wild} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/inner-radius.stories.tsx b/stories/victory-charts/victory-pie/inner-radius.stories.tsx index 40061e3aa..52c5d493b 100644 --- a/stories/victory-charts/victory-pie/inner-radius.stories.tsx +++ b/stories/victory-charts/victory-pie/inner-radius.stories.tsx @@ -1,62 +1,62 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const InnerRadius: Story = { - args: {}, - render: (props) => ( - <> - - datum.radius} - innerRadius={({ datum }) => datum.radius - 20} - data={[ - { x: 1, y: 1, radius: 110 }, - { x: 2, y: 3, radius: 120 }, - { x: 3, y: 5, radius: 140 }, - { x: 4, y: 2, radius: 150 }, - { x: 5, y: 3, radius: 130 }, - ]} - /> - datum.y + 10} - labelRadius={({ datum }) => datum.y - 20} - data={[ - { x: "Cat", y: 62 }, - { x: "Dog", y: 91 }, - { x: "Fish", y: 55 }, - { x: "Bird", y: 25 }, - ]} - /> - datum.radius} - data={[ - { x: 1, y: 1, radius: 50 }, - { x: 2, y: 3 }, - { x: 3, y: 5 }, - { x: 4, y: 2 }, - { x: 5, y: 3 }, - ]} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const InnerRadius: Story = { + args: {}, + render: (props) => ( + <> + + datum.radius} + innerRadius={({ datum }) => datum.radius - 20} + data={[ + { x: 1, y: 1, radius: 110 }, + { x: 2, y: 3, radius: 120 }, + { x: 3, y: 5, radius: 140 }, + { x: 4, y: 2, radius: 150 }, + { x: 5, y: 3, radius: 130 }, + ]} + /> + datum.y + 10} + labelRadius={({ datum }) => datum.y - 20} + data={[ + { x: "Cat", y: 62 }, + { x: "Dog", y: 91 }, + { x: "Fish", y: 55 }, + { x: "Bird", y: 25 }, + ]} + /> + datum.radius} + data={[ + { x: 1, y: 1, radius: 50 }, + { x: 2, y: 3 }, + { x: 3, y: 5 }, + { x: 4, y: 2 }, + { x: 5, y: 3 }, + ]} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/label-indicator.stories.tsx b/stories/victory-charts/victory-pie/label-indicator.stories.tsx index 8420704da..62aae4aec 100644 --- a/stories/victory-charts/victory-pie/label-indicator.stories.tsx +++ b/stories/victory-charts/victory-pie/label-indicator.stories.tsx @@ -1,72 +1,72 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { LineSegment, VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const LabelIndicator: Story = { - args: {}, - render: (props) => ( - <> - - - - - - } - /> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { LineSegment, VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const LabelIndicator: Story = { + args: {}, + render: (props) => ( + <> + + + + + + } + /> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/label-placement.stories.tsx b/stories/victory-charts/victory-pie/label-placement.stories.tsx index 8071d2081..4f771747b 100644 --- a/stories/victory-charts/victory-pie/label-placement.stories.tsx +++ b/stories/victory-charts/victory-pie/label-placement.stories.tsx @@ -1,67 +1,67 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const LabelPlacement: Story = { - args: { - data: [ - { x: 1, y: 1, l: 0 }, - { x: 2, y: 1, l: 45 }, - { x: 3, y: 1, l: 90 }, - { x: 4, y: 1, l: 135 }, - { x: 5, y: 1, l: 180 }, - { x: 6, y: 1, l: 225 }, - { x: 7, y: 1, l: 270 }, - { x: 8, y: 1, l: 315 }, - ], - }, - render: (props) => ( - <> - `${datum.l} degrees`} - /> - `${datum.l}\ndegrees`} - /> - `${datum.l} degrees`} - /> - `${datum.l}\ndegrees`} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const LabelPlacement: Story = { + args: { + data: [ + { x: 1, y: 1, l: 0 }, + { x: 2, y: 1, l: 45 }, + { x: 3, y: 1, l: 90 }, + { x: 4, y: 1, l: 135 }, + { x: 5, y: 1, l: 180 }, + { x: 6, y: 1, l: 225 }, + { x: 7, y: 1, l: 270 }, + { x: 8, y: 1, l: 315 }, + ], + }, + render: (props) => ( + <> + `${datum.l} degrees`} + /> + `${datum.l}\ndegrees`} + /> + `${datum.l} degrees`} + /> + `${datum.l}\ndegrees`} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/label-radius.stories.tsx b/stories/victory-charts/victory-pie/label-radius.stories.tsx index 9c7e9351e..4fc719f9d 100644 --- a/stories/victory-charts/victory-pie/label-radius.stories.tsx +++ b/stories/victory-charts/victory-pie/label-radius.stories.tsx @@ -1,70 +1,70 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const LabelRadius: Story = { - args: {}, - render: (props) => ( - <> - - datum.y} - radius={80} - innerRadius={100} - data={[ - { x: 1, y: 100 }, - { x: 2, y: 130 }, - { x: 3, y: 150 }, - { x: 4, y: 120 }, - { x: 5, y: 130 }, - ]} - /> - datum.r} - innerRadius={100} - data={[ - { x: 1, y: 100 }, - { x: 2, y: 130 }, - { x: 3, y: 150, r: 80 }, - { x: 4, y: 120 }, - { x: 5, y: 130 }, - ]} - /> - datum.r} - innerRadius={100} - labelPosition="startAngle" - data={[ - { x: 1, y: 100 }, - { x: 2, y: 130 }, - { x: 3, y: 150, r: 80 }, - { x: 4, y: 120 }, - { x: 5, y: 130 }, - ]} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const LabelRadius: Story = { + args: {}, + render: (props) => ( + <> + + datum.y} + radius={80} + innerRadius={100} + data={[ + { x: 1, y: 100 }, + { x: 2, y: 130 }, + { x: 3, y: 150 }, + { x: 4, y: 120 }, + { x: 5, y: 130 }, + ]} + /> + datum.r} + innerRadius={100} + data={[ + { x: 1, y: 100 }, + { x: 2, y: 130 }, + { x: 3, y: 150, r: 80 }, + { x: 4, y: 120 }, + { x: 5, y: 130 }, + ]} + /> + datum.r} + innerRadius={100} + labelPosition="startAngle" + data={[ + { x: 1, y: 100 }, + { x: 2, y: 130 }, + { x: 3, y: 150, r: 80 }, + { x: 4, y: 120 }, + { x: 5, y: 130 }, + ]} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/labels.stories.tsx b/stories/victory-charts/victory-pie/labels.stories.tsx index 2c0287083..5a7993af7 100644 --- a/stories/victory-charts/victory-pie/labels.stories.tsx +++ b/stories/victory-charts/victory-pie/labels.stories.tsx @@ -1,42 +1,42 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const Labels: Story = { - args: {}, - render: (props) => ( - <> - - `#${index}`} - /> - `#${index}`} - labelPosition="startAngle" - /> - `#${index}`} - labelPosition="endAngle" - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const Labels: Story = { + args: {}, + render: (props) => ( + <> + + `#${index}`} + /> + `#${index}`} + labelPosition="startAngle" + /> + `#${index}`} + labelPosition="endAngle" + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/origin.stories.tsx b/stories/victory-charts/victory-pie/origin.stories.tsx index 9b15c75fe..4443f063d 100644 --- a/stories/victory-charts/victory-pie/origin.stories.tsx +++ b/stories/victory-charts/victory-pie/origin.stories.tsx @@ -1,45 +1,45 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const Origin: Story = { - args: {}, - render: (props) => ( - <> - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const Origin: Story = { + args: {}, + render: (props) => ( + <> + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/pad-angle.stories.tsx b/stories/victory-charts/victory-pie/pad-angle.stories.tsx index 486b5654b..f78d56927 100644 --- a/stories/victory-charts/victory-pie/pad-angle.stories.tsx +++ b/stories/victory-charts/victory-pie/pad-angle.stories.tsx @@ -1,57 +1,57 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const PadAngle: Story = { - args: {}, - render: (props) => ( - <> - - - datum.x * 2} - innerRadius={100} - data={[ - { x: 1, y: 1 }, - { x: 2, y: 3 }, - { x: 3, y: 5 }, - { x: 4, y: 2 }, - { x: 5, y: 3 }, - ]} - /> - datum.r} - innerRadius={100} - data={[ - { x: 1, y: 1 }, - { x: 2, y: 3 }, - { x: 3, y: 5, r: 8 }, - { x: 4, y: 2 }, - { x: 5, y: 3 }, - ]} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const PadAngle: Story = { + args: {}, + render: (props) => ( + <> + + + datum.x * 2} + innerRadius={100} + data={[ + { x: 1, y: 1 }, + { x: 2, y: 3 }, + { x: 3, y: 5 }, + { x: 4, y: 2 }, + { x: 5, y: 3 }, + ]} + /> + datum.r} + innerRadius={100} + data={[ + { x: 1, y: 1 }, + { x: 2, y: 3 }, + { x: 3, y: 5, r: 8 }, + { x: 4, y: 2 }, + { x: 5, y: 3 }, + ]} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/radius.stories.tsx b/stories/victory-charts/victory-pie/radius.stories.tsx index 3a856e8d2..f4ba4fe01 100644 --- a/stories/victory-charts/victory-pie/radius.stories.tsx +++ b/stories/victory-charts/victory-pie/radius.stories.tsx @@ -1,68 +1,68 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const Radius: Story = { - args: {}, - render: (props) => ( - <> - - datum.radius} - data={[ - { x: 1, y: 1, radius: 110 }, - { x: 2, y: 3, radius: 120 }, - { x: 3, y: 5, radius: 140 }, - { x: 4, y: 2, radius: 150 }, - { x: 5, y: 3, radius: 130 }, - ]} - /> - datum.y + 100} - labelRadius={({ datum }) => datum.y + 50} - style={{ - labels: { fill: "white" }, - }} - data={[ - { x: "Cat", y: 62 }, - { x: "Dog", y: 91 }, - { x: "Fish", y: 55 }, - { x: "Bird", y: 25 }, - ]} - /> - datum.y + 100} - labelRadius={({ datum }) => datum.y + 65} - style={{ - labels: { fill: "white" }, - }} - data={[ - { x: "Cat", y: 62 }, - { x: "Dog", y: 91 }, - { x: "Fish", y: 55 }, - { x: "Bird", y: 25 }, - ]} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const Radius: Story = { + args: {}, + render: (props) => ( + <> + + datum.radius} + data={[ + { x: 1, y: 1, radius: 110 }, + { x: 2, y: 3, radius: 120 }, + { x: 3, y: 5, radius: 140 }, + { x: 4, y: 2, radius: 150 }, + { x: 5, y: 3, radius: 130 }, + ]} + /> + datum.y + 100} + labelRadius={({ datum }) => datum.y + 50} + style={{ + labels: { fill: "white" }, + }} + data={[ + { x: "Cat", y: 62 }, + { x: "Dog", y: 91 }, + { x: "Fish", y: 55 }, + { x: "Bird", y: 25 }, + ]} + /> + datum.y + 100} + labelRadius={({ datum }) => datum.y + 65} + style={{ + labels: { fill: "white" }, + }} + data={[ + { x: "Cat", y: 62 }, + { x: "Dog", y: 91 }, + { x: "Fish", y: 55 }, + { x: "Bird", y: 25 }, + ]} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/start-and-end-angles.stories.tsx b/stories/victory-charts/victory-pie/start-and-end-angles.stories.tsx index 6b9df7362..d7d17ebd4 100644 --- a/stories/victory-charts/victory-pie/start-and-end-angles.stories.tsx +++ b/stories/victory-charts/victory-pie/start-and-end-angles.stories.tsx @@ -1,76 +1,76 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { Helpers, Slice, VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const StartAndEndAngles: Story = { - args: {}, - render: (props) => ( - <> - - - datum.endAngle} - /> - } - labels={() => null} - cornerRadius={5} - radius={({ datum }) => datum.radius} - innerRadius={({ datum }) => datum.innerRadius} - data={[ - { x: "Cat", y: 62, innerRadius: 0, radius: 30 }, - { x: "Dog", y: 91, innerRadius: 35, radius: 65 }, - { x: "Fish", y: 55, innerRadius: 70, radius: 100 }, - { x: "Bird", y: 55, innerRadius: 105, radius: 135, endAngle: 360 }, - ]} - /> - - Helpers.radiansToDegrees(slice?.endAngle) - 90 - } - /> - } - labels={() => null} - cornerRadius={5} - radius={({ datum }) => datum.radius} - innerRadius={({ datum }) => datum.innerRadius} - data={[ - { x: "Cat", y: 62, innerRadius: 0, radius: 30 }, - { x: "Dog", y: 91, innerRadius: 35, radius: 65 }, - { x: "Fish", y: 55, innerRadius: 70, radius: 100 }, - { x: "Bird", y: 55, innerRadius: 105, radius: 135 }, - ]} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { Helpers, Slice, VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const StartAndEndAngles: Story = { + args: {}, + render: (props) => ( + <> + + + datum.endAngle} + /> + } + labels={() => null} + cornerRadius={5} + radius={({ datum }) => datum.radius} + innerRadius={({ datum }) => datum.innerRadius} + data={[ + { x: "Cat", y: 62, innerRadius: 0, radius: 30 }, + { x: "Dog", y: 91, innerRadius: 35, radius: 65 }, + { x: "Fish", y: 55, innerRadius: 70, radius: 100 }, + { x: "Bird", y: 55, innerRadius: 105, radius: 135, endAngle: 360 }, + ]} + /> + + Helpers.radiansToDegrees(slice?.endAngle) - 90 + } + /> + } + labels={() => null} + cornerRadius={5} + radius={({ datum }) => datum.radius} + innerRadius={({ datum }) => datum.innerRadius} + data={[ + { x: "Cat", y: 62, innerRadius: 0, radius: 30 }, + { x: "Dog", y: 91, innerRadius: 35, radius: 65 }, + { x: "Fish", y: 55, innerRadius: 70, radius: 100 }, + { x: "Bird", y: 55, innerRadius: 105, radius: 135 }, + ]} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/styles.stories.tsx b/stories/victory-charts/victory-pie/styles.stories.tsx index 94a13d342..328165063 100644 --- a/stories/victory-charts/victory-pie/styles.stories.tsx +++ b/stories/victory-charts/victory-pie/styles.stories.tsx @@ -1,74 +1,74 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const Styles: Story = { - args: {}, - render: (props) => ( - <> - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const Styles: Story = { + args: {}, + render: (props) => ( + <> + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-pie/tooltips.stories.tsx b/stories/victory-charts/victory-pie/tooltips.stories.tsx index 98ebbdfc3..0c7648820 100644 --- a/stories/victory-charts/victory-pie/tooltips.stories.tsx +++ b/stories/victory-charts/victory-pie/tooltips.stories.tsx @@ -1,70 +1,70 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPie, VictoryTheme, VictoryTooltip } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPie", -}; - -export const Tooltips: Story = { - args: {}, - render: (props) => ( - <> - } - /> - } - /> - `#${index}`} - labelPosition="startAngle" - labelPlacement="perpendicular" - labelComponent={} - /> - `#${index}`} - labelPosition="endAngle" - labelPlacement="perpendicular" - labelComponent={} - /> - `#${index}`} - labelPosition="startAngle" - labelPlacement="parallel" - labelComponent={} - /> - `#${index}`} - labelPosition="endAngle" - labelPlacement="parallel" - labelComponent={} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPie, VictoryTheme, VictoryTooltip } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPie", +}; + +export const Tooltips: Story = { + args: {}, + render: (props) => ( + <> + } + /> + } + /> + `#${index}`} + labelPosition="startAngle" + labelPlacement="perpendicular" + labelComponent={} + /> + `#${index}`} + labelPosition="endAngle" + labelPlacement="perpendicular" + labelComponent={} + /> + `#${index}`} + labelPosition="startAngle" + labelPlacement="parallel" + labelComponent={} + /> + `#${index}`} + labelPosition="endAngle" + labelPlacement="parallel" + labelComponent={} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-polar-axis/axis-angle.stories.tsx b/stories/victory-charts/victory-polar-axis/axis-angle.stories.tsx index 6ca4e630e..9b67c10b7 100644 --- a/stories/victory-charts/victory-polar-axis/axis-angle.stories.tsx +++ b/stories/victory-charts/victory-polar-axis/axis-angle.stories.tsx @@ -1,50 +1,50 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPolarAxis, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPolarAxis", -}; - -export const AxisAngle: Story = { - args: {}, - render: (props) => ( - <> - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPolarAxis, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPolarAxis", +}; + +export const AxisAngle: Story = { + args: {}, + render: (props) => ( + <> + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-polar-axis/axis-value.stories.tsx b/stories/victory-charts/victory-polar-axis/axis-value.stories.tsx index 7ea3fbc5d..058842d86 100644 --- a/stories/victory-charts/victory-polar-axis/axis-value.stories.tsx +++ b/stories/victory-charts/victory-polar-axis/axis-value.stories.tsx @@ -1,50 +1,50 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPolarAxis, VictoryChart, VictoryTheme } from "@/victory"; - -import { getValues } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPolarAxis", -}; - -export const AxisValue: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPolarAxis, VictoryChart, VictoryTheme } from "@/victory"; + +import { getValues } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPolarAxis", +}; + +export const AxisValue: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-polar-axis/domain.stories.tsx b/stories/victory-charts/victory-polar-axis/domain.stories.tsx index 7c74c975b..dbf2a0755 100644 --- a/stories/victory-charts/victory-polar-axis/domain.stories.tsx +++ b/stories/victory-charts/victory-polar-axis/domain.stories.tsx @@ -1,71 +1,71 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPolarAxis, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getValues } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPolarAxis", -}; - -export const Domain: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPolarAxis, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getValues } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPolarAxis", +}; + +export const Domain: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-polar-axis/label-placement.stories.tsx b/stories/victory-charts/victory-polar-axis/label-placement.stories.tsx index 661b3850f..5a277b2ab 100644 --- a/stories/victory-charts/victory-polar-axis/label-placement.stories.tsx +++ b/stories/victory-charts/victory-polar-axis/label-placement.stories.tsx @@ -1,41 +1,56 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPolarAxis, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPolarAxis", -}; - -export const LabelPlacement: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPolarAxis, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPolarAxis", +}; + +export const LabelPlacement: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-polar-axis/scale.stories.tsx b/stories/victory-charts/victory-polar-axis/scale.stories.tsx index 171634ffa..185f34dc2 100644 --- a/stories/victory-charts/victory-polar-axis/scale.stories.tsx +++ b/stories/victory-charts/victory-polar-axis/scale.stories.tsx @@ -1,47 +1,47 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPolarAxis, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getTimeValues } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPolarAxis", -}; - -export const Scale: Story = { - args: {}, - render: (props) => ( - <> - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPolarAxis, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getTimeValues } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPolarAxis", +}; + +export const Scale: Story = { + args: {}, + render: (props) => ( + <> + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-polar-axis/style.stories.tsx b/stories/victory-charts/victory-polar-axis/style.stories.tsx index 4841d5465..be5fe2881 100644 --- a/stories/victory-charts/victory-polar-axis/style.stories.tsx +++ b/stories/victory-charts/victory-polar-axis/style.stories.tsx @@ -1,43 +1,43 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPolarAxis, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPolarAxis", -}; - -export const Style: Story = { - args: {}, - render: (props) => ( - <> - (tick > 0.5 ? "red" : "grey") }, - ticks: { stroke: "grey", size: 5 }, - tickLabels: { fontSize: 15, padding: 5 }, - }} - /> - (tick > 0.5 ? "red" : "grey") }, - ticks: { stroke: "grey", size: 5 }, - tickLabels: { fontSize: 15, padding: 5 }, - }} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPolarAxis, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPolarAxis", +}; + +export const Style: Story = { + args: {}, + render: (props) => ( + <> + (tick > 0.5 ? "red" : "grey") }, + ticks: { stroke: "grey", size: 5 }, + tickLabels: { fontSize: 15, padding: 5 }, + }} + /> + (tick > 0.5 ? "red" : "grey") }, + ticks: { stroke: "grey", size: 5 }, + tickLabels: { fontSize: 15, padding: 5 }, + }} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-polar-axis/tick-format.stories.tsx b/stories/victory-charts/victory-polar-axis/tick-format.stories.tsx index cb810cda4..a74cd2a51 100644 --- a/stories/victory-charts/victory-polar-axis/tick-format.stories.tsx +++ b/stories/victory-charts/victory-polar-axis/tick-format.stories.tsx @@ -1,49 +1,49 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPolarAxis, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getValues } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPolarAxis", -}; - -export const TickFormat: Story = { - args: {}, - render: (props) => ( - <> - - - `#${t}`} - /> - `#${t}`} - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPolarAxis, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getValues } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPolarAxis", +}; + +export const TickFormat: Story = { + args: {}, + render: (props) => ( + <> + + + `#${t}`} + /> + `#${t}`} + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-polar-axis/tick-values.stories.tsx b/stories/victory-charts/victory-polar-axis/tick-values.stories.tsx index daf999357..46dfbb1c1 100644 --- a/stories/victory-charts/victory-polar-axis/tick-values.stories.tsx +++ b/stories/victory-charts/victory-polar-axis/tick-values.stories.tsx @@ -1,57 +1,57 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryPolarAxis, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getRandomValues, getValues } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPolarAxis", -}; - -export const TickValues: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryPolarAxis, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getRandomValues, getValues } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPolarAxis", +}; + +export const TickValues: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-portal/default.stories.tsx b/stories/victory-charts/victory-portal/default.stories.tsx index e81060068..e319baf86 100644 --- a/stories/victory-charts/victory-portal/default.stories.tsx +++ b/stories/victory-charts/victory-portal/default.stories.tsx @@ -1,60 +1,60 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryBar, - VictoryPortal, - VictoryChart, - VictoryGroup, - VictoryLabel, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryPortal", -}; - -export const Default: Story = { - args: {}, - render: (props) => ( -
- - - - - - } - data={[ - { x: 1, y: 1 }, - { x: 2, y: 2 }, - { x: 3, y: 5 }, - ]} - /> - - - - -
- ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryBar, + VictoryPortal, + VictoryChart, + VictoryGroup, + VictoryLabel, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryPortal", +}; + +export const Default: Story = { + args: {}, + render: (props) => ( +
+ + + + + + } + data={[ + { x: 1, y: 1 }, + { x: 2, y: 2 }, + { x: 3, y: 5 }, + ]} + /> + + + + +
+ ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/bubble-charts.stories.tsx b/stories/victory-charts/victory-scatter/bubble-charts.stories.tsx index 1db17b8b0..ff7233cb0 100644 --- a/stories/victory-charts/victory-scatter/bubble-charts.stories.tsx +++ b/stories/victory-charts/victory-scatter/bubble-charts.stories.tsx @@ -1,80 +1,80 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryScatter, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const BubbleCharts: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryScatter, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const BubbleCharts: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/data-accessors.stories.tsx b/stories/victory-charts/victory-scatter/data-accessors.stories.tsx index 929472256..a6f8d697e 100644 --- a/stories/victory-charts/victory-scatter/data-accessors.stories.tsx +++ b/stories/victory-charts/victory-scatter/data-accessors.stories.tsx @@ -1,85 +1,85 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryScatter, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const DataAccessors: Story = { - args: { - data: [ - { animal: "Cat", pet: 45, wild: 17 }, - { animal: "Dog", pet: 85, wild: 6 }, - { animal: "Fish", pet: 55, wild: 0 }, - { animal: "Bird", pet: 15, wild: 40 }, - { animal: "Monkey", pet: 5, wild: 40 }, - ], - }, - render: (props) => ( - <> - - datum.animal} - x={"animal"} - y={(data) => data.pet + data.wild} - /> - - - datum.animal} - x={"animal"} - y={(data) => data.pet + data.wild} - /> - - - datum.animal} - x={"animal"} - y={(data) => data.pet + data.wild} - /> - - - - - - - - - - - - Math.sin(2 * Math.PI * d.x)} /> - - - Math.sin(2 * Math.PI * d.x)} /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryScatter, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const DataAccessors: Story = { + args: { + data: [ + { animal: "Cat", pet: 45, wild: 17 }, + { animal: "Dog", pet: 85, wild: 6 }, + { animal: "Fish", pet: 55, wild: 0 }, + { animal: "Bird", pet: 15, wild: 40 }, + { animal: "Monkey", pet: 5, wild: 40 }, + ], + }, + render: (props) => ( + <> + + datum.animal} + x={"animal"} + y={(data) => data.pet + data.wild} + /> + + + datum.animal} + x={"animal"} + y={(data) => data.pet + data.wild} + /> + + + datum.animal} + x={"animal"} + y={(data) => data.pet + data.wild} + /> + + + + + + + + + + + + Math.sin(2 * Math.PI * d.x)} /> + + + Math.sin(2 * Math.PI * d.x)} /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/domain.stories.tsx b/stories/victory-charts/victory-scatter/domain.stories.tsx index f19d270d9..c4f28a248 100644 --- a/stories/victory-charts/victory-scatter/domain.stories.tsx +++ b/stories/victory-charts/victory-scatter/domain.stories.tsx @@ -14,9 +14,9 @@ export const Domain: Story = { args: {}, render: (props) => ( <> - diff --git a/stories/victory-charts/victory-scatter/functional-symbols.stories.tsx b/stories/victory-charts/victory-scatter/functional-symbols.stories.tsx index f2a702def..4de8cc5f1 100644 --- a/stories/victory-charts/victory-scatter/functional-symbols.stories.tsx +++ b/stories/victory-charts/victory-scatter/functional-symbols.stories.tsx @@ -1,79 +1,79 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - ScatterSymbolType, - VictoryScatter, - VictoryChart, - VictoryTheme, -} from "@/victory"; - -import { getData, getMixedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -const SYMBOLS: ScatterSymbolType[] = [ - "circle", - "cross", - "diamond", - "plus", - "minus", - "square", - "star", - "triangleDown", - "triangleUp", -]; - -export const FunctionalSymbols: Story = { - args: {}, - render: (props) => ( - <> - - SYMBOLS[index]} - labels={({ index }) => SYMBOLS[index]} - size={8} - /> - - - SYMBOLS[index]} - labels={({ index }) => SYMBOLS[index]} - size={8} - /> - - - - - - SYMBOLS[index]} - labels={({ index }) => SYMBOLS[index]} - size={8} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + ScatterSymbolType, + VictoryScatter, + VictoryChart, + VictoryTheme, +} from "@/victory"; + +import { getData, getMixedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +const SYMBOLS: ScatterSymbolType[] = [ + "circle", + "cross", + "diamond", + "plus", + "minus", + "square", + "star", + "triangleDown", + "triangleUp", +]; + +export const FunctionalSymbols: Story = { + args: {}, + render: (props) => ( + <> + + SYMBOLS[index]} + labels={({ index }) => SYMBOLS[index]} + size={8} + /> + + + SYMBOLS[index]} + labels={({ index }) => SYMBOLS[index]} + size={8} + /> + + + + + + SYMBOLS[index]} + labels={({ index }) => SYMBOLS[index]} + size={8} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/labels.stories.tsx b/stories/victory-charts/victory-scatter/labels.stories.tsx index 531d77d83..cc3b3f37e 100644 --- a/stories/victory-charts/victory-scatter/labels.stories.tsx +++ b/stories/victory-charts/victory-scatter/labels.stories.tsx @@ -1,44 +1,47 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryScatter, VictoryChart } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const Labels: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - /> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryScatter, VictoryChart } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const Labels: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + /> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/polar.stories.tsx b/stories/victory-charts/victory-scatter/polar.stories.tsx index 7abe68f9e..dbe2512a1 100644 --- a/stories/victory-charts/victory-scatter/polar.stories.tsx +++ b/stories/victory-charts/victory-scatter/polar.stories.tsx @@ -1,74 +1,74 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryScatter, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const Polar: Story = { - args: {}, - render: (props) => ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryScatter, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const Polar: Story = { + args: {}, + render: (props) => ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/stacked.stories.tsx b/stories/victory-charts/victory-scatter/stacked.stories.tsx index 10c8ca992..2d7d6da61 100644 --- a/stories/victory-charts/victory-scatter/stacked.stories.tsx +++ b/stories/victory-charts/victory-scatter/stacked.stories.tsx @@ -1,76 +1,76 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryScatter, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const Stacked: Story = { - args: {}, - render: (props) => ( - <> - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - datum.x}> - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryScatter, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const Stacked: Story = { + args: {}, + render: (props) => ( + <> + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + datum.x}> + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/styles.stories.tsx b/stories/victory-charts/victory-scatter/styles.stories.tsx index 1889e2e64..b3016b4f5 100644 --- a/stories/victory-charts/victory-scatter/styles.stories.tsx +++ b/stories/victory-charts/victory-scatter/styles.stories.tsx @@ -1,49 +1,49 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryScatter, VictoryChart, VictoryTheme } from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const Styles: Story = { - args: {}, - render: (props) => ( - <> - - datum.x} - style={{ - labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, - data: { fill: "tomato" }, - }} - /> - - - (datum.x === "Dog" ? "red" : "black"), - }, - }} - labels={({ datum }) => datum.x} - data={[ - { x: "Cat", y: 62 }, - { x: "Dog", y: 91 }, - { x: "Fish", y: 55 }, - { x: "Bird", y: 55 }, - ]} - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryScatter, VictoryChart, VictoryTheme } from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const Styles: Story = { + args: {}, + render: (props) => ( + <> + + datum.x} + style={{ + labels: { fontSize: 20, fill: "tomato", fontFamily: "monospace" }, + data: { fill: "tomato" }, + }} + /> + + + (datum.x === "Dog" ? "red" : "black"), + }, + }} + labels={({ datum }) => datum.x} + data={[ + { x: "Cat", y: 62 }, + { x: "Dog", y: 91 }, + { x: "Fish", y: 55 }, + { x: "Bird", y: 55 }, + ]} + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/theme.stories.tsx b/stories/victory-charts/victory-scatter/theme.stories.tsx index 99f6335a1..6dd9263f9 100644 --- a/stories/victory-charts/victory-scatter/theme.stories.tsx +++ b/stories/victory-charts/victory-scatter/theme.stories.tsx @@ -1,67 +1,75 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryScatter, VictoryChart, VictoryStack, VictoryTheme } from "@/victory"; - -import { getData, getMixedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const Theme: Story = { - args: {}, - render: (props) => ( - <> - - datum.x} - /> - - - datum.x}> - - - - - - - - - datum.x} - /> - - - datum.x}> - - - - - - - - - datum.x} - /> - - - datum.x}> - - - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryScatter, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; + +import { getData, getMixedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const Theme: Story = { + args: {}, + render: (props) => ( + <> + + datum.x} + /> + + + datum.x}> + + + + + + + + + datum.x} + /> + + + datum.x}> + + + + + + + + + datum.x} + /> + + + datum.x}> + + + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/time-scale.stories.tsx b/stories/victory-charts/victory-scatter/time-scale.stories.tsx index 85d159eb3..ffe75ddd9 100644 --- a/stories/victory-charts/victory-scatter/time-scale.stories.tsx +++ b/stories/victory-charts/victory-scatter/time-scale.stories.tsx @@ -1,54 +1,54 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryScatter, - VictoryChart, - VictoryStack, - VictoryTheme, -} from "@/victory"; -import { Story, ComponentMeta } from "./config"; -import { getTimeData } from "../../utils/data"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const TimeScale: Story = { - args: {}, - render: (props) => ( - <> - - datum.x.getFullYear()} - /> - - - datum.x.getFullYear()} - /> - - - datum.x.getFullYear()}> - - - - - - - datum.x.getFullYear()}> - - - - - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryScatter, + VictoryChart, + VictoryStack, + VictoryTheme, +} from "@/victory"; +import { Story, ComponentMeta } from "./config"; +import { getTimeData } from "../../utils/data"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const TimeScale: Story = { + args: {}, + render: (props) => ( + <> + + datum.x.getFullYear()} + /> + + + datum.x.getFullYear()} + /> + + + datum.x.getFullYear()}> + + + + + + + datum.x.getFullYear()}> + + + + + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-scatter/tooltips.stories.tsx b/stories/victory-charts/victory-scatter/tooltips.stories.tsx index 989a5288c..b7cf982dc 100644 --- a/stories/victory-charts/victory-scatter/tooltips.stories.tsx +++ b/stories/victory-charts/victory-scatter/tooltips.stories.tsx @@ -1,55 +1,59 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { - VictoryScatter, - VictoryChart, - VictoryTheme, - VictoryTooltip, -} from "@/victory"; - -import { getData, getMixedData } from "../../utils/data"; -import { Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryScatter", -}; - -export const Tooltips: Story = { - args: {}, - render: (props) => ( - <> - - `x: ${datum.x}`} - labelComponent={} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - `x: ${datum.x}`} - labelComponent={} - /> - - - } - /> - - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { + VictoryScatter, + VictoryChart, + VictoryTheme, + VictoryTooltip, +} from "@/victory"; + +import { getData, getMixedData } from "../../utils/data"; +import { Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryScatter", +}; + +export const Tooltips: Story = { + args: {}, + render: (props) => ( + <> + + `x: ${datum.x}`} + labelComponent={} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + `x: ${datum.x}`} + labelComponent={} + /> + + + } + /> + + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/center-offset.stories.tsx b/stories/victory-charts/victory-tooltip/center-offset.stories.tsx index e2c04eb97..e4faaa320 100644 --- a/stories/victory-charts/victory-tooltip/center-offset.stories.tsx +++ b/stories/victory-charts/victory-tooltip/center-offset.stories.tsx @@ -1,162 +1,162 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const CenterOffset: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - (datum.y < 0 ? 10 : -10), x: 10 }} - text={`function\noffset`} - /> - } - /> - (datum.y < 0 ? -10 : 10), - y: -10, - }} - text={`function\noffset`} - /> - } - /> - (Number(index) < 3 ? -10 : 10), - x: 10, - }} - text={`function\noffset`} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const CenterOffset: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + (datum.y < 0 ? 10 : -10), x: 10 }} + text={`function\noffset`} + /> + } + /> + (datum.y < 0 ? -10 : 10), + y: -10, + }} + text={`function\noffset`} + /> + } + /> + (Number(index) < 3 ? -10 : 10), + x: 10, + }} + text={`function\noffset`} + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/constrain-to-visible-area.stories.tsx b/stories/victory-charts/victory-tooltip/constrain-to-visible-area.stories.tsx index 20c29cb1b..7f4e851f3 100644 --- a/stories/victory-charts/victory-tooltip/constrain-to-visible-area.stories.tsx +++ b/stories/victory-charts/victory-tooltip/constrain-to-visible-area.stories.tsx @@ -1,86 +1,86 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const ConstrainToVisibleArea: Story = { - args: {}, - render: (props) => ( - <> - (datum.y > 0 ? -40 : 40), - x: ({ datum }) => (datum.y > 0 ? -20 : 20), - }} - pointerOrientation={({ datum }) => (datum.y > 0 ? "bottom" : "top")} - text={`constrain\nto\nvisible\narea`} - /> - } - /> - (datum.y > 0 ? -60 : 60), - x: ({ datum }) => (datum.y > 0 ? -10 : 10), - }} - pointerOrientation={({ datum }) => (datum.y > 0 ? "bottom" : "top")} - text={`constrain to\nvisible area`} - /> - } - /> - (datum.y > 0 ? 70 : -70), - y: ({ datum }) => (datum.y > 0 ? -10 : 10), - }} - pointerOrientation={({ datum }) => (datum.y > 0 ? "left" : "right")} - text={`constrain to\nvisible area`} - /> - } - /> - (datum.y > 0 ? 70 : -70), - y: ({ datum }) => (datum.y > 0 ? -10 : 10), - }} - pointerOrientation={({ datum }) => (datum.y > 0 ? "left" : "right")} - text={`constrain\nto\nvisible\narea`} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const ConstrainToVisibleArea: Story = { + args: {}, + render: (props) => ( + <> + (datum.y > 0 ? -40 : 40), + x: ({ datum }) => (datum.y > 0 ? -20 : 20), + }} + pointerOrientation={({ datum }) => (datum.y > 0 ? "bottom" : "top")} + text={`constrain\nto\nvisible\narea`} + /> + } + /> + (datum.y > 0 ? -60 : 60), + x: ({ datum }) => (datum.y > 0 ? -10 : 10), + }} + pointerOrientation={({ datum }) => (datum.y > 0 ? "bottom" : "top")} + text={`constrain to\nvisible area`} + /> + } + /> + (datum.y > 0 ? 70 : -70), + y: ({ datum }) => (datum.y > 0 ? -10 : 10), + }} + pointerOrientation={({ datum }) => (datum.y > 0 ? "left" : "right")} + text={`constrain to\nvisible area`} + /> + } + /> + (datum.y > 0 ? 70 : -70), + y: ({ datum }) => (datum.y > 0 ? -10 : 10), + }} + pointerOrientation={({ datum }) => (datum.y > 0 ? "left" : "right")} + text={`constrain\nto\nvisible\narea`} + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/corner-radius.stories.tsx b/stories/victory-charts/victory-tooltip/corner-radius.stories.tsx index 04e165735..345d55bee 100644 --- a/stories/victory-charts/victory-tooltip/corner-radius.stories.tsx +++ b/stories/victory-charts/victory-tooltip/corner-radius.stories.tsx @@ -1,88 +1,88 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const CornerRadius: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - (text === "square" ? 0 : 5)} - text={({ datum }) => (datum.y < 0 ? "square" : "rounded ")} - /> - } - /> - (text === "square" ? 0 : 5)} - text={({ datum }) => (datum.y < 0 ? "square" : "rounded ")} - /> - } - /> - (text === "square" ? 0 : 5)} - text={({ index }) => (Number(index) > 2 ? "square" : "rounded ")} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const CornerRadius: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + (text === "square" ? 0 : 5)} + text={({ datum }) => (datum.y < 0 ? "square" : "rounded ")} + /> + } + /> + (text === "square" ? 0 : 5)} + text={({ datum }) => (datum.y < 0 ? "square" : "rounded ")} + /> + } + /> + (text === "square" ? 0 : 5)} + text={({ index }) => (Number(index) > 2 ? "square" : "rounded ")} + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/flyout-height.stories.tsx b/stories/victory-charts/victory-tooltip/flyout-height.stories.tsx index ee59e7a35..0e8f61201 100644 --- a/stories/victory-charts/victory-tooltip/flyout-height.stories.tsx +++ b/stories/victory-charts/victory-tooltip/flyout-height.stories.tsx @@ -1,88 +1,88 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const FlyoutHeight: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - (text === "short" ? 20 : 50)} - text={({ datum }) => (datum.y < 0 ? "short" : "tall")} - /> - } - /> - (text === "short" ? 20 : 50)} - text={({ datum }) => (datum.y < 0 ? "short" : "tall")} - /> - } - /> - (text === "short" ? 20 : 50)} - text={({ index }) => (Number(index) > 2 ? "short" : "tall")} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const FlyoutHeight: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + (text === "short" ? 20 : 50)} + text={({ datum }) => (datum.y < 0 ? "short" : "tall")} + /> + } + /> + (text === "short" ? 20 : 50)} + text={({ datum }) => (datum.y < 0 ? "short" : "tall")} + /> + } + /> + (text === "short" ? 20 : 50)} + text={({ index }) => (Number(index) > 2 ? "short" : "tall")} + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/flyout-padding.stories.tsx b/stories/victory-charts/victory-tooltip/flyout-padding.stories.tsx index 95c4a6a15..7fde1f076 100644 --- a/stories/victory-charts/victory-tooltip/flyout-padding.stories.tsx +++ b/stories/victory-charts/victory-tooltip/flyout-padding.stories.tsx @@ -1,67 +1,67 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const FlyoutPadding: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - datum.y > 0 ? { top: 20, left: 15, right: 5 } : 2 - } - text={`flyoutPadding\nfunction`} - /> - } - /> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const FlyoutPadding: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + datum.y > 0 ? { top: 20, left: 15, right: 5 } : 2 + } + text={`flyoutPadding\nfunction`} + /> + } + /> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/flyout-style.stories.tsx b/stories/victory-charts/victory-tooltip/flyout-style.stories.tsx index 0c616de89..93391fc3f 100644 --- a/stories/victory-charts/victory-tooltip/flyout-style.stories.tsx +++ b/stories/victory-charts/victory-tooltip/flyout-style.stories.tsx @@ -1,66 +1,66 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const FlyoutStyle: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const FlyoutStyle: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/flyout-width.stories.tsx b/stories/victory-charts/victory-tooltip/flyout-width.stories.tsx index 3142abd02..c2e41ba3a 100644 --- a/stories/victory-charts/victory-tooltip/flyout-width.stories.tsx +++ b/stories/victory-charts/victory-tooltip/flyout-width.stories.tsx @@ -1,88 +1,88 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const FlyoutWidth: Story = { - args: {}, - render: (props) => ( - <> - - } - /> - - } - /> - - } - /> - (text === "short" ? 35 : 100)} - text={({ datum }) => (datum.y < 0 ? "short" : "long")} - /> - } - /> - (text === "short" ? 35 : 100)} - text={({ datum }) => (datum.y < 0 ? "short" : "long")} - /> - } - /> - (text === "short" ? 35 : 100)} - text={({ index }) => (Number(index) > 2 ? "short" : "long")} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const FlyoutWidth: Story = { + args: {}, + render: (props) => ( + <> + + } + /> + + } + /> + + } + /> + (text === "short" ? 35 : 100)} + text={({ datum }) => (datum.y < 0 ? "short" : "long")} + /> + } + /> + (text === "short" ? 35 : 100)} + text={({ datum }) => (datum.y < 0 ? "short" : "long")} + /> + } + /> + (text === "short" ? 35 : 100)} + text={({ index }) => (Number(index) > 2 ? "short" : "long")} + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/pointer-length.stories.tsx b/stories/victory-charts/victory-tooltip/pointer-length.stories.tsx index bcc7f9513..a134301ab 100644 --- a/stories/victory-charts/victory-tooltip/pointer-length.stories.tsx +++ b/stories/victory-charts/victory-tooltip/pointer-length.stories.tsx @@ -1,96 +1,96 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const PointerLength: Story = { - args: {}, - render: (props) => ( - <> - (index === 0 ? -20 : 0) }} - pointerLength={30} - text={`pointerLength\n30`} - /> - } - /> - (index === 0 ? 20 : 0) }} - text={`pointerLength\n30`} - /> - } - /> - (index === 0 ? 20 : 0) }} - text={`pointerLength\n30`} - /> - } - /> - (Number(index) < 2 ? 20 : 0) }} - pointerLength={({ text }) => (text === "short" ? 1 : 30)} - text={({ datum }) => (datum.y < 0 ? "short" : "long ")} - /> - } - /> - (Number(index) < 2 ? 20 : 0) }} - pointerLength={({ text }) => (text === "short" ? 1 : 30)} - text={({ datum }) => (datum.y < 0 ? "short" : "long ")} - /> - } - /> - (index === 0 || index === 4 ? 20 : 0), - }} - pointerLength={({ text }) => (text === "short" ? 1 : 30)} - text={({ index }) => (Number(index) > 2 ? "short" : "long ")} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const PointerLength: Story = { + args: {}, + render: (props) => ( + <> + (index === 0 ? -20 : 0) }} + pointerLength={30} + text={`pointerLength\n30`} + /> + } + /> + (index === 0 ? 20 : 0) }} + text={`pointerLength\n30`} + /> + } + /> + (index === 0 ? 20 : 0) }} + text={`pointerLength\n30`} + /> + } + /> + (Number(index) < 2 ? 20 : 0) }} + pointerLength={({ text }) => (text === "short" ? 1 : 30)} + text={({ datum }) => (datum.y < 0 ? "short" : "long ")} + /> + } + /> + (Number(index) < 2 ? 20 : 0) }} + pointerLength={({ text }) => (text === "short" ? 1 : 30)} + text={({ datum }) => (datum.y < 0 ? "short" : "long ")} + /> + } + /> + (index === 0 || index === 4 ? 20 : 0), + }} + pointerLength={({ text }) => (text === "short" ? 1 : 30)} + text={({ index }) => (Number(index) > 2 ? "short" : "long ")} + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/pointer-orientation.stories.tsx b/stories/victory-charts/victory-tooltip/pointer-orientation.stories.tsx index 716a56466..60b865573 100644 --- a/stories/victory-charts/victory-tooltip/pointer-orientation.stories.tsx +++ b/stories/victory-charts/victory-tooltip/pointer-orientation.stories.tsx @@ -1,113 +1,113 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const PointerOrientation: Story = { - args: {}, - render: (props) => ( - <> - (datum.y > 0 ? "bottom" : "top")} - text={({ datum }) => - datum.y > 0 ? `orientation\nbottom` : `orientation\ntop` - } - /> - } - /> - (datum.y > 0 ? -40 : 40), - x: ({ datum }) => (datum.y > 0 ? -20 : 20), - }} - pointerOrientation={({ datum }) => (datum.y > 0 ? "bottom" : "top")} - text={({ datum }) => - datum.y > 0 ? `orientation\nbottom` : `orientation\ntop` - } - /> - } - /> - (index < 3 ? "bottom" : "top")} - text={({ index }) => - Number(index) < 3 ? `orientation\nbottom` : `orientation\ntop` - } - /> - } - /> - (datum.y > 0 ? 55 : -55), - }} - pointerOrientation={({ datum }) => (datum.y > 0 ? "left" : "right")} - text={({ datum }) => - datum.y > 0 ? `orientation\nleft` : `orientation\nright` - } - /> - } - /> - (datum.y > 0 ? "left" : "right")} - text={({ datum }) => - datum.y > 0 ? `orientation\nleft` : `orientation\nright` - } - /> - } - /> - - - index === 2 || index === 3 ? "right" : "left" - } - text={({ index }) => - index === 2 || index === 3 - ? `orientation\nleft` - : `orientation\nright` - } - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const PointerOrientation: Story = { + args: {}, + render: (props) => ( + <> + (datum.y > 0 ? "bottom" : "top")} + text={({ datum }) => + datum.y > 0 ? `orientation\nbottom` : `orientation\ntop` + } + /> + } + /> + (datum.y > 0 ? -40 : 40), + x: ({ datum }) => (datum.y > 0 ? -20 : 20), + }} + pointerOrientation={({ datum }) => (datum.y > 0 ? "bottom" : "top")} + text={({ datum }) => + datum.y > 0 ? `orientation\nbottom` : `orientation\ntop` + } + /> + } + /> + (index < 3 ? "bottom" : "top")} + text={({ index }) => + Number(index) < 3 ? `orientation\nbottom` : `orientation\ntop` + } + /> + } + /> + (datum.y > 0 ? 55 : -55), + }} + pointerOrientation={({ datum }) => (datum.y > 0 ? "left" : "right")} + text={({ datum }) => + datum.y > 0 ? `orientation\nleft` : `orientation\nright` + } + /> + } + /> + (datum.y > 0 ? "left" : "right")} + text={({ datum }) => + datum.y > 0 ? `orientation\nleft` : `orientation\nright` + } + /> + } + /> + + + index === 2 || index === 3 ? "right" : "left" + } + text={({ index }) => + index === 2 || index === 3 + ? `orientation\nleft` + : `orientation\nright` + } + /> + } + /> + + ), +}; + +export default meta; diff --git a/stories/victory-charts/victory-tooltip/pointer-width.stories.tsx b/stories/victory-charts/victory-tooltip/pointer-width.stories.tsx index c8e1d0a6e..b70f81925 100644 --- a/stories/victory-charts/victory-tooltip/pointer-width.stories.tsx +++ b/stories/victory-charts/victory-tooltip/pointer-width.stories.tsx @@ -1,96 +1,96 @@ -import React from "react"; -import type { Meta } from "@storybook/react"; - -import { VictoryTooltip, VictoryBar } from "@/victory"; -import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; - -const meta: Meta = { - ...ComponentMeta, - title: "Victory Charts/VictoryTooltip", -}; - -export const PointerWidth: Story = { - args: {}, - render: (props) => ( - <> - (index === 0 ? -20 : 0) }} - text={`pointerWidth\n20`} - /> - } - /> - (index === 0 ? 20 : 0) }} - text={`pointerWidth\n20`} - /> - } - /> - (index === 0 ? 20 : 0) }} - text={`pointerWidth\n20`} - /> - } - /> - (Number(index) < 2 ? -20 : 0) }} - pointerWidth={({ text }) => (text === "skinny" ? 0 : 20)} - text={({ datum }) => (datum.y < 0 ? "skinny" : "wide ")} - /> - } - /> - (Number(index) < 2 ? 20 : 0) }} - pointerWidth={({ text }) => (text === "skinny" ? 0 : 20)} - text={({ datum }) => (datum.y < 0 ? "skinny" : "wide ")} - /> - } - /> - (index === 0 || index === 4 ? 20 : 0), - }} - pointerWidth={({ text }) => (text === "skinny" ? 0 : 20)} - text={({ index }) => (Number(index) > 2 ? "skinny" : "wide ")} - /> - } - /> - - ), -}; - -export default meta; +import React from "react"; +import type { Meta } from "@storybook/react"; + +import { VictoryTooltip, VictoryBar } from "@/victory"; +import { defaultBarProps, polarBarProps, Story, ComponentMeta } from "./config"; + +const meta: Meta = { + ...ComponentMeta, + title: "Victory Charts/VictoryTooltip", +}; + +export const PointerWidth: Story = { + args: {}, + render: (props) => ( + <> + (index === 0 ? -20 : 0) }} + text={`pointerWidth\n20`} + /> + } + /> + (index === 0 ? 20 : 0) }} + text={`pointerWidth\n20`} + /> + } + /> + (index === 0 ? 20 : 0) }} + text={`pointerWidth\n20`} + /> + } + /> + (Number(index) < 2 ? -20 : 0) }} + pointerWidth={({ text }) => (text === "skinny" ? 0 : 20)} + text={({ datum }) => (datum.y < 0 ? "skinny" : "wide ")} + /> + } + /> + (Number(index) < 2 ? 20 : 0) }} + pointerWidth={({ text }) => (text === "skinny" ? 0 : 20)} + text={({ datum }) => (datum.y < 0 ? "skinny" : "wide ")} + /> + } + /> + (index === 0 || index === 4 ? 20 : 0), + }} + pointerWidth={({ text }) => (text === "skinny" ? 0 : 20)} + text={({ index }) => (Number(index) > 2 ? "skinny" : "wide ")} + /> + } + /> + + ), +}; + +export default meta;