TimelineJS options
When you create a timeline manually by calling TL.Timeline
, you may pass in an optional third parameter which contains a variety of presentation options. This third parameter should be a Javascript object with keys matching
the value in the Name
column and corresponding values appropriate to the specific key. For example:
var options = { hash_bookmark: false, initial_zoom: 5 } var timeline = new TL.Timeline('timeline-embed', 'https://docs.google.com/spreadsheets/d/1cWqQBZCkX9GpzFtxCWHoqFXCHg-ylTVUWlnrdYMzKUI/pubhtml', options);
If you use our authoring tool, you can pass most of these as URL parameters. Add &option_name=value
for each. To demonstrate using the same options as above: https://cdn.knightlab.com/libs/timeline3/latest/embed/index.html?source=1cWqQBZCkX9GpzFtxCWHoqFXCHg-ylTVUWlnrdYMzKUI&font=Default&lang=en&initial_zoom=3&height=650&hash_bookmark=false
font
default
May be one of a list of Timeline's "built-in" font sets, or a full or relative URL (ending in .css) which points to a CSS file in the same format as the built-ins. (See the typography section of "Overriding Timeline's Styles")
The valid values for the built-in fonts are:
abril-droidsans
amatic-andika
bevan-pontanosans
bitter-raleway
clicker-garamond
dancing-ledger
default
fjalla-average
georgia-helvetica
lustria-lato
medula-lato
oldstandard
opensans-gentiumbook
playfair-faunaone
playfair
pt
roboto-megrim
rufina-sintony
ubuntu
unicaone-vollkorn
debug
false
true
, copious console logging will be enabled.
height
this._el.container.offsetHeight
width
this._el.container.offsetWidth
is_embed
false
true
, the class tl-timeline-embed
is added to the outer Timeline container. Typically only used to support Timeline iframe embeds.
hash_bookmark
false
true
, TimelineJS will update the browser URL each time a slide advances, so that people can link directly to specific slides.
default_bg_color
white
r
, g
, and b
properties from 0-255.
scale_factor
initial_zoom
zoom_sequence
series used to scale the Timeline when it is first created. Takes precedence over scale_factor
.
zoom_sequence
scale_factor
, which means that at any given level, the full timeline would require that many screens to display all events.
timenav_position
top
or bottom
.
optimal_tick_width
base_class
timenav_height
timenav_height_percentage
.
timenav_height_percentage
timenav_mobile_height_percentage
timenav_height_min
marker_height_min
marker_width_min
marker_padding
start_at_slide
start_at_end
false
menubar_height
use_bc
false
duration
ease
TL.Ease.easeInOutQuint
dragging
true
trackResize
true
slide_padding_lr
slide_default_fade
language
Value should be a language code for a translation set included with TimelineJS. See
the
Github repository for the set of supported language codes—to use these, specify the filename without the .json
extension.
Alternatively, you can create your own translation file, for other languages or simply to override the default messages. To do this, specify a URL to a file based on en.json
.
Your URL must end in .json
.
ga_measurement_id
ga_property_id
ga_measurement_id
which better matches Google Analytics 4 (GA4) language. For now, if ga_property_id
is set and ga_measurement_id
is not, then ga_property_id
will be used, even though the code is designed for GA4.
track_events
script_path
soundcite
false
If this option is set to true
, then TimelineJS will load the code necessary to support clips created using Knight Lab's SoundciteJS. This eliminates the need to add the embed code shown in step 3 of the Soundcite authoring tool. Simply copy the per-clip markup from step 2 into the "text" field for any TimelineJS event.
Note that while the default value for this option is false
, for timelines hosted on Knight Lab's systems, the value is set to true for ease of use.