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 : 12982  
 
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 AND DEVELOPMENT.

 
 
 

Related Posts

How to upload files to the server using JavaScript

In this tutorial we are going to see how you can upload files to a server using Node.js using JavaScript, which is very common. For example, you might want to…

How to combine multiple objects in JavaScript

In JavaScript you can merge multiple objects in a variety of ways. The most commonly used methods are the spread operator ... and the Object.assign() function.   How to copy objects with…

The Payment Request API: Revolutionizing Online Payments (Part 2)

In the first part of this series, we explored the fundamentals of the Payment Request API and how it simplifies the payment experience. Now, let's delve deeper into advanced features…

The Payment Request API: Revolutionizing Online Payments (Part 1)

The Payment Request API has emerged as the new standard for online payments, transforming the way transactions are conducted on the internet. In this two-part series, we will delve into…

Let's create a Color Picker from scratch with HTML5 Canvas, Javascript and CSS3

HTML5 Canvas is a technology that allows developers to generate real-time graphics and animations using JavaScript. It provides a blank canvas on which graphical elements, such as lines, shapes, images…

How do you stop JavaScript execution for a while: sleep()

A sleep()function is a function that allows you to stop the execution of code for a certain amount of time. Using a function similar to this can be interesting for…

Mastering array sorting in JavaScript: a guide to the sort() function

In this article, I will explain the usage and potential of the sort() function in JavaScript.   What does the sort() function do?   The sort() function allows you to sort the elements of…

Infinite scrolling with native JavaScript using the Fetch API

I have long wanted to talk about how infinite scroll functionality can be implemented in a list of items that might be on any Web page. Infinite scroll is a technique…

Sorting elements with SortableJS and storing them in localStorage

SortableJS is a JavaScript extension that you will be able to use in your developments to offer your users the possibility to drag and drop elements in order to change…

What is a JWT token and how does it work?

JWT tokens are a standard used to create application access tokens, enabling user authentication in web applications. Specifically, it follows the RFC 7519 standard. What is a JWT token A JWT token…

Template Literals in JavaScript

Template literals, also known as template literals, appeared in JavaScript in its ES6 version, providing a new method of declaring strings using inverted quotes, offering several new and improved possibilities. About…

How to use the endsWith method in JavaScript

In this short tutorial, we are going to see what the endsWith method, introduced in JavaScript ES6, is and how it is used with strings in JavaScript. The endsWith method is…

Clicky