Published
Edited
Oct 1, 2019
1 fork
1 star
Insert cell
Insert cell
sampleCount = 2000;
Insert cell
compressionCount = 1000;
Insert cell
smoothingWidth = 100;
Insert cell
Insert cell
vl.markPoint().data(data).encode(vl.x().fieldQ('r').scale({domain: [minToShow, maxToShow]})).render()
Insert cell
vl.markBar().data(data).encode(vl.x().fieldQ('r').bin({maxBins: 100}).type("quantitative"), vl.y().count()).width(940).render()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {vl} from "@vega/vega-lite-api"
Insert cell
Insert cell
data = fn(guesstimatorInput).values.map(r => ({r}))
Insert cell
cdfLib = require('https://bundle.run/@foretold/cdf@1.0.9')
Insert cell
Insert cell
Insert cell
asPdf = asCdf.toPdf();
Insert cell
zipp = (cdf) => cdf.xs.map((a,i) => ({x:cdf.xs[i], y:cdf.ys[i]}))
Insert cell
minToShow = asCdf.findX(0.0001);
Insert cell
maxToShow = asCdf.findX(0.99);
Insert cell
cdfToJs = JSON.stringify(asCdf)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more