Update: fix only trace bug (#222) v6.0.0-GA
authorAllen Wang <Allen.Wang.123@outlook.com>
Fri, 18 Jan 2019 03:27:57 +0000 (11:27 +0800)
committer吴晟 Wu Sheng <wu.sheng@foxmail.com>
Fri, 18 Jan 2019 03:27:57 +0000 (11:27 +0800)
src/components/TraceTree/d3-trace.js

index 8f0461b..274e1ed 100644 (file)
@@ -37,7 +37,7 @@ export default class TraceMap {
     this.i = 0;
     this.j = 0;
     this.width = el.clientWidth;
-    this.height = (row.length - 1) * 80;
+    this.height = row.length * 80 + 20;
     this.body = d3
       .select(this.el)
       .style('height', this.height + 'px')
@@ -66,7 +66,7 @@ export default class TraceMap {
       .scaleSequential()
       .domain([0, this.list.length])
       .interpolator(d3.interpolateCool);
-    this.svg = this.body.append('g').attr('transform', d => `translate(0, ${this.row.length * 14})`).append('g');
+    this.svg = this.body.append('g').attr('transform', d => `translate(0, ${this.row.length * 14 + 20})`).append('g');
     this.timeGroup = this.body.append('g').attr('class','timeGroup').attr('transform', d => 'translate(5,30)');
     this.body.call(this.getZoomBehavior(this.svg));
     this.root = d3.hierarchy(this.data, d => d.children);