Interactive JessieScript: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
<script type="text/javascript" href="https://jsxgraph.org/distrib/jsxgraphcore.js"></script> | |||
<script type="text/javascript" href="https://jsxgraph.org/distrib/JessieScript.js"></script> | <script type="text/javascript" href="https://jsxgraph.org/distrib/JessieScript.js"></script> | ||
< | <div width="600" width="450" id="box"> | ||
</div> | |||
<script> | |||
var board, construction = []; | var board, construction = []; | ||
board = JXG.JSXGraph.initBoard('box', {grid:false, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true});https://jsxgraph.org/distrib/JessieScript.js | board = JXG.JSXGraph.initBoard('box', {grid:false, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true});https://jsxgraph.org/distrib/JessieScript.js | ||
Line 16: | Line 18: | ||
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true}); | board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true}); | ||
} | } | ||
</ | </script> | ||
</html> | |||
<br> | <br> |
Revision as of 13:40, 4 January 2021
Available commands
See our documentation page for a list of commands.
The JavaScript code
var board, construction = [];
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true});
function construct() {
var t = document.getElementById('input').value;
board.suspendUpdate();
construction.push(board.construct(t));
board.unsuspendUpdate();
}
function clearAll() {
JXG.JSXGraph.freeBoard(board);
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true});
}