Public
Edited
Oct 14, 2024
Insert cell
Insert cell
{
/* Code below is taken from assignment 3 page for rendering the map */
// // Add an SVG element to the DOM
var container = d3.create("div");
var svg = container
.append("svg")
.attr("width", mapWidth)
.attr("height", mapHeight)
.style("border", "1px solid black");

// Add SVG map at correct size, assuming map is saved in a subdirectory called `data`
svg
.append("image")
.attr("width", mapWidth)
.attr("height", mapHeight)
.attr("xlink:href", await FileAttachment("cs448b-map2.png").url());

const data = d3
.csv(
"FILE_URL_HERE",
(d) => {
// TODO: Add any data pre-processing here, if necesary
return d;
}
)
.then((data) => {
// TODO: Callback function
});
/* End of code taken from assignemnt 3 page for rendering the map */

return container.node();
}
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