Skip to content

Commit

Permalink
Use the percentage field for profile plots (#3238)
Browse files Browse the repository at this point in the history
Previously we populated this data, but didn't use it correctly in the
tooltip
  • Loading branch information
mrocklin authored Nov 14, 2019
1 parent 886189a commit f8aca16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distributed/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def traverse(state, start, stop, height):
x += width

traverse(state, 0, 1, 0)
percentages = ["{:.2f}%".format(100 * w) for w in widths]
percentages = ["{:.1f}%".format(100 * w) for w in widths]
return {
"left": starts,
"right": stops,
Expand Down Expand Up @@ -423,7 +423,7 @@ def plot_figure(data, **kwargs):
</div>
<div>
<span style="font-size: 14px; font-weight: bold;">Percentage:</span>&nbsp;
<span style="font-size: 10px; font-family: Monaco, monospace;">@width</span>
<span style="font-size: 10px; font-family: Monaco, monospace;">@percentage</span>
</div>
""",
)
Expand Down

0 comments on commit f8aca16

Please sign in to comment.