Skip to content
Open
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ export const Gantt = ({ limit }: Props) => {
.filter((item) => item !== undefined);
}, [flatNodes, gridTiSummaries, taskInstancesData, selectedTimezone, isLoading, runId]);

const chartLabels = useMemo(() => flatNodes.map((node) => node.id), [flatNodes]);

const chartData = useMemo(
() => ({
datasets: [
Expand All @@ -185,9 +187,9 @@ export const Gantt = ({ limit }: Props) => {
minBarLength: MIN_BAR_WIDTH,
},
],
labels: [],
labels: chartLabels,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
labels: chartLabels,
labels: flatNodes.map((node) => node.id),

I think it would be better and more clear in this way.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, I was thinking to get the labels specifically memoized would be performant but could be trivial, thanks and making the updates now.

}),
[data],
[data, chartLabels],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[data, chartLabels],
[data, flatNodes],

);

const fixedHeight = flatNodes.length * CHART_ROW_HEIGHT + CHART_PADDING;
Expand Down