Public
Edited
Sep 26, 2023
Insert cell
Insert cell
part-000001.json
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
part000002 = FileAttachment("part-000002.json").json()
Insert cell
Object.keys(part000001)
Insert cell
by_artist = allPartsParsed.filter(t=> t.p.indexOf(' by ')>-1)
Insert cell
prompt_artist = allPartsParsed.filter(t=> t.p.indexOf('volumetric lighting')>-1)
Insert cell
by_artist[0].p
Insert cell
allPartsParsed.filter(t=> t.p.indexOf('cat ')>-1)

Insert cell
allPartsParsed = parseAllParts( [part000001, part000002, part000003, part000004, part000005, part000006, part000007])
Insert cell
function parseAllParts(arr){
const parsedParts = arr.map( (part, partID) => {
const keysArr = Object.keys(part);
const prompt_arr = Object.values(part).map((a, id) => ({...a, id: `./part-00000${partID+1}/`+keysArr[id]}))
return prompt_arr
})
return [].concat(...parsedParts)
}
Insert cell
part000001= FileAttachment("part-000001@1.json").json()
Insert cell
part000003 = FileAttachment("part-000003.json").json()
Insert cell
part000004 = FileAttachment("part-000004@1.json").json()
Insert cell
part000005 = FileAttachment("part-000005.json").json()
Insert cell
part000006 = FileAttachment("part-000006.json").json()
Insert cell
part000007 = FileAttachment("part-000007.json").json()
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