Published
Edited
May 2, 2022
Importers
44 stars
Insert cell
Insert cell
Insert cell
Insert cell
import { DatasetteClient } from "@asg017/datasette-client-core"
Insert cell
db = DatasetteClient("https://congress-legislators.datasettes.com/legislators")
Insert cell
Insert cell
// As of 2021-05-14, Observable's Cell Mode for latex uses tex.block instead of tex, so assign it to tex.block instead!
tex = ({
block: db.table
})
Insert cell
SELECT
id_bioguide,
name_first,
name_last
FROM legislators
WHERE name_first LIKE 'ALEX%'
LIMIT 25;
Insert cell
Insert cell
Insert cell
viewof party = html`<select>
<option>Democrat</option>
<option>Republican</option>
<option>Independent</option>`
Insert cell
SELECT
legislator_terms.type,
legislator_terms.state,
legislator_terms.party,
legislators.name,
legislator_terms.start as start,
legislator_terms.end
FROM legislators
LEFT JOIN legislator_terms ON legislators.id = legislator_terms.legislator_id
GROUP BY id_bioguide
HAVING
date(max(legislator_terms.end)) > date("now")
and legislator_terms.type = "sen"
and legislator_terms.party = ${party}
ORDER BY state ASC
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