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

Fixed issue #346 (Timeline start and end options are not taken into account) #351

Open ova2 opened 9 years ago

ova2 commented 9 years ago

Fix for https://github.com/almende/chap-links-library/issues/346 Please approve this pull request.

josdejong commented 9 years ago

Thanks for your PR Oleg.

I think though that the function setVisibleChartRangeAuto is not the right place for this logic: the function will then no longer (always) do what it's supposed to do: fit all items.

ova2 commented 9 years ago

It was working for me. What is the right place then? Somewhere here?

if (this.firstDraw) {
    // logic for start / end options
   ...
    this.setVisibleChartRangeAuto();
}

Currenty, the function setVisibleChartRangeAuto() is only called in this if (this.firstDraw). I tested all use cases and it was fine, so I can not see any problems.

josdejong commented 9 years ago

It will indeed work fine, but setVisibleChartRangeAuto is a public method which then will no longer behave as advertised.

I guess a more robust solution would be to create a new (private?) helper function for this, something like _setVisibleChartRangeInitial.