MCPcopy
hub / github.com/NUKnightLab/TimelineJS3 / _getTimeScale

Method _getTimeScale

src/js/timenav/TimeNav.js:178–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176 /* TimeScale
177 ================================================== */
178 _getTimeScale() {
179 /* maybe the establishing config values (marker_height_min and max_rows) should be
180 separated from making a TimeScale object, which happens in another spot in this file with duplicate mapping of properties of this TimeNav into the TimeScale options object? */
181 // Set Max Rows
182 var marker_height_min = 0;
183 try {
184 marker_height_min = parseInt(this.options.marker_height_min);
185 } catch (e) {
186 trace("Invalid value for marker_height_min option.");
187 marker_height_min = 30;
188 }
189 if (marker_height_min == 0) {
190 trace("marker_height_min option must not be zero.")
191 marker_height_min = 30;
192 }
193 this.max_rows = Math.round((this.options.height - this._el.timeaxis_background.offsetHeight - (this.options.marker_padding)) / marker_height_min);
194 if (this.max_rows < 1) {
195 this.max_rows = 1;
196 }
197 return new TimeScale(this.config, {
198 display_width: this._el.container.offsetWidth,
199 screen_multiplier: this.options.scale_factor,
200 max_rows: this.max_rows
201
202 });
203 }
204
205 _updateTimeScale(new_scale) {
206 this.options.scale_factor = new_scale;

Callers 3

updateDisplayMethod · 0.95
_drawTimelineMethod · 0.95
_updateDrawTimelineMethod · 0.95

Calls 1

traceFunction · 0.90

Tested by

no test coverage detected