Freezing the zoom and pan

520 views
Skip to first unread message

David

unread,
Aug 21, 2011, 5:26:19 PM8/21/11
to jsxg...@googlegroups.com
Hi,

How do you set up a board so that zooming and panning are disabled? So that you have a fixed static image?

Is there a simple parameter one can add to the board initialization for this purpose?

Thanks.

David Arnold
College of the Redwoods
Eureka, CA 95501
http://msemac.redwoods.edu/~darnold/index.php

michael

unread,
Aug 28, 2011, 11:12:17 AM8/28/11
to jsxg...@googlegroups.com
Hi David,

atm only the navigation bar can be disabled via

shownavigation: false

when initializing the board, e.g.:

JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-9, 8, 9, -10],shownavigation: false});


But disabling the zoom via mouse wheel or panning via shift+drag is not possible, yet. But it sounds useful, i'll note it in our tracker.


michael

evertv...@gmail.com

unread,
Jan 26, 2012, 4:31:10 AM1/26/12
to jsxg...@googlegroups.com
You can remove the event mouseheel and mousscroll as followed:

JXG.removeEvent(board.containerObj, 'mousewheel', board.mouseWheelListener, board);
JXG.removeEvent(board.containerObj, 'DOMMouseScroll', board.mouseWheelListener, board);

but i still don't know how to remove the panning event.

michael

unread,
Jan 26, 2012, 4:33:33 AM1/26/12
to jsxg...@googlegroups.com
It will be possible with the next release which we are preparing right now. The options to pass in initBoard are {zoom: false, pan: false}.

This will disable all zooming/panning with gestures and keyboard shortcuts.



michael

PierreG

unread,
Mar 5, 2012, 5:24:34 PM3/5/12
to JSXGraph
Hi,
Yes, I also look forward for the version with the possibility of
freeze panning (triggered by scrolling in the board) and zooming.
Loving jsxgraph otherwise.
P

michael

unread,
Mar 6, 2012, 1:14:09 AM3/6/12
to jsxg...@googlegroups.com

PierreG

unread,
Mar 13, 2012, 5:49:40 PM3/13/12
to JSXGraph
Great, thanks!

Murray

unread,
May 17, 2014, 9:44:06 PM5/17/14
to jsxg...@googlegroups.com
Hi

This documentation http://jsxgraph.uni-bayreuth.de/wiki/index.php/Options suggests "pan:false" as the way of turning off pan ability, but it doesn't work.

Cleonis' fiddle at http://jsfiddle.net/Cleonis/LUnVA/ has

pan: {enabled: false}

And this works!

Perhaps the documentation should be updated? Or it seems to me that "pan:false" is more consistent syntax and should be the accepted method.

Thanks and regards

Murray

Cleonis

unread,
May 18, 2014, 10:06:12 AM5/18/14
to jsxg...@googlegroups.com
I notice that the current version of options.js
https://github.com/jsxgraph/jsxgraph/blob/master/src/options.js

Specifies 'pan' as follows:

pan
: {
                needShift: true,
                needTwoFingers: true,
                enabled: true
            }


Presumably in an earlier state 'pan' was like, say, the option 'showNavigation', hence the syntax 'pan:false' in an example in the wiki.
http://jsxgraph.uni-bayreuth.de/wiki/index.php/Parallel_projection_of_a_sphere


But at a later stage an additional level was added. The property 'needTwoFingers' is obviously touch-interface related; 'needShift' is presumably keyboard-related.

I guess the alternative would have been to create an option 'panInterface', with the following properties:

panInterface: {
                needShift: true,
                needTwoFingers: true,
            }

Then the syntax 'pan:true','pan:false' would have remained.

In this case we see a decision was made to change the syntax.

Alfred Wassermann

unread,
May 19, 2014, 7:52:48 AM5/19/14
to jsxg...@googlegroups.com
Yes, exactly. Sorry for the inconvenience.
The documentation at http://jsxgraph.uni-bayreuth.de/wiki/index.php/Options is now updated and points directly to the github page.
Best wishes,
Alfred

Reply all
Reply to author
Forward
0 new messages