almende / chap-links-library

a web based visualization library for displaying graphs, networks, and timelines
http://almende.github.com/chap-links-library
Apache License 2.0
599 stars 167 forks source link

Timeline start and end options are not taken into account #346

Open ova2 opened 9 years ago

ova2 commented 9 years ago

The docu says:

start: "The initial start date for the axis of the timeline. If not provided, the earliest date present in the events is taken as start date." end: "The initial end date for the axis of the timeline. If not provided, the latest date present in the events is taken as end date."

But you have removed in the last version the logic for this.options.start and this.options.end from the function links.Timeline.prototype.draw. We had

if (this.options && (this.options.start || this.options.end)) {
    this.setVisibleChartRange(this.options.start, this.options.end);
}

but now we have

if (this.firstDraw) {
    this.setVisibleChartRangeAuto();
}

The problem is that this.setVisibleChartRangeAuto() doesn't take start and end options into account. They are simple ignored.

josdejong commented 9 years ago

Hm passing start and end via .draw is being deprecated (you should see a deprecation warning in your console). See commit https://github.com/almende/chap-links-library/commit/15fcd8347786e687116b44544f464b69f7c6dbc5). I didn't realize this would be a breaking change, should have been published as a breaking release.

ova2 commented 9 years ago

Yes, I know this deprecation warning and I know your commit. We don't pass options via .draw due to this warning. But now, we have a problem because start and end dates are not considered. I think this is easy to fix. Thanks in advance.

josdejong commented 9 years ago

I don't expect to have time to fix this very soon, but if you could put together a PR would be great.

ova2 commented 9 years ago

Sure, I can put PR, but a little bit later (the same - no time to fix this very soon).

ova2 commented 9 years ago

Done. The pull request is here https://github.com/almende/chap-links-library/pull/351/files Thanks.