Published
Edited
Nov 14, 2020
1 fork
12 stars
Insert cell
Insert cell
Insert cell
books = [
{ title: 'Broad Band', author: 'Claire L. Evans', rating: 4},
{ title: 'Americanah', author: 'Chimamanda Ngozi Adichie', rating: 5},
{ title: 'Another Country', author: 'James Baldwin', rating: 4.5}
]
Insert cell
Insert cell
d3.tsvParse(rawData)
Insert cell
d3 = require('d3-dsv')
Insert cell
Insert cell
file = FileAttachment("Racial Equity Resources.csv")
Insert cell
d3.csvParse(await file.text())
Insert cell
text = file.text()
Insert cell
d3.csvParse(text)
Insert cell
FileAttachment("weather.json").json()
Insert cell
FileAttachment("observable_banner.png").image()
Insert cell
Insert cell
import { alphabet } from '@observablehq/vega-lite-chart-types'
Insert cell
alphabet
Insert cell
Insert cell
url = 'https://data.sfgov.org/resource/xdgd-c79v.json'
Insert cell
response = fetch(url)
Insert cell
response.json()
Insert cell
jsonData = (await fetch(url)).json()
Insert cell
d3Fetch = require('d3-fetch')
Insert cell
d3Fetch.json(url)
Insert cell
marsData = d3Fetch.json(`https://api.nasa.gov/insight_weather/?api_key=${Secret("NASA_API_KEY")}&feedtype=json&ver=1.0`)
Insert cell
Insert cell
Insert cell
Insert cell
db = DatabaseClient("Weather")
Insert cell
db.describe('weather')
Insert cell
db.query(`select location, date, weather from weather where location='${location}' limit 20`)
Insert cell
// As an alternative to the above approach using ${} within the template literal, you can also pass an array of variables as a second arg to the DatabseClient.query() method.
// This version will do any needed escaping if your variable has any tricky characters like quotes (‘“) in it. See https://observablehq.com/@observablehq/connecting-to-databases#query for more details!
db.query('select location, date, weather from weather where location=$1 limit 20', [location])
Insert cell
viewof location = select(['Seattle', 'New York'])
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