• This repository has been archived on 20/Feb/2020
  • Stars
    star
    98
  • Rank 345,882 (Top 7 %)
  • Language
    JavaScript
  • License
    Other
  • Created almost 12 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Interactive timeline

Timeline

The timeline can be seen in action here

The aim of the project was to provide a reusable presentation mechanism that was easily integrated into the Wellcome Library’s content management system and other data sources. The timeline can be embedded on any page, much like a YouTube video. Instead of a video file it loads a chunk of data in JSON format that provides it with text and graphics for all the events it needs to render. Anyone who can provide a file in this format can use the timeline to render their own events.

In this example the JSON is generated from a CMS – but it could come from any data source, or even be hand-crafted. Here is an example of the same timeline component loading JSON data generated from a SPARQL query to DBpedia:

The timeline shows more events as you zoom in, smoothly expanding the canvas until there is enough room for the chosen event.

Embedding

You will notice that the Example Timeline has an 'embed' option in the bottom-left corner.

You can use the code in this panel to embed the timeline on your own website, e.g:

<div class="timeline" data-uri="/content/timelines/history-of-genetics-timeline/" data-eventid="" style="width:600px; height:600px; background-color: #000"></div>
<script type="text/javascript" src="http://wellcomelibrary.org/plugins/timeline/embed.min.js"></script><script type="text/javascript">/* wordpress fix */</script>

The timeline also supports 'deep linking' to events, where a hash value is appended to the Url as you browse e.g:

http://wellcomelibrary.org/.../genetics-timeline/#16121

##Developers

The timeline project uses a build.ps1 PowerShell script in the root of the project to combine and minify the various JavaScript files into embed.min.js and wellcomeTimeline.min.js, (right click > Run with PowerShell). You will need Google Closure Compiler - and a Java runtime - and will need to edit the build.ps1 file to point to it).

To get the project running on localhost, create a website pointing to the /src directory with a virtual directory called 'build' pointing to the /build directory.

Alternatively, to run with Visual Studio's built-in web server 'Cassini' open the /src directory as a Web Site and change the solution's Virtual Path in the properties panel to /. It is not possible to create a virtual directory to /build with Cassini, so follow the steps in the next paragraph to use the unminified scripts.

To debug individual scripts, open timeline.html, comment out wellcomeTimeline.min.js and uncomment the scripts directly underneath. Also open index.html and change the src of the script tag from build/embed.min.js to js/embed.js

Data Format

The example timeline data employs the use of Julian days. These are useful for plotting applications as they represent a calendar-independent, absolute unit of time.

However, the code controlling the main user interface only deals in moment objects.

The timeline loosely employs the Provider Model, which abstracts the date parsing out to wellcomeTimelineProvider.js.

Providers could be created to work with any arbitrary date format that can be converted to moment objects.

To change the provider, edit the provider option of the wellcomeTimeline widget in timeline.html.

Use the data-uri attribute of div.timeline to set the path to your custom data source.

Notes

The /* wordpress fix */ empty script in the embed code is for convenience when using the Wordpress WYSIWYG editor, which will otherwise strip out the script tags.

More Repositories

1

next-plugin-transpile-modules

Next plugin to allow for compilation of local modules with workspaces
JavaScript
84
star
2

player

Navigate sequences of images in a zoomable, extensible interface.
JavaScript
32
star
3

WellcomeML

Retired repository for Machine Learning utils at the Wellcome Trust (now deprecated).
Python
31
star
4

terraform-modules

Terraform modules developed at the Wellcome Trust.
HCL
27
star
5

reach

Wellcome tool to parse references scraped from policy documents using machine learning
Python
26
star
6

deep_reference_parser

A deep learning model for extracting references from text
Python
23
star
7

grants_tagger

Tag grants with MeSH and other tags
Jupyter Notebook
13
star
8

dotmailer-php

Explorify Dotmailer config
PHP
6
star
9

wsf-web-scraper

A web scraper tool to get data for evaluating Wellcome impact.
Python
5
star
10

chart-data-editor

A simple web tool to create chart data for Wellcome dynamic charts
JavaScript
5
star
11

daily-art

Daily art from the Wellcome Collection
Python
4
star
12

corporate-components

Component library for the Wellcome Trust corporate site
SCSS
3
star
13

fonts

βœ’οΈ Publicly available Wellcome fonts
3
star
14

nutrition-labels

Placeholder description: @lizgzil created this with repo-genesis
Jupyter Notebook
3
star
15

prispal

Migrating Drupal to Prismic
JavaScript
3
star
16

landing-page-generator

Landing page generator to use on S3 subdomains etc
HTML
3
star
17

upd

Understanding patient data
Twig
2
star
18

coreplayer-default-theme

CSS
2
star
19

annotation-viewer

JavaScript
2
star
20

design-system

Placeholder description: @creido-welly created this with repo-genesis
TypeScript
2
star
21

player-examples

JavaScript
2
star
22

player-tests

JavaScript
1
star
23

sage

Toolkit for easy deployment of machine learning models on AWS SageMaker
Python
1
star
24

intranet-d8

Trustnet D8
PHP
1
star
25

remote

Remote CLI to manage AWS instances
Shell
1
star
26

together-science-can

Site for the Together Science Can campaign.
CSS
1
star
27

coffeetrial

This repository contains the source code for the randomised coffee trial app created for Wellcome's 2018 Firebreak
Python
1
star
28

ncw-terraform-modules

Some reusable terrraform modules
HCL
1
star
29

wellcome_vision_assistant

A camera based assistant using AI to assist with Wellcome related tasks
Jupyter Notebook
1
star
30

img2color

Calculate dominant colours from images
JavaScript
1
star
31

ga-tracker

A JavaScript library for declarative custom event bindings for Google Analytics.
JavaScript
1
star
32

text-duplicates

CSS
1
star
33

configuration

Holds public configuration for UV etc
JavaScript
1
star
34

wellcome-design-system

CSS
1
star
35

womens-work

Revealing women's employment through text-mining the MOH London reports
Python
1
star
36

drink

Searching the collection for drink related data
JavaScript
1
star