@@ -100,7 +100,7 @@ class Paper extends React.Component {
100100 const { maxSize, enlargeFactor } = this . props ;
101101 const { onClick, onMouseOver, onMouseOut } = this . props ;
102102
103- const { title, authors_string : authors , year, area } = data ;
103+ const { title, authors_string : authors , authors_list : authors_list , year, area} = data ;
104104 const { num_readers : readers , published_in : publisher } = data ;
105105 const { x, y, width : baseWidth , height : baseHeight } = this . state ;
106106 const { path : basePath , dogEar : baseDogEar } = this . state ;
@@ -168,6 +168,19 @@ class Paper extends React.Component {
168168 eventHandlers . onMouseOut = handleMouseOut ;
169169 }
170170
171+
172+ // function returns a string of authors with conditionals if the list is too long, it's cut off and an ellipsis is added
173+ // if less than maxLength authors, the full list is returned
174+ function cutAuthors ( authorsList , maxLength ) {
175+ if ( authorsList . length > maxLength ) {
176+ const firstAuthors = authorsList . slice ( 0 , maxLength - 1 ) . join ( ', ' ) ;
177+ const lastAuthor = authorsList [ authorsList . length - 1 ] ;
178+ return `${ firstAuthors } , ... ${ lastAuthor } ` ;
179+ } else {
180+ return authors
181+ }
182+ }
183+
171184 return (
172185 // html template starts here
173186 < g className = { gClass } { ...eventHandlers } >
@@ -222,7 +235,8 @@ class Paper extends React.Component {
222235 < p id = "details" className = { sizeModifierClass } >
223236 < Hyphenate >
224237 < Highlight hyphenated queryHighlight >
225- { authors }
238+ { /*{authors}*/ }
239+ { cutAuthors ( authors_list , 15 ) }
226240 </ Highlight >
227241 </ Hyphenate >
228242 </ p >
@@ -478,7 +492,7 @@ export const isNonTextDocument = (paper) => {
478492 }
479493
480494 const knownTypes = paper . resulttype . filter ( ( t ) => t . toLowerCase ( ) !== UNKNOWN_TYPE ) ;
481-
495+
482496 // the only type is unknown
483497 if ( knownTypes . length === 0 ) {
484498 return true ;
0 commit comments