Public
Edited
Jun 13, 2021
Insert cell
Insert cell
Insert cell
vl
.markTick()
.data(numbers)
.encode(vl.x().fieldQ("value"))
.render()
Insert cell
Insert cell
function manualHistogram(data, sizeOfBin) {
// your task: loop through the data and construct a histogram,
// Your data should be an array of numbers. Each number represents the count of observations within a range
// you can peek at the answer below if you want to!
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vl
.markBar()
.data(distributionForVegaLite)
.encode(vl.x().fieldN("index"), vl.y().fieldQ("count"))
.render()
Insert cell
Insert cell
vl
.markBar()
.data(numbers)
.encode(
vl
.x()
.fieldQ("value")
.bin({ maxbins: 22 }),
vl.y().count()
)
.render()
Insert cell
Insert cell
vl
.markCircle()
.data(movies)
.encode(vl.x().fieldQ('Rotten_Tomatoes_Rating'), vl.y().fieldQ('IMDB_Rating'))
.render()
Insert cell
Insert cell
vl
.markBar()
.data(movies)
.encode(
vl
.x()
.fieldQ('Rotten_Tomatoes_Rating')
.bin({ maxbins: 20 }),
vl
.y()
.fieldQ('IMDB_Rating')
.bin({ maxbins: 20 }),
vl.color().count()
)
.render()
Insert cell
Insert cell
vl
.markCircle()
.data(movies)
.encode(
vl
.x()
.fieldQ('Rotten_Tomatoes_Rating')
.bin({ maxbins: 20 }),
vl
.y()
.fieldQ('IMDB_Rating')
.bin({ maxbins: 20 }),
vl.size().count(),
vl.row("MPAA_Rating")
)
.render()
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