publication-timeline is an interactive CV for use by professionals in the sciences, medicine, and academia. The app allows a user to browse a large number of the author's published works in chronological order and filter publications by type and category.
The app uses a simple config object stored in config.js
to set the author name and details, as well as a list of publication types and categories. The config pulls a publication list from data.js
, which is structured to receive data from a simple spreadsheet processed through one of the many CSV-to-JSON converters available online.
This project was bootstrapped with Create React App.
npm install
to install dependencies
npm start
to initialize a test server
The config object is stored in config.js
.
- Author object - author info, displayed in the left sidebar.
- displayName string - the author's name
- degrees string - any degrees that should appear after the author's name
- institution string - university, hospital, or other affiliation
- image - a headshot or other featured image, imported in
config.js
- summary string - a text summary, revealed by clicking "About" in the sidebar
- links array - one or more link objects to include in the "About" panel
- link object
- text string - link text
- ref string - link url
- link object
- pubs - imported from
data.js
- categories array - list of all publication categories for filtering the timeline
- category string - a publication category
- types array - list of all publication types for filtering the timeline
- type string - a publication type
{
author: {
displayName: 'Firstname Lastname',
degrees: 'MD, PhD',
institution: 'Temple University',
image: img,
links: [
{
text: 'Click This Informative Link →',
ref: 'http://google.com',
},
{
text: 'This One Is Great Too →',
ref: 'http://google.com',
},
],
},
pubs: pubs,
categories: [
'all',
'Basic',
'Clinical',
'Engineering',
],
types: [
'all',
'Original Research',
'Collaborative',
'Case Report',
'Abstract',
'Book Chapter',
'Editorial',
'Poster',
'Proceeding Report',
'Patent',
'Grant',
'Other',
],
}
An array of publications is stored in data.js
.
- id number - a unique contiguous int for the publication. In a future update these will be set automatically instead of included in the config.
- title string - the title of the work
- publication string - the journal or other publication in which the work was published
- author1 string - the work's primary author
- author2 string - another author
- author3 string - another author
- moreAuthors boolean -
true
if there are more than 3 authors of the work. Displays 'et al' when the work is rendered - category string - a category that matches a category from the config array, used for filtering
- type string - a publication type that matches a type from the config array, used for filtering
- link string - a url where the user can find the work
- date number - the date of publication, used for sorting works on the timeline
- image string - an accent image to display in the summary
{
"id": 235,
"title": "Efficacy of a moon bounce for the glory of the Old Gods",
"publication": "Nature Medicine",
"author1": "Ward",
"author2": "Moore",
"author3": "",
"moreAuthors": true,
"category": "Basic",
"type": "Patent",
"link": "http://google.com",
"date": 2003,
"image": "img4"
}
The starting state is set in App.js
.
- config - config object imported from
config.js
- minYear number - the first year rendered in the timeline
- maxYear number - the last year rendered in the timeline
- matches array - the array of publications that match the type/category selected, created by
filter()
. The default values for type and category are 'all', sofilter()
will return all publications as matches on initial load. - type string - the publication type set by
selectType()
. Defaults to 'all'. - category string - the publication category set by
selectCategory()
. Defaults to 'all'. - pub number - the selected publication id, defaults to the last publication in
config.pubs
(loaded fromdata.js
) - initialLoad boolean - this value suppresses the summary panel animation on initial load
- aboutVisible boolean - about panel is visible. Toggled by
showAbout()
. Defaults tofalse
.
const startingState = {
config: config,
minYear: 1970,
maxYear: 2017,
matches: [],
type: 'all',
category: 'all',
pub: config.pubs.length,
initialLoad: true,
aboutVisible: false,
}
- showAbout() - sets
state.aboutVisible
to the opposite of its current value, showing or hiding the About panel. - filter() - iterates through the publications array, setting
publication.match
totrue
if the publication's type and category matchstate.type
andstate.category
, orfalse
if either does not match. Invoked by the<Timeline>
component; will run afterselectType()
orselectCategory()
is invoked. - selectType() - updates
state.type
- type string - the publication type the user selects from the left sidebar
- selectCategory() - updates
state.category
- category string - the publication category the user selects from the left sidebar
- getSummary - update
state.pub
, causing the summary of the selected publication to display id number - the id of the publication to display
- App - the master React app element
- Timeline - the main viewable area, which holds
<TimeEvent>
components arranged by year - TimeEvent - the element for an individual publication, containing a button that triggers the
getSummary()
event - Tags - the left sidebar element, which contains author info and type/category tags with
getType()
andgetCategory
events. This should be renamed to reflect the full scope of the element - Summary - the right sidebar element, which displays a summary of the selected publication
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.