Skip to content

Commit

Permalink
Include percent durations in fraction chart legend
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Dec 18, 2023
1 parent 83f0454 commit 215ebff
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ const chartRows: ComputedRef<Array<[string, CompilationSections]>> = computed(
]
);
const legendItems: ComputedRef<
Array<{section: CompilationSection; color: string}>
Array<{section: CompilationSection; label: string; color: string}>
> = computed(() => {
const items = [];
for (const section of props.before.sections) {
items.push({
section,
label: `${section.name} (${formatPercent(
props.before,
section.name
)} -> ${formatPercent(props.after, section.name)})`,
color: getSectionColor(items.length),
});
}
Expand Down Expand Up @@ -122,7 +126,7 @@ function deactivate() {
:class="{color: true, active: activeSection === item.section.name}"
:style="{backgroundColor: item.color}"
></div>
<div class="name">{{ item.section.name }}</div>
<div class="name">{{ item.label }}</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 215ebff

Please sign in to comment.