Published
Edited
Dec 1, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md` # Display settings
Use this section to make changes as needed to how the information is displayed.
`
Insert cell
viewof show_legend = checkbox({
description: "Details about articles sources.",
options: [{ value: "legend", label: "Show legend." }],
value: "legend"
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md` # Code and Data
This section contains the code and data powering the visualization.
`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
getColor = function(d){
let color = 'black'
if(d.source == 'daily-mail'){
color = d3.rgb(11,77,180)
}
else if(d.source == 'the-telegraph'){
color = d3.rgb(44, 255, 254)
}
else if(d.source == 'bbc-news'){
color = d3.rgb(150, 14, 20)
}
else if(d.source == 'the-guardian-uk'){
color = d3.rgb(51, 150, 51)
}
return color
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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