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

Flame chart zoom and navigation with WASD keys #1611

Merged
merged 20 commits into from
Feb 12, 2020

Conversation

kenzieschmoll
Copy link
Member

Implement flame chart zoom with WASD keys.

wasd_flame_chart

Fixes #683

P.S. Excuse the ugly commit history. Rebasing was a nightmare.

Copy link
Contributor

@DaveShuckerow DaveShuckerow left a comment

Choose a reason for hiding this comment

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

This is some sophisticated logic that is well-organized and well-explained. Nicely written!

Just a few small suggestions.


previousZoom = currentZoom;
linkedHorizontalScrollControllerGroup
.jumpTo(newScrollOffset.clamp(minScrollOffset, maxScrollOffset));
Copy link
Contributor

Choose a reason for hiding this comment

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

This entire section is very well explained. Thanks!

// Only handle down events so logic is not duplicated on key up.
if (event is RawKeyDownEvent) {
// Handle zooming / navigation from W-A-S-D keys.
final keyLabel = event.data.keyLabel;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why are we using wsad instead of the arrow keys? is that for compatibility with the observatory?

Copy link
Member Author

Choose a reason for hiding this comment

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

WASD will be familiar for users with experience using other trace viewers (e.g. chrome://tracing, Observatory, etc.). Wdyt about allowing both WASD and the arrow keys to zoom / pan?

@jacob314
Copy link
Contributor

lgtm

@kenzieschmoll kenzieschmoll merged commit ed8c3af into flutter:master Feb 12, 2020
@kenzieschmoll kenzieschmoll deleted the zoom branch February 12, 2020 19:29
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.

Feature request: make WSAD work for timeline navigation
3 participants