Skip to content

Commit 45f5f07

Browse files
chore: always show max cu line
1 parent 48f87c8 commit 45f5f07

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/features/Overview/SlotPerformance/ComputeUnitsCard/cuRefAreaPlugin.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,6 @@ export function cuRefAreaPlugin({
300300
},
301301
drawSeries: [
302302
(u, sid) => {
303-
if (!store.get(showChartProjectionsAtom)) return;
304-
305303
// to draw the ref area above bank lines, but below other series
306304
if (u.series[sid].label !== "Active Bank") return;
307305

@@ -319,6 +317,8 @@ export function cuRefAreaPlugin({
319317

320318
ctx.save();
321319

320+
const onlyMaxCu = !store.get(showChartProjectionsAtom);
321+
322322
const slotDurationNanos = Number(
323323
slotTransactions.target_end_timestamp_nanos -
324324
slotTransactions.start_timestamp_nanos,
@@ -327,13 +327,15 @@ export function cuRefAreaPlugin({
327327
maxComputeUnits + 0.05 * slotDurationNanos * cusPerNs,
328328
);
329329

330-
const refLines = getRefLinesWithinScales(
331-
u.scales[xScaleKey],
332-
u.scales[computeUnitsScaleKey],
333-
slotTransactions,
334-
refLineMaxComputeUnits,
335-
bankTileCount,
336-
);
330+
const refLines = onlyMaxCu
331+
? []
332+
: getRefLinesWithinScales(
333+
u.scales[xScaleKey],
334+
u.scales[computeUnitsScaleKey],
335+
slotTransactions,
336+
refLineMaxComputeUnits,
337+
bankTileCount,
338+
);
337339

338340
// Adding a max CU line unrelated to bank count
339341
refLines.unshift({
@@ -353,6 +355,7 @@ export function cuRefAreaPlugin({
353355

354356
const prevXY = { x: -100, y: 30 };
355357

358+
// draw lines and labels
356359
for (let i = 0; i < refLines.length; i++) {
357360
const { line, bankCount } = refLines[i];
358361
const x0 = Math.round(u.valToPos(line[0].x, xScaleKey, true));
@@ -466,7 +469,7 @@ export function cuRefAreaPlugin({
466469
}
467470
}
468471
// Drawing the entire area of the current bank count if no ref lines to seperate them
469-
else {
472+
else if (!onlyMaxCu) {
470473
const midComputeUnits =
471474
u.scales[computeUnitsScaleKey].max ??
472475
0 - (u.scales[computeUnitsScaleKey].min ?? 0);

0 commit comments

Comments
 (0)