Skip to content
New issue

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

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

Already on GitHub? # to your account

Jquery easing #261

Closed
catlabs opened this issue Sep 2, 2016 · 12 comments
Closed

Jquery easing #261

catlabs opened this issue Sep 2, 2016 · 12 comments

Comments

@catlabs
Copy link

catlabs commented Sep 2, 2016

Hi,

I would like to know what's the best way to integrate jquery easing functionalities when zooming into the map. I think the linear easing it's not the best but a easeOutQuad for instance might work better.

Any suggestions?

@tammo0
Copy link

tammo0 commented Sep 2, 2016

As far as i know the easing works with RaphaelJS.
Take a look at line 51-53 at my jsfiddle: https://jsfiddle.net/t36y5mh3/
The RaphaelJS reference can be found here: http://dmitrybaranovskiy.github.io/raphael/reference.html#Raphael.easing_formulas

@catlabs
Copy link
Author

catlabs commented Sep 2, 2016

Allright, didn't notice this parameter, great!

@catlabs
Copy link
Author

catlabs commented Sep 2, 2016

In fact it works ok with a mouse but with a trackpad, at least on mac it is not smooth at all. It waits like half a second before it zoom.

@tammo0
Copy link

tammo0 commented Sep 2, 2016

Yep, i got the same issue even with mousewheel. Perhaps its a performance problem on maps with lots of plots?

@catlabs
Copy link
Author

catlabs commented Sep 2, 2016

Well , for instance no plots on the map I am using and also on the fiddle you gave me:
https://jsfiddle.net/t36y5mh3/
Only 2 plots and same issue

@tammo0
Copy link

tammo0 commented Sep 2, 2016

for me its much smoother with a higher step-value like 1.25: (line 49)
https://jsfiddle.net/t36y5mh3/1/

@catlabs
Copy link
Author

catlabs commented Sep 2, 2016

Still this latency before zoom starting for me. Seems like the trackpad increment the wheel much more that a simple mouse wheel. Difficult to handle in js cause it can't check which device is being used but maybe adding a condition when wheel increment is too big can make it...

@tammo0
Copy link

tammo0 commented Sep 2, 2016

i think i'll use step: 1.25, animDuration: 1000 and ease-in-out. at least feels a bit smoother: https://jsfiddle.net/t36y5mh3/4/

@catlabs
Copy link
Author

catlabs commented Sep 2, 2016

yeah you're right :-)

Thanks dude!

@neveldo
Copy link
Owner

neveldo commented Sep 5, 2016

Hi,

You are right, zooming into SVG is a little costly for the browser, so it can be slow with low configurations or mobile devices. I didn't found a fix for now, but feel free to contribute if you can !

@Indigo744
Copy link
Collaborator

The zoom functionality might need some rework indeed.

For instance, instead of setInterval to animate the viewPort, maybe use requestAnimationFrame where possible (recent browsers).

@Indigo744
Copy link
Collaborator

@Cat-Labs @tammo0 can you check on the new Zoom algorithm? See linked PR.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants