Public
Edited
Feb 12, 2023
Insert cell
Insert cell
dataset_generator = {
return compose(custom_suiteids, vectorize(suiteid_get_suiteobj))
//return compose(custom_suiteids, suiteid_get_suiteobj, suiteobj_get_refupdatetag)
//return compose(first100_suiteids, suiteid_get_suiteobj)
}
Insert cell
column_grouper = {
return suiteobj_get_refupdatetag
}
Insert cell
row_grouper = {
return compose(suiteobj_get_suiteid)
}
Insert cell
displayer = {
}
Insert cell
Insert cell
dataset = dataset_generator()
Insert cell
dataset
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
dataset_by_col = {
return groupBy(dataset, column_grouper)
}
Insert cell
Insert cell
Insert cell
Insert cell
async function custom_suiteids() {
return [10069157, 10069153, 10069155, 10069152, 10069156,
10069149, 10069166, 10069148, 10069151, 10069154]
}
Insert cell
async function first100_suiteids() {
let url = `https://suites.api.trip.illumina.com/api/v1/suites`
let res = await fetch(url)
res = await res.json()
res = res.results
res = res.map(x => x.id)
return res
}
Insert cell
async function suiteid_get_suiteobj(suiteid) {
let res = await fetch(`https://suites.api.trip.illumina.com/api/v1/suites/${suiteid}/`)
res = await res.json()
return res
}
Insert cell
Insert cell
async function suiteobj_get_refupdatetag(suiteobj) {
let tags = suiteobj.metadata.tags
let reftags = tags.filter(t => t.startsWith("refoverride-"))
if (reftags.length) {
return reftags[0]
} else {
return ""
}
}
Insert cell
async function suiteobj_get_suiteid(suiteobjs) {
return suiteobjs.map(x => x.id)
}
Insert cell
Insert cell
async function items_disp_list() {
}
Insert cell
//library = import("http://localhost:8989/suites-api/suites-api-1.47.0.tgz") // from: https://ussd.artifactory.illumina.com/npm-dragen-qa/suites-api/-/suites-api-1.47.0.tgz
Insert cell
//import("http://localhost:8989/test/package/dist/index.js")
Insert cell
//import("http://localhost:8989/test/pkg.js")
Insert cell
//requirejs = import("https://cdn.skypack.dev/requirejs")
Insert cell
Insert cell
function compose(...fns) {
const compose2 = (f, g) => async (...args) => g(await f(...args))
return fns.reduce(compose2)
}
Insert cell
async function groupBy(list, keyGetter) {
const map = new Map();
for (let item of list) {
const key = await keyGetter(item)
const collection = map.get(key);
if (!collection) {
map.set(key, [item]);
} else {
collection.push(item);
}
}
return map;
}
Insert cell
function vectorize(f) {
return async (xl) => {
console.log(xl)
return await Promise.all(xl.map(f))
}
}
Insert cell
hyperscript = import("https://cdn.skypack.dev/hyperscript")
Insert cell
hyperscriptHelpers = import("https://cdn.skypack.dev/hyperscript-helpers")
Insert cell
h = hyperscriptHelpers.default(hyperscript)
Insert cell
async function pre() {
const hyperscript = await import("https://cdn.skypack.dev/hyperscript")
const hyperscriptHelpers = await import("https://cdn.skypack.dev/hyperscript-helpers")
const h = hyperscriptHelpers.default(hyperscript)
const {div, span} = h
return h.pre()
}
Insert cell
pre()
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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