diff --git a/src/data/reviews.json.ts b/src/data/reviews.json.ts index 0092773..aa0b28d 100644 --- a/src/data/reviews.json.ts +++ b/src/data/reviews.json.ts @@ -27,6 +27,7 @@ const Reviews = Schema.Array( preprint: Doi.ParseDoiSchema, language: Schema.OptionFromUndefinedOr(LanguageCode.LanguageCodeSchema), live: Schema.Boolean, + requested: Schema.Boolean, server: PreprintServer.PreprintServerSchema, type: Schema.Literal('full', 'structured', 'rapid'), }), @@ -96,6 +97,7 @@ const getLegacyRapidReviews = Effect.gen(function* () { language: Option.some('en'), live: false, preprint: review.preprint.handle, + requested: false, server: review.preprint.preprintServer, type: 'rapid', }) satisfies Schema.Schema.Type[number], @@ -122,6 +124,7 @@ const getLegacyReviews = Effect.gen(function* () { language: Option.some('en'), live: false, preprint: review.preprint.handle, + requested: false, server: review.preprint.preprintServer, type: 'full', }) satisfies Schema.Schema.Type[number], diff --git a/src/reviews.md b/src/reviews.md index 3564c0f..293d961 100644 --- a/src/reviews.md +++ b/src/reviews.md @@ -12,7 +12,6 @@ const languageNames = new Intl.DisplayNames(['en-US'], { type: 'language' }) const languageName = code => (code ? languageNames.of(code) : 'Unknown') const preprintServers = FileAttachment('./data/preprint-servers.json').json() -const requests = FileAttachment('./data/requests.json').json() const reviews = FileAttachment('./data/reviews.json') .json() .then(data => data.map(review => ({ ...review, createdAt: parseDate(review.createdAt) }))) @@ -22,7 +21,6 @@ const reviews = FileAttachment('./data/reviews.json') const now = new Date() const firstReview = d3.min(reviews, review => review.createdAt) -const preprintsWithRequest = new d3.InternSet(d3.group(requests, request => request.preprint).keys()) const preprintServerName = id => preprintServers[id] const reviewType = id => { @@ -62,9 +60,7 @@ const reviewsInTimePeriod = chosenYear ? reviews.filter(review => review.createdAt.getUTCFullYear() === chosenYear) : reviews -const reviewsWithRequest = chosenRequest - ? reviewsInTimePeriod.filter(review => preprintsWithRequest.has(review.preprint)) - : reviewsInTimePeriod +const reviewsWithRequest = chosenRequest ? reviewsInTimePeriod.filter(review => review.requested) : reviewsInTimePeriod const reviewsSelected = chosenType ? reviewsWithRequest.filter(review => review.type === chosenType)