Create stunning timelines with Timeline.js

by Janeth Kent Date: 04-05-2021 javascript timeline coding

Timelines are complicated but effective tools for showing large amounts of data. TimelineJS removes the pain

TimelineJS  is an easy-to-use JavaScript library, both for user and developer. It can be as easy as embedding an iframe onto your page using the embed generator with a Google Doc spreadsheet, or as complicated as dynamically adding in your own events based on external sources; we’re going to opt for the latter..

If you’re looking for an easy way to include a timeline in your site, this may well be perfect. 

Beginners can create a timeline using nothing more than a Google spreadsheet. Experts can use their JSON skills to create custom installations, while keeping TimelineJS's core functionality.

TimelineJS can pull in media from a variety of sources. Twitter, Flickr, YouTube, Vimeo, Vine, Dailymotion, Google Maps, Wikipedia, SoundCloud, Document Cloud and more!

Why you might use Timeline JS to Teach: 

  • Timeline can integrate images, text, websites, and more to clearly communicate concepts and stories.  
  • Timeline JS can present information chronologically or can be used to create non-chronological narratives in the form of storybooks or virtual museums.  

Tips & tricks

  1. Keep it short. We recommend not having more than 20 slides for a reader to click through.
  2. Pick stories that have a strong chronological narrative. It does not work well for stories that need to jump around in the timeline.
  3. Write each event as a part of a larger narrative.
  4. Include events that build up to major occurrences — not just the major events.

How to use it (Make a Timeline):

You’ll need: 

  • A google account  
  • A rough outline of your timeline with dates, brief text, and sources (images, maps, video, etc.) Knight Lab recommends users limit their timelines to approximately 20 slides to not overwhelm viewers.  
  • See the Timeline JS  giude on supported media types for guidance. [Note: Timeline JS does not like pdfs] 

Let’s Begin: 

  • Start at the Timeline JS page on the Knight Lab site.
  • Click “Make a Timeline” on the main site 
  • Click “Get the spreadsheet template.” Timeline JS will require you to make a copy of their Google spreadsheet to proceed.  
  • Click “make a copy” 
  • The spreadsheet will appear with sample information. Highlight these cells and click “delete.” Do not delete row 1 which includes headings you will need to organize your timeline (Year, Month, Day, . . . Headline, Text, etc.).
  • Understand categories and plan your timeline:
    • The first row in blue represents the title page of your timeline and need not have an associated date.  
    • Year/Month/Date/Time represent boxes to input the dates of events.   
    • The “Display Date” heading represents the date as you would like to appear. For example if you enter the date in the Year/Month/Date headings as 2006/1/1 but would like the date to appear on your slide as “January 1st, 2006” enter it as such in the “Display Date.” Text entered in the “Display Date” will supersede any dates entered in the Year/Month/Date/Categories.  
    • “Display Date” is also the heading where users can enter “Page 1” or other organizing terms to use Timeline to make a non-chronological story.   
  • Under media, you can add Google Maps, URLs [ Flickr, Instagram, Spotify, Twitter, Vimeo, YouTube, Wikipedia], etc. 
    • To find images that comply with usage rights, do a google image search for a desired subject. When the search produces results, click “Tools” and then “Usage Rights” in the toolbar to filter for images labelled for reuse.  
    • To streamline the process of adding images, you can right click on an image, and select “copy image address” and add that to the related box. Be sure to credit the image source in the “Media Credit” box.  
  • When you’ve completed your entries, select “File” and then “Publish to the Web.
  • In the next window, change the menu that reads “entire document” to “od1.” Then, click the blue “publish” button. When asked, “Are you sure…?” click OK. Ignore the URL that appears in the center of the window. Just close the window using the X in the top right corner. 
  • After you close the window, copy the URL in your browser’s address bar. You’ll use this in the next step. 
  • Return to the Timeline page and proceed to Step 3, “Generate Your Timeline.”  Paste your URL into the box labelled “Google Spreadsheet URL.”
  • Scroll down to Step 4 and select “Preview” to see you Timeline. You will find the link and embed code to share your work there.  
  • To see these instruction in practice, check out this video tutorial from Knight Lab.  

by Janeth Kent Date: 04-05-2021 javascript timeline coding hits : 8601  
Janeth Kent

Janeth Kent

Licenciada en Bellas Artes y programadora por pasión. Cuando tengo un rato retoco fotos, edito vídeos y diseño cosas. El resto del tiempo escribo en MA-NO WEB DESIGN END DEVELOPMENT.


Related Posts

Strings in JavaScript: What they are and how to use them

In this tutorial we are going to explain what strings are and how they are used in JavaScript. The tutorial is intended for people who are learning to program in…

Dates in local format with Javascript

In the articles we have about dates in JavaScript we were missing one about how to create dates in local format with JavaScript. That is to say, being able to…

Formatting hours in Javascript

Continuing with the set of articles that talk about internationalisation elements, like the previous one where we talked about relative dates in JavaScript, we will see in this one how…

Request data with prompt in JavaScript

After having published several articles about how to manipulate arrays and dates, today I will publish a post that some of you will find too basic and others will find…

Relative dates in JavaScript

One of the interesting things about the internationalisation library represented in the Int object is the handling of relative dates in Javascript. This handling allows us to represent a date…

How to access webcam and grab an image using HTML5 and Javascript

We often use webcams to broadcast video in real time via our computer. This broadcast can be viewed, saved and even shared via the Internet. As a rule, we need…

The JavaScript forEach loop

We have already talked about how to handle some of loops  types in Javascript including for, for-in and for-off loops. In the case of today we are going to see how…

What are React Hooks and what problems they solve

Working with React, - and before the release of Hooks in version 16.8 -  there was always the possibility to create components in three different ways based on a number of…

Flattening arrays in JavaScript

When we are handling arrays that are arrays or have multiple dimensions it can be very useful to know how to flatten arrays in JavaScript. That is to say, to…

How to populate an array with random numbers in JavaScript

Some of you might think that what we explained in the article on how to populate an array with numbers, apart from the didactic part, would not have much applicability…

How to populate an array with numbers in JavaScript

Populate an array with numbers in JavaScript The first step is to initialise the array. So today we are going to see a simple way to do it and see how…

Top Javascript Libraries and Frameworks Part 2

What are JavaScript frameworks?   JavaScript frameworks are application frameworks that allow developers to manipulate code to meet their particular needs. Web application development is like building a house. You have the option…

We use our own and third-party cookies to improve our services, compile statistical information and analyze your browsing habits. This allows us to personalize the content we offer and to show you advertisements related to your preferences. By clicking "Accept all" you agree to the storage of cookies on your device to improve website navigation, analyse traffic and assist our marketing activities. You can also select "System Cookies Only" to accept only the cookies required for the website to function, or you can select the cookies you wish to activate by clicking on "settings".

Accept All Only sistem cookies Configuration