I am hoping to use 2 different boards and make elements of one dependent on elements on the other board. Is this possible?
Yes, boards can be connected by board1.addChild(board2)
. Then, every update of board1
triggers an update of board2
. Here is a simple example (see it live at https://jsfiddle.net/vcL7aepo/6/ ):
var board1 = JXG.JSXGraph.initBoard('box1', {
boundingbox: [-5, 5, 5, -5],
axis: false,
showNavigation: false
});
var board2 = JXG.JSXGraph.initBoard('box2', {
boundingbox: [-5, 5, 5, -5],
axis: true,
showNavigation: false
});
board1.addChild(board2);
var a = board1.create('slider', [[-3,1], [3,1], [-10,1,10]]);
var f = board2.create('functiongraph', [
function(x) { return a.Value()*x*x;}
]);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.