Published
Edited
Jul 21, 2021
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
with_anum = with_year.filter(d => d["date of entry"])
Insert cell
with_year = table.orderby(("anum")).derive({year: d => op.year(d['date of entry'])})
Insert cell
Insert cell
Insert cell
embed({
title: "All A Numbers, by year of entry.",
data: {
values: with_anum.derive({"year of entry": d => op.year(d['date of entry'])}).filter(d => d.anum > 100e6, d=> d.anum < 220e6)
},
width: 600,
height: 600,
mark: "rect",
encoding: {
x: {"field": "year of entry", type: "quantitative", "bin": {"maxbins":230}},
y: {field: "anum", type: "quantitative", "bin": {"maxbins":130} },
color: {aggregate: "count", scale: {type: "log"}},
}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
embed({
data: {
values: with_anum
// .filter(d => d.anum > 16e6).filter(d => d.anum < 42e6)
.filter( d => d.year > 1928, d => d.year < 1966)
.filter(d => d.country != "China")
.sample(10000)
},
"params": [{
"name": "grid",
"select": "interval",
"bind": "scales"
}],
width: 1000,
height: 1000,
mark: "circle",
encoding: {
x: {field: "date of entry", type: "temporal"},
y: {field: "anum", type: "quantitative", scale: {zero: false} },
// color: {field: "port of entry"},
// tooltip: {field: "name"},
// color: {field: "country", type: "nominal"}
}
})
Insert cell
md`# The 1986 Amnesty

It may be possible identify the 1986 amnesty recipients through A numbers. Here's a chart of all Mexican A-numbers from 1960 to 1987

`
Insert cell
embed = require("vega-embed@6")
Insert cell
embed({
data: {
values: with_anum
.filter(d => d.anum > 16e6).filter(d => d.anum < 52e6)
.filter( d=> d.year > 1965, d => d.year < 1986)
.filter(d => (/*(d['port of entry'] == 'New York, NY' || d['port of entry'] == 'Los Angeles, CA' || d['port of entry'] == 'San Ysidro, CA' || d['port of entry'] == 'Miami, FL') && */ (d.country == 'Mexico' || d.country == "Cuba" || d.country == "Canada"))).sample(10000)
},
"params": [{
"name": "grid",
"select": "interval",
"bind": "scales"
}],
width: 800,
height: 640,
mark: "circle",
encoding: {
x: {"field": "date of entry", type: "temporal"},
y: {field: "anum", type: "quantitative", scale: {zero: false} },
// color: {field: "port of entry"},
tooltip: {field: "name"},
color: {field: "country", type: "nominal"}
}
})
Insert cell
import { repr } from '@bmschmidt/targeting-a-files'
Insert cell
import { aq, op, table } from '@bmschmidt/a-files'
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