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

[Feature Request] Zoom and panning in html report #843

Closed
Ujifman opened this issue May 19, 2022 · 20 comments
Closed

[Feature Request] Zoom and panning in html report #843

Ujifman opened this issue May 19, 2022 · 20 comments

Comments

@Ujifman
Copy link
Contributor

Ujifman commented May 19, 2022

Hello, I found two features that will increase usability of html report, when you in views diagrams.

  1. Zoom in/out with ctrl+/- for diagram. By default ctrl+/- change zoom for all browser page. It would be more usefull if ctrl+/- will duplictate zoom slider and change zoom for diagram only.
  2. Panning with click and move. Usually views are rather huge, and one needs zoom in and move view. Now one can move only with scroll bars, but it is not useful. It would be great to move view just like in program with click and move wheel button of mouse.

My idea is just to add some js code to report building tool, that will implement described behavior.

@Phillipus
Copy link
Member

My idea is just to add some js code to report building tool, that will implement described behavior.

Are you offering to provide the JS code? If so, a draft PR would work.

@Ujifman
Copy link
Contributor Author

Ujifman commented May 19, 2022

Yes I already have js code that implements it, and now I study your code to find the right place for it, ad i suppose it should be in com.archimatetool.reports\templates\html am I right?

@Phillipus
Copy link
Member

Yes, that's correct. Thanks for taking a look at it.

@Ujifman
Copy link
Contributor Author

Ujifman commented May 19, 2022

So now I can prepare pull request?

@Phillipus
Copy link
Member

Phillipus commented May 19, 2022

So now I can prepare pull request?

Yes please, a draft PR in a branch of forked Archi code is the way to go. Thanks.

@Ujifman
Copy link
Contributor Author

Ujifman commented Nov 10, 2022

Sorry for long time for implementing, but finally I've got pull request about this feature #882

@Phillipus
Copy link
Member

Thanks for this, I merged it.

@Phillipus Phillipus reopened this Dec 9, 2022
@Phillipus
Copy link
Member

@Ujifman Hi, I've found a problem with panelBodyScroller.js. The text field for inputting alasql queries on the "Query" tab in the report cannot receive text input. The problem occurs on line 16:

  const mouseDownHandler = function (e) {
    e.preventDefault(); <-------------------- Here!

Would you be able to take a look at this?

BTW - I've edited the file to support IE11

@Phillipus
Copy link
Member

Phillipus commented Dec 9, 2022

One thing I tried that seems to work is removing the e.preventDefault(); line and adding this:

  ele.getElementsByClassName('diagram')[0].addEventListener('mousedown', function (e) {
    e.preventDefault();
  });

@Phillipus
Copy link
Member

Phillipus commented Dec 10, 2022

I've created a branch html-fix with my attempt at a fix. Also, I don't think it's a good idea to show a "grab" cursor by default.

68fa5d6

@Ujifman
Copy link
Contributor Author

Ujifman commented Dec 11, 2022

@Phillipus Hi, sorry, I've missed alert from GitHub, had some crazy days at work. As I see you already fixed the issue, do you need some help?

@Phillipus
Copy link
Member

@Ujifman Hi, I just wanted to check it with you, first. Do you see any problems with my proposed fix?

@Ujifman
Copy link
Contributor Author

Ujifman commented Dec 11, 2022

@Ujifman Hi, I just wanted to check it with you, first. Do you see any problems with my proposed fix?

Looks nice! I don't see any problems.

@Phillipus
Copy link
Member

Thanks for the feedback. I'll commit it,

Phillipus added a commit that referenced this issue Dec 13, 2022
@Phillipus Phillipus reopened this Jan 7, 2023
@Phillipus
Copy link
Member

Hi, this is causing problems as noted by @evlibra:

5f81eed#commitcomment-95334110

b8c4163#commitcomment-95333906

We should reconsider this one for Archi 5 and find a way to only pan when the mouse is down on a diagram. If not we should remove this feature for now and come back to it.

@Ujifman Can you find a way to do this?

Phillipus referenced this issue Jan 7, 2023
* add Ctrl + wheel zoom in for diagram only instead of whole page
* add panning by mouse left click over the diagram
@Phillipus
Copy link
Member

I think I've fixed this issue now. @evlibra: please test.

@evlibra
Copy link

evlibra commented Jan 8, 2023

I think I've fixed this issue now. @evlibra: please test.

Thanks @Phillipus. Yes, the issue is fixed now - frames beyond the diagram are not impacted. The only question is whether grabbing shall be allowed only within boundaries of diagram elements (see area in green on the screenshot), or within whole diagram frame, meaning also empty area at the right from the diagram elements. At the moment is is only within diagram's elements (V), but intuitively one might expect also grab at right from it (?). See the screenshot
image

@Phillipus
Copy link
Member

I'm sorry but I can't spend any more time on this issue, I've tried my best to make it work based on @Ujifman 's PR. If it continues to be a problem I will remove it.

@Phillipus
Copy link
Member

This is now removed. I've left the mouse scroll wheel feature in.

Please resubmit a working PR that we might consider for Archi 5.1.

@Ujifman
Copy link
Contributor Author

Ujifman commented Jan 9, 2023

@Phillipus I'll try to find out a way to fix it.

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

No branches or pull requests

3 participants