diff --git a/src/components/chart-elements/DonutChart/DonutChart.tsx b/src/components/chart-elements/DonutChart/DonutChart.tsx index 69628d8b3..a3e0de11b 100644 --- a/src/components/chart-elements/DonutChart/DonutChart.tsx +++ b/src/components/chart-elements/DonutChart/DonutChart.tsx @@ -16,7 +16,7 @@ import { DonutChartTooltip } from "./DonutChartTooltip"; import { parseData, parseLabelInput } from "./inputParser"; import type { EventProps } from "components/chart-elements/common"; -import { CustomTooltipType } from "components/chart-elements/common/CustomTooltipProps"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import type BaseAnimationTimingProps from "../common/BaseAnimationTimingProps"; type DonutChartVariant = "donut" | "pie"; @@ -35,7 +35,7 @@ export interface DonutChartProps extends BaseAnimationTimingProps { noDataText?: string; className?: string; onValueChange?: (value: EventProps) => void; - customTooltip?: React.ComponentType; + customTooltip?: React.ComponentType; } const renderInactiveShape = (props: any) => { diff --git a/src/components/chart-elements/ScatterChart/ScatterChart.tsx b/src/components/chart-elements/ScatterChart/ScatterChart.tsx index 61ea11195..a18aa0fad 100644 --- a/src/components/chart-elements/ScatterChart/ScatterChart.tsx +++ b/src/components/chart-elements/ScatterChart/ScatterChart.tsx @@ -26,7 +26,7 @@ import { getYAxisDomain, } from "../common/utils"; -import { CustomTooltipType } from "components/chart-elements/common/CustomTooltipProps"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import { BaseColors, colorPalette, @@ -73,7 +73,7 @@ export interface ScatterChartProps noDataText?: string; enableLegendSlider?: boolean; onValueChange?: (value: EventProps) => void; - customTooltip?: React.ComponentType; + customTooltip?: React.ComponentType; rotateLabelX?: { angle: number; verticalShift: number; diff --git a/src/components/chart-elements/common/BaseChartProps.tsx b/src/components/chart-elements/common/BaseChartProps.tsx index b139a45ef..c2d915f0e 100644 --- a/src/components/chart-elements/common/BaseChartProps.tsx +++ b/src/components/chart-elements/common/BaseChartProps.tsx @@ -1,6 +1,6 @@ import { Color, ValueFormatter, IntervalType } from "../../../lib"; import type BaseAnimationTimingProps from "./BaseAnimationTimingProps"; -import { CustomTooltipType } from "./CustomTooltipProps"; +import { CustomTooltipProps } from "./CustomTooltipProps"; type FixedProps = { eventType: "dot" | "category" | "bar" | "slice" | "bubble"; @@ -34,7 +34,7 @@ interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes< noDataText?: string; onValueChange?: (value: EventProps) => void; enableLegendSlider?: boolean; - customTooltip?: React.ComponentType; + customTooltip?: React.ComponentType; rotateLabelX?: { angle: number; verticalShift?: number; diff --git a/src/components/chart-elements/common/CustomTooltipProps.tsx b/src/components/chart-elements/common/CustomTooltipProps.tsx index 05e3b3724..7a7cc5794 100644 --- a/src/components/chart-elements/common/CustomTooltipProps.tsx +++ b/src/components/chart-elements/common/CustomTooltipProps.tsx @@ -1,6 +1,6 @@ import { NameType, Payload } from "recharts/types/component/DefaultTooltipContent"; -export type CustomTooltipType = { +export type CustomTooltipProps = { payload: Payload[] | undefined; active: boolean | undefined; label: NameType | undefined; diff --git a/src/components/chart-elements/common/index.ts b/src/components/chart-elements/common/index.ts index dcb316e86..7a73db7fe 100644 --- a/src/components/chart-elements/common/index.ts +++ b/src/components/chart-elements/common/index.ts @@ -1,2 +1,2 @@ export type { EventProps } from "./BaseChartProps"; -export type { CustomTooltipType } from "./CustomTooltipProps"; +export type { CustomTooltipProps } from "./CustomTooltipProps"; diff --git a/src/stories/chart-elements/AreaChart.stories.tsx b/src/stories/chart-elements/AreaChart.stories.tsx index 20564c833..5486c449e 100644 --- a/src/stories/chart-elements/AreaChart.stories.tsx +++ b/src/stories/chart-elements/AreaChart.stories.tsx @@ -3,7 +3,7 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { AreaChart } from "components"; -import { CustomTooltipType } from "components/chart-elements/common/CustomTooltipProps"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import { Color, currencyValueFormatter } from "lib"; import { simpleBaseChartData as data, @@ -228,7 +228,7 @@ export const CustomTooltipSimple: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; @@ -263,7 +263,7 @@ export const CustomTooltipPreviousDay: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; @@ -307,7 +307,7 @@ export const CustomTooltipComplex: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; diff --git a/src/stories/chart-elements/BarChart.stories.tsx b/src/stories/chart-elements/BarChart.stories.tsx index 727936a22..8b0e7b4c6 100644 --- a/src/stories/chart-elements/BarChart.stories.tsx +++ b/src/stories/chart-elements/BarChart.stories.tsx @@ -3,7 +3,7 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { BarChart } from "components"; -import { CustomTooltipType } from "components/chart-elements/common/CustomTooltipProps"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import { Color, currencyValueFormatter } from "lib"; import { simpleBaseChartData as data, @@ -244,7 +244,7 @@ export const CustomTooltipSimple: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; @@ -279,7 +279,7 @@ export const CustomTooltipPreviousDay: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; @@ -323,7 +323,7 @@ export const CustomTooltipComplex: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; diff --git a/src/stories/chart-elements/DonutChart.stories.tsx b/src/stories/chart-elements/DonutChart.stories.tsx index 51e94966a..3ae2a563f 100644 --- a/src/stories/chart-elements/DonutChart.stories.tsx +++ b/src/stories/chart-elements/DonutChart.stories.tsx @@ -4,7 +4,7 @@ import type { Meta, StoryObj } from "@storybook/react"; import { DonutChart } from "components"; -import { CustomTooltipType } from "components/chart-elements/common/CustomTooltipProps"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import { currencyValueFormatter } from "lib"; import { simpleBaseChartData as data2, @@ -144,7 +144,7 @@ export const CustomTooltipSimple: Story = { index: "month", category: "Sales", valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; const categoryPayload = payload?.[0]; diff --git a/src/stories/chart-elements/LineChart.stories.tsx b/src/stories/chart-elements/LineChart.stories.tsx index 69dedaae4..4f5de6e79 100644 --- a/src/stories/chart-elements/LineChart.stories.tsx +++ b/src/stories/chart-elements/LineChart.stories.tsx @@ -3,7 +3,7 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { LineChart } from "components"; -import { CustomTooltipType } from "components/chart-elements/common/CustomTooltipProps"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import { Color, currencyValueFormatter } from "lib"; import { simpleBaseChartData as data, @@ -188,7 +188,7 @@ export const CustomTooltipSimple: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; @@ -223,7 +223,7 @@ export const CustomTooltipPreviousDay: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; @@ -267,7 +267,7 @@ export const CustomTooltipComplex: Story = { categories: ["Sales"], colors: customTooltipColors, valueFormatter: currencyValueFormatter, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; diff --git a/src/stories/chart-elements/ScatterChart.stories.tsx b/src/stories/chart-elements/ScatterChart.stories.tsx index 5bb658666..701870a0e 100644 --- a/src/stories/chart-elements/ScatterChart.stories.tsx +++ b/src/stories/chart-elements/ScatterChart.stories.tsx @@ -3,7 +3,7 @@ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { ScatterChart } from "components"; -import { CustomTooltipType } from "components/chart-elements/common/CustomTooltipProps"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import { Color } from "lib"; import { simpleScatterChartData as data, @@ -157,7 +157,7 @@ export const CustomTooltip: Story = { args: { colors: customTooltipColors, category: customTooltipIndex, - customTooltip: (props: CustomTooltipType) => { + customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null;