houseDwg = {
const width = 800,
height = 800;
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
var p = svg.selectAll("polyline")
if(houseButton=="On"){
p.enter().append("polyline")
.data(houseData)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','rgb(0,0,0)')
.style('stroke-width','2')
p.enter().append("polyline")
.data(housedetails)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','rgb(0,0,0)')
.style('stroke-width','1')
.style('stroke-dasharray','6,3')
}
if(chimneyButton=="On"){
p.enter().append("polyline")
.data(combinedData)
.enter()
.append("polyline")
.attr('points',function(d){return d.geo})
.style('fill','white')
.style('stroke','rgb(0,0,0)')
.style('stroke-width','2')
.on('mouseover',chimneyData)
.on('mouseout',chimneyDataOut)
function chimneyData(event,d){
svg
.append("text")
.attr('x','100')
.attr('y','400')
.attr('class','chimneyText')
.style('font-family','helvetica')
.style('font-size','1em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text('Nacho House')
console.log(d.data.material)
svg
.append("text")
.attr('x','100')
.attr('y','500')
.attr('class','chimneyText')
.style('font-family','helvetica')
.style('font-size','1em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text(d.data.material)
d3.select(this).style('fill','cyan')
}
function chimneyDataOut(){
d3.selectAll('text.chimneyText').remove()
d3.select(this).style('fill','white')
}
p.enter().append("polyline")
.data(chimneydetails)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','rgb(0,0,0)')
.style('stroke-width','1')
.style('stroke-dasharray','6,3')
}
if(roofButton=="On"){
p.enter().append("polyline")
.data(roof)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','rgb(0,0,0)')
.style('stroke-width','2')
p.enter().append("polyline")
.data(roofdetails)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','rgb(0,0,0)')
.style('stroke-width','1')
.style('stroke-dasharray','6,3')
}
return svg.node();
}