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

Some values of max and min zoom not allowing to initialize Timeglider correctly #51

Open
psanchez-zRed opened this issue Jun 7, 2012 · 1 comment

Comments

@psanchez-zRed
Copy link

Hi! First of all, thank you for building this awesome plugin! :)

Well, let's go to the point. The plugin is working well with the default zoom levels included in the demos. But I want to set a "three days" zoom in my timeline by default, allowing user to zoom until a week view, so I have been testing the plugin with different zoom levels.

To achieve this, I made some tests in the table.html demo page changing the zoom values to:

        var tg1 = $("#placement").timeline({
                "min_zoom":10, 
                "max_zoom":30, 
                // data source is the id of the table!
                "data_source":"#mylife"
        });

or

        var tg1 = $("#placement").timeline({
                "min_zoom":10, 
                "max_zoom":11, 
                // data source is the id of the table!
                "data_source":"#mylife"
        });

But when I go to the browser the timeline is empty. There are no ticks or timeslots at all. These are some screenshots on Firefox and Chrome:

![Firefox](http://ompldr.org/vZTVhdA/Timeglider jQuery Widget: Basic Demo - Mozilla Firefox_026.png)

![Chrome](http://ompldr.org/vZTVhdg/Timeglider jQuery Widget: Basic Demo - Google Chrome_027.png)

However, after changing the zoom manually (clicking on the zoom bar), the timeline redraws itself and now it displays correctly. Maybe a workaround for me could be call the goTo() function at start. I have to test this solution.

I experimented this issue in the previous version, but it also appears in the last version (0.1.4).

Thank you very much and sorry for my bad english.
Greetings from Spain.

Pedro S.

@psanchez-zRed
Copy link
Author

Well, my workaround is working well. Doing this call after Timeglider creation solves the problem and draws the timeline correctly at start:

    $('#placement').data('timeline').goTo('today',10);

This could be included as option, something like initial_zoom and initial_day :)

Pedro S.

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