NUKnightLab / NUKnightLab/TimelineJS3

zoom_sequence option not supported via URL parameter

Open
#829 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement
Dominant language
JavaScript
Stars
3.2k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

Via ZenDesk, a user reported that a timeline URL including the fragment &zoom_sequence=[0.5,1,2,3,5,8,13,21,34,55,89] did not achieve the desired effect, and, in fact, broke the zoom function.

This is one of the exceptions noted on the options documentation page, "you can pass most of these as URL parameters" (emphasis added).

At its heart is that TimelineJS accepts most options passed in the constructor as strings (see this code). There's special handling for default_bg_color, to see if it is passed as a string.

At a minimum, the Zoom function should not fail if a String value is provided for this option. It could be rejected, or, if done safely, possibly converted into a true array. (safely means no eval of course).

Of course, this option can be passed as an array if a timeline is initialized via javascript code; the issue only arises when it is passed as a URL parameter to the embed page.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/js/timeline/Timeline.js around the constructor option handling cited in the issue, then trace zoom_sequence into the Zoom function. Check the options documentation and embed-page URL handling to reproduce the failure. Done means a URL-provided zoom_sequence no longer breaks zoom, either by safe conversion or clear rejection without eval.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.