Published
Edited
Nov 12, 2018
13 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
worker = {
mutable item_loaded = 0;
createWorker('worker.js', (worker) => {
worker.postMessage({
url: "https://raw.githubusercontent.com/AlanDelip/D3Viz/master/data/airport-data/las_vegas_stream.json"
});

worker.onmessage = function (e) {
if (e.data.load) {
mutable item_loaded++;
mutable item_loading = e.data.load;
}
}
});
return md`You can use Shift-Enter restart this for preview`;
}
Insert cell
Insert cell
Insert cell
Insert cell
abort_worker = {
mutable a_item_loaded = 0;
createWorker('worker.js', (worker) => {
worker.postMessage({
url: "https://raw.githubusercontent.com/AlanDelip/D3Viz/master/data/airport-data/las_vegas_stream.json",
till_id: 122104
});

worker.onmessage = function (e) {
if (e.data.load) {
mutable a_item_loaded++;
mutable a_item_loading = e.data.load;
}
}
});
return md`You can use Shift-Enter restart this for preview`;
}
Insert cell
function createWorker(s, cb) {
const worker = new window.Worker(
window.URL.createObjectURL(
new Blob(
[
`
importScripts('https://unpkg.com/oboe@2.1.4/dist/oboe-browser.min.js');
self.onmessage = function(e){
oboe(e.data.url)
.node('{id name}', function(res) {
if(e.data.till_id && res.id === e.data.till_id){
this.abort();
}
self.postMessage({
load: res
});
});
};`
],
{
type: "text/javascript"
}
)
)
);
if (typeof cb == "function") {
cb(worker);
}
}
Insert cell
Insert cell
Insert cell
Insert cell
viewof local_file = file({
description: "Only image files are allowed.",
accept: "image/*",
multiple: false
})
Insert cell
blob = {
let fileReader = new FileReader();
let blob_url = URL.createObjectURL(local_file);
return blob_url;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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