Public
Edited
Feb 15, 2024
Insert cell
Insert cell
c1Med = FileAttachment("C@1.MED.txt").tsv({array:true})
Insert cell
cMed2 = FileAttachment("C.MED.2.txt").tsv({array:true})
Insert cell
c1Outline = FileAttachment("C@1.OUTLINE.txt").tsv({array:true})
Insert cell
cOutline2 = FileAttachment("C.OUTLINE.2.txt").tsv({array:true})
Insert cell
cThin2 = FileAttachment("C.THIN.2.txt").tsv({array:true})
Insert cell
c1Thin = FileAttachment("C@1.THIN.txt").tsv({array:true})
Insert cell
g1Brick = FileAttachment("G@1.BRICK.txt").tsv({array:true})
Insert cell
g1Brownstone = FileAttachment("G@1.BROWNSTONE.txt").tsv({array:true})
Insert cell
g2Copper = FileAttachment("G@2.COPPER.txt").tsv({array:true})
Insert cell
g1Enter = FileAttachment("G@1.ENTER.txt").tsv({array:true})
Insert cell
g1Medium = FileAttachment("G@1.MEDIUM.txt").tsv({array:true})
Insert cell
g1Outline = FileAttachment("G@1.OUTLINE.txt").tsv({array:true})
Insert cell
g1Slate = FileAttachment("G@1.SLATE.txt").tsv({array:true})
Insert cell
g1Stairs = FileAttachment("G@1.STAIRS.txt").tsv({array:true})
Insert cell
g1Thin = FileAttachment("G@1.THIN.txt").tsv({array:true})
Insert cell
g1Windows = FileAttachment("G@1.WINDOWS.txt").tsv({array:true})
Insert cell
g1Holes = FileAttachment("G@1.HOLES.txt").tsv({array:true})
Insert cell
o1Border = FileAttachment("O@1.BORDER.txt").tsv({array:true})
Insert cell
oBorder2 = FileAttachment("O.BORDER2.txt").tsv({array:true})
Insert cell
oBorder3 = FileAttachment("O.BORDER3.txt").tsv({array:true})
Insert cell
o1Dash = FileAttachment("O@1.DASH.txt").tsv({array:true})
Insert cell
oDash2 = FileAttachment("O.DASH2.txt").tsv({array:true})
Insert cell
Insert cell
data = d3.csv(materiallink,d3.autoType())
Insert cell
concretecombined = {
var alldata = []

for (let i = 0; i < c1Outline.length; i++) {
//for each line in my roof array, combine it wit the date from the spreadsheet, add that to alldata
alldata.push({geo:c1Outline[i],data:data[0]})
}
return alldata
}
Insert cell
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();
}
Insert cell
viewof CToggle = Inputs.radio(["On", "Off"], {label: "Concrete", value:"On"})
Insert cell
viewof GHToggle = Inputs.radio(["On", "Off"], {label: "Guild House", value:"On"})
Insert cell
dash = {

const width = 800,
height = 800;

const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);

var p = svg.selectAll("polyline")
if(CToggle=="On"){
p.enter().append("polyline")
.data(oDash2)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','None')
.style('stroke', 'Gray')
.style('stroke-width', '1')
.style('stroke-dasharray', '2')
}

return svg.node();
}
Insert cell
border = {

const width = 800,
height = 800;

const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);

var p = svg.selectAll("polyline")
.data(oBorder3)
.enter() //there are more data than elements, this selects them
.append("polyline")
.attr('points',function(d){return d})
.style('fill','None')
.style('stroke', 'Gray')
.style('stroke-width', '8')
.style('stroke-linecap', 'round')

return svg.node();

return svg.node();
}
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
dashboard =

html`

<div class='dashboardOuter' style='height:800px;width:800px'>


<div class='G' style='position:absolute;width:800px;top:0px;left:0px'>
${border}
</div>

<div class='G' style='position:absolute;width:800px;top:0px;left:0px'>
${dash}
</div>

<div class='shack' style='position:absolute;width:800px;top:0px;left:0px'>
${draw}
</div>

<div class='text' style='position:absolute;top:40px;left:480px;font-family:helvetica;font-size:30px;color:Gray'>
${md`**The Guild House**`}
${viewof GHToggle}
${viewof CToggle}





</div>






`
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more