Public
Edited
Nov 9, 2023
Insert cell
Insert cell
workbook = FileAttachment("Copy of Bioscience Map of Maine company-town.xlsx").xlsx()
Insert cell
Insert cell
Insert cell
companies = workbook.sheet("Companies").slice(1);
Insert cell
companiesInfo = ({
type: "FeatureCollection",
features: companies.map(company => ({
type: "Feature",
properties: {
company: company.A,
city: company.B,
state: company.C,
county: company.D
},
geometry: {
type: "Point",
coordinates:[company.F, company.E]
}
}))
})
Insert cell
companiesGeoJSON = companiesInfo.features
Insert cell
Insert cell
Insert cell
maine = FileAttachment("Maine_County_Boundary_Lines_Feature@1.geojson").json();
Insert cell
Insert cell
Plot.plot({
width: 900,
height: 1200,
marks: [
Plot.geo(maine, {stroke: "lightgray"}),
Plot.dot(companiesGeoJSON, {
...Plot.centroid({fill: "black", stroke: "white", r: 5}),
title: d => `${d.properties.company}\n${d.properties.city}, ${d.properties.county}, ${d.properties.state}`
// Added tooltip to display company name, city and county
})
],
});
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