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

Add zoom in/out/reset and fit option #39

Merged
merged 2 commits into from
May 24, 2018
Merged

Conversation

prusse-martin
Copy link
Member

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 88.663% when pulling 3bb8faa on fb-ASIM-1235-zoom-network into a17e424 on master.

@coveralls
Copy link

coveralls commented May 21, 2018

Coverage Status

Coverage decreased (-0.6%) to 88.633% when pulling 312eca9 on fb-ASIM-1235-zoom-network into a17e424 on master.

@@ -431,6 +431,16 @@ graphs.createGraph = function createGraph (container, options, styles) {
};
graph.addListener(mxEvent.REFRESH, onRefresh);

// * Adds mouse wheel handling for zoom
mxEvent.addMouseWheelListener(function(evt, up) {
Copy link
Member

Choose a reason for hiding this comment

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

What's up means?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is the direction my mouse wheel must move to move the pages' scrollbar up. I think that is the default configuration.

Copy link
Member

Choose a reason for hiding this comment

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

I see thanks. Please document that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a comment explaining up.

*/
graphs.Api.prototype.zoomIn = function zoomIn () {
"use strict";
this._graphEditor.graph.zoomIn();
Copy link
Member

Choose a reason for hiding this comment

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

Does the underlying API support a parameter that controls how much zoom is applied, like a factor or something?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is a zoomFactor, but that is graph member (not an function argument).
I could receive am argument here, use the zoom factor and restore the original value after.
Is that good or you think I should also expose the zoomFactor member?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, I asked just in case the zoomFactor was an argument already.

"""
return self.call_api('fit')

def get_zoom_scale(self):
Copy link
Member

Choose a reason for hiding this comment

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

Will we be able to do any extra work to save the final scene in the project file, with pans, zooms and whatever changes the user made?

Copy link
Member Author

Choose a reason for hiding this comment

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

I went to actually check that since I was expecting it to already be saved on dump but it is not.
It should be easy since we can obtain all that data.

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Added get_scale_and_translation/set_scale_and_translation to abstract the order pan and zoom are applied.

@prusse-martin prusse-martin force-pushed the fb-ASIM-1235-zoom-network branch 3 times, most recently from e88f538 to 312eca9 Compare May 24, 2018 17:29
…on call

Having them in a single function call will abstract the order in which the
zoom and translations are applied,
@prusse-martin
Copy link
Member Author

Create #41 to check test_set_scale_and_translation on linux.

@nicoddemus nicoddemus merged commit 6d59fd8 into master May 24, 2018
@nicoddemus nicoddemus deleted the fb-ASIM-1235-zoom-network branch May 24, 2018 17:51
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.

3 participants