Public
Edited
Dec 14, 2022
2 forks
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
map.addSource("countries", {
type: "geojson",
data: countries
});
map.addLayer({
id: "countries-yes",
type: "fill",
source: "countries",
layout: {},
filter: ["==", "fantasy", true],
paint: {
"fill-color": "#ECBAC5",
"fill-opacity": 0.8
}
});
map.addLayer({
id: "countries-no",
type: "fill",
source: "countries",
layout: {},
filter: ["!=", "fantasy", true],
paint: {
"fill-color": "#666",
"fill-opacity": 0.8
}
});
}
Insert cell
Insert cell
countryinfo@2.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
countrycodes = countryinfo.reduce((agg, cur) => {
agg[cur.ISO3] = {
code: cur.ISO,
fantasy: fantasy.available_markets.includes(cur.ISO)
};
return agg;
}, {})
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