Difference between revisions of "Use the MediaWiki extension for JSXGraph"

From JSXGraph Wiki
Jump to: navigation, search
 
Line 1: Line 1:
An extension to include JSXGraph in MediaWiki is under development, see also [http://www.mediawiki.org/wiki/Extension:JSXGraph http://www.mediawiki.org/wiki/Extension:JSXGraph].
+
Download the MediaWiki extension [http://www.mediawiki.org/wiki/Extension:JSXGraph http://www.mediawiki.org/wiki/Extension:JSXGraph here].
You can see it in action here:
 
  
 
===Include a GEONExT file===
 
===Include a GEONExT file===
Line 14: Line 13:
 
===Include JavaScript source code===
 
===Include JavaScript source code===
 
<jsxgraph height="500" width="600" board="board" box="mybox">
 
<jsxgraph height="500" width="600" board="board" box="mybox">
board = JXG.JSXGraph.initBoard('mybox', {originX: 250, originY: 250, unitX: 25, unitY: 25});
+
board = JXG.JSXGraph.initBoard('mybox', {boundingbox: [-10, 10, 14, -10]});
 
var a = board.create('slider', [[1,8],[5,8],[0,1,4]]);
 
var a = board.create('slider', [[1,8],[5,8],[0,1,4]]);
 
var b = board.create('slider', [[1,9],[5,9],[0,0.25,4]]);
 
var b = board.create('slider', [[1,9],[5,9],[0,0.25,4]]);
Line 23: Line 22:
 
<script type="text/javascript" src="/distrib/GeonextReader.js"></script>
 
<script type="text/javascript" src="/distrib/GeonextReader.js"></script>
 
<jsxgraph height="500" width="600" board="board"  box="jxgbox2">
 
<jsxgraph height="500" width="600" board="board"  box="jxgbox2">
board = JXG.JSXGraph.initBoard('jxgbox2', {originX: 250, originY: 250, unitX: 25, unitY: 25});
+
board = JXG.JSXGraph.initBoard('jxgbox2', {boundingbox: [-10, 10, 14, -10]});
 
var a = board.create('slider', [[1,8],[5,8],[0,1,4]]);
 
var a = board.create('slider', [[1,8],[5,8],[0,1,4]]);
 
var b = board.create('slider', [[1,9],[5,9],[0,0.25,4]]);
 
var b = board.create('slider', [[1,9],[5,9],[0,0.25,4]]);

Latest revision as of 15:39, 8 June 2011

Download the MediaWiki extension http://www.mediawiki.org/wiki/Extension:JSXGraph here.

Include a GEONExT file

To display the above example, a GEONExT file has to be uploaded and the following code has to be included in a MediWiki page:

<jsxgraph height="500" width="600" filename="Wuerfel_drehbar_dreieck.gxt" />


Include JavaScript source code

<script type="text/javascript" src="/distrib/GeonextReader.js"></script>
<jsxgraph height="500" width="600" board="board"  box="jxgbox2">
board = JXG.JSXGraph.initBoard('jxgbox2', {boundingbox: [-10, 10, 14, -10]});
var a = board.create('slider', [[1,8],[5,8],[0,1,4]]);
var b = board.create('slider', [[1,9],[5,9],[0,0.25,4]]);
var c = board.create('curve', [function(phi){return a.Value()+b.Value()*phi; }, [0, 0], 0, 8*Math.PI],
{curveType:'polar', strokewidth:4});      
</jsxgraph>

Include GEONExT string

Include a GEONExT construction as string: The attribut filestring contains the content of a GEONExT file.

<jsxgraph height="500" width="600" filestring="eNrtnXtv2zgSwP+2P4WAAE ... F/VMRG8q5ofzj6fn11fuv8Hn24cYA==" />