Public
Edited
Dec 17, 2023
Insert cell
Insert cell
viewof zoom = Inputs.range([0, 1], {label: "longitude", step: .001, value: .23})
Insert cell
viewof Floor_water = Inputs.toggle({label: "Floor water in 50 years"})
Insert cell
Floor_water
Insert cell
Select_asset = dgi.filter: (dgi, (d) => d3.asset_type("asset_type"))
Insert cell
Plot.plot({width:1200,height:1200,
projection: {type: "orthographic",rotate: [80, -34], domain:circle},
r: {transform: (d) => Math.pow(10, d)}, // convert Richter to amplitude
style: "overflow: visible;", // allow dots to escape
marks: [
//Plot.geo(datasetwithdataproperty to create cloropleth, {fill: d => color(d.properties.POPULATION), fillOpacity: 0.2, type:"md"}),
//Plot.geo(_census_tracts__tabular_20231105, {fill: d => color(d.properties.POPULATION), fillOpacity: 0.2, type:"md"}),
Plot.geo(combined, {fill: d => color(d.properties.Income), fillOpacity:1,
//channels: { Income: (d) => d.properties.Income }, // Display asset_type in the tooltip
tip: true},
),
Plot.geo(Flood, {fill: "blue", fillOpacity: 0.7, type:"md"}),
Plot.geo(archivedParksProperties , {fill: "green", stroke:"green", fillOpacity: 0.5, type:"md",
//channels: { typecatego: (d) => d.properties.typecatego}, // Display asset_type in the tooltip
tip: true}),
Plot.dot(dgi.features, {x: (d) => d.geometry.coordinates[0], y: (d) => d.geometry.coordinates[1],
r: .7,
stroke: "cyan",
fill: "cyan",
fillOpacity: 0.1,
channels: { asset_type: (d) => d.properties.asset_type }, // Display asset_type in the tooltip
tip: true})
]
})
Insert cell
archivedParksProperties = FileAttachment("ARCHIVED - Parks Properties.geojson").json()
Insert cell
censusTractsTabular_20231107 = FileAttachment("2020 Census Tracts - Tabular_20231107.geojson").json()
Insert cell
nyc_census_tracts@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
combined = {

var geo = censusTractsTabular_20231107.features
var data = nyc_census_tracts1

var combinedData = []
for (let i = 0; i < geo.length; i++) {
var lineName = Number(geo[i].properties.geoid)//dataset w/ lines, specify properties that has match key
for (let k = 0; k < data.length; k++) {
var dataName = data[k].CensusTract//none spatial dataset, specify properties that have match
if(lineName == dataName){//console.log('match')

combinedData.push({type:'Feature',properties:data[k],geometry:geo[i].geometry})
}
}
}

return {type: 'FeatureCollection',features:combinedData}}

Insert cell
Flood = FileAttachment("Sea Level Rise Maps (2050s 500-year Floodplain).geojson").json()
Insert cell
color = d3.scaleQuantize().domain([5000, 120000]).range(d3.schemeReds[9]);
Insert cell
circle = d3.geoCircle().center([-73.9, 40.68]).radius(zoom)()
Insert cell
dgi = FileAttachment("DEP Green Infrastructure.geojson").json()
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