Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak formatting so that more nodes have text visible in them #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions snakeviz/static/drawsvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,23 @@ var drawIcicle = function drawIcicle(json) {
.attr("width", function(d) { return x(d.dx); })
.attr("height", function(d) { return y(d.dy); })
.attr("font-family", "sans-serif")
.attr("font-size", "15px")
.attr("font-size", "12px")
.attr("fill", "black")
.attr("text-anchor", "middle")
.attr("pointer-events", "none");

// Append the function name
// Append the function location
labels.append("tspan")
.text(function(d) { return d.display_name; })
.text(function(d) { return d.display_name.split("(")[0]; })
.attr("text-anchor", "middle")
.attr("x", function(d) { return x(d.x + (d.dx / 2.0)); });
.attr("x", function(d) { return x(d.x + (d.dx / 2.0)); })
.attr("dy", "-0.8em");
// Append the function name (without wrapping parens to save on width)
labels.append("tspan")
.text(function(d) { return d.display_name.split("(")[1].slice(0, -1); })
.attr("text-anchor", "middle")
.attr("x", function(d) { return x(d.x + (d.dx / 2.0)); })
.attr("dy", "1.2em");
// Append the time
labels.append("tspan")
.text(function(d) { return d.cumulative.toPrecision(3) + " s"; })
Expand Down