projects/dvl-fw-isi/src/lib/data-model/isi-publication.ts
constructor(data: any)
|
||||||
Parameters :
|
abstract |
Type : string
|
authors |
Type : string[]
|
Authors |
Type : Author[]
|
Decorators :
@Transient()
|
authorsAddress |
Type : string[]
|
authorsFullname |
Type : string[]
|
authorsLabel |
Type : string
|
Decorators :
@Operand(undefined)
|
defaultStyles |
Default value : defaultStyles
|
eissn |
Type : string
|
globalStats |
Type : PublicationStats
|
id |
Type : string
|
issn |
Type : string
|
issue |
Type : number
|
Journal |
Type : Journal
|
Decorators :
@Transient()
|
journalFullname |
Type : string
|
journalName |
Type : string
|
numCites |
Type : number
|
numCitesAreaSize |
Type : number
|
Decorators :
@Operand(undefined)
|
numCitesColor |
Type : string
|
Decorators :
@Operand(undefined)
|
numCitesFontSize |
Type : number
|
Decorators :
@Operand(undefined)
|
numCitesLabel |
Type : string
|
Decorators :
@Operand(undefined)
|
numCitesNorm |
Type : number
|
Decorators :
@Operand(undefined)
|
numCitesStrokeColor |
Type : string
|
Decorators :
@Operand(undefined)
|
numCitesTransparency |
Type : number
|
Decorators :
@Operand(undefined)
|
publicationType |
Type : string
|
publicationYear |
Type : number
|
publicationYearAreaSize |
Type : number
|
Decorators :
@Operand(undefined)
|
publicationYearColor |
Type : string
|
Decorators :
@Operand(undefined)
|
publicationYearFontSize |
Type : number
|
Decorators :
@Operand(undefined)
|
publicationYearLabel |
Type : string
|
Decorators :
@Operand(undefined)
|
publicationYearNorm |
Type : number
|
Decorators :
@Operand(undefined)
|
publicationYearStrokeColor |
Type : string
|
Decorators :
@Operand(undefined)
|
title |
Type : string
|
import {
areaSizeScaleNormQuantitative, colorScaleNormQuantitative, colorScaleNormQuantitativeStroke, defaultStyles,
fontSizeScaleNormQuantitative, formatNumber, formatYear, norm0to100, quantitativeTransparency, Transient,
} from '@dvl-fw/core';
import { access, chain, map, Operand } from '@ngx-dino/core';
import { Author } from './isi-author';
import { Journal } from './isi-journal';
export class PublicationStats {
numCitesMax = 0;
yearMax = 0;
yearMin = 9999;
count(publication: Publication) {
if (publication.numCites) {
this.numCitesMax = Math.max(this.numCitesMax, publication.numCites);
}
if (publication.publicationYear) {
this.yearMax = Math.max(this.yearMax, publication.publicationYear);
this.yearMin = Math.min(this.yearMin, publication.publicationYear);
}
}
}
// @dynamic
export class Publication {
id: string;
title: string;
issn: string;
eissn: string;
journalName: string;
journalFullname: string;
authors: string[];
authorsFullname: string[];
authorsAddress: string[];
publicationYear: number;
abstract: string;
publicationType: string;
issue: number;
numCites: number;
globalStats: PublicationStats;
defaultStyles = defaultStyles;
constructor(data: any) {
Object.assign(this, data);
}
@Transient
Authors: Author[];
@Transient
Journal: Journal;
@Operand<string>(chain(access<string[]>('authors'), map(s => s.join(', '))))
authorsLabel: string;
// #Cites Encodings
@Operand<number>(norm0to100('numCites', 'globalStats.numCitesMax'))
numCitesNorm: number;
@Operand<string>(chain(access('numCites'), formatNumber))
numCitesLabel: string;
@Operand<number>(chain(access('numCitesNorm'), areaSizeScaleNormQuantitative))
numCitesAreaSize: number;
@Operand<number>(chain(access('numCitesNorm'), fontSizeScaleNormQuantitative))
numCitesFontSize: number;
@Operand<string>(chain(access('numCitesNorm'), colorScaleNormQuantitative))
numCitesColor: string;
@Operand<string>(chain(access('numCitesNorm'), colorScaleNormQuantitativeStroke))
numCitesStrokeColor: string;
@Operand<number>(chain(access<number>('numCitesNorm'), quantitativeTransparency))
numCitesTransparency: number;
// First Year Encodings
@Operand<number>(norm0to100('publicationYear', 'globalStats.yearMax', 'globalStats.yearMin'))
publicationYearNorm: number;
@Operand<string>(chain(access('publicationYear'), formatYear))
publicationYearLabel: string;
@Operand<number>(chain(access('publicationYearNorm'), areaSizeScaleNormQuantitative))
publicationYearAreaSize: number;
@Operand<number>(chain(access('publicationYearNorm'), fontSizeScaleNormQuantitative))
publicationYearFontSize: number;
@Operand<string>(chain(access('publicationYearNorm'), colorScaleNormQuantitative))
publicationYearColor: string;
@Operand<string>(chain(access('publicationYearNorm'), colorScaleNormQuantitativeStroke))
publicationYearStrokeColor: string;
}