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

Canvas: Add Pan and Zoom #76705

Merged
merged 70 commits into from
Jan 2, 2024
Merged

Canvas: Add Pan and Zoom #76705

merged 70 commits into from
Jan 2, 2024

Conversation

drew08t
Copy link
Contributor

@drew08t drew08t commented Oct 17, 2023

Add pan and zoom to canvas.

This feature will exist behind feature flag: canvasPanelPanZoom

  • Add feature
  • Fix moveable scaling
  • Fix pan :( :)
  • Fix drag
  • Fix resize
  • Fix arrow appearance while zoomed
  • Minor clean-up to arrows during zoom (shift depending on anchor)
  • Transform position while adding element using context menu
  • Mini map is only updating for arrows To be addressed later: Canvas: Include preview of canvas in minimap #78561
  • Ensure mini map has no mouse events
  • Add zoom toggle to options or behind feature flag
  • BONUS (if built into library): UI Hints
  • Option or control to toggle mini map
  • General code cleanup
  • Fix dragging of selected group while zoomed
  • Apply feature flag to options menu for minimap

New "Simplified" Minimap:
Nov-22-2023 14-42-00

Pan / Zoom:
Oct-24-2023 10-38-50
Arrow Behavior:
Nov-06-2023 18-15-43
Add Element During Zoom:
Nov-06-2023 18-15-54
Resize/Delete Arrow:
Nov-06-2023 18-16-28
Select:
Nov-06-2023 18-15-10

Closes #63902, #73953, #73177

@drew08t drew08t added add to changelog area/panel/canvas Issues related to canvas panel no-backport Skip backport of PR add to what's new labels Oct 17, 2023
@drew08t drew08t added this to the 10.3.x milestone Oct 17, 2023
@drew08t drew08t self-assigned this Oct 17, 2023
@grafana-delivery-bot grafana-delivery-bot bot modified the milestones: 10.3.x, 10.2.x Oct 17, 2023
@drew08t drew08t modified the milestones: 10.2.x, 10.3.x Oct 20, 2023
@drew08t drew08t changed the title [WIP] Canvas: Add Zoom [WIP] Canvas: Add Pan and Zoom Oct 30, 2023
@drew08t drew08t changed the title [WIP] Canvas: Add Pan and Zoom Canvas: Add Pan and Zoom Oct 30, 2023
@drew08t
Copy link
Contributor Author

drew08t commented Dec 18, 2023

I’ve found a small issue when the pan stops working. It happens when you right-click on canvas (probably opens some invisible context menu in the background). To enable panning back you have to left-click somewhere on canvas. I know it’s a small one but it can be confusing. Let me know if you have an issue with reproducing.

About to do some refactoring. I will make sure to test this afterwards!

Copy link
Contributor

@nmarrs nmarrs left a comment

Choose a reason for hiding this comment

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

🥇 great job on this! I went through and smoothed a few things over - I'm comfortable with this in its current state to move forward and merge :)

Re: @Develer finding with phantom context menu while in panel edit mode, I was also able to replicate that. I created #79883 as a follow-up to address that bug / edge case (at this point I don't think we should block merging this PR as this is an experimental feature behind a FF and we need to prioritize progress over perfection 😬)

></div>
<TransformComponent>{sceneDiv}</TransformComponent>
</TransformWrapper>
<SceneTransformWrapper scene={this}>{sceneDiv}</SceneTransformWrapper>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice job!

@drew08t drew08t merged commit 2502fe4 into main Jan 2, 2024
20 checks passed
@drew08t drew08t deleted the drew08t/canvas-add-zoom branch January 2, 2024 19:52
@summerwollin summerwollin modified the milestones: 10.3.x, 10.3.0 Jan 22, 2024
@kasaranenikarthik
Copy link

Hi
Seems like the 10.3.1 and the public preview of this feature doesn't include all the features. I was only able to zoom but not drag/move around well. Is it the case for all?
Could you please tell me when this feature can be launched for all the users?

Thanks in advance

@drew08t
Copy link
Contributor Author

drew08t commented Jan 25, 2024

Hi Seems like the 10.3.1 and the public preview of this feature doesn't include all the features. I was only able to zoom but not drag/move around well. Is it the case for all? Could you please tell me when this feature can be launched for all the users?

Thanks in advance

Thanks for the feedback, @kasaranenikarthik! Please create an issue so we can better capture and track what you are experiencing.

@11phc
Copy link

11phc commented Mar 7, 2024

Hi, I am trying to overlay elements in exact locations over a large jpeg, set as background in Original scaling mode. I also want it to be responsive and work on desktop and iphone, i.e. portrait and landscape.

The issue I have with canvasPanelPanZoom on a narrow iphone browser (or a narrowed desktop browser) is that the background image is only initially rendered as wide as the browser window allows, trimming off the right hand side of the jpeg image as expected, but you can never zoom or pan to the right hand side of the image / canvas panel and see the "trimmed" bit, if that makes sense?

Likewise in the vertical plane, if the panel height is not high enough to contain the original background image, then you will never be able to zoom or pan down to the bottom part of the background image. Thanks

p.s. would you like me to create this as an Issue? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Canvas: Consider adding zoom functionality
7 participants