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

Zoom plots scaling #352

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Indigo744
Copy link
Collaborator

Fix #253

Implements a feature asked by several users: automatically scale down plots on zooming.

There are 2 hard parts in this feature:

  • Handling of SVG plots, because they already have their own transforms...
  • Handling of stroke-width when scaling (Raphael does not scale down the stroke-width when applying a transform). I had to introduce a special check in anim function to scale down stroke-width when we are zooming and scaling.

Plot scaling is disabled by default.

I've updated two examples to use plots scaling.

@Indigo744 Indigo744 mentioned this pull request Nov 9, 2017
8 tasks
@neveldo
Copy link
Owner

neveldo commented Nov 11, 2017

Wonderful new feature @Indigo744 !!

I have first checked the examples you provided. I think I have found a little error in the behavior in transformations_on_svg_plots.html by following this events :

1 / Zoom on the map
2 / Reset zoom level
3 / Click on "update elements"
4 / Re-zoom on the map

It seems that the SVG transform is lost when applying the last zoom.

Otherwise, it seems to work like a charm !

@Indigo744
Copy link
Collaborator Author

Damn... I though I had it working 🤦‍
I'll check it ASAP

@Indigo744
Copy link
Collaborator Author

I don't know why but I checked for a minimum zoom level before applying plot scaling. That should work now... 😃

@Indigo744
Copy link
Collaborator Author

Indigo744 commented Nov 11, 2017

Those SVG plots were real bitches! 🙄

Copy link
Owner

@neveldo neveldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reviewed the code, all seems to be good to me, great great work !!!! I saw that you had to deal with SVG plots, user defined transforms, stroke width, but at the end, the result is quite perfect !

I have still found another very little bug, but I don't know if it worth fixing it : if I zoom-in and hover a plot in the same time, it seems that the stroke-width is not properly update.

Not a bug but : maybe we could keep in mind to handle the scaling for links in the same way because for now, the links will keep growing when zooming but not the plots.

@Indigo744
Copy link
Collaborator Author

There is actually a remaining bug that I should tackle... Wait for the update 😅

@neveldo
Copy link
Owner

neveldo commented Nov 12, 2017

No problem, i'm waiting for it ;)

@Indigo744
Copy link
Collaborator Author

Damn, coming back to it several month after and I can't remember what was that bug...

@neveldo neveldo mentioned this pull request Apr 9, 2018
6 tasks
@neveldo
Copy link
Owner

neveldo commented Apr 9, 2018

Hi @Indigo744 ,

I will take the time to re-check your feature in all the possible ways as soon as possible. I hope we will find what was missing :)

Maybe it was related to this ?

I have still found another very little bug, but I don't know if it worth fixing it : if I zoom-in and hover a plot in the same time, it seems that the stroke-width is not properly update.

@neveldo
Copy link
Owner

neveldo commented Apr 21, 2018

HI @Indigo744 ,

Sorry for my late answer. I ended up to take the time to re-check your great new feature, under Firefox and Chrome, and for my part, I didn't found anything else than the minor bug with the stroke width when zooming with the cursor on a plot !

@SarikaWirtz
Copy link

Hello, i am still struggling to scale plots. Any help will be appriciated.

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

Successfully merging this pull request may close these issues.

Disable plots zooming
3 participants