Difference between revisions of "Synchronous file load"

From JSXGraph Wiki
Jump to navigationJump to search
(Created page with "<jsxgraph width="500" height="500"> var board = JXG.JSXGraph.initBoard('jxgbox'); JXG.FileReader.parseFileContent('http://jsxgraph.uni-bayreuth.de/geonext/Unendlich.gxt', board, ...")
 
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<jsxgraph width="500" height="500">
+
<jsxgraph width="500" height="500" modules="GeogebraReader">
 
var board = JXG.JSXGraph.initBoard('jxgbox');
 
var board = JXG.JSXGraph.initBoard('jxgbox');
JXG.FileReader.parseFileContent('http://jsxgraph.uni-bayreuth.de/geonext/Unendlich.gxt', board, 'Geonext', false);
+
JXG.FileReader.parseFileContent('//jsxgraph.org/geonext/point.ggb', board, 'GeoGebra', false);
 +
 
 +
board.create('point',[0,0],{fixed:true, name:'jsxpoint1', size:1});
 +
 
 +
var J = JXG.getReference(board, "jsxpoint1");
 +
var G = JXG.getReference(board, "geogebrapoint1");
 +
 
 +
J.setAttribute({size: 5});
 +
G.setAttribute({size: 10});
 +
 
 +
//board.setBoundingBox([-5, 5, 5, -5], true);
 
</jsxgraph>
 
</jsxgraph>
  
 
<source lang="javascript">
 
<source lang="javascript">
  var brd = JXG.JSXGraph.loadBoardFromFile('jxgbox', 'http://jsxgraph.uni-bayreuth.de/geonext/Unendlich.gxt', 'Geonext');
+
var board = JXG.JSXGraph.initBoard('jxgbox');
 +
JXG.FileReader.parseFileContent('//jsxgraph.org/geonext/point.ggb', board, 'GeoGebra', false);
 +
 
 +
board.create('point',[0,0], {fixed:true, name:'jsxpoint1', size:1});
 +
 
 +
var J = JXG.getReference(board, "jsxpoint1");
 +
var G = JXG.getReference(board, "geogebrapoint1");
 +
 
 +
J.setAttribute({size: 5});
 +
G.setAttribute({size: 10});
 +
 
 +
board.setBoundingBox([-5, 5, 5, -5], true);
 
</source>
 
</source>
  
 
[[Category:Examples]]
 
[[Category:Examples]]

Latest revision as of 18:59, 24 June 2020

var board = JXG.JSXGraph.initBoard('jxgbox');
JXG.FileReader.parseFileContent('//jsxgraph.org/geonext/point.ggb', board, 'GeoGebra', false);

board.create('point',[0,0], {fixed:true, name:'jsxpoint1', size:1});

var J = JXG.getReference(board, "jsxpoint1");
var G = JXG.getReference(board, "geogebrapoint1");

J.setAttribute({size: 5});
G.setAttribute({size: 10});

board.setBoundingBox([-5, 5, 5, -5], true);