nonWorkAggregated = d3.rollups(
data1.filter(d => ["Social Media", "Entertainment", "Browsing"].includes(d["App Usage"])),
v => ({
totalScreenTime: d3.sum(v, d => d["Screen Time (minutes)"]),
totalTasks: d3.sum(v, d => d["Tasks Completed"])
}),
d => d.Date
).map(([Date, { totalScreenTime, totalTasks }]) => ({
Date,
"Total Screen Time (minutes)": totalScreenTime,
"Tasks Completed": totalTasks
}));