Public
Edited
Jun 26, 2023
1 fork
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
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
validDate = d => d instanceof Date && !isNaN(d)
Insert cell
readBook = d => validDate(dateRead(d))
Insert cell
allSubjects = extractSubjectsByType("subjects")
Insert cell
Insert cell
allPeople = extractSubjectsByType("subject_people")
Insert cell
cvsFileName = "goodreads_library_export (6).csv"
Insert cell
Insert cell
Insert cell
olIdentifier = (d) => d?.identifiers?.openlibrary?.[0]
Insert cell
/*
WIP trying to get the LIC# from differnet editions but the OL editions API doesn't seem to work.
source: https://openlibrary.org/dev/docs/restful_api
*/

// bookDataDefClss = Promise.all(goodreadsData.slice(0, 5).map(async(grData, i) => {
// const isbn = extractIsbn(grData)

// const openLibraryDataResponse = await d3Fetch.json(openLibraryApi(isbn))
// const isbnKeys = Object.keys(openLibraryDataResponse)
// const openLibraryData = isbnKeys.length ? openLibraryDataResponse[isbnKeys[0]] : {}
// console.log(i, isbn, grData, openLibraryData, lcClassification(openLibraryData), lcClassification(openLibraryData) == undefined )
// if(lcClassification(openLibraryData) == undefined) {
// const olId = olIdentifier(openLibraryData)
// const editionsAPI = `https://openlibrary.org/works/${olId}/editions.json?limit=5`
// const editions = await d3Fetch.json(editionsAPI)
// console.log('editions!!!', editions)
// }
// return {...grData, ...openLibraryData}
// }))

Insert cell
Insert cell
Insert cell
noLIC.filter(d => extractIsbn(d.ISBN))
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
Insert cell
Insert cell
publicationDate = d => parseInt(d["Original Publication Year"])
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