Public
Edited
May 5, 2023
Insert cell
Insert cell
Insert cell
fos_chart(
worksWithSubjectsData.works.subjects,
gettotalWorksData.works.totalCount
)
Insert cell
fos_chart(
worksWithSubjectsData.works.subjects,
gettotalWorksData.works.totalCount
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
totalDatasetsCount = gettotalDatasets(totalCountDatasets)
Insert cell
dataWithSubjects.datasets.subjects.push({
title: "No Field of Science",
count:
totalDatasetsCount.datasets.totalCount -
dataWithSubjects.datasets.totalCount
})
Insert cell
(dataWithSubjects.datasets.totalCount /
totalDatasetsCount.datasets.totalCount) *
100
Insert cell
dataWithSubjects
Insert cell
Insert cell
// // Create an embed function that applies the loader and theme
// vegalite = function(spec) {
// return vegaEmbed(spec, {loader: vegaEmbed.vega.loader({baseURL: 'https://vega.github.io/vega/'}), theme: "quartz", actions: true})
// }
Insert cell
// vegaEmbed = require("vega-embed@6")
Insert cell
Insert cell
worksWithsubjectsqxx = `{
works: works(facetCount:100, registrationAgency:"datacite",
query: "_exists_:subjects && subjects.subjectScheme:\\"Fields of Science and Technology (FOS)\\""
) {
totalCount
subjects: fieldsOfScience{
title
count
}
}
}`
Insert cell
worksWithsubjectsq = `{
works: works(facetCount:100, registrationAgency:"datacite",
query: "_exists_:client.subjects || subjects.subjectScheme:\\"Fields of Science and Technology (FOS)\\""
) {
totalCount
subjects: fieldsOfScienceCombined{
title
count
}
}
}`
Insert cell
totalCountWorksq = `{
works(facetCount:100, registrationAgency:"datacite"
) {
totalCount
}
}`
Insert cell
worksWithSubjects = graph.query(worksWithsubjectsq)
Insert cell
worksWithSubjectsData = worksWithSubjects()
Insert cell
gettotalWorks = graph.query(totalCountWorksq)
Insert cell
gettotalWorksData = gettotalWorks()
Insert cell
(worksWithSubjectsData.works.totalCount / gettotalWorksData.works.totalCount) *
100
Insert cell
((worksWithSubjectsData.works.totalCount + 3930414) /
gettotalWorksData.works.totalCount) *
100
Insert cell
worksWithSubjectsData.works.subjects.push({
title: "No Field of Science",
count:
gettotalWorksData.works.totalCount - worksWithSubjectsData.works.totalCount
})
Insert cell
Insert cell
dataCsv = FileAttachment("mydata2-fos - Sheet1.csv").csv()
Insert cell
mydata2-fos - Sheet1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
mydata2-fos -post.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
datacsvPost = FileAttachment("mydata2-fos -post.csv").csv()
Insert cell
std_stacked_chart2(datacsvPost.flat())
Insert cell
dataCsv.flat()
Insert cell
import { std_stacked_chart2 } from "@kjgarza/vega-charts"
Insert cell
import { fos_chart } from "@kjgarza/vega-charts"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more