diff --git a/packages/core/src/Chart.tsx b/packages/core/src/Chart.tsx index 6c3c32d2e..2d916cf11 100644 --- a/packages/core/src/Chart.tsx +++ b/packages/core/src/Chart.tsx @@ -1,7 +1,7 @@ -import { ScaleContinuousNumeric, scaleLinear } from "d3-scale"; +import { ScaleContinuousNumeric } from "d3-scale"; import * as React from "react"; import { ChartCanvasContext, chartCanvasContextDefaultValue, ChartCanvasContextType } from "./ChartCanvas"; -import { ChartConfig } from "./utils/ChartDataUtil"; +import type { ChartConfig } from "./utils/ChartDataUtil"; export type ChartContextType = Omit, "chartConfig"> & { chartConfig: ChartConfig; @@ -111,14 +111,4 @@ export const Chart = React.memo((props: React.PropsWithChildren) => ); }); -export const ChartDefaultConfig = { - flipYScale: false, - id: 0, - origin: [0, 0], - padding: 0, - yPan: true, - yPanEnabled: false, - yScale: scaleLinear(), -}; - Chart.displayName = "Chart"; diff --git a/packages/core/src/utils/ChartDataUtil.ts b/packages/core/src/utils/ChartDataUtil.ts index fca2a004d..0457fdb4a 100644 --- a/packages/core/src/utils/ChartDataUtil.ts +++ b/packages/core/src/utils/ChartDataUtil.ts @@ -1,9 +1,8 @@ import { extent } from "d3-array"; -import { ScaleContinuousNumeric, ScaleTime } from "d3-scale"; +import { ScaleContinuousNumeric, scaleLinear, ScaleTime } from "d3-scale"; import flattenDeep from "lodash.flattendeep"; import * as React from "react"; - -import { ChartDefaultConfig, ChartProps } from "../Chart"; +import type { ChartProps } from "../Chart"; import { functor, getClosestItem, isNotDefined, isObject, last, mapObject, shallowEqual, zipper } from "./index"; @@ -31,6 +30,16 @@ export interface ChartConfig { mouseCoordinates?: { at: string; format: () => unknown }; } +export const ChartDefaultConfig = { + flipYScale: false, + id: 0, + origin: [0, 0], + padding: 0, + yPan: true, + yPanEnabled: false, + yScale: scaleLinear(), +}; + export function getChartOrigin(origin: any, contextWidth: number, contextHeight: number) { const originCoordinates = typeof origin === "function" ? origin(contextWidth, contextHeight) : origin;