Every app on this page is built from the three layers described in HTML, CSS and JavaScript. Each library adds to one or more of these layers.
| Layer | What libraries add | Examples |
|---|---|---|
| JavaScript | data, charts and maps drawn into an HTML element | DuckDB-WASM, Observable Plot, D3, MapLibre, deck.gl |
| CSS | colors, fonts and layouts that adapt to the screen | Pico CSS, Bootstrap, Tailwind CSS |
| HTML | new elements such as tabs, drawers and dialogs, defined with JavaScript | Web Awesome |
| All three | components written together and compiled into plain files | Svelte, React, Vue, Observable Framework |
The starter app uses plain HTML and CSS and two JavaScript libraries: DuckDB-WASM reads the data and Observable Plot draws the chart. This page tours the major libraries for each layer through apps that people actually use, grouped by the themes of Modules 1 to 3. Use it to find an app worth imitating, and then find out how that app was built.
Reading an app¶
Every client-side app can be read in the same way. Open the app, then open the browser’s developer tools.
The network tab lists every file the app loads: its scripts, its data files, and its map tiles. Reload the page with the tab open to see which data an app reads, how large they are, and whether it queries a server or reads static files.
The elements or inspector tab shows the HTML of the page and the CSS rules applied to each element. Most apps have a
<div>or<canvas>element into which a chart or map library draws.The sources or debugger tab shows the JavaScript libraries. A file named
maplibre-gl.jsorduckdb-wasmtells you a lot about how the app works.The device toolbar (the phone icon in Chrome and Firefox) shows the app at the width of a phone. Try it on every app below, including your own.
Many of these apps are open source. Look for a link to the code and the license. An app whose code you may reuse, under a license you understand, is the best kind of example.
Ask your coding agent to explain what it finds, the same way you asked it to explain an unfamiliar
ibis expression in Module 1.
Charts¶
Chart libraries are JavaScript. Each one takes data and draws a chart into an element on the page, usually as SVG, which is itself a kind of HTML that CSS can style. Observable Plot is one of several grammar-of-graphics libraries for the browser. Vega-Lite is the library underneath Python’s Altair, so a chart you write in Altair in a notebook can be exported as a Vega-Lite spec and embedded in a web page. D3 is the lower-level library that Plot is built on, and most custom newsroom graphics use it directly. Apache ECharts and Plotly.js are chart libraries with many ready-made chart types and built-in zooming and tooltips.
These apps build on the climate data from Module 1.
🌡 The Our World in Data CO₂ explorer charts the same file the starter app reads, with menus for the measure, the countries and the time range, and a toggle between a chart, a map and a table. Its code, the Grapher, is open source and written in TypeScript with React and D3.
🌡 Show your stripes reduces a temperature record to one stripe of color per year. The reader picks a country or region and the stripes redraw. It is a good example of a single, well-chosen chart with one control.
🌡 Climate Reanalyzer draws daily global temperature with one line per year and highlights the current year against all earlier ones.
🌡 NOAA’s Climate at a Glance lets a reader choose a region, a variable, a season and a base period, and draws the time series.
Maps¶
Map libraries are JavaScript, together with a small CSS file for the zoom buttons and popups.
The map fills one <div> on the page and draws with the computer’s graphics card. In Module 2 we
used MapLibre through leafmap, which writes this JavaScript for us. Writing MapLibre in JavaScript
directly opens up much more of it. The MapLibre examples
include a globe,
3D terrain, and a
cloud-optimized GeoTIFF
read directly in the browser with the
maplibre
Other map libraries are worth knowing. deck.gl draws millions of points, arcs and hexagons on the GPU, and can be layered on a MapLibre map. kepler.gl is a complete map app built on deck.gl, into which you can drop a CSV or GeoJSON file. Leaflet is older and simpler and does not use WebGL, and OpenLayers has the widest support for map projections and GIS formats.
These apps build on the environmental justice theme of Module 2.
🛰 Tree Equity Score scores every neighborhood in the US on tree canopy relative to income, race, age and heat. It asks the same question as Module 2 for the present day, and a reader can search for their own address.
🛰 The NYC Street Tree Map shows every street tree in New York City, with its species and the ecosystem services it provides. It shows how far one city’s open data can go.
🛰 The Climate and Economic Justice Screening Tool was the federal map of disadvantaged communities. It was taken offline in January 2025, and Public Environmental Data Partners now host a copy on GitHub Pages, the same service we use. Because the app is a set of static files, anyone with a copy of the files could put it back online.
🛰 The Copernicus Browser shows Sentinel-2 imagery for any date and place, with band combinations and indices such as NDVI computed on the fly.
🛰 STAC Browser explores any STAC catalog. The link opens the Planetary Computer catalog we searched in Module 2. It is open source and built with Vue and OpenLayers.
🛰 The Overture Maps explorer shows buildings, places and roads for the whole world. It is built with React, MapLibre and PMTiles, and its code is open source.
🌡 Climate TRACE maps greenhouse gas emissions by country, sector and individual facility. Probable Futures maps the days of extreme heat and drought expected at different levels of warming, and Climate Central’s coastal risk map shows land below projected sea level.
🌡 CarbonPlan’s forest carbon risk and downscaled climate projections maps each come with a written explainer. Their map library, @carbonplan/maps, reads gridded climate data from Zarr files directly in the browser.
The Global Forest Watch map, now part of Global Nature Watch, and earth
.nullschool .net show what a map can do with a time slider and with animation.
Linked views and SQL in the browser¶
When a reader selects a range in one chart and every other chart filters to match, the charts are linked. Mosaic links Observable Plot charts through DuckDB-WASM, so each selection becomes a SQL query. Its ten million flights and Gaia star catalog examples filter millions of rows as fast as the reader can drag. The DuckDB shell runs DuckDB-WASM in a browser tab, which is a quick way to test a query on a remote Parquet file before you put it in your app.
Observable Framework builds a whole data site from markdown pages with code in them, and adds a sidebar, a grid of cards and dark mode. Its examples include a dashboard of the US electricity grid and a map of US dams.
Models and simulations¶
A model explorer runs a calculation in the browser every time a slider moves. JavaScript is fast enough for most models from an ecology course, and these apps show how far the idea goes.
🌡 En-ROADS is a global climate policy simulator. Each slider is a policy, such as a carbon price or a coal phase-out, and the projected warming updates as the reader moves it. It was built by Climate Interactive and the MIT Sloan School of Management, and is often played as a group game in classes. The model is compiled to WebAssembly with the open source SDEverywhere, so it runs entirely in the browser.
🛰 Parable of the Polygons lets the reader play a model of residential segregation, in which a small preference among individuals produces strongly segregated neighborhoods. It pairs well with the history in Module 2.
Complexity Explorables has short interactive models from ecology and other fields, such as a predator and prey model.
Nicky Case’s What Happens Next? and the Washington Post’s epidemic simulator are two widely read model explorers from 2020. Seeing Theory does the same for statistics.
Text and search¶
The tools from Module 3 can also run in the browser, with one important limit: any API key in a client-side app is public. An app can call the NRP language model only through a server that holds the key. A static app can still search text by meaning if the paragraph embeddings are computed ahead of time and saved to a file, and the reader’s query is embedded in the browser by Transformers.js.
📜 Climate Policy Radar searches the text of climate laws and policies from every country, using machine learning to tag and find passages. Climate Change Laws of the World is a related database. Both do for national laws roughly what Module 3 did for listing rules.
📜 Embedding Atlas draws a map of embeddings in which each point is a document or passage, with search, nearest neighbors and filters on the other columns. It works with Mosaic and can be embedded in a page or used from Python. See its examples. The older Embedding Projector does something similar.
📜 Semantle is a word-guessing game in which the only clue is how close each guess is to the answer in embedding space. It is a “guess, then reveal” app built on the same idea as semantic search.
WebLLM Chat runs an open-weight language model entirely in the browser. The model download is large, often several gigabytes, which is a cost to weigh for any reader on a phone.
Streamlit and Shiny galleries¶
The Streamlit gallery, the Shiny for Python gallery and the Shiny for R gallery collect hundreds of data apps, most with a link to their source code. These apps run on a server. Free hosted apps are put to sleep when nobody uses them, so the first visit can take a minute while the server wakes up, which is the cost of server-side apps described in the Module 4 introduction. Many of them translate directly into a client-side app. The data file becomes a static CSV or Parquet file read by DuckDB-WASM, each widget becomes an HTML input, and each chart becomes an Observable Plot or Vega-Lite chart. These apps would translate well.
🌡 The Seattle weather dashboard shows summary numbers for one year at the top, then lets the reader compare temperature, precipitation and wind across chosen years. Its source is a single short Python file with Altair charts, which are already Vega-Lite.
🌡 The respiratory disease app maps fine particulate pollution and deaths from respiratory disease by country, with a slider for the year. It uses World Bank, OECD and Our World in Data files, and its source is in Shiny for Python.
🛰 The Utah Lake water quality dashboard maps monitoring sites. When the reader clicks a site, the app draws the profile of dissolved oxygen and temperature with depth for that site. The pattern of clicking a place on a map to fill a panel of charts fits almost any spatial dataset.
🛰 Prettymapp draws a poster-style map of streets, water and parks for any address, with a radius slider and color themes. A MapLibre version would restyle vector tiles instead of downloading OpenStreetMap data on a server.
📜 Biodiversity in National Parks lists the species recorded in each US national park with their conservation status, as tables, charts and a map, and its source is in R. An app from Module 3 could pair each listed species with the listing rules that discuss climate change.
The Shiny for Python templates are worth browsing for layout alone. The restaurant tips dashboard shows a common arrangement of summary numbers in a row across the top, filters in a sidebar, and cards that each hold one chart or table.
Layout and components¶
The starter app uses plain HTML and a short stylesheet of its own. Layout and component libraries replace that stylesheet, or add new HTML elements, so that menus, tabs, dialogs and grids look consistent and rearrange themselves on a phone. They differ in which layer they work in.
Pico CSS is a stylesheet only. It styles plain HTML elements with no classes to learn, and includes dark mode. It is the smallest step up from the starter app.
Bootstrap is mostly CSS, with a little JavaScript for menus that open and close. It provides a responsive grid, a navigation bar that collapses into a menu on a phone, and many other components. Its examples page has complete layouts for dashboards, sidebars and landing pages.
Tailwind CSS is CSS applied through many small classes written in the HTML, such as
p-4for padding. Coding agents write it fluently, but the resulting HTML is harder to read.Web Awesome, the successor to Shoelace, adds new HTML elements, such as
<wa-tab-group>and<wa-drawer>, which are defined in JavaScript and styled with CSS. They work in a plain HTML page without a framework.
Larger apps use a JavaScript framework. A framework lets you write each part of the interface as a component that holds its own HTML, CSS and JavaScript together, and it updates the page whenever the app’s state changes. A build step then compiles the components into ordinary HTML, CSS and JavaScript files. Svelte is common in newsrooms, and LayerCake is a chart library for it. React powers the Our World in Data Grapher and the Overture explorer above, and Vue powers STAC Browser.
Each of these libraries is a dependency that you must pin and test. Svelte, React, Tailwind and Observable Framework also need a build step, which turns your source files into the files that GitHub Pages serves, so the deploy workflow in the template would need a new step to run it. Libraries such as Pico, Web Awesome and MapLibre can be loaded from a pinned URL with no build step at all. Choose the smallest set of tools that does what your readers need.
The Shiny layouts page is a useful catalog of the standard arrangements, such as a navigation bar, a sidebar, tabs and cards, each with a picture. The same arrangements can be built with any of the libraries above.
A few habits make an app work on a phone whatever library you choose:
Put controls above the chart on a narrow screen and beside it on a wide one, or in a drawer that slides over a full-screen map.
Make every control large enough to tap, and reachable with the keyboard.
Test with the device toolbar, and then on a real phone.
Scrolling stories¶
Some apps are read from top to bottom, with the chart or map changing as the reader scrolls. Scrollama is a small library that tells your code which paragraph is on screen. Bloomberg’s What’s really warming the world? adds one possible cause of warming at a time, from the sun to volcanoes to greenhouse gases, and compares each one with the observed temperature record.