Timeline.js
Timeline.js is a small JavaScript module for drawing a timeline diagram using SVG. It provides a way to represent the interactions, merges, splits, appearance, and disappearance of elements over time. Those elements could represent media, software projects, organisations, and so on. Events can be added on the timeline and on particular entries to mark interesting points.
For example, the timeline below represents how Linux desktop environments have developed since the mid-1990s.
Key features
- Draw connections between entries with SVG, based on provided attributes
- Add expandable event markers to the timeline – either along the date-line or on a specific entry
- Optional panning and zooming functionality and control buttons (using @panzoom/panzoom)
- Optional search filters entries by name and pans to and highlights the entry
- Position all entries automatically, or set some manually for more fine-grained control of the diagram
- Group entries without a direct connection to position them in the same segment of the timeline
Timeline.js takes a set of entries and uses their defined attributes to determine their position and connections to other entries, which are then drawn with SVG. It can also include a set of events, which will show an expandable information marker, either on the date line or on a specific entry. Both entries and events can be added either using data-
attributes, or passed as javascript objects when creating the diagram. The example above is created with the following HTML:
Example
<!--Timeline entries-->
KDE
KDE Plasma
Trinity Desktop Environment
Budgie
GNOME
Cinnamon
MATE
XFCE
LXDE
LXDE
LXQT
Razor-qt
Enlightenment
Moksha Desktop
<!--Events-->
X.org is founded as a fork of XFree86.
The Wayland project was started.
Gnome 3.0 was released.
KDE 4 was released.
The Timeline above is created with this JavaScript:
const = new;
;
Note: the panzoom feature requires @panzoom/panzoom to be included. This is not bundled, and defaults to null
.
You'll find complete documentation of the entries, events and JavaScript configuration in the README file in the Git repository. Timeline.js is available under the GPLv3 licence.