Interactive JessieScript: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<jsxgraph width="600" height="450" box="box">
<jsxgraph width="600" height="450" box="box" modules="JessieScript">
var board, construction = [];
var board, construction = [];
board = JXG.JSXGraph.initBoard('box', {grid:true, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true});
board = JXG.JSXGraph.initBoard('box', {grid:false, boundingbox:[-1,6,11,-3], keepaspectratio:true, axis:true});


function construct() {
function construct() {
     var t = document.getElementById('input').value;
     var t = document.getElementById('input').value;
    board.suspendUpdate();
     construction.push(board.construct(t));
     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});
}
}
</jsxgraph>
</jsxgraph>


Type the construction and press "set".
<br>
<br>
<html>
<html>
<form><textarea id="input" cols=50 rows=4>
<form><textarea id="input" cols=50 rows=4>
A(1,1);B(2,2.5);C(1,3);G(5,3);H(6,4);[GH];k(G,1);AB(5,-1);X(6,-1);Y(7,-2);k(Y,X);k(A,[BC]);k(B,[AC]);
A(1,1);B(2,2.5);C(1,3);[AB];k(B,[AC]);
</textarea>
</textarea>
<br>
<br>
<input type="button" value="set" onClick="construct()">
<input type="button" value="set" onClick="construct()">
<input type="button" value="clear all" onClick="clearAll()">
</form>
</form>
</html>
</html>
===Available commands===
See our [http://jsxgraph.org/distrib/jessiescript_ref_en.pdf documentation page] for a list of commands.
==The JavaScript code==
JessieScript is not longer actively delevoped. Instead, the focus is on the programming language
[https://github.com/jsxgraph/JessieCode JessieCode].
As a consequence, JessieScript is not contained in jsxgraphcore.js anymore. If you want to use JessieScript, you have to load the file jessiescript.js from the JSXGraph sources or the file
https://jsxgraph.org/distrib/JessieScript.js after loading jsxgraphcore.js
<source lang="javascript">
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});
}
</source>
[[Category:Geometry]]
[[Category:Examples]]

Latest revision as of 13:57, 4 January 2021



Available commands

See our documentation page for a list of commands.

The JavaScript code

JessieScript is not longer actively delevoped. Instead, the focus is on the programming language JessieCode. As a consequence, JessieScript is not contained in jsxgraphcore.js anymore. If you want to use JessieScript, you have to load the file jessiescript.js from the JSXGraph sources or the file https://jsxgraph.org/distrib/JessieScript.js after loading jsxgraphcore.js

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});
}