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

optimize zoom and pan controls for various input types #40

Merged
merged 2 commits into from
Jan 3, 2023

Conversation

brandonreid
Copy link
Contributor

Resolves #38

Trackpad: Click and drag to pan, pinch or two finger scroll to zoom
Mouse: Click and drag to pan, scroll to zoom
Touch: Drag to pan, pinch to zoom

@netlify
Copy link

netlify bot commented Jan 3, 2023

Deploy Preview for prefect-graphs ready!

Name Link
🔨 Latest commit d4d3f70
🔍 Latest deploy log https://app.netlify.com/sites/prefect-graphs/deploys/63b4844efad204000853b033
😎 Deploy Preview https://deploy-preview-40--prefect-graphs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment on lines -2 to -8
<div class="flow-run-timeline">
<div class="flow-run-timeline__zoom-controls">
<p-button icon="MinusIcon" inset rounded aria-label="Zoom out" @click="zoomOut" />
<p-button icon="PlusIcon" inset rounded aria-label="Zoom in" @click="zoomIn" />
</div>
<div ref="stage" class="flow-run-timeline__canvas-container" />
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't discreet controls necessary for keyboard-only users? Should we maintain these in those cases even while we expand touchscreen controls?

Copy link
Contributor Author

@brandonreid brandonreid Jan 3, 2023

Choose a reason for hiding this comment

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

I was actually just creating a ticket to work through accessibility for this graph.

I think for assistive tech users or screen reader users, I'd actually surface a way to focus the graph and use arrows and +/- keys or something similar. For now, there will be no keyboard only pan controls, so zoom without pan really wouldn't be helpful anyway. One could argue they're a bit distracting up there as well, at least in their current size. So if they're not helping and possibly hurting, I still think they can go for now. Added to that ticket to think through how to enable keyboard only interaction though.

@brandonreid brandonreid merged commit e5e0837 into main Jan 3, 2023
@brandonreid brandonreid deleted the optimize-controls branch January 9, 2023 16:01
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.

Optimize viewport controls for various inputs
3 participants