Published
Edited
Apr 1, 2018
7 stars
Insert cell
Insert cell
{
const div = html`<div>`;
yield div; // EventDrops needs the DIV to be added to the DOM to infer width.
d3.select(div).datum(repositoriesData).call(chart);
yield div; // Tell Observable that EventDrops has rendered to infer height.
}
Insert cell
chart = eventDrops({
range: {
start: new Date('03/01/2018 6:55:11 PM'),
end: new Date('03/06/2018 7:15:11 PM')
},
drop: {
date: d => d.date,
}
})
Insert cell
repositoriesData = [{
name: "intake",
data: [
{ date: new Date('03/02/2018 6:55:11 PM') },
{ date: new Date('03/02/2018 10:56:11 PM') },
{ date: new Date('03/03/2018 6:57:11 AM') },
]
}, {
name: "eligibility",
data: [
{ date: new Date('03/03/2018 6:58:09 PM') },
{ date: new Date('03/03/2018 11:58:09 PM') }, ]
}, {
name: "assessment",
data: [
{ date: new Date('03/04/2018 6:59:09 PM') }
]
}, {
name: "dispute resolution",
data: [
{ date: new Date('03/05/2018 7:01:09 AM') }
]
}, {
name: "compliance",
data: [
{ date: new Date('03/05/2018 7:05:09 PM') }
]
}, {
name: "closure",
data: [
{ date: new Date('03/05/2018 11:12:07 PM') }
]
}]
Insert cell
d3 = require("d3@4.13.0/build/d3.min.js")
Insert cell
eventDrops = {
window.d3 = d3; // EventDrops requires D3 as a global.
return require("event-drops@1.1.1/dist/index.js");
}
Insert cell
// EventDrops requires a stylesheet.
html`<link href="${resolve("event-drops@1.1.1/dist/style.css")}" rel="stylesheet">`
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more