Skip to content

Commit 215ebff

Browse files
committed
Include percent durations in fraction chart legend
1 parent 83f0454 commit 215ebff

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

site/frontend/src/pages/compare/compile/table/sections-chart.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@ const chartRows: ComputedRef<Array<[string, CompilationSections]>> = computed(
5454
]
5555
);
5656
const legendItems: ComputedRef<
57-
Array<{section: CompilationSection; color: string}>
57+
Array<{section: CompilationSection; label: string; color: string}>
5858
> = computed(() => {
5959
const items = [];
6060
for (const section of props.before.sections) {
6161
items.push({
6262
section,
63+
label: `${section.name} (${formatPercent(
64+
props.before,
65+
section.name
66+
)} -> ${formatPercent(props.after, section.name)})`,
6367
color: getSectionColor(items.length),
6468
});
6569
}
@@ -122,7 +126,7 @@ function deactivate() {
122126
:class="{color: true, active: activeSection === item.section.name}"
123127
:style="{backgroundColor: item.color}"
124128
></div>
125-
<div class="name">{{ item.section.name }}</div>
129+
<div class="name">{{ item.label }}</div>
126130
</div>
127131
</div>
128132
</div>

0 commit comments

Comments
 (0)