Public
Edited
Nov 16, 2023
6 stars
Also listed in…
Press Freedom Tracker
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = (await d3.csv('https://pressfreedomtracker.us/api/edge/incidents/?format=csv&limit=99999&fields=date,title,url,categories', d3.autoType))
.filter(d => d.date > new Date(Date.UTC(2016, 11, 31)))
.map(d => ({
...d,
categories: d.categories.split(', ')
}))
Insert cell
categoryColor = d3.scaleOrdinal(new Set(data.map(d => d.categories).flat()), [
'#E07A5F',
'#669599',
'#B0829D',
'#63729A',
'#F4C280',
'#7EBBC8',
'#F9B29F',
'#98C9CD',
'#E2B6D0',
'#B2B8E5',
'#FBE0BC',
'#BAECF7',
'#975544',
'#435556',
'#6B5261',
'#484B6B',
'#957932',
'#54767D',
])
Insert cell
FONT_STACK = '"Helvetica Neue","Segoe UI","Roboto","Helvetica","Arial",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"'
Insert cell
touchDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)
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