//hint: you can use d3.mean to find the average age of passengers in second class
//try to find the answer here for third class
//hint: you can use d3.mean to find the passengers in third class
functioncalculateTicket()
{
//calculate the ticket inside this function
//return name + ", $" + ticket
}
calculateTicket();
//
vl.markTick()
.data(titanicMap)
.encode(
vl.x().fieldQ('Fare')
)
.render()
vl.markBar()
.data(titanicMap)
.encode(
vl.x().fieldQ('Age').bin(true),
vl.y().count('Survived')
)
.render()
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.