From 0ec4d05d0abdcbf03c69c8ee78cc12d0a98ec09c Mon Sep 17 00:00:00 2001 From: Jiaxing Yang Date: Tue, 3 Dec 2019 08:26:17 -0500 Subject: [PATCH 1/3] fix size --- src/pages/Bus.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/Bus.vue b/src/pages/Bus.vue index 79b42c6..8320e78 100644 --- a/src/pages/Bus.vue +++ b/src/pages/Bus.vue @@ -65,7 +65,7 @@ function render_d3(data,div) { } } - const WIDTH=500; + const WIDTH=250; const HEIGHT=80; const MARGIN={TOP:10,BOTTOM:10,LEFT:10,RIGHT:10}; @@ -80,8 +80,6 @@ function render_d3(data,div) { $(div).empty(); - d3.select(div).style("width",WIDTH+MARGIN.LEFT+MARGIN.RIGHT); - let svg=d3.select(div) .append("svg") .attr("width",WIDTH+MARGIN.LEFT+MARGIN.RIGHT) @@ -90,7 +88,7 @@ function render_d3(data,div) { .attr("transform","translate("+MARGIN.LEFT+","+MARGIN.TOP+")"); let x=d3.scaleLinear() - .domain([current-30,current+30]) + .domain([current-15,current+15]) .range([0,WIDTH]); svg.append("defs").append("marker") From 230791153553425e5686a3b309199f8438c07131 Mon Sep 17 00:00:00 2001 From: Jiaxing Yang Date: Tue, 3 Dec 2019 09:06:22 -0500 Subject: [PATCH 2/3] fix --- src/pages/Bus.vue | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/pages/Bus.vue b/src/pages/Bus.vue index 8320e78..efa1d4c 100644 --- a/src/pages/Bus.vue +++ b/src/pages/Bus.vue @@ -10,7 +10,6 @@ span {{item.start}} span(v-if="item.start !== item.end") -{{item.end}} .right.tip {{item.interval}} - div.svg_container#d3_workday ul.detail-list(v-else) li.info(:class="{active: item.active}" v-for='item in holiday') .top @@ -18,7 +17,7 @@ span {{item.start}} span(v-if="item.start !== item.end") -{{item.end}} .right.tip {{item.interval}} - div.svg_container#d3_holiday + div.svg_container#d3