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

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