Skip to content

Commit

Permalink
fix: Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
2Steaks committed May 20, 2024
1 parent 68b8fd2 commit ee65dd4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dashboard/assets/packages/ui/src/components/Chart/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Icon } from "components/Icon"
import { Paper } from "components/Paper"
import { Tooltip } from "components/Tooltip"

import { SeriesPlotWithDefinedSeries } from "./Chart.utils"
import { useOptions } from "./Chart.hooks"
import * as styles from "./Chart.css"

Expand All @@ -31,7 +32,7 @@ export default function Chart({ panel, container }: ChartProps) {
const { theme } = useTheme()
const [ref, { width }] = useElementSize()

const plot = new SeriesPlot(digest, panel, createColorScheme(theme))
const plot = new SeriesPlot(digest, panel, createColorScheme(theme)) as SeriesPlotWithDefinedSeries
const hasData = !plot.empty && plot.data[0].length > 1
const plotData = (hasData ? plot.data : []) as AlignedData
const options = useOptions({ plot, theme, width })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ interface SelectedUplotOptions extends Pick<Options, "hooks" | "scales" | "width
height?: number
}

export type SeriesPlotWithDefinedSeries = Omit<SeriesPlot, "series"> & { series: Series[] }

export interface CreateOptionsProps extends SelectedUplotOptions {
plot: Omit<SeriesPlot, "series"> & { series: Series[] }
plot: SeriesPlotWithDefinedSeries
theme: Theme
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ export const button = style({

export const icon = styleVariants({
fill: [],
outline: [],
text: [{ color: vars.colors.text.primary }]
})

0 comments on commit ee65dd4

Please sign in to comment.