Skip to content

Commit

Permalink
Fixed the timeline guide height after the graph resize (#5490)
Browse files Browse the repository at this point in the history
  • Loading branch information
manojVivek authored Feb 14, 2025
1 parent ff4269e commit e4d927a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ui/packages/shared/profile/src/MetricsGraphStrips/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ export const labelSetToString = (labelSet?: LabelSet): string => {
return str;
};

const STRIP_HEIGHT = 24;

const getTimelineGuideHeight = (cpus: LabelSet[], collapsedIndices: number[]): number => {
return 56 * (cpus.length - collapsedIndices.length) + 20 * collapsedIndices.length + 24;
return (
(STRIP_HEIGHT + 4) * (cpus.length - collapsedIndices.length) +
20 * collapsedIndices.length +
24 -
6
);
};

export const MetricsGraphStrips = ({
Expand Down Expand Up @@ -107,7 +114,7 @@ export const MetricsGraphStrips = ({
{!isCollapsed ? (
<AreaGraph
data={data[i]}
height={24}
height={STRIP_HEIGHT}
width={width ?? 1468}
fill={color(labelStr) as string}
selectionBounds={
Expand Down

0 comments on commit e4d927a

Please sign in to comment.