chore: moving web constants to packages

This commit is contained in:
sriram veeraghanta 2025-01-14 16:30:43 +05:30
parent ae3b588081
commit e9372adcf4
36 changed files with 305 additions and 314 deletions

View file

@ -1,7 +1,7 @@
// nivo
import { ResponsiveBar, BarSvgProps } from "@nivo/bar";
import { CHARTS_THEME, CHART_DEFAULT_MARGIN } from "@plane/constants";
// helpers
import { CHARTS_THEME, DEFAULT_MARGIN } from "@/constants/graph";
import { generateYAxisTickValues } from "@/helpers/graph.helper";
// types
import { TGraph } from "./types";
@ -27,8 +27,8 @@ export const BarGraph: React.FC<Props & TGraph & Omit<BarSvgProps<any>, "height"
<ResponsiveBar
indexBy={indexBy}
keys={keys}
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
padding={rest.padding ?? rest.data.length > 7 ? 0.8 : 0.9}
margin={{ ...CHART_DEFAULT_MARGIN, ...(margin ?? {}) }}
padding={(rest.padding ?? rest.data.length > 7) ? 0.8 : 0.9}
axisLeft={{
tickSize: 0,
tickPadding: 10,

View file

@ -1,7 +1,7 @@
// nivo
import { ResponsiveCalendar, CalendarSvgProps } from "@nivo/calendar";
// types
import { CHARTS_THEME, DEFAULT_MARGIN } from "@/constants/graph";
import { CHARTS_THEME, CHART_DEFAULT_MARGIN } from "@plane/constants";
import { TGraph } from "./types";
// constants
@ -14,7 +14,7 @@ export const CalendarGraph: React.FC<TGraph & Omit<CalendarSvgProps, "height" |
}) => (
<div style={{ height, width }}>
<ResponsiveCalendar
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
margin={{ ...CHART_DEFAULT_MARGIN, ...(margin ?? {}) }}
colors={
rest.colors ?? [
"rgba(var(--color-primary-100), 0.2)",

View file

@ -1,7 +1,7 @@
// nivo
import { ResponsiveLine, LineSvgProps } from "@nivo/line";
// helpers
import { CHARTS_THEME, DEFAULT_MARGIN } from "@/constants/graph";
import { CHARTS_THEME, CHART_DEFAULT_MARGIN } from "@plane/constants";
import { generateYAxisTickValues } from "@/helpers/graph.helper";
// types
import { TGraph } from "./types";
@ -21,7 +21,7 @@ export const LineGraph: React.FC<Props & TGraph & LineSvgProps> = ({
}) => (
<div style={{ height, width }}>
<ResponsiveLine
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
margin={{ ...CHART_DEFAULT_MARGIN, ...(margin ?? {}) }}
axisLeft={{
tickSize: 0,
tickPadding: 10,

View file

@ -1,7 +1,7 @@
// nivo
import { PieSvgProps, ResponsivePie } from "@nivo/pie";
// types
import { CHARTS_THEME, DEFAULT_MARGIN } from "@/constants/graph";
import { CHARTS_THEME, CHART_DEFAULT_MARGIN } from "@plane/constants";
import { TGraph } from "./types";
// constants
@ -14,7 +14,7 @@ export const PieGraph: React.FC<TGraph & Omit<PieSvgProps<any>, "height" | "widt
}) => (
<div style={{ height, width }}>
<ResponsivePie
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
margin={{ ...CHART_DEFAULT_MARGIN, ...(margin ?? {}) }}
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
animate
{...rest}

View file

@ -1,7 +1,7 @@
// nivo
import { ResponsiveScatterPlot, ScatterPlotSvgProps } from "@nivo/scatterplot";
// types
import { CHARTS_THEME, DEFAULT_MARGIN } from "@/constants/graph";
import { CHARTS_THEME, CHART_DEFAULT_MARGIN } from "@plane/constants";
import { TGraph } from "./types";
// constants
@ -14,7 +14,7 @@ export const ScatterPlotGraph: React.FC<TGraph & Omit<ScatterPlotSvgProps<any>,
}) => (
<div style={{ height, width }}>
<ResponsiveScatterPlot
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
margin={{ ...CHART_DEFAULT_MARGIN, ...(margin ?? {}) }}
animate
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
{...rest}