Public
Edited
Mar 15, 2023
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function webRDFToJS(obj) {
return d3.range(0, obj.values[0].values.length).map((ridx) => {
let m = {};
for (var cidx = 0; cidx < obj.names.length; cidx++) {
m[obj.names[cidx]] = obj.values[cidx].values[ridx];
}
return m;
});
}
Insert cell
much_better = webRDFToJS(obj)
Insert cell
much_better
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
d3
.range(0, ob.values[0].values.length)
.map((ridx) =>
d3
.range(0, ob.values.length)
.flatMap((cidx) => ob.values[cidx].values[ridx])
)
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