Skip to content

Commit

Permalink
feat: tooltip shows line (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
clement2026 committed Sep 7, 2024
1 parent f272c44 commit 985d97b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Binary file modified assets/web/html.zip
Binary file not shown.
11 changes: 8 additions & 3 deletions ts/components/hooks/use-pprof-option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,22 @@ const tooltipFormatter = (foc: FlatOrCum, labelFmt: (value: number) => string):
const value = p.value[foc.toLowerCase()]
const splits = p.seriesName.split(" ")
const func = splits[0]
const line = splits[1]
if (value) {
output += `<div class="flex flex-col gap-0.5">
<div class="flex flex-col">
<div class="flex items-center justify-between gap-8">
<div class="flex gap-0.5">
<div class="flex flex-col items-start">
<div class="flex items-center justify-between gap-8 w-full">
<div class="flex gap-0.5 w-full">
<div class="translate-y-0.5">${p.marker}</div>
<span class="text-default-600 text-center">${func}</span>
</div>
<div class="font-bold text-default-600">${labelFmt(value)}</div>
</div>
<div class="flex gap-0.5 justify-start mr-12">
<div class="opacity-0">${p.marker}</div>
<p class="text-default-500 font-light text-sm text-center">${line}</p>
</div>
</div">
</div>`
}
Expand Down
2 changes: 1 addition & 1 deletion ts/components/state/pref-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const newGraphPref = (): GraphPref => ({
total: false,
flatOrCum: FlatOrCum.flat,
enabled: true,
topN: 20
topN: 10
})

export type GraphPrefs = {
Expand Down

0 comments on commit 985d97b

Please sign in to comment.