draw = {
const width = 800,
height = 800;
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
var p = svg.selectAll("polyline")
svg
.append("text")
.attr('x','480')
.attr('y','300')
.attr('class', 'Atext')
.style('font-family', 'helvetica')
.style('font-size','30px')
.style('font-weight', 'bold')
.style("fill", "Gray")
.text("Data:")
svg
.append("text")
.attr('x','500')
.attr('y','340')
.attr('class', 'Atext')
.style('font-family', 'helvetica')
.style('font-size','20px')
.style('font-weight', 'bold')
.style("fill", "Gray")
.text("Material:")
svg
.append("text")
.attr('x','500')
.attr('y','360')
.attr('class', 'Atext')
.style('font-family', 'helvetica')
.style('font-size','20px')
.style('font-weight', 'bold')
.style("fill", "Gray")
.text("Age:")
svg
.append("text")
.attr('x','500')
.attr('y','380')
.attr('class', 'Atext')
.style('font-family', 'helvetica')
.style('font-size','20px')
.style('font-weight', 'bold')
.style("fill", "Gray")
.text("Orgin:")
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(GHToggle=="On"){
p.enter().append("polyline")
.data(g1Enter)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','Tan')
.style('stroke', 'black')
.style('stroke-width', '1')
///////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Brick)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','FireBrick')
.style('stroke', 'black')
.style('stroke-width', '1')
//////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Brownstone)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','DimGray')
.style('stroke', 'black')
.style('stroke-width', '1')
//////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g2Copper)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','DarkSeaGreen')
.style('stroke', 'black')
.style('stroke-width', '1')
/////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Stairs)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','LightGray')
.style('stroke', 'black')
.style('stroke-width', '1')
/////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Slate)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','IndianRed')
.style('stroke', 'black')
.style('stroke-width', '1')
/////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Windows)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','Peru')
.style('stroke', 'black')
.style('stroke-width', '1')
////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Holes)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WhiteSmoke')
.style('stroke', 'black')
.style('stroke-width', '1')
////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Outline)
.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', '2')
////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Medium)
.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', '0.5')
/////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(g1Thin)
.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', '0.5')
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(CToggle=="On"){
//////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(concretecombined)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d.geo})
.style('fill','LightGray')
.style('stroke', 'black')
.style('stroke-width', '2')
.on('mouseover',concretedata)
.on('mouseout',concretedataout)
function concretedata(event,d){
svg
.append("text")
.attr('x','600')
.attr('y','340')
.attr('class', 'Ctext')
.style('font-family', 'helvetica')
.style('font-size','20px')
.style('font-weight', 'bold')
.style("fill", "Gray")
.text(d.data.material)
svg
.append("text")
.attr('x','600')
.attr('y','360')
.attr('class', 'Ctext')
.style('font-family', 'helvetica')
.style('font-size','20px')
.style('font-weight', 'bold')
.style("fill", "Gray")
.text(d.data.age)
svg
.append("text")
.attr('x','600')
.attr('y','380')
.attr('class', 'Ctext')
.style('font-family', 'helvetica')
.style('font-size','20px')
.style('font-weight', 'bold')
.style("fill", "Gray")
.text(d.data.origin)
d3.select(this).style('fill','DarkGray')
}
function concretedataout(){
d3.selectAll('text.Ctext').remove()
d3.select(this).style('fill','LightGray')
}
p.enter().append("polyline")
.data(c1Med)
.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', '1')
p.enter().append("polyline")
.data(c1Thin)
.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', '0.5')
}
//////////////////////////////\\\\\\\\\\\\\\\\//////////\\\\\\\\\\/////////////\\\\\\\\////\/////////////\////\\\/\\\\\\\\\\\\\\\\\\\/\//\\\\\\\\
if(GHToggle=="Off"){
p.enter().append("polyline")
.data(cMed2)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','LightGray')
.style('stroke', 'black')
.style('stroke-width', '1')
//////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(cOutline2)
.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', '2')
/////////////////////////////////////////////////////////////////
p.enter().append("polyline")
.data(cThin2)
.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', '0.5')
}
return svg.node();
}