fix clearing of target
This commit is contained in:
parent
6828a158f8
commit
3a8c0a3c09
|
@ -76,10 +76,10 @@ module.exports =
|
||||||
|
|
||||||
# Render the D3 chart.
|
# Render the D3 chart.
|
||||||
'render': ([ actual, ideal ], cb) ->
|
'render': ([ actual, ideal ], cb) ->
|
||||||
(target = document.querySelector('#graph')).innerHTML = ''
|
document.querySelector('#svg').innerHTML = ''
|
||||||
|
|
||||||
# Get available space.
|
# Get available space.
|
||||||
{ height, width } = target.getBoundingClientRect()
|
{ height, width } = document.querySelector('#graph').getBoundingClientRect()
|
||||||
|
|
||||||
margin = { top: 30, right: 30, bottom: 40, left: 50 }
|
margin = { top: 30, right: 30, bottom: 40, left: 50 }
|
||||||
width -= margin.left + margin.right
|
width -= margin.left + margin.right
|
||||||
|
@ -115,7 +115,7 @@ module.exports =
|
||||||
y.domain([ 0, ideal[0].points ]).nice()
|
y.domain([ 0, ideal[0].points ]).nice()
|
||||||
|
|
||||||
# Add an SVG element with the desired dimensions and margin.
|
# Add an SVG element with the desired dimensions and margin.
|
||||||
svg = d3.select("#graph").append("svg")
|
svg = d3.select("#svg").append("svg")
|
||||||
.attr("width", width + margin.left + margin.right)
|
.attr("width", width + margin.left + margin.right)
|
||||||
.attr("height", height + margin.top + margin.bottom)
|
.attr("height", height + margin.top + margin.bottom)
|
||||||
.append("g")
|
.append("g")
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<h1><%- @name %></h2>
|
<h1><%- @name %></h2>
|
||||||
<div id="graph">
|
<div id="graph">
|
||||||
<div id="tooltip"></div>
|
<div id="tooltip"></div>
|
||||||
|
<div id="svg"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="progress"></div>
|
<div id="progress"></div>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue