<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://jsxgraph.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=84.147.76.214</id>
	<title>JSXGraph Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://jsxgraph.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=84.147.76.214"/>
	<link rel="alternate" type="text/html" href="https://jsxgraph.org/wiki/index.php?title=Special:Contributions/84.147.76.214"/>
	<updated>2026-04-06T00:31:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://jsxgraph.org/wiki/index.php?title=Create_your_own_constructions/visualizations_using_JavaScript&amp;diff=76</id>
		<title>Create your own constructions/visualizations using JavaScript</title>
		<link rel="alternate" type="text/html" href="https://jsxgraph.org/wiki/index.php?title=Create_your_own_constructions/visualizations_using_JavaScript&amp;diff=76"/>
		<updated>2008-09-15T20:14:10Z</updated>

		<summary type="html">&lt;p&gt;84.147.76.214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== First step ===&lt;br /&gt;
Link to prototye.js and to jsxgraphcore.js:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://jsxgraph.uni-bayreuth.de/distrib/prototype.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Second step ===&lt;br /&gt;
Insert a div inside of the document body:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot; class=&amp;quot;jxgbox&amp;quot; style=&amp;quot;width:400px; height:400px;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Third step ===&lt;br /&gt;
Connect JXG with the div (usually at the end of the document body)&lt;br /&gt;
and call initBoard():&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var board = JXG.JSXGraph.initBoard(&#039;box&#039;, {originX: 100, originY: 200, unitX: 50, unitY: 50});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Parameter 1: id of the division&lt;br /&gt;
* Parameter 2: properties of the board. Possible entries are:&lt;br /&gt;
** originX&lt;br /&gt;
** originY&lt;br /&gt;
** unitX&lt;br /&gt;
** unitY&lt;br /&gt;
** zoomX&lt;br /&gt;
** zoomY&lt;br /&gt;
More than one boards can be initialised simultaneously in one HTML file.&lt;br /&gt;
=== Fourth step: Creating geometric elements ===&lt;br /&gt;
Through the variable board new geometry elements can be added to the board. All elements are added with the method createElement():&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
board.createElement(&#039;point&#039;, [1,3], {name:&#039;A&#039;, strokecolor:&#039;red&#039;}); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Another example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
board.createElement(&#039;point&#039;, [function(){return s.X();},function(){return t.X()}], {trace:true}); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The parameters of createElement() are:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
board.createElement(elementType, parentElements, attributes);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where &lt;br /&gt;
*elementType is a string containing the type of the element which is constructed. At the moment, possible types are:&lt;br /&gt;
#primitive elements:&lt;br /&gt;
**angle&lt;br /&gt;
**arc&lt;br /&gt;
**arrow&lt;br /&gt;
**circle&lt;br /&gt;
**curve&lt;br /&gt;
**group&lt;br /&gt;
**line&lt;br /&gt;
**point&lt;br /&gt;
**polygon&lt;br /&gt;
**sector&lt;br /&gt;
**text&lt;br /&gt;
**transform&lt;br /&gt;
#composite elements:&lt;br /&gt;
**arrowparallel&lt;br /&gt;
**bisector&lt;br /&gt;
**circumcircle&lt;br /&gt;
**circumcirclemidpoint&lt;br /&gt;
**integral&lt;br /&gt;
**midpoint&lt;br /&gt;
**mirrorpoint&lt;br /&gt;
**normal&lt;br /&gt;
**parallel&lt;br /&gt;
**parallelpoint&lt;br /&gt;
**perpendicular&lt;br /&gt;
**perpendicularpoint&lt;br /&gt;
**reflection&lt;br /&gt;
*parentElements is an array containing the parameters which define the element. This can be parent elements like two points which define a line. It can also consist of JavaScript functions, numbers, and strings containing GEONExT syntax. The possible array elements depend on the element type.&lt;br /&gt;
*attributes is a JavaScript object. Usually it is given in the &amp;quot;literal object&amp;quot; form&lt;br /&gt;
        {key1:value1, key2:value2, ...}&lt;br /&gt;
&lt;br /&gt;
  Properties of a point:&lt;br /&gt;
  - style&lt;br /&gt;
  - strokeColor&lt;br /&gt;
  - strokeWidth&lt;br /&gt;
  - fillColor&lt;br /&gt;
  - highlightStrokeColor&lt;br /&gt;
  - highlightFillColor&lt;br /&gt;
  - labelColor&lt;br /&gt;
  - &lt;br /&gt;
  - visible&lt;br /&gt;
  - fixed&lt;br /&gt;
  - draft&lt;br /&gt;
  - trace&lt;br /&gt;
&lt;br /&gt;
  - labelX&lt;br /&gt;
  - labelY&lt;br /&gt;
  - showcoord&lt;br /&gt;
&lt;br /&gt;
  Additional properties of a line:&lt;br /&gt;
  - straightFirst&lt;br /&gt;
  - straightLast&lt;br /&gt;
&lt;br /&gt;
  There are no additional properties of a circle&lt;br /&gt;
&lt;br /&gt;
Additional properties for an element:&lt;br /&gt;
  needsRegularUpdate = [true]/false (eg axis are set to needsRegularUpdate=false)&lt;br /&gt;
  These elements are updated only, if the origin of the board is moved or after zooming.&lt;br /&gt;
  &lt;br /&gt;
Possible parameters:&lt;br /&gt;
el.setProperty(&#039;key1:value1&#039;,&#039;key2:value2&#039;,...);&lt;br /&gt;
el.setProperty([key1:value1],[key2:value2],...);&lt;br /&gt;
el.setProperty({key1:value1, key2:value2},...);&lt;br /&gt;
&lt;br /&gt;
----------------------------------------&lt;br /&gt;
Methods JXG.JSXGraph:&lt;br /&gt;
var board = JXG.JSXGraph.initBoard(&#039;box&#039;, {originX: 100, originY: 200, unitX: 50, unitY: 50});&lt;br /&gt;
Initializes a new board without loading a construction.&lt;br /&gt;
&lt;br /&gt;
var board = JXG.JSXGraph.loadBoardFromFile(DOMid, filename, format);&lt;br /&gt;
DOMid is the id of the div (or other HTML element) where the viewer should be displayed.&lt;br /&gt;
filename is the name of the file containing the geometric construction.&lt;br /&gt;
format iss the file format: &#039;Geonext&#039; or &#039;Intergeo&#039;&lt;br /&gt;
Returns a pointer to the board.&lt;br /&gt;
&lt;br /&gt;
var board = JXG.JSXGraph.loadBoardFromString(DOMid, string, format);&lt;br /&gt;
Same as JXG.JSXGraph.loadBoardFromFile, but string contains the complete data of&lt;br /&gt;
the geometric construction.&lt;br /&gt;
&lt;br /&gt;
JXG.JSXGraph.freeBoard(board);&lt;br /&gt;
Deletes the contents of a board. Should be called before a new construction is loaded.&lt;br /&gt;
&lt;br /&gt;
The updates can be supressed with board.suspendUpdate()&lt;br /&gt;
board.unsuspendUpdate() reestablishes the updating of all elements (and&lt;br /&gt;
fires one update())&lt;/div&gt;</summary>
		<author><name>84.147.76.214</name></author>
	</entry>
</feed>