Published
Edited
May 19, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
p_type
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
selectedStateId
Insert cell
mutable stateSelector = "13"
Insert cell
Insert cell
Insert cell
Insert cell
producerStatsSum
Insert cell
countyCombined
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// temporarily disabled this part
dataLayer = {
map.createPane("600").style.zIndex = 600;
var geojsonMarkerOptions = {
pane: '600',
radius: 5,
fillColor: "#873E91",
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 0.8
};
function whenClicked(e) {
mutable selectedProducer = e.sourceTarget.feature;
}
const datalayer = L.geoJSON(powerFiltered, {
pointToLayer: function (feature, latlng) {
return L.circleMarker(latlng, geojsonMarkerOptions);
},
onEachFeature: function (feature, featureLayer){
featureLayer.bindPopup(feature.properties.NAME);
featureLayer.on({
click: whenClicked
});
},
}).addTo(map);
invalidation.then(() => map.removeLayer(datalayer));
//return datalayer;
}
Insert cell
dataLayer3 = {
var buffered = [];
map.createPane("550").style.zIndex = 550;
var lenny = powerFiltered.length;
for (var i = 0;i < lenny;i++){
buffered.push((turf.buffer(powerFiltered[i],buffDistance, options)));
}
const datalayer3 = L.geoJson(buffered,{pane:'550'}).addTo(map);
invalidation.then(() => map.removeLayer(datalayer3));
return datalayer3;
}
Insert cell
dataLayer2 ={
// temporarily disabled this part
map.createPane("500").style.zIndex = 500;
const datalayer2 = L.geoJSON(countyCombined,{
onEachFeature: function (feature, featureLayer){
//featureLayer.bindPopup(feature.DATA.NAME);
},
pane:'500',
color:'#94918d',
fillColor:'#52504d',
fillOpacity:0.9,
weight: 1,
}).addTo(map);
invalidation.then(() => map.removeLayer(datalayer2));
map.fitBounds(datalayer2.getBounds());
return datalayer2;
}
Insert cell
countyCombined[0]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
polygonX = turf.polygon(countyCombined[5].geometry)
Insert cell
centroidX = turf.centroid(polygonX.geometry.coordinates)
Insert cell
fromX = turf.point(powerFiltered[1].geometry.coordinates)
Insert cell
toX = turf.point(centroidX.geometry.coordinates)
Insert cell
distanceX = turf.distance(fromX, toX, options);
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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