Skip to content

Commit

Permalink
Merge pull request #422 from datacite/schema-4.6-2
Browse files Browse the repository at this point in the history
Support Schema 4.6 features
  • Loading branch information
codycooperross authored Nov 26, 2024
2 parents 499ee5a + 11ada9f commit e73f659
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/data/color_palettes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const otherRange = [ 'gray', 'black' ]
export const resourceTypeDomain = [
...otherDomain,
'Audiovisual',
'Award',
'Book',
'Book Chapter',
'Collection',
Expand Down Expand Up @@ -44,6 +45,7 @@ export const resourceTypeDomain = [
export const resourceTypeRange = [
...otherRange,
'#AEC7E8',
'#D4AF37',
'#FF7F0E',
'#FFBB78',
'#D62728',
Expand Down
17 changes: 4 additions & 13 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,13 @@ export function isDMP(work: WorkMetadata) {

export function isProject(work: WorkMetadata) {
return (
work.types.resourceType === 'Project' &&
(work.types.resourceTypeGeneral === 'Other' ||
work.types.resourceTypeGeneral === 'Text')
(work.types.resourceType === 'Project' &&
(work.types.resourceTypeGeneral === 'Other' ||
work.types.resourceTypeGeneral === 'Text')) ||
work.types.resourceTypeGeneral === 'Project'
)
}

export function isAwardGrant(work: WorkMetadata) {
return (
(work.types.resourceType === 'Award' ||
work.types.resourceType === 'Grant') &&
(work.types.resourceTypeGeneral === 'Other' ||
work.types.resourceTypeGeneral === 'Text')
)
}


function getTotalCount(sum: number, data: HorizontalBarRecord) { return sum + data.count }

export function getTopFive(data: HorizontalBarRecord[]) {
Expand Down

0 comments on commit e73f659

Please sign in to comment.