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

Implement state for zoom and search #198

Merged
merged 13 commits into from
Aug 31, 2021
Merged

Conversation

versable
Copy link
Contributor

@versable versable commented Feb 18, 2019

Hey @brendangregg,

looking through old PRs I found #134 very interesting. I have implemented a history safe (meaning the browsers back and forward functions won't interfere) solution that "safes" the zoom and/or search state.

It basically uses CSS attribute selectors[1] to match a frame ([x=100][y=200]) and uses GET parameters using the history API[2] to "store" the current zoom/search state.

Cheers,

Mike

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
[2] https://developer.mozilla.org/en-US/docs/Web/API/History_API

@versable
Copy link
Contributor Author

versable commented Feb 19, 2019

Hey @brendangregg, would you prefer this functionality to be enabled/disabled per parameter switch (something like --state/--nostate, depending on which behavior is preferred) if you were to accept this PR?

AnderEnder added a commit to AnderEnder/inferno that referenced this pull request Apr 12, 2019
AnderEnder added a commit to AnderEnder/inferno that referenced this pull request Apr 13, 2019
jonhoo pushed a commit to jonhoo/inferno that referenced this pull request Apr 15, 2019
@brendangregg
Copy link
Owner

I tried this out and it's great, thanks -- solves the problem without increasing the SVG size. If you have a chance, can you do the resolve conflicts, and also make it so if I click the "all" frame at the bottom it shouldn't put stuff in the URL as that's essentially clearing the zoom.

I thought there was a perf regression as zooming was slower with this change, and Chrome profiling showed a lot more time in GC, but I now think it was just a tab that was out of memory. Opening it again in a new tab and it was fast again. Huh.

@versable
Copy link
Contributor Author

versable commented Mar 2, 2020

@brendangregg Done

@versable
Copy link
Contributor Author

@brendangregg still interested?

@brendangregg
Copy link
Owner

thanks!

@brendangregg brendangregg merged commit 2039017 into brendangregg:master Aug 31, 2021
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.

2 participants