parade_waterfall_good_friday_brushing = vegalite({
data: {
values: parade_events
},
vconcat: [
{
width,
height: 180,
mark: "bar",
selection: {
brush: { type: "interval", encodings: ['x']}
},
encoding: {
y: { field: "event_compound_name", type: 'nominal',
sort: { field: 'start_datetime', op: 'min' },
axis: { labels: false, ticks: false, title: false }
},
x: { field: "start_datetime", type: "temporal", timeUnit: "yearmonthdatehoursminutes",
axis: { title: "Event Time",
format: "%m/%d"},
scale: { domain: { selection: "brush" } }
},
x2: { field: "end_datetime", type: "temporal", timeUnit: "yearmonthdatehoursminutes" },
}
},{
width,
height: 1400,
autosize: "fit",
mark: "bar",
encoding: {
y: {field: "event_compound_name", type: 'nominal',
sort: {field: 'start_datetime', op: 'min'}
},
x: { field: "start_datetime", type: "temporal", timeUnit: "yearmonthdatehoursminutes",
axis: { title: "Event Time",
format :"%m/%d %H:%M"},
scale: {domain: {selection: "brush"}}
},
x2: { field: "end_datetime", type: "temporal", timeUnit: "yearmonthdatehoursminutes",
scale: {domain: {selection: "brush"}}},
color: { value: ENIGMA_MONO_COLOR }
},
}
],
transform : [
{'calculate': "datum.event_name + ' ' + datum.event_id",
'as': 'event_compound_name'
},
],
title: `Interactive Gantt Chart: All Permitted Parades in NYC (March 2018)`
})