Published
Edited
Apr 29, 2020
Insert cell
md`# UpSet Observable dataset chooser example`
Insert cell
md`this example uses the library to list the datasets from the original upset tool`
Insert cell
import {
listUpSet2Datasets,
datasetChooser,
setsFromDataset,
UpSetJSElement,
generateIntersections
} from '@sgratzl/upset-js'
Insert cell
datasets = listUpSet2Datasets()
Insert cell
viewof selectedDataset = datasetChooser(datasets)
Insert cell
ds = datasets[selectedDataset]
Insert cell
sets = setsFromDataset(ds)
Insert cell
intersections = generateIntersections(sets).sort(
(a, b) => b.cardinality - a.cardinality
)
Insert cell
viewof selection = UpSetJSElement(sets, intersections)
Insert cell
selection
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