function update (sen_data, stock_data)
{
var g = d3.select("svg").selectAll("g#heatmap");
g.remove();
var viz = d3.select("svg#viz");
var heat_map =viz.append("g");
heat_map
.attr("width", width)
.attr("height", c_height)
.attr('id', 'heatmap')
.attr("transform",`translate(${heat_margin.left},${heat_margin.top + cellSize * 1.5})`)
.on("mouseleave", left);
drawheat(heat_map,sen_data);
mutable x = d3.scaleTime()
.domain(d3.extent(stock_data, d => d.date))
.range([margin.left, margin.left+l_width])
mutable y = d3.scaleLinear()
.domain([d3.min(stock_data,d=>d.close), d3.max(stock_data,d=>d.close)]).nice()
.range([c_height + l_height - margin.bottom+heat_margin.top, c_height + heat_margin.top+ margin.top+30])
viz.selectAll("g.xaxis").remove()
viz.selectAll("g.yaxis").remove()
viz.append("g")
.attr("class", "xaxis")
.call(xAxis)
viz.append("g")
.attr("class", "yaxis")
.call(yAxis)
var t = d3.transition()
.duration(500)
.ease(d3.easeLinear);
d3
.select(".line")
.transition(t)
.attr("d", line(stock_data))
}