Public
Edited
May 6, 2024
Insert cell
Insert cell
//////////////////////////MACHINE LEARNING/////////////////////////////////
Insert cell
rf = import('https://cdn.skypack.dev/ml-random-forest@2.1.0?min')
Insert cell
regression = new rf.RandomForestRegression(options)
Insert cell
regression2 = new rf.RandomForestRegression(options)
Insert cell
regression3 = new rf.RandomForestRegression(options)
Insert cell
regression4 = new rf.RandomForestRegression(options)
Insert cell
a = await regression.train(trainingSet, predictions);
Insert cell
aSteel = await regression2.train(trainingSetSteel, predictionssteel);
Insert cell
awood = await regression3.train(trainingSetWood, predictionswood);
Insert cell
aPly = await regression4.train(trainingSetPly, predictionsply);
Insert cell
result = a, regression.predict(trainingSet);
Insert cell
//////////////////////////////////TRAININGSET//////////////////////////////////
Insert cell
trainingSet = formattedData.map((d) => d.slice(0, 5));
Insert cell
trainingSetPly = formattedDataply.map((d) => d.slice(0, 5));
Insert cell
trainingSetWood = formattedDataWood.map((d) => d.slice(0, 5));
Insert cell
trainingSetSteel = formattedDataSteel.map((d) => d.slice(0, 5));
Insert cell
//////////////////////////////////PREDICTION//////////////////////////////////
Insert cell
predictions = formattedData.map((d) => d[5])
Insert cell
predictionswood = formattedDataWood.map((d) => d[5])
Insert cell
predictionsply = formattedDataply.map((d) => d[5])
Insert cell
predictionssteel = formattedDataSteel.map((d) => d[5])
Insert cell
options = ({
seed: 3,
maxFeatures: 5,
replacement: false,
nEstimators: 100
})
Insert cell
////////////////////Numeric data/////////////////////////////Steel//////////////////
Insert cell
viewof quantity = Inputs.range([25, 60], {value: 30, step: 1, label: "quantity"})
Insert cell
viewof endoflife = Inputs.select(["Landfill", "Downcycle", "Recycle", "Re-Manufacture", "Reuse"], {value: "Landfill" ,label: "End of Life"})
Insert cell
viewof PCTRecovered = Inputs.radio(["0%", "25%", "50%"], {value: "0%" , label: "Material Recovered:"})
Insert cell
viewof distance = Inputs.range([50, 300], {value: 60, step: 5, label: "Distance Traveled:"})
Insert cell
viewof set = Inputs.button("Set Data")
Insert cell
////////////////////Numeric data/////////////////////////////Wood//////////////////
Insert cell
viewof woodquantity = Inputs.range([350, 450], {value: 350, step: 1, label: "quantity"})
Insert cell
viewof woodeol = Inputs.select(["Landfill", "Combust", "Downcycle", "Re-Manufacture", "Reuse"], {value: "Landfill" ,label: "End of Life"})
Insert cell
viewof WDPCTRecovered = Inputs.radio(["0%", "25%", "50%"], {value: "0%" , label: "Material Recovered:"})
Insert cell
viewof WDdistance = Inputs.range([50, 300], {value: 60, step: 5, label: "Distance Traveled:"})
Insert cell
////////////////////Numeric data/////////////////////////////Plywood//////////////////
Insert cell
viewof plyquantity = Inputs.range([80, 120], {value: 80, step: 1, label: "quantity"})
Insert cell
viewof plyeol = Inputs.select(["Landfill", "Combust", "Downcycle", "Re-Manufacture", "Reuse"], {value: "Landfill" ,label: "End of Life"})
Insert cell
viewof PLYPCTRecovered = Inputs.radio(["0%", "25%", "50%"], {value: "0%" , label: "Material Recovered:"})
Insert cell
viewof PLYdistance = Inputs.range([50, 300], {value: 60, step: 5, label: "Distance Traveled:"})
Insert cell
NumericData = {

var data = []
var quantity
var eol
var rcvrd
var distance

if (viewof endoflife.value=="Landfill"){eol = 1}
if (viewof endoflife.value=="Downcyle"){eol = 2}
if (viewof endoflife.value=="Combust"){eol = 2}
if (viewof endoflife.value=="Recycle"){eol = 3}
if (viewof endoflife.value=="Re-Manufacture"){eol = 4}
if (viewof endoflife.value=="Reuse"){eol = 5}

if (viewof PCTRecovered.value=="0%"){rcvrd = 0}
if (viewof PCTRecovered.value=="25%"){rcvrd = 25}
if (viewof PCTRecovered.value=="50%"){rcvrd = 50}


distance = viewof distance.value
quantity = viewof quantity.value
data.push(quantity)
data.push(eol)
data.push(rcvrd)
data.push(distance)
data.push(set)
return data
}
Insert cell
NumericDataSteel = {

var data = []
var quantity
var eol
var rcvrd
var distance

if (viewof endoflife.value=="Landfill"){eol = 1}
if (viewof endoflife.value=="Downcyle"){eol = 2}
if (viewof endoflife.value=="Recycle"){eol = 3}
if (viewof endoflife.value=="Re-Manufacture"){eol = 4}
if (viewof endoflife.value=="Reuse"){eol = 5}

if (viewof PCTRecovered.value=="0%"){rcvrd = 0}
if (viewof PCTRecovered.value=="25%"){rcvrd = 25}
if (viewof PCTRecovered.value=="50%"){rcvrd = 50}


distance = viewof distance.value
quantity = viewof quantity.value
data.push(quantity)
data.push(eol)
data.push(rcvrd)
data.push(distance)
data.push(set)
return data
}
Insert cell
NumericDataWood = {

var data = []
var quantity
var eol
var rcvrd
var distance

if (viewof woodeol.value=="Landfill"){eol = 1}
if (viewof woodeol.value=="Combust"){eol = 2}
if (viewof woodeol.value=="Recycle"){eol = 3}
if (viewof woodeol.value=="Re-Manufacture"){eol = 4}
if (viewof woodeol.value=="Reuse"){eol = 5}

if (viewof WDPCTRecovered.value=="0%"){rcvrd = 0}
if (viewof WDPCTRecovered.value=="25%"){rcvrd = 25}
if (viewof WDPCTRecovered.value=="50%"){rcvrd = 50}


distance = viewof WDdistance.value
quantity = viewof woodquantity.value
data.push(quantity)
data.push(eol)
data.push(rcvrd)
data.push(distance)
data.push(set)
return data
}
Insert cell
NumericDataply = {

var data = []
var quantity
var eol
var rcvrd
var distance

if (viewof plyeol.value=="Landfill"){eol = 1}
if (viewof plyeol.value=="Combust"){eol = 2}
if (viewof plyeol.value=="Recycle"){eol = 3}
if (viewof plyeol.value=="Re-Manufacture"){eol = 4}
if (viewof plyeol.value=="Reuse"){eol = 5}

if (viewof PLYPCTRecovered.value=="0%"){rcvrd = 0}
if (viewof PLYPCTRecovered.value=="25%"){rcvrd = 25}
if (viewof PLYPCTRecovered.value=="50%"){rcvrd = 50}


distance = viewof PLYdistance.value
quantity = viewof plyquantity.value
data.push(quantity)
data.push(eol)
data.push(rcvrd)
data.push(distance)
data.push(set)
return data
}
Insert cell
co2calculator = {

var options
if(Materials=="Steel"){options=Steeloptions}
if(Materials=="Wood"){options=Woodoptions}
if(Materials=="Plywood"){options=Plyoptions}

return options
}
Insert cell
Steeloptions =
html`

<div class='steel' style='position:absolute;width:400px;height:200px;top:0px;left:300px'>

${md `**Steel Calculator**`}
${viewof quantity}
${viewof endoflife}
${viewof PCTRecovered}
${viewof distance}
${viewof set}

</div>

`
Insert cell
Woodoptions =
html`

<div class='steel' style='position:absolute;width:400px;height:200px;top:0px;left:300px'>

${md `**Wood Calculator**`}
${viewof woodquantity}
${viewof woodeol}
${viewof WDPCTRecovered}
${viewof WDdistance}
${viewof set}

</div>

`
Insert cell
Plyoptions =
html`

<div class='steel' style='position:absolute;width:400px;height:200px;top:0px;left:300px'>

${md `**Wood Calculator**`}
${viewof plyquantity}
${viewof plyeol}
${viewof PLYPCTRecovered}
${viewof PLYdistance}
${viewof set}

</div>

`
Insert cell
viewof Materials = Inputs.radio(["Steel", "Wood", "Plywood"], {value: "Steel" , label: "Material:"})
Insert cell
////////////////////////dataset/////////////////////////////////
Insert cell
fullDataSet = {
return machinelearning
}
Insert cell
formattedData = {

var fullSet = []

for (let i = 0; i < fullDataSet.length; i++) {

var currentLine = [Number(fullDataSet[i].col1),Number(fullDataSet[i].col2),Number(fullDataSet[i].col3),Number(fullDataSet[i].col4),Number(fullDataSet[i].col5),Number(fullDataSet[i].result)]

fullSet.push(currentLine)
}

return fullSet
}
Insert cell
fullDataSetply = {
return PLYTraining
}
Insert cell
formattedDataply = {

var fullSet = []

for (let i = 0; i < fullDataSetply.length; i++) {

var currentLine = [Number(fullDataSetply[i].col1),Number(fullDataSetply[i].col2),Number(fullDataSetply[i].col3),Number(fullDataSetply[i].col4),Number(fullDataSetply[i].col5),Number(fullDataSetply[i].results)]

fullSet.push(currentLine)
}

return fullSet
}
Insert cell
fullDataSetWood = {
return WDTraining
}
Insert cell
formattedDataWood = {

var fullSet = []

for (let i = 0; i < fullDataSetWood.length; i++) {

var currentLine = [Number(fullDataSetWood[i].col1),Number(fullDataSetWood[i].col2),Number(fullDataSetWood[i].col3),Number(fullDataSetWood[i].col4),Number(fullDataSetWood[i].col5),Number(fullDataSetWood[i].results)]

fullSet.push(currentLine)
}

return fullSet
}
Insert cell
fullDataSetSteel = {
return SteelTraining
}
Insert cell
formattedDataSteel = {

var fullSet = []

for (let i = 0; i < fullDataSetSteel.length; i++) {

var currentLine = [Number(fullDataSetSteel[i].col1),Number(fullDataSetSteel[i].col2),Number(fullDataSetSteel[i].col3),Number(fullDataSetSteel[i].col4),Number(fullDataSetSteel[i].col5),Number(fullDataSetSteel[i].results)]

fullSet.push(currentLine)
}

return fullSet
}
Insert cell
//////////////////////////EXCEL/////////////////////////////////
Insert cell
//Learning Set for outputs to function//
Insert cell
SP - Materials for Machine Learning - Sheet3 (2).csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
3.14.2024 - Sheet2 (3).csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
WDTraining
Insert cell
3.14.2024 - OBS PLYWD (1).csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
3.14.2024 - OBS WD (2).csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
//////////////////////////REGRESSION/////////////////////////////////
Insert cell
result2 = a, regression.predict([[1,NumericData[0],NumericData[1],NumericData[2],NumericData[3]]]);
Insert cell
resultsteel = aSteel, regression2.predict([[1,NumericDataSteel[0],NumericDataSteel[1],NumericDataSteel[2],NumericDataSteel[3]]]);
Insert cell
resultwood = a, regression3.predict([[1,NumericDataWood[0],NumericDataWood[1],NumericDataWood[2],NumericDataWood[3]]]);
Insert cell
woodlist = {

var list = []

list.push(1)
list.push(NumericDataWood[0])
list.push(NumericDataWood[1])
list.push(NumericDataWood[2])
list.push(NumericDataWood[3])
list.push(set)
return list
}
Insert cell
resultply = a, regression4.predict([[1,NumericDataply[0],NumericDataply[1],NumericDataply[2],NumericDataply[3]]]);
Insert cell
co2totals = html`

<div class='total' style='position:absolute;width; 0px;top:50px;left:0px;font-family:helvetica;font-size12px;line-height:16px'>

${md`**Predicted Steel CO2**`}
<p> ${Math.round(resultsteel[0],1)} lbs<br>
${md`**Predicted Wood CO2**`}
<p> ${Math.round(resultwood[0],1)} lbs<br>
${md`**Predicted Plywood CO2**`}
<p> ${Math.round(resultply[0],1)} lbs<br>
${md`**Total Predicted CO2**`}
<p> ${Totalco2} lbs<br>
</div>
`
Insert cell
Totalco2 = Math.round(resultply[0],1) + Math.round(resultsteel[0],1) + Math.round(resultwood[0],1)
Insert cell
resultsteel[0]
Insert cell
/////////////////////////////MASSING PARTI/////////////////////////////
Insert cell
viewof DashboardButtons = Inputs.radio(["Parti","Massing","Existing Material Analysis"], {label: "Settings", value:"Parti"})
Insert cell
currentView = {

var materialToShow

if(DashboardButtons=="Existing Material Analysis"){materialToShow=NEWMATERIAL}

if(DashboardButtons=="Massing"){materialToShow=partimassing}

if(DashboardButtons=="Parti"){materialToShow=PARTI}


return materialToShow
}
Insert cell
currentButtons = {

var materialToShow

if(DashboardButtons=="Existing Material Analysis"){materialToShow=NMDash}

if(DashboardButtons=="Massing"){materialToShow=PMDash}

if(DashboardButtons=="Parti"){materialToShow=PDash}


return materialToShow

}
Insert cell
NMDash= {
var NM=

html`
<div class='guildhouse' style='position:absolute;width:300px;top:100px;left:50px'>
${md`Materials for Design Proposal`}
${viewof DashboardButtons}
${viewof proposedmats}
</div>`
return NM
}
Insert cell
PMDash ={
var PM=

html`
<div class='guildhouse' style='position:absolute;width:300px;top:100px;left:50px'>
${md`Parti Massing`}
${viewof DashboardButtons}
${viewof Massingoption}
${viewof Massingbutton}
</div>`
return PM
}
Insert cell
PDash = {
var PD=

html`

<div class='guildhouse' style='position:absolute;width:300px;top:100px;left:50px'>
${md`Parti to Understand organization of the structure and massing`}
${viewof DashboardButtons}
${viewof partioptions}
</div>`
return PD
}
Insert cell
viewof Massingbutton = Inputs.radio(["All Masses", "North East chunk","North West chunk","South West chunk"], {label: "Massing", value:"All Masses"})
Insert cell
viewof Massingoption = Inputs.radio(["Chunk Massing", "Detailed Massing"], {label: "Options:", value:"Chunk Massing"})
Insert cell
massingModelWhole = FileAttachment("Massing model whole Revised.txt").tsv({array:true})
Insert cell
massingModel1 = FileAttachment("Massing model 1 Revised.txt").tsv({array:true})
Insert cell
massingModel2 = FileAttachment("Massing model 2 Revised.txt").tsv({array:true})
Insert cell
massingModel3 = FileAttachment("Massing model 3 Revised.txt").tsv({array:true})
Insert cell
guildoutline = FileAttachment("GUILDOUTLINE Revised.txt").tsv({array:true})
Insert cell
partimassing = {
const width = 1940,
height = 1280;

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

var p = svg.selectAll("polyline")
///////////////////OUTLINE////////////////////////////
p.enter().append("polyline")
.data(guildoutline)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','3')

if(Massingoption=="Chunk Massing"){
////////////////////MASSINGWHOLE//////////////////////
if(Massingbutton =="All Masses"){
p.enter().append("polyline")
.data(massingModelWhole)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','white')
.style('stroke','black')
.style('stroke-width','2')
}

////////////////////MASSINGNE/////////////////////////
if(Massingbutton =="North East chunk"){
p.enter().append("polyline")
.data(massingModel3)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////MASSINGNW/////////////////////////
if(Massingbutton =="North West chunk"){
p.enter().append("polyline")
.data(massingModel2)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
///////////////////MASSINGSW//////////////////////////
if(Massingbutton =="South West chunk"){
p.enter().append("polyline")
.data(massingModel1)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
}
//////////////////////////////////////////////////////

if(Massingoption=="Detailed Massing"){
////////////////////MASSINGWHOLE//////////////////////
if(Massingbutton =="All Masses"){
p.enter().append("polyline")
.data(massingDetailWhole)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','white')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////MASSINGNE/////////////////////////
if(Massingbutton =="North East chunk"){
p.enter().append("polyline")
.data(massingDetail3)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////MASSINGNW/////////////////////////
if(Massingbutton =="North West chunk"){
p.enter().append("polyline")
.data(massingDetail2)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
///////////////////MASSINGSW//////////////////////////
if(Massingbutton =="South West chunk"){
p.enter().append("polyline")
.data(massingDetail1)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
}


return svg.node();
}
Insert cell
/////////////////////////////Detailed Massing/////////////////////////////
Insert cell
massingDetail1 = FileAttachment("Massing detail 1 Revised.txt").tsv({array:true})
Insert cell
massingDetail2 = FileAttachment("Massing detail 2 Revised.txt").tsv({array:true})
Insert cell
massingDetail3 = FileAttachment("Massing detail 3 Revised.txt").tsv({array:true})
Insert cell
massingDetailWhole = FileAttachment("Massing detail whole Revised.txt").tsv({array:true})
Insert cell
viewof detailedoption = Inputs.radio(["All Masses", "North East chunk","North West chunk","South West chunk"], {label: "Massing", value:"All Masses"})
Insert cell
detailmassing = {
const width = 1940,
height = 1280;

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

var p = svg.selectAll("polyline")
///////////////////OUTLINE////////////////////////////
p.enter().append("polyline")
.data(guildoutline)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','3')

if(Massingoption=="Detailed Massing"){
////////////////////MASSINGWHOLE//////////////////////
if(detailedoption =="All Masses"){
p.enter().append("polyline")
.data(massingDetailWhole)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','white')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////MASSINGNE/////////////////////////
if(detailedoption =="North East chunk"){
p.enter().append("polyline")
.data(massingDetail3)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////MASSINGNW/////////////////////////
if(detailedoption =="North West chunk"){
p.enter().append("polyline")
.data(massingDetail2)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
///////////////////MASSINGSW//////////////////////////
if(detailedoption =="South West chunk"){
p.enter().append("polyline")
.data(massingDetail1)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','WHITE')
.style('stroke','black')
.style('stroke-width','2')
}
}
//////////////////////////////////////////////////////
return svg.node();
}
Insert cell
/////////////////////////NEW MATERIAL///////////////////////////////
Insert cell
viewof proposedmats = Inputs.radio(["Timber", "Plywood","Steel","Glass"], {label: "Proposed Materials:", value:"Timber"})
Insert cell
glass = FileAttachment("GLASS Revised.txt").tsv({array:true})
Insert cell
plywood = FileAttachment("PLYWOOD Revised.txt").tsv({array:true})
Insert cell
steel = FileAttachment("STEEL Revised.txt").tsv({array:true})
Insert cell
timber = FileAttachment("timber Revised.txt").tsv({array:true})
Insert cell
NEWMATERIAL= {
const width = 1940,
height = 1280;

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

var p = svg.selectAll("polyline")
///////////////////OUTLINE////////////////////////////
p.enter().append("polyline")
.data(guildoutline)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','black')
.style('stroke-width','3')
////////////////////TIMBER//////////////////////
if(proposedmats =="Timber"){
p.enter().append("polyline")
.data(timber)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////STEEL/////////////////////////
if(proposedmats =="Steel"){
p.enter().append("polyline")
.data(steel)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////GLASS/////////////////////////
if(proposedmats =="Glass"){
p.enter().append("polyline")
.data(glass)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','black')
.style('stroke-width','2')
}
///////////////////PLYWOOD//////////////////////////
if(proposedmats =="Plywood"){
p.enter().append("polyline")
.data(plywood)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','None')
.style('stroke','black')
.style('stroke-width','2')
}
//////////////////////////////////////////////////////
return svg.node();
}
Insert cell
/////////////////////////PARTI///////////////////////////////
Insert cell
viewof partioptions = Inputs.radio(["Beam Division", "Cross-structure","Circulation Mass","Mass Chunks"], {label: "Parti:", value:"Beam Division"})
Insert cell
parti1 = FileAttachment("parti1Revised.txt").tsv({array:true})
Insert cell
parti2 = FileAttachment("parti2Revised.txt").tsv({array:true})
Insert cell
parti3 = FileAttachment("parti3Revised.txt").tsv({array:true})
Insert cell
parti33 = FileAttachment("parti33Revised.txt").tsv({array:true})
Insert cell
parti4 = FileAttachment("parti4Revised.txt").tsv({array:true})
Insert cell
parti44 = FileAttachment("parti44Revised.txt").tsv({array:true})
Insert cell
PARTI= {
const width = 1940,
height = 1280;

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

var p = svg.selectAll("polyline")
///////////////////OUTLINE////////////////////////////
//p.enter().append("polyline")
//.data(guildoutline)
//.enter()
//.append("polyline")
//.attr('points',function(d){return d})
//.style('fill','none')
//.style('stroke','black')
//.style('stroke-width','.5')
////////////////////parti1//////////////////////
if(partioptions =="Beam Division"){
p.enter().append("polyline")
.data(parti1)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////parti2/////////////////////////
if(partioptions =="Cross-structure"){
p.enter().append("polyline")
.data(parti2)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','black')
.style('stroke-width','2')
}
////////////////////part3/////////////////////////
if(partioptions =="Circulation Mass"){
p.enter().append("polyline")
.data(parti3)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','rosybrown')
.style('fill-opacity',.5)
.style('stroke','black')
.style('stroke-width','2')

p.enter().append("polyline")
.data(parti2)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','none')
.style('stroke','black')
.style('stroke-width','2')

p.enter().append("polyline")
.data(parti33)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','Rgb(200,225,231)')
.style('fill-opacity',.5)
.style('stroke','black')
.style('stroke-width','.25')

}
///////////////////parti4//////////////////////////
if(partioptions =="Mass Chunks"){
p.enter().append("polyline")
.data(parti4)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','None')
.style('stroke','black')
.style('stroke-width','3')

p.enter().append("polyline")
.data(parti3)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','red')
.style('fill-opacity',.25)
.style('stroke','black')
.style('stroke-width','2')
p.enter().append("polyline")
.data(parti33)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','Rgb(200,225,231)')
.style('fill-opacity',.25)
.style('stroke','black')
.style('stroke-width','2')

p.enter().append("polyline")
.data(parti44)
.enter()
.append("polyline")
.attr('points',function(d){return d})
.style('fill','Rgb(200,225,231)')
.style('fill-opacity',.6)
.style('stroke','black')
.style('stroke-width','2')
}
//////////////////////////////////////////////////////
return svg.node();
}
Insert cell
/////////////////////////DASHBOARD SETUP///////////////////////////////
Insert cell
viewof Dashboardoptions = Inputs.radio(["Proposed Design Approaches", "Material Analysis"], {label: "", value:"Proposed Design Approaches"})
Insert cell
DBoptions= {

var Dashboardtoshow

if(Dashboardoptions=="Proposed Design Approaches"){Dashboardtoshow=designDash}

if(Dashboardoptions=="Material Analysis"){Dashboardtoshow=carbonDash}


return Dashboardtoshow

}
Insert cell
designDash = {
var dash = html`


${viewof DashboardButtons}
${currentView}
${currentButtons}


`
return dash
}
Insert cell
carbonDash = {

var dash = html`

<div class='steel' style='position:absolute;width:400px;height:200px;top:0px;left:50px'>

${md `**Wood Calculator**`}
${viewof woodquantity}
${viewof woodeol}
${viewof WDPCTRecovered}
${viewof WDdistance}
${viewof set}

</div>
<div class='Wood' style='position:absolute;width:400px;height:200px;top:0px;left:500px'>

${md `**Steel Calculator**`}
${viewof quantity}
${viewof endoflife}
${viewof PCTRecovered}
${viewof distance}
${viewof set}

</div>

<div class='Ply' style='position:absolute;width:400px;height:200px;top:250px;left:50px'>

${md `**Plywood Calculator**`}
${viewof plyquantity}
${viewof plyeol}
${viewof PLYPCTRecovered}
${viewof PLYdistance}
${viewof set}

</div>

<div class='co2' style='position:absolute;width:400px;height:200px;top:250px;left:500px'>


${co2totals}
</div>
`
return dash
}
Insert cell
dashboard2 =
html`
<div class='dashboard' style='height:800px;width:350px'>

<div class='guildhouse' style='position:absolute;width:1000px;top:00px;left:00px'>
${md `** Guild House Analysis and Design**`}
${viewof Dashboardoptions}
</div>


<div class='guildhouse' style='position:absolute;width:1000px;top:100px;left:00px'>
${DBoptions}
</div>


</div>
`
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more