Public
Edited
Mar 4, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
_(algorithm.attributes)
.pickBy((v) => types.standard.includes(v.type))
.keys()
.value()
Insert cell
_(algorithm.attributes)
.entries()
.filter(([k, v]) => types.inline.includes(v.type))
.map(([k, v]) => k)
.value()
Insert cell
_(algorithm.attributes)
.toPairs()
.filter(([k, v]) => v.type === "component")
.map(([k, v]) => [k, cmpts[v.component]])
// Do some recursive magic here
.fromPairs()
.value()
Insert cell
doit = {
const doit_ = (attrs) => {
const att = _(attrs);
const result = {
standard: att
.pickBy((v) => types.standard.includes(v.type))
.keys()
.value(),
inline: att
.pickBy((v) => types.inline.includes(v.type))
.keys()
.value(),
components: att
.pickBy((v) => v.type === "component")
.mapValues((v) => cmpts[v.component].attributes)
.mapValues((attr) => doit_(attr))
.value()
};

return _.pickBy(result, (v) => _.keys(v).length > 0);
};
return doit_;
}
Insert cell
targets = doit(algorithm.attributes)
Insert cell
_(cmpts)
.values()
.map((v) => _.has(v, "attributes"))
.every()
Insert cell
Insert cell
Insert cell
obj = {
Body: 'hai',
Title: 'wat',
Summary: 'foobar',
outcomes:
}
Insert cell
trav = {
const trav_ = (obj) => {
}
}
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