Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump turbo to v2 #2163

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions ui/components/src/LineChart/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,25 @@ export const LineChart = forwardRef<ChartInstance, LineChartProps>(function Line
const [isDragging, setIsDragging] = useState(false);
const [startX, setStartX] = useState(0);

useImperativeHandle(
ref,
() => {
return {
highlightSeries({ id }: ChartInstanceFocusOpts) {
if (!chartRef.current) {
// when chart undef, do not highlight series when hovering over legend
return;
}
useImperativeHandle(ref, () => {
return {
highlightSeries({ id }: ChartInstanceFocusOpts) {
if (!chartRef.current) {
// when chart undef, do not highlight series when hovering over legend
return;
}

chartRef.current.dispatchAction({ type: 'highlight', seriesId: id });
},
clearHighlightedSeries: () => {
if (!chartRef.current) {
// when chart undef, do not clear highlight series
return;
}
clearHighlightedSeries(chartRef.current);
},
};
},
[]
);
chartRef.current.dispatchAction({ type: 'highlight', seriesId: id });
},
clearHighlightedSeries: () => {
if (!chartRef.current) {
// when chart undef, do not clear highlight series
return;
}
clearHighlightedSeries(chartRef.current);
},
};
}, []);

const handleEvents: OnEventsType<LineSeriesOption['data'] | unknown> = useMemo(() => {
return {
Expand Down
2 changes: 1 addition & 1 deletion ui/components/src/Table/model/table-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export interface TableProps<TableData> {
function calculateTableCellHeight(lineHeight: CSSProperties['lineHeight'], paddingY: string): number {
// Doing a bunch of math to enforce height to avoid weirdness with mismatched
// heights based on customization of cell contents.
const lineHeightNum = typeof lineHeight === 'string' ? parseInt(lineHeight, 10) : lineHeight ?? 0;
const lineHeightNum = typeof lineHeight === 'string' ? parseInt(lineHeight, 10) : (lineHeight ?? 0);
const verticalPaddingNum = typeof paddingY === 'string' ? parseInt(paddingY, 10) : paddingY;

return lineHeightNum + verticalPaddingNum * 2;
Expand Down
40 changes: 18 additions & 22 deletions ui/components/src/TimeChart/TimeChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,29 +133,25 @@ export const TimeChart = forwardRef<ChartInstance, TimeChartProps>(function Time
timeScale = timeScaleProp;
}

useImperativeHandle(
ref,
() => {
return {
highlightSeries({ name }: ChartInstanceFocusOpts) {
if (!chartRef.current) {
// when chart undef, do not highlight series when hovering over legend
return;
}
useImperativeHandle(ref, () => {
return {
highlightSeries({ name }: ChartInstanceFocusOpts) {
if (!chartRef.current) {
// when chart undef, do not highlight series when hovering over legend
return;
}

chartRef.current.dispatchAction({ type: 'highlight', seriesId: name });
},
clearHighlightedSeries: () => {
if (!chartRef.current) {
// when chart undef, do not clear highlight series
return;
}
clearHighlightedSeries(chartRef.current);
},
};
},
[]
);
chartRef.current.dispatchAction({ type: 'highlight', seriesId: name });
},
clearHighlightedSeries: () => {
if (!chartRef.current) {
// when chart undef, do not clear highlight series
return;
}
clearHighlightedSeries(chartRef.current);
},
};
}, []);

const handleEvents: OnEventsType<LineSeriesOption['data'] | unknown> = useMemo(() => {
return {
Expand Down
Loading
Loading