chart = {
const width = 800,
height = 800;
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
var c = svg.selectAll('circle')
var p = svg.selectAll('polyline')
polyline(test2,'none','1','1','.5','black')
polyline(outline_01,'none','1','1','2.5','red')
polyline(smiley,'none','1','1','4','purple')
polyline(outline_03,'none','1','1','1','green')
function polyline(data, pfill, pOpac, sOpac, sWght, stroke){
p.enter().append("polyline")
.data(data)
.enter()
.append('polyline')
.attr("points", function(d){return d})
.style("fill", pfill)
.style("fill-opacity", pOpac)
.style('stroke-opacity',sOpac)
.style("stroke-width", sWght)
.style("stroke", stroke)
}
p.enter().append("polyline")
.data(outline_04)
.enter()
.append('polyline')
.attr("points", function(d){return d})
.style("fill", 'white')
.style("fill-opacity", '.5')
.style('stroke-opacity','1')
.style("stroke-width", '1')
.style("stroke", 'blue')
.on('mouseover',changeFill)
.on('mouseout',changeFillBack)
function changeFill(event,d){
d3.select(this).style("fill", 'yellow')
}
function changeFillBack(event,d){
d3.select(this).style("fill", 'white')
}
return svg.node();
}