Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Optimization: Local span layer issue (#223)
Browse files Browse the repository at this point in the history
* Local span layer Unknown => Local

* Optimization judgment

* Revert "Optimization judgment"

This reverts commit a87dce5.
  • Loading branch information
zhaoyuguang authored and wu-sheng committed Jan 24, 2019
1 parent c44642f commit 6c00408
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/TraceTree/d3-trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default class TraceMap {
.scaleLinear()
.domain([0, this.max])
.range([0, this.width - 10]);

this.xAxis = d3.axisTop(this.xScale).tickFormat(d => {
if (d === 0) return 0;
if (d >= 1000) return d / 1000 + 's';
Expand Down Expand Up @@ -189,7 +189,7 @@ export default class TraceMap {
.attr('dx', 5)
.attr('dy', 11)
.text(d=> `children: ${d.data.childrenLength}`)
.attr('fill', '#fff')
.attr('fill', '#fff')
nodeEnter
.append('rect')
.attr('class', 'block')
Expand Down Expand Up @@ -222,7 +222,12 @@ export default class TraceMap {
.attr('text-anchor', 'start')
.attr('fill', d => this.type[d.data.layer])
.attr('stroke', d => this.type[d.data.layer])
.text(d => d.data.layer);
.text(d => {
if(d.data.type == 'Local' && d.data.layer == 'Unknown'){
return 'Local';
}
return d.data.layer;
});

nodeEnter
.append('text')
Expand Down

0 comments on commit 6c00408

Please sign in to comment.