(elem, data, options)
| 61 | */ |
| 62 | class Timeline { |
| 63 | constructor(elem, data, options) { |
| 64 | if (!options) { |
| 65 | options = {} |
| 66 | } |
| 67 | this.ready = false; |
| 68 | this._el = { |
| 69 | container: DOM.get(elem), |
| 70 | storyslider: {}, |
| 71 | timenav: {}, |
| 72 | menubar: {} |
| 73 | }; |
| 74 | |
| 75 | if (options.lang && !options.language) { |
| 76 | options.language = options.lang; |
| 77 | } |
| 78 | |
| 79 | /** @type {Language} */ |
| 80 | this.language = fallback; |
| 81 | |
| 82 | /** @type {StorySlider} */ |
| 83 | this._storyslider = {}; |
| 84 | |
| 85 | /** @type {TimeNav} */ |
| 86 | this._timenav = {}; |
| 87 | |
| 88 | /** @type {MenuBar} */ |
| 89 | this._menubar = {}; |
| 90 | |
| 91 | // Loaded State |
| 92 | this._loaded = { storyslider: false, timenav: false }; |
| 93 | |
| 94 | /** @type {TimelineConfig} */ |
| 95 | this.config = null; |
| 96 | |
| 97 | this.options = { |
| 98 | script_path: "https://cdn.knightlab.com/libs/timeline3/latest/js/", // as good a default as any |
| 99 | height: this._el.container.offsetHeight, |
| 100 | width: this._el.container.offsetWidth, |
| 101 | debug: false, |
| 102 | font: 'default', |
| 103 | is_embed: false, |
| 104 | is_full_embed: false, |
| 105 | hash_bookmark: false, |
| 106 | default_bg_color: { r: 255, g: 255, b: 255 }, |
| 107 | scale_factor: 2, // How many screen widths wide should the timeline be |
| 108 | layout: "landscape", // portrait or landscape |
| 109 | timenav_position: "bottom", // timeline on top or bottom |
| 110 | optimal_tick_width: 60, // optimal distance (in pixels) between ticks on axis |
| 111 | base_class: "tl-timeline", // removing tl-timeline will break all default stylesheets... |
| 112 | timenav_height: null, |
| 113 | timenav_height_percentage: 25, // Overrides timenav height as a percentage of the screen |
| 114 | timenav_mobile_height_percentage: 40, // timenav height as a percentage on mobile devices |
| 115 | timenav_height_min: 175, // Minimum timenav height |
| 116 | marker_height_min: 30, // Minimum Marker Height |
| 117 | marker_width_min: 100, // Minimum Marker Width |
| 118 | marker_padding: 5, // Top Bottom Marker Padding |
| 119 | start_at_slide: 0, |
| 120 | start_at_end: false, |
nothing calls this directly
no test coverage detected