Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when all times are coincident #88

Open
al opened this issue Sep 18, 2016 · 0 comments
Open

Errors when all times are coincident #88

al opened this issue Sep 18, 2016 · 0 comments

Comments

@al
Copy link

al commented Sep 18, 2016

If it transpires that all of your data points are coincident then beginning will equal ending and https://github.com/jiahuang/d3-timeline/blob/master/src/d3-timeline.js#L223 will become undefined causing errors like:

Error: <circle> attribute cx: Expected length, "NaN".

It's trivial to add a default window in such cases, although the choice of sensible width is not obvious.

// (after line 220)
//
// If all the times are the same, force the timeline to cover
// 12 hours on either side.
//
if (beginning === ending) {
  beginning -= (12 * 60 * 60 * 1000);
  ending += (12 * 60 * 60 * 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant