Public
Edited
May 28, 2023
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
duckDBClient = DuckDBClient.of({
flights: FileAttachment("flights-10m.parquet")
})
Insert cell
{
// FALCON
const flightsDuckDB = new falconVis.DuckDB(duckDBClient._db, "flights");
const falcon = new falconVis.FalconVis(flightsDuckDB);

// VIEWS
const count = await falcon.view0D((updatedCounts) => {
mutable selected = updatedCounts.filter;
});
// const resolution = chartWidth; // if the resolution is the same as the chartWidth pixels, filtering will be accurate, if lower, filtering counts will be approximate
const resolution = 350; // I can afford to be approximate here to reduce memory
const distanceView = await falcon.view1D(
{
type: "continuous",
name: "Distance",
bins: 25,
resolution
},
(updatedCounts) =>
updateVegaliteChart(distanceChart, vegaliteDataFormat(updatedCounts))
);
const arrivalDelayView = await falcon.view1D(
{
type: "continuous",
name: "ArrDelay",
range: [-20, 140],
bins: 25,
resolution
},
(updatedCounts) =>
updateVegaliteChart(arrivalDelayChart, vegaliteDataFormat(updatedCounts))
);
const flightDateView = await falcon.view1D(
{
type: "continuous",
name: "FlightDate",
bins: 25,
time: true,
resolution
},
(updatedCounts) =>
updateVegaliteChart(flightDateChart, vegaliteDataFormat(updatedCounts))
);

// LINK'em!
await falcon.link();

addListenersToChart(distanceChart, distanceView);
addListenersToChart(arrivalDelayChart, arrivalDelayView);
addListenersToChart(flightDateChart, flightDateView);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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