buildingDWG = {
const width = 1920,
height = 1080;
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
var p = svg.selectAll("polyline")
p.enter().append("polyline")
.data(borderOutline2)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','white')
.style('stroke', 'black')
.style('stroke-width', '6')
.style('fill-opacity','1')
if(brickbutton=="On"){
p.enter().append("polyline")
.data(brickCombined)
.enter()
.append("polyline")
.attr('class', "brickoutlinescombined")
.attr('points',function(d){return d.geo})
.style('fill','white')
.style('stroke', 'black')
.style('stroke-width', '0')
.style('fill-opacity','.5')
.on('mouseover',brickData)
.on('mouseout',brickDataOut)
p.enter().append("polyline")
.data(brickLinework)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke', 'black')
.style('stroke-width', '.25')
function brickData(event,d){
//things in here will happen when you roll over brick
d3.selectAll("polyline.brickoutlinescombined").style('fill','red')
svg
.append("text")
.attr('x','540')
.attr('y','500')
.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','regular')
.style("fill", "rgb(0,0,0)")
.text(d.data.Material)
svg
.append("text")
.attr('x','540')
.attr('y','540')
.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','regular')
.style("fill", "rgb(0,0,0)")
.text(d.data.Age)
svg
.append("text")
.attr('x','540')
.attr('y','580')
.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','regular')
.style("fill", "rgb(0,0,0)")
.text(d.data.Part)
svg
.append("text")
.attr('x','540')
.attr('y','620')
.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','regular')
.style("fill", "rgb(0,0,0)")
.text(d.data.Origin)
svg
.append("text")
.attr('x','540')
.attr('y','660')
.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','regular')
.style("fill", "rgb(0,0,0)")
.text(d.data.Company)
svg
.append("text")
.attr('x','540')
.attr('y','700')
.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','regular')
.style("fill", "rgb(0,0,0)")
.text(d.data.Method)
svg
.append("text")
.attr('x','540')
.attr('y','740')
.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','regular')
.style("fill", "rgb(0,0,0)")
.text(d.data.Time)
svg
.append("line")
.attr('class','hoverLine')
.attr('x1','610')
.attr('y1','490')
.attr('x2','875')
.attr('y2','490')
.style('stroke-width','.5')
.style('stroke','black')
}
function brickDataOut(){
d3.selectAll('text.brickText').remove()
d3.selectAll("polyline.brickoutlinescombined").style('fill','white')
d3.selectAll('line.hoverLine').remove()
}
svg
.append("text")
.attr('x','410')
.attr('y','580')
//.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text('Part:')
svg
.append("text")
.attr('x','410')
.attr('y','540')
//.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text('Age:')
svg
.append("text")
.attr('x','410')
.attr('y','500')
//.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text('Material:')
svg
.append("text")
.attr('x','410')
.attr('y','620')
//.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text('Origin:')
svg
.append("text")
.attr('x','410')
.attr('y','660')
//.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text('Company:')
svg
.append("text")
.attr('x','410')
.attr('y','700')
//.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text('Method:')
svg
.append("text")
.attr('x','410')
.attr('y','740')
//.attr('class','brickText')
.style('font-family','helvetica')
.style('font-size','1.5em')
.style('font-weight','bold')
.style("fill", "rgb(0,0,0)")
.text('Time:')
}
return svg.node();
}