Public
Edited
Mar 25, 2023
Paused
2 stars
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
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
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
import {toc} from "@nebrius/indented-toc"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
firstDataDate = "2022-06-21"
Insert cell
Insert cell
Insert cell
//oldData = fetchData("?date="+yesterday)
Insert cell
Insert cell
//plotCruiseData(oldData.filter(d=>!({"CRYSTAL SYMPHONY":1,"INSIGNIA":1,"ISLAND PRINCESS":1,"JEWEL OF THE SEAS":1,"LEGEND OF THE SEAS":1}[d.VesselName])))
Insert cell
//compareCruiseData(oldData,allData).filter(d=>!d.old)
Insert cell
Insert cell
Insert cell
lastColorStatusReportDate = d3.max(allColorStatus,d=>d.reportDate)
Insert cell
lastColorStatusDate = (new Date(lastColorStatusReportDate)).toISOString().slice(0,10)
Insert cell
Insert cell
// Use only the most recent report for report date
allColorStatusPreviousText = Array.from(d3.rollup(
allColorStatusPrevious.filter(d=>d).map(d=>shipWeeklySummaryObject(d,selectVesselName)),
group => group[0],
d => d["Report Date"]
).values()).filter(d=>!isNaN(d["Passenger cases"]) || !isNaN(d["Crew cases"]))
Insert cell
Insert cell
async function getColorStatus(params="") {
let data = await d3.csv("https://labvegas.com/data/covid19/cruises/dashboard-Color Status.csv"+params, d3.autoType);
data.sort((a,b)=> a.reportDate - b.reportDate);
delete data.columns;
console.log(data);
let prev = null ;
data.forEach(d=>{
d.Date=new Date(d.reportDate);
d["Total cases in last 7 days"] = d["Crew cases in last 7 days"] + d["Pax cases in last 7 days"];
d["Total pax and crew"] = d["numpax"] + d["numcrew"];
d["Total cases %"] = d["Total cases in last 7 days"] / d["Total pax and crew"];
delete d["Current Voyage Type"];
delete d["Current Voyage Type"];
delete d["include.on.website"];

});
return data;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
getColorStatusTotals(allColorStatus)
Insert cell
vesselNames = getUnique(d3.map(allData, d=>d.VesselName)).sort()
Insert cell
cruiseLines = getUnique(d3.map(allData, d=>d["Cruise.Line"])).sort()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//Object.entries(allColorStatusPreviousWeek.find(d=>d["Ship Name"]===selectVesselName)).map(kv=>kv[0]+"|"+kv[1]).join("\n")
Insert cell
function toggleDisplay(show,content) {
return html`<span style="display:${show ? "inline-block":"none"}">${content}</span>`
}
Insert cell
//plotCruiseData(allData,"Cruise.Line")
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