Published
Edited
Mar 1, 2021
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function position({
county_FIPS,
plant_state,
plant_name,
coord_lat,
coord_long
}) {
if (!county_FIPS) {
return get_FIPS(coord_lat, coord_long);
}
const feature = features.get(county_FIPS);
return feature && path.centroid(feature);
}
Insert cell
function get_FIPS(coord_lat, coord_long) {
return d3.json(
`https://geo.fcc.gov/api/census/area?lat=${coord_lat}&lon=${coord_long}&format=json`
);
}
Insert cell
test = get_FIPS(coord_lat, coord_long)
Insert cell
test.results[0].county_fips
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