Subversion Repositories wimsdev

Rev

Rev 11922 | Blame | Last modification | View Log | RSS feed

  1.  
  2. <input type='text' size='10' value='' id='search'  onkeydown='javascripts:if(event.keyCode == 13){look();}'/><input type='button' onclick='javascript:look();' value='search' />
  3. <h2 style=text-align:center>Implemented canvasdraw commands (22-09-2017)</h2>
  4. <table style='color:blue;font-size:0.8em;'><tr>
  5.  
  6. <td><a name='canvasdraw top' href='#canvasdraw'>canvasdraw</a></td>
  7. <td><a name='affine top' href='#affine'>affine</a></td>
  8. <td><a name='angle top' href='#angle'>angle</a></td>
  9. <td><a name='animate top' href='#animate'>animate</a></td>
  10. <td><a name='arc top' href='#arc'>arc</a></td>
  11. <td><a name='arrow top' href='#arrow'>arrow</a></td>
  12. <td><a name='vector top' href='#arrow'>vector</a></td>
  13. <td><a name='arrows top' href='#arrows'>arrows</a></td>
  14. <td><a name='vectors top' href='#arrows'>vectors</a></td>
  15. </tr><tr>
  16. <td><a name='arrow2 top' href='#arrow2'>arrow2</a></td>
  17. <td><a name='arrows2 top' href='#arrows2'>arrows2</a></td>
  18. <td><a name='arrowhead top' href='#arrowhead'>arrowhead</a></td>
  19. <td><a name='audio top' href='#audio'>audio</a></td>
  20. <td><a name='axisnumbering top' href='#axisnumbering'>axisnumbering</a></td>
  21. <td><a name='axis top' href='#axis'>axis</a></td>
  22. <td><a name='barchart top' href='#barchart'>barchart</a></td>
  23. <td><a name='bezier top' href='#bezier'>bezier</a></td>
  24. <td><a name='bgcolor top' href='#bgcolor'>bgcolor</a></td>
  25. </tr><tr>
  26. <td><a name='bgimage top' href='#bgimage'>bgimage</a></td>
  27. <td><a name='blink top' href='#blink'>blink</a></td>
  28. <td><a name='boxplot top' href='#boxplot'>boxplot</a></td>
  29. <td><a name='boxplotdata top' href='#boxplotdata'>boxplotdata</a></td>
  30. <td><a name='canvastype top' href='#canvastype'>canvastype</a></td>
  31. <td><a name='centerstring top' href='#centerstring'>centerstring</a></td>
  32. <td><a name='circle top' href='#circle'>circle</a></td>
  33. <td><a name='circles top' href='#circles'>circles</a></td>
  34. <td><a name='disks top' href='#circles'>disks</a></td>
  35. </tr><tr>
  36. <td><a name='clearbutton top' href='#clearbutton'>clearbutton</a></td>
  37. <td><a name='delete top' href='#clearbutton'>delete</a></td>
  38. <td><a name='erase top' href='#clearbutton'>erase</a></td>
  39. <td><a name='clock top' href='#clock'>clock</a></td>
  40. <td><a name='colorpalette top' href='#colorpalette'>colorpalette</a></td>
  41. <td><a name='copy top' href='#copy'>copy</a></td>
  42. <td><a name='copyresized top' href='#copyresized'>copyresized</a></td>
  43. <td><a name='crosshair top' href='#crosshair'>crosshair</a></td>
  44. <td><a name='crosshairs top' href='#crosshairs'>crosshairs</a></td>
  45. </tr><tr>
  46. <td><a name='crosshairsize top' href='#crosshairsize'>crosshairsize</a></td>
  47. <td><a name='cursor top' href='#cursor'>cursor</a></td>
  48. <td><a name='pointer top' href='#cursor'>pointer</a></td>
  49. <td><a name='curve top' href='#curve'>curve</a></td>
  50. <td><a name='dashed top' href='#dashed'>dashed</a></td>
  51. <td><a name='dashtype top' href='#dashtype'>dashtype</a></td>
  52. <td><a name='diamondfill top' href='#diamondfill'>diamondfill</a></td>
  53. <td><a name='dotfill top' href='#dotfill'>dotfill</a></td>
  54. <td><a name='drag top' href='#drag'>drag</a></td>
  55. </tr><tr>
  56. <td><a name='ellipse top' href='#ellipse'>ellipse</a></td>
  57. <td><a name='fillall top' href='#fillall'>fillall</a></td>
  58. <td><a name='filled top' href='#filled'>filled</a></td>
  59. <td><a name='fillcolor top' href='#fillcolor'>fillcolor</a></td>
  60. <td><a name='fillpattern top' href='#fillpattern'>fillpattern</a></td>
  61. <td><a name='filltoborder top' href='#filltoborder'>filltoborder</a></td>
  62. <td><a name='floodfill top' href='#floodfill'>floodfill</a></td>
  63. <td><a name='fill top' href='#floodfill'>fill</a></td>
  64. <td><a name='fontcolor top' href='#fontcolor'>fontcolor</a></td>
  65. </tr><tr>
  66. <td><a name='fontfamily top' href='#fontfamily'>fontfamily</a></td>
  67. <td><a name='fontsize top' href='#fontsize'>fontsize</a></td>
  68. <td><a name='functionlabel top' href='#functionlabel'>functionlabel</a></td>
  69. <td><a name='grid top' href='#grid'>grid</a></td>
  70. <td><a name='gridfill top' href='#gridfill'>gridfill</a></td>
  71. <td><a name='demiline top' href='#demiline'>demiline</a></td>
  72. <td><a name='halfline top' href='#demiline'>halfline</a></td>
  73. <td><a name='demilines top' href='#demilines'>demilines</a></td>
  74. <td><a name='halflines top' href='#demilines'>halflines</a></td>
  75. </tr><tr>
  76. <td><a name='hatchfill top' href='#hatchfill'>hatchfill</a></td>
  77. <td><a name='hline top' href='#hline'>hline</a></td>
  78. <td><a name='horizontalline top' href='#hline'>horizontalline</a></td>
  79. <td><a name='hlines top' href='#hlines'>hlines</a></td>
  80. <td><a name='horizontallines top' href='#hlines'>horizontallines</a></td>
  81. <td><a name='http top' href='#http'>http</a></td>
  82. <td><a name='html top' href='#html'>html</a></td>
  83. <td><a name='imagefill top' href='#imagefill'>imagefill</a></td>
  84. <td><a name='inputstyle top' href='#inputstyle'>inputstyle</a></td>
  85. </tr><tr>
  86. <td><a name='input top' href='#input'>input</a></td>
  87. <td><a name='intooltip top' href='#intooltip'>intooltip</a></td>
  88. <td><a name='jscurve top' href='#jscurve'>jscurve</a></td>
  89. <td><a name='jsplot top' href='#jscurve'>jsplot</a></td>
  90. <td><a name='jsmath top' href='#jsmath'>jsmath</a></td>
  91. <td><a name='killaffine top' href='#killaffine'>killaffine</a></td>
  92. <td><a name='killrotate top' href='#killrotate'>killrotate</a></td>
  93. <td><a name='killslider top' href='#killslider'>killslider</a></td>
  94. <td><a name='killtranslation top' href='#killtranslation'>killtranslation</a></td>
  95. </tr><tr>
  96. <td><a name='killtranslate top' href='#killtranslation'>killtranslate</a></td>
  97. <td><a name='line top' href='#line'>line</a></td>
  98. <td><a name='lines top' href='#lines'>lines</a></td>
  99. <td><a name='linewidth top' href='#linewidth'>linewidth</a></td>
  100. <td><a name='lattice top' href='#lattice'>lattice</a></td>
  101. <td><a name='levelcurve top' href='#levelcurve'>levelcurve</a></td>
  102. <td><a name='legend top' href='#legend'>legend</a></td>
  103. <td><a name='legendcolors top' href='#legendcolors'>legendcolors</a></td>
  104. <td><a name='linegraph top' href='#linegraph'>linegraph</a></td>
  105. </tr><tr>
  106. <td><a name='mathml top' href='#mathml'>mathml</a></td>
  107. <td><a name='mouse top' href='#mouse'>mouse</a></td>
  108. <td><a name='mouse_degree top' href='#mouse_degree'>mouse_degree</a></td>
  109. <td><a name='display top' href='#display'>display</a></td>
  110. <td><a name='precision top' href='#precision'>precision</a></td>
  111. <td><a name='mousex top' href='#mousex'>mousex</a></td>
  112. <td><a name='mousey top' href='#mousey'>mousey</a></td>
  113. <td><a name='multidash top' href='#multidash'>multidash</a></td>
  114. <td><a name='multidraw top' href='#multidraw'>multidraw</a></td>
  115. </tr><tr>
  116. <td><a name='multilabel top' href='#multilabel'>multilabel</a></td>
  117. <td><a name='multilinewidth top' href='#multilinewidth'>multilinewidth</a></td>
  118. <td><a name='multifill top' href='#multifill'>multifill</a></td>
  119. <td><a name='multifillcolors top' href='#multifillcolors'>multifillcolors</a></td>
  120. <td><a name='multifillopacity top' href='#multifillopacity'>multifillopacity</a></td>
  121. <td><a name='multisnaptogrid top' href='#multisnaptogrid'>multisnaptogrid</a></td>
  122. <td><a name='multistrokecolors top' href='#multistrokecolors'>multistrokecolors</a></td>
  123. <td><a name='multistrokeopacity top' href='#multistrokeopacity'>multistrokeopacity</a></td>
  124. <td><a name='multiuserinput top' href='#multiuserinput'>multiuserinput</a></td>
  125. </tr><tr>
  126. <td><a name='noaxis top' href='#noaxis'>noaxis</a></td>
  127. <td><a name='noayis top' href='#noayis'>noayis</a></td>
  128. <td><a name='numberline top' href='#numberline'>numberline</a></td>
  129. <td><a name='opacity top' href='#opacity'>opacity</a></td>
  130. <td><a name='transparent top' href='#opacity'>transparent</a></td>
  131. <td><a name='onclick top' href='#onclick'>onclick</a></td>
  132. <td><a name='parallel top' href='#parallel'>parallel</a></td>
  133. <td><a name='plotsteps top' href='#plotsteps'>plotsteps</a></td>
  134. <td><a name='point top' href='#point'>point</a></td>
  135. </tr><tr>
  136. <td><a name='points top' href='#points'>points</a></td>
  137. <td><a name='poly top' href='#poly'>poly</a></td>
  138. <td><a name='polyline top' href='#polyline'>polyline</a></td>
  139. <td><a name='popup top' href='#popup'>popup</a></td>
  140. <td><a name='protractor top' href='#protractor'>protractor</a></td>
  141. <td><a name='pixels top' href='#pixels'>pixels</a></td>
  142. <td><a name='pixelsize top' href='#pixelsize'>pixelsize</a></td>
  143. <td><a name='piechart top' href='#piechart'>piechart</a></td>
  144. <td><a name='rays top' href='#rays'>rays</a></td>
  145. </tr><tr>
  146. <td><a name='rect top' href='#rect'>rect</a></td>
  147. <td><a name='rects top' href='#rects'>rects</a></td>
  148. <td><a name='replyformat top' href='#replyformat'>replyformat</a></td>
  149. <td><a name='roundrect top' href='#roundrect'>roundrect</a></td>
  150. <td><a name='roundrects top' href='#roundrects'>roundrects</a></td>
  151. <td><a name='ruler top' href='#ruler'>ruler</a></td>
  152. <td><a name='resetoffset top' href='#resetoffset'>resetoffset</a></td>
  153. <td><a name='rotate top' href='#rotate'>rotate</a></td>
  154. <td><a name='rotationcenter top' href='#rotationcenter'>rotationcenter</a></td>
  155. </tr><tr>
  156. <td><a name='size top' href='#size'>size</a></td>
  157. <td><a name='segment top' href='#segment'>segment</a></td>
  158. <td><a name='seg top' href='#segment'>seg</a></td>
  159. <td><a name='segments top' href='#segments'>segments</a></td>
  160. <td><a name='segs top' href='#segments'>segs</a></td>
  161. <td><a name='setlimits top' href='#setlimits'>setlimits</a></td>
  162. <td><a name='setpixel top' href='#setpixel'>setpixel</a></td>
  163. <td><a name='slider top' href='#slider'>slider</a></td>
  164. <td><a name='sliderfunction_x top' href='#sliderfunction_x'>sliderfunction_x</a></td>
  165. </tr><tr>
  166. <td><a name='sliderfunction_y top' href='#sliderfunction_y'>sliderfunction_y</a></td>
  167. <td><a name='sgraph top' href='#sgraph'>sgraph</a></td>
  168. <td><a name='snaptofunction top' href='#snaptofunction'>snaptofunction</a></td>
  169. <td><a name='snaptofun top' href='#snaptofunction'>snaptofun</a></td>
  170. <td><a name='snaptopoints top' href='#snaptopoints'>snaptopoints</a></td>
  171. <td><a name='snaptogrid top' href='#snaptogrid'>snaptogrid</a></td>
  172. <td><a name='square top' href='#square'>square</a></td>
  173. <td><a name='status top' href='#status'>status</a></td>
  174. <td><a name='string top' href='#string'>string</a></td>
  175. </tr><tr>
  176. <td><a name='stringup top' href='#stringup'>stringup</a></td>
  177. <td><a name='highlight top' href='#highlight'>highlight</a></td>
  178. <td><a name='strokecolor top' href='#strokecolor'>strokecolor</a></td>
  179. <td><a name='text top' href='#text'>text</a></td>
  180. <td><a name='textarea top' href='#textarea'>textarea</a></td>
  181. <td><a name='textfill top' href='#textfill'>textfill</a></td>
  182. <td><a name='textup top' href='#textup'>textup</a></td>
  183. <td><a name='trace_jscurve top' href='#trace_jscurve'>trace_jscurve</a></td>
  184. <td><a name='trange top' href='#trange'>trange</a></td>
  185. </tr><tr>
  186. <td><a name='ranget top' href='#trange'>ranget</a></td>
  187. <td><a name='translation top' href='#translation'>translation</a></td>
  188. <td><a name='translate top' href='#translation'>translate</a></td>
  189. <td><a name='triangle top' href='#triangle'>triangle</a></td>
  190. <td><a name='triangles top' href='#triangles'>triangles</a></td>
  191. <td><a name='userboxplot top' href='#userboxplot'>userboxplot</a></td>
  192. <td><a name='userboxplotdata top' href='#userboxplotdata'>userboxplotdata</a></td>
  193. <td><a name='userdraw top' href='#userdraw'>userdraw</a></td>
  194. <td><a name='userinput top' href='#userinput'>userinput</a></td>
  195. </tr><tr>
  196. <td><a name='userinput_function top' href='#userinput'>userinput_function</a></td>
  197. <td><a name='userinput_textarea top' href='#userinput'>userinput_textarea</a></td>
  198. <td><a name='userinput_xy top' href='#userinput'>userinput_xy</a></td>
  199. <td><a name='userinput_xy top' href='#userinput_xy'>userinput_xy</a></td>
  200. <td><a name='userinput_function top' href='#userinput_function'>userinput_function</a></td>
  201. <td><a name='usertextarea_xy top' href='#usertextarea_xy'>usertextarea_xy</a></td>
  202. <td><a name='vline top' href='#vline'>vline</a></td>
  203. <td><a name='verticalline top' href='#vline'>verticalline</a></td>
  204. <td><a name='vlines top' href='#vlines'>vlines</a></td>
  205. </tr><tr>
  206. <td><a name='verticallines top' href='#vlines'>verticallines</a></td>
  207. <td><a name='video top' href='#video'>video</a></td>
  208. <td><a name='xaxis top' href='#xaxis'>xaxis</a></td>
  209. <td><a name='xaxistext top' href='#xaxis'>xaxistext</a></td>
  210. <td><a name='xaxisup top' href='#xaxisup'>xaxisup</a></td>
  211. <td><a name='xaxistextup top' href='#xaxisup'>xaxistextup</a></td>
  212. <td><a name='xerrorbars top' href='#xerrorbars'>xerrorbars</a></td>
  213. <td><a name='xrange top' href='#xrange'>xrange</a></td>
  214. <td><a name='rangex top' href='#xrange'>rangex</a></td>
  215. </tr><tr>
  216. <td><a name='xsnaptogrid top' href='#xsnaptogrid'>xsnaptogrid</a></td>
  217. <td><a name='xoffset top' href='#xoffset'>xoffset</a></td>
  218. <td><a name='xyoffset top' href='#xyoffset'>xyoffset</a></td>
  219. <td><a name='xunit top' href='#xunit'>xunit</a></td>
  220. <td><a name='xlabel top' href='#xlabel'>xlabel</a></td>
  221. <td><a name='xlogbase top' href='#xlogbase'>xlogbase</a></td>
  222. <td><a name='xlogscale top' href='#xlogscale'>xlogscale</a></td>
  223. <td><a name='xylogscale top' href='#xylogscale'>xylogscale</a></td>
  224. <td><a name='yaxis top' href='#yaxis'>yaxis</a></td>
  225. </tr><tr>
  226. <td><a name='yerrorbars top' href='#yerrorbars'>yerrorbars</a></td>
  227. <td><a name='yoffset top' href='#yoffset'>yoffset</a></td>
  228. <td><a name='yrange top' href='#yrange'>yrange</a></td>
  229. <td><a name='rangey top' href='#yrange'>rangey</a></td>
  230. <td><a name='ysnaptogrid top' href='#ysnaptogrid'>ysnaptogrid</a></td>
  231. <td><a name='ylabel top' href='#ylabel'>ylabel</a></td>
  232. <td><a name='ylogbase top' href='#ylogbase'>ylogbase</a></td>
  233. <td><a name='ylogscale top' href='#ylogscale'>ylogscale</a></td>
  234. <td><a name='yunit top' href='#yunit'>yunit</a></td>
  235. </tr><tr>
  236. <td><a name='zoom top' href='#zoom'>zoom</a></td>
  237. <td>&nbsp;</td>
  238. <td>&nbsp;</td>
  239. <td>&nbsp;</td>
  240. <td>&nbsp;</td>
  241. <td>&nbsp;</td>
  242. <td>&nbsp;</td>
  243. <td>&nbsp;</td>
  244. <td>&nbsp;</td>
  245. </tr></table>
  246. <ul>
  247. <li><a name='canvasdraw' href='#canvasdraw top'>  canvasdraw</a><ul>
  248. <li><span style="color:blue;font-size:0.8em"> will try use the same syntax as flydraw or svgdraw to paint a html5 bitmap image<br />by generating a tailor-made javascript include file: providing only the js-functionality needed to perform the job.<br />thus ensuring a minimal strain on the client browser <br />(unlike some popular 'canvas-do-it-all' libraries, who have proven to be not suitable for low-end computers found in schools...)
  249. </span></li>
  250. <li><span style="color:blue;font-size:0.8em"> general syntax <ul><li>The transparency of all objects can be controlled by command <a href="#opacity">'opacity [0-255],[0,255]'</a></il><li>line width of any object can be controlled by command <a href="#linewidth">'linewidth int'</a></li><li>any may be dashed by using keyword <a href="#dashed">'dashed'</a> before the object command.<br />the dashing type can be controled by command <a href="#dashtype">'dashtype int,int'</a></li><li>a fillable object can be set fillable by starting the object command with an 'f'<br />(like frect,fcircle,ftriangle...)<br />or by using the keyword <a href="#filled">'filled'</a> before the object command.<br />The fill colour of 'non_userdraw' objects will be the stroke colour...(flydraw harmonization 19/10/2013)<br />non-solid filling (grid,hatch,diamond,dot,text) is provided using command <a href="#fillpattern">fillpattern a_pattern</a><br />for <a href="#filltoborder">filltoborder x0,y0,color</a> or <a href="#filltoborder">fill x0,y0,color</a> type filling (eg fill a region around x0,y0 with color until a border is encountered),<br />there are non-solid pattern fill analogues:<ul><li><a href="#gridfill">gridfill x,y,dx,dy,color</a></li><li><a href="#hatchfill">hatchfill x,y,dx,dy,color</a></li><li><a href="#diamondfill">diamondfill x,y,dx,dy,color</a></li><li><a href="#dotfill">dotfill x,y,dx,dy,color</a></li><li><a href="#textfill">textfill x,y,color,sometext_or_char</a></li></ul></li><li>all draggable objects may have a <a href="#slider">slider</a> for translation / rotation; several objects may be translated / rotated by a single slider</li> <li> a draggable object can be set draggable by a preceding command <a href="#drag">'drag x/y/xy'</a><br />The translation can be read by javascript:read_dragdrop();The replyformat is : object_number : x-orig : y-orig : x-drag : y-drag<br />The x-orig/y-orig will be returned in maximum precision (javascript float)...<br />the x-drag/y-drag will be returned in defined 'precision' number of decimals<br />Multiple objects may be set draggable / clickable (no limit)<br /> not all flydraw objects may be dragged / clicked<br />Only draggable / clickable objects will be scaled on <a href="#zoom">zoom</a> and will be translated in case of panning</li><li> a 'onclick object' can be set 'clickable' by the preceding keyword <a href="#onclick">'onclick'</a><br />not all flydraw objects can be set clickable</li><li><b>remarks using a ';' as command separator</b><br />commands with only numeric or colour arguments may be using a ';' as command separator (instead of a new line)<br />commands with a string argument may not use a ';' as command separator !<br />these exceptions are not really straight forward... so keep this in mind.</li><li>almost every <a href="#userdraw">"userdraw object,color"</a> or <a href="#multidraw">"multidraw"</a> command 'family' may be combined with keywords <a href="#snaptogrid">"snaptogrid | xsnaptogrid | ysnaptogrid | snaptofunction</a> or command "snaptopoints x1,y1,x2,y2,..." </li><li>every draggable | onclick object may be combined with keywords <a href="#snaptogrid">snaptogrid | xsnaptogrid | ysnaptogrid | snaptofunction</a> or command "snaptopoints x1,y1,x2,y2,..." </li><li>almost every command for a single object has a multiple objects counterpart:<br /><ul>general syntaxrule:<li><em>single_object</em> x1,y1,...,color</li><li><em>multi_object</em> color,x1,y1,...</li></ul><li>All inputfields or textareas generated, can be styled individually using command <a href="#inputstyle">'inputstyle some_css'</a><br/>the fontsize used for labeling these elements can be controlled by command <a href="fontsize">'fontsize int'</a> <br />command 'fontfamily' is <b>not</b> active for these elements </li></ul>
  251. </span></li>
  252. <li><span style="color:blue;font-size:0.8em"> If needed multiple interactive scripts may be used in a single webpage.<br />A function 'read_canvas()' and / or 'read_dragdrop()' can read all interactive userdata from these images.<br />The global array 'canvas_scripts' will contain all unique random "canvas_root_id" of the included scripts.<br />The included local javascript "read" functions "read_canvas%d()" and "read_dragdrop%d()" will have this "%d = canvas_root_id"<br />e.g. canvas_scripts[0] will be the random id of the first script in the page and will thus provide a function<br />fun = eval("read_canvas"+canvas_scripts[0]) to read user based drawings / inputfield in this first image.<br />The read_dragdrop is analogue.<br />If the default reply formatting is not suitable, use command <a href='#replyformat'>'replyformat'</a> to format the replies for an individual canvas script,<br />To read all user interactions from all included canvas scripts , use something like:<br /><em>function read_all_canvas_images(){<br />&nbsp;var script_len = canvas_scripts.length;<br />&nbsp;var draw_reply = "";<br />&nbsp;var found_result = false;<br />&nbsp;for(var p = 0 ; p < script_len ; p++){<br />&nbsp;&nbsp;var fun = eval("read_canvas"+canvas_scripts[p]);<br />&nbsp;&nbsp;if( typeof fun === 'function'){<br />&nbsp;&nbsp;&nbsp;var result = fun();<br />&nbsp;&nbsp;&nbsp;if( result&nbsp;&nbsp;&& result.length != 0){<br />&nbsp;&nbsp;&nbsp;&nbsp;if(script_len == 1 ){ return result;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;found_result = true;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_reply = draw_reply + result + "\n";<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;};<br />&nbsp;if( found_result ){return draw_reply;}else{return null;};<br />};</em>
  253. </span></li>
  254. <li><span style="color:blue;font-size:0.8em"> you can check the javascript reply format in the wims tool <a href="http://localhost/wims/wims.cgi?lang=en&module=tool/directexec">direct exec</a>
  255. </span></li>
  256. <li><span style="color:blue;font-size:0.8em"> for usage within OEF (without anstype "draw"), something like this (a popup function plotter) will work:<br /><small>\text{popup_grapher=wims(exec canvasdraw <br />popup<br />size 400,400<br />xrange -10,10<br />yrange -10,10<br />axis<br />axisnumbering<br />opacity 100,100<br />grid 2,2,grey,2,2,6,black<br />snaptogrid<br />linewidth 2<br />jsplot red,5*sin(1/x)<br />strokecolor green<br />functionlabel f(x)=<br />userinput function<br />mouse blue,22<br />)<br />}<br />\statement{<br />\popup_grapher<br />}</small>
  257. </span></li>
  258. <li><span style="color:blue;font-size:0.8em"> be aware that older browsers will probably not work correctly<br />no effort has been undertaken to add glue code for older browsers !! <br />in any case it's not wise to use older browsers...not just for canvasdraw
  259. </span></li>
  260. <li><span style="color:blue;font-size:0.8em"> if you find flaws, errors or other incompatibilities -not those mentioned in this document- send <a href='mailto:jm.evers-at-schaersvoorde.nl'>me</a> an email with screenshots and the generated javascript include file.
  261. </span></li>
  262. <li><span style="color:blue;font-size:0.8em"> there is limited support for touch devices : touchstart,touchmove and touchend in commands <a href="#userdraw">userdraw primitives </a>, <a href="#protractor">protractor</a> and <a href="#ruler">ruler</a><br />only single finger gestures are supported (for now)<br />for more accurate user-interaction with canvasdraw on touch devices: use the command family <a href="userinput_xy">userinput</a>
  263. </span></li>
  264. </ul>
  265. <li><a name='affine' href='#affine top'>  affine a,b,c,d,tx,ty</a><ul>
  266. <li><span style="color:blue;font-size:0.8em"> defines a transformation matrix for subsequent objects
  267. </span></li>
  268. <li><span style="color:blue;font-size:0.8em"> images drawn by setting skew params a &amp; d will be very different from Flydraw's "affine a,b,c,d,e,tx,ty" !!
  269. </span></li>
  270. <li><span style="color:blue;font-size:0.8em"> use keyword 'killaffine' to end the transformation
  271. </span></li>
  272. <li><span style="color:blue;font-size:0.8em"> note 1: only 'draggable' / 'noclick' objects can be transformed.
  273. </span></li>
  274. <li><span style="color:blue;font-size:0.8em"> note 2: do not use 'onclick' or 'drag xy' with tranformation objects : the mouse coordinates do not get transformed (yet)
  275. </span></li>
  276. <li><span style="color:blue;font-size:0.8em"> note 3: no matrix operations on the transformation matrix implemented (yet)
  277. </span></li>
  278. <li><span style="color:blue;font-size:0.8em"> a : Scales the drawings horizontally
  279. </span></li>
  280. <li><span style="color:blue;font-size:0.8em"> b : Skews the drawings horizontally
  281. </span></li>
  282. <li><span style="color:blue;font-size:0.8em"> c : Skews the drawings vertically
  283. </span></li>
  284. <li><span style="color:blue;font-size:0.8em"> d : Scales the drawings vertically
  285. </span></li>
  286. <li><span style="color:blue;font-size:0.8em"> tx: Moves the drawings horizontally in xrange coordinate system
  287. </span></li>
  288. <li><span style="color:blue;font-size:0.8em"> ty: Moves the drawings vertically in yrange coordinate system
  289. </span></li>
  290. <li><span style="color:blue;font-size:0.8em"> the data precision may be set by preceding command "precision int"
  291. </span></li>
  292. </ul>
  293. <li><a name='angle' href='#angle top'>  angle xc,yc,width,start_angle,end_angle,color</a><ul>
  294. <li><span style="color:blue;font-size:0.8em"> width is in x-range
  295. </span></li>
  296. <li><span style="color:blue;font-size:0.8em"> will zoom in/out
  297. </span></li>
  298. <li><span style="color:blue;font-size:0.8em"> if size is controlled by command <a href='#slider'>'slider'</a> use radians to set limits of slider.
  299. </span></li>
  300. </ul>
  301. <li><a name='animate' href='#animate top'>  animate</a><ul>
  302. <li><span style="color:blue;font-size:0.8em"> keyword
  303. </span></li>
  304. <li><span style="color:blue;font-size:0.8em"> the animated point is a filled rectangle ; adjust colour with command 'fillcolor colorname/hexnumber'
  305. </span></li>
  306. <li><span style="color:blue;font-size:0.8em"> use linewidth to adjust size of the points
  307. </span></li>
  308. <li><span style="color:blue;font-size:0.8em"> will animate a point on the next jsplot/jscurve command
  309. </span></li>
  310. <li><span style="color:blue;font-size:0.8em"> only usable for command jsplot (normal functions or parametric)
  311. </span></li>
  312. <li><span style="color:blue;font-size:0.8em"> moves repeatedly from xmin to xmax or incase of a parametric function from tmin to tmax (set trange)
  313. </span></li>
  314. </ul>
  315. <li><a name='arc' href='#arc top'>  arc xc,yc,width,height,start_angle,end_angle,color</a><ul>
  316. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be set "onclick" or "drag xy"
  317. </span></li>
  318. <li><span style="color:blue;font-size:0.8em"> <b>attention</b>: width in height in x/y-range
  319. </span></li>
  320. <li><span style="color:blue;font-size:0.8em"> will not zoom in or zoom out (because radius is given in pixels an not in x/y-system !). Panning will work
  321. </span></li>
  322. <li><span style="color:blue;font-size:0.8em"> use command <a href='#angle'>'angle'</a> for scalable angle
  323. </span></li>
  324. </ul>
  325. <li><a name='arrow' href='#arrow top'>  arrow x1,y1,x2,y2,h,color</a><ul>
  326. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='vector' href='#vector top'>vector</a></span></li>
  327. <li><span style="color:blue;font-size:0.8em"> draw a single headed arrow / vector from (x1:y1) to (x2:y2)<br />with arrowhead size h in px and in color 'color'
  328. </span></li>
  329. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adjust thickness of the arrow
  330. </span></li>
  331. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  332. </span></li>
  333. </ul>
  334. <li><a name='arrows' href='#arrows top'>  arrows color,head (px),x1,y1,x2,y2...x_n,y_n</a><ul>
  335. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='vectors' href='#vectors top'>vectors</a></span></li>
  336. <li><span style="color:blue;font-size:0.8em"> draw single headed arrows / vectors from (x1:y1) to (x2:y2) ... (x3:y3) to (x4:y4) etc ... in color 'color'
  337. </span></li>
  338. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adjust thickness of the arrow
  339. </span></li>
  340. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually
  341. </span></li>
  342. </ul>
  343. <li><a name='arrow2' href='#arrow2 top'>  arrow2 x1,y1,x2,y2,h,color</a><ul>
  344. <li><span style="color:blue;font-size:0.8em"> draw a double headed arrow/vector from (x1:y1) to (x2:y2)<br />with arrowhead size h in px and in color 'color'
  345. </span></li>
  346. <li><span style="color:blue;font-size:0.8em"> use command 'arrowhead int' to adjust the arrow head size
  347. </span></li>
  348. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adjust thickness of the arrow
  349. </span></li>
  350. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  351. </span></li>
  352. </ul>
  353. <li><a name='arrows2' href='#arrows2 top'>  arrows2 color,head (px),x1,y1,x2,y2...x_n,y_n</a><ul>
  354. <li><span style="color:blue;font-size:0.8em"> draw double headed arrows / vectors from (x1:y1) to (x2:y2) ... (x3:y3) to (x4:y4) etc ... in color 'color'
  355. </span></li>
  356. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adjust thickness of the arrows
  357. </span></li>
  358. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually
  359. </span></li>
  360. </ul>
  361. <li><a name='arrowhead' href='#arrowhead top'>  arrowhead int</a><ul>
  362. <li><span style="color:blue;font-size:0.8em"> default 8 (pixels)
  363. </span></li>
  364. </ul>
  365. <li><a name='audio' href='#audio top'>  audio x,y,w,h,loop,visible,audiofile location</a><ul>
  366. <li><span style="color:blue;font-size:0.8em"> x,y : left top corner of audio element (in xrange / yrange)
  367. </span></li>
  368. <li><span style="color:blue;font-size:0.8em"> w,y : width and height in pixels
  369. </span></li>
  370. <li><span style="color:blue;font-size:0.8em"> loop : 0 or 1 ( 1 = loop audio fragment)
  371. </span></li>
  372. <li><span style="color:blue;font-size:0.8em"> visible : 0 or 1 (1 = show controls)
  373. </span></li>
  374. <li><span style="color:blue;font-size:0.8em"> audio format may be in *.mp3 or *.ogg
  375. </span></li>
  376. <li><span style="color:blue;font-size:0.8em"> If you are using *.mp3 : be aware that FireFox will not (never) play this ! (Pattented format)
  377. </span></li>
  378. <li><span style="color:blue;font-size:0.8em"> if you are using *.ogg : be aware that Microsoft based systems not support it natively
  379. </span></li>
  380. <li><span style="color:blue;font-size:0.8em"> To avoid problems supply both types (mp3 and ogg) of audiofiles.<br />the program will use both as source tag
  381. </span></li>
  382. <li><span style="color:blue;font-size:0.8em"> example: upload both audio1.ogg and audio1.mp3 to http://server/files/<br />audio 0,0,http://server/files/audio1.mp3<br />svdraw will copy html-tag audio1.mp3 to audio1.ogg<br /> and the browser will play the compatible file (audio1.ogg or audio1.mp3)<br />
  383. </span></li>
  384. </ul>
  385. <li><a name='axisnumbering' href='#axisnumbering top'>  axisnumbering</a><ul>
  386. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  387. </span></li>
  388. <li><span style="color:blue;font-size:0.8em"> for special numbering of x-axis or y-axis see grid related commands <a href="#axis">axis</a> <a href="#xaxis">xaxis</a> , <a href="#xaxisup">xaxisup</a>, <a href="#noxaxis">noxaxis</a> ,<a href="#yaxis">yaxis</a> , <a href="#yaxisup">yaxisup</a>, <a href="#noyaxis">noyaxis</a>
  389. </span></li>
  390. <li><span style="color:blue;font-size:0.8em"> to be used before command grid (see <a href="#grid">command grid</a>)
  391. </span></li>
  392. </ul>
  393. <li><a name='axis' href='#axis top'>  axis</a><ul>
  394. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  395. </span></li>
  396. <li><span style="color:blue;font-size:0.8em"> to be used before command grid (see <a href="#grid">command grid</a>)
  397. </span></li>
  398. </ul>
  399. <li><a name='barchart' href='#barchart top'>  barchart x_1:y_1:color_1:x_2:y_2:color_2:...x_n:y_n:color_n</a><ul>
  400. <li><span style="color:blue;font-size:0.8em"> may <b>only</b> to be used together with command <a href='#grid'>'grid'</a>
  401. </span></li>
  402. <li><span style="color:blue;font-size:0.8em"> can be used together with freestyle x-axis/y-axis texts : see commands <a href='#xaxis'>'xaxis'</a>,<a href='#xaxisup'>'xaxisup'</a> and <a href='#yaxis'>'yaxis'</a>
  403. </span></li>
  404. <li><span style="color:blue;font-size:0.8em"> use command <a href='#legend'>'legend'</a> to provide an optional legend in right-top-corner
  405. </span></li>
  406. <li><span style="color:blue;font-size:0.8em"> multiple barchart command may be used in a single script
  407. </span></li>
  408. <li><span style="color:blue;font-size:0.8em"> also see command <a href='#piechart'>'piechart'</a>
  409. </span></li>
  410. <li><span style="color:blue;font-size:0.8em"> note: your arguments are not checked by canvasdraw : use your javascript console in case of trouble...
  411. </span></li>
  412. </ul>
  413. <li><a name='bezier' href='#bezier top'>  bezier color,x_start,y_start,x_first,y_first,x_second,y_second,x_end,y_end</a><ul>
  414. <li><span style="color:blue;font-size:0.8em"> draw a bezier curve between points, starting from (x_start:y_start)
  415. </span></li>
  416. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be dragged or set onclick
  417. </span></li>
  418. </ul>
  419. <li><a name='bgcolor' href='#bgcolor top'>  bgcolor colorname or #hex</a><ul>
  420. <li><span style="color:blue;font-size:0.8em"> use this color as background of the "div" containing the canvas(es)
  421. </span></li>
  422. </ul>
  423. <li><a name='bgimage' href='#bgimage top'>  bgimage image_location</a><ul>
  424. <li><span style="color:blue;font-size:0.8em"> use an image as background .<br />technical: we use the background of 'canvas_div'
  425. </span></li>
  426. <li><span style="color:blue;font-size:0.8em"> the background image will be resized to match "width = xsize" and "height = ysize"
  427. </span></li>
  428. </ul>
  429. <li><a name='blink' href='#blink top'>  blink time(seconds)</a><ul>
  430. <li><span style="color:blue;font-size:0.8em"> NOT IMPLEMETED -YET
  431. </span></li>
  432. </ul>
  433. <li><a name='boxplot' href='#boxplot top'>  boxplot x_or_y,box-height_or_box-width,position,min,Q1,median,Q3,max</a><ul>
  434. <li><span style="color:blue;font-size:0.8em"> example:<br />xrange 0,300<br />yrange 0,10<br />boxplot x,4,8,120,160,170,220,245<br />meaning: create a boxplot in x-direction, with height 4 (in yrange) and centered around line y=8
  435. </span></li>
  436. <li><span style="color:blue;font-size:0.8em"> example:<br />xrange 0,10<br />yrange 0,300<br />boxplot y,4,8,120,160,170,220,245<br />meaning: create a boxplot in y-direction, with width 4 (in xrange) and centered around line x=8
  437. </span></li>
  438. <li><span style="color:blue;font-size:0.8em"> use command <a href='#filled'>'filled'</a> to fill the box<br /><b>note:</b> the strokecolor is used for filling Q1, the fillcolor is used for filling Q3
  439. </span></li>
  440. <li><span style="color:blue;font-size:0.8em"> use command <a href='#fillpattern'>'fillpattern some_pattern'</a> to use a (diamond for Q1, hatch for Q3) pattern.
  441. </span></li>
  442. <li><span style="color:blue;font-size:0.8em"> use command <a href='#opacity'>'opacity'</a> to adjust fill_opacity of stroke and fill colours
  443. </span></li>
  444. <li><span style="color:blue;font-size:0.8em"> use command <a href='#legend'>'legend'</a> to automatically create a legend <br />unicode allowed in legend<br />use command 'fontfamily' to set the font of the legend.
  445. </span></li>
  446. <li><span style="color:blue;font-size:0.8em"> there is no limit to the number of boxplots used.
  447. </span></li>
  448. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be set draggable (<a href='#onclick'>'onclick'</a> is not ready ,yet)
  449. </span></li>
  450. <li><span style="color:blue;font-size:0.8em"> use keyword <a href="#userboxplot">'userboxplot'</a> before command boxplot, if a pupil must draw a boxplot (using his own min,Q1,median,Q3,max data)
  451. </span></li>
  452. <li><span style="color:blue;font-size:0.8em"> use keyword <a href="#userboxplotdata">'userboxplotdata'</a> before command boxplot, if a pupil must generate the data by some means.
  453. </span></li>
  454. <li><span style="color:blue;font-size:0.8em"> use command <a href="#boxplotdata">'boxplotdata'</a> when the boxplot should be drawn from wims-generated raw statistical date
  455. </span></li>
  456. </ul>
  457. <li><a name='boxplotdata' href='#boxplotdata top'>  boxplotdata some_data</a><ul>
  458. <li><span style="color:blue;font-size:0.8em"> 'some_data' are a list of numbers separated by a comma "," (items)
  459. </span></li>
  460. <li><span style="color:blue;font-size:0.8em"> only be used before command 'boxplot': the command <a href="#boxplot">'boxplot'</a> will provide the boxplot drawing of the data.
  461. </span></li>
  462. <li><span style="color:blue;font-size:0.8em"> xrange 0,100<br />yrange 0,10<br />boxplotdata 11,22,13,15,23,43,12,12,14,2,45,32,44,13,21,24,13,19,35,21,24,23<br />boxplot x,4,5
  463. </span></li>
  464. <li><span style="color:blue;font-size:0.8em"> note: wims will not check your data input | format. use js-error console to debug any problems.
  465. </span></li>
  466. <li><span style="color:blue;font-size:0.8em"> a javascript function 'statistics()' will parse the data and calculate the values [min,Q1,median,Q3,max] and hand them to the boxplot draw function.
  467. </span></li>
  468. </ul>
  469. <li><a name='canvastype' href='#canvastype top'>  canvastype TYPE</a><ul>
  470. <li><span style="color:blue;font-size:0.8em"> for now only usefull before commands filltoborder / floodfill / clickfill etc operations<br />Only the images of this TYPE will be scanned and filled
  471. </span></li>
  472. <li><span style="color:blue;font-size:0.8em"> default value of TYPE is DRAG_CANVAS e.g. 5 (all clickable / draggable object are in this canvas)
  473. </span></li>
  474. <li><span style="color:blue;font-size:0.8em"> use another TYPE, if you know what you are doing...
  475. </span></li>
  476. <li><span style="color:blue;font-size:0.8em"> other possible canvasses (transparent PNG pictures xsize x ysize on top of each other)<ul><li> EXTERNAL_IMAGE_CANVAS 0</li><li> BG_CANVAS 1</li><li> STATIC_CANVAS 2</li><li> MOUSE_CANVAS 3</li><li> GRID_CANVAS 4</li><li> DRAG_CANVAS 5</li><li> DRAW_CANVAS 6</li><li> TEXT_CANVAS 7</li><li> CLOCK_CANVAS 8</li><li> ANIMATE_CANVAS 9</li><li> TRACE_CANVAS 10</li><li>BOXPLOT_CANVAS 11</li><li> JSPLOT_CANVAS 100 , will increase with every call</li><li> FILL_CANVAS 200 , will increase with every call </li><li> USERDRAW_JSPLOT 300 , will increase with every call </li><li>CLICKFILL_CANVAS 400 , will increase with every call/click</li><li>BOXPLOT_CANVAS 500 , will increase with every call</li></ul>
  477. </span></li>
  478. </ul>
  479. <li><a name='centerstring' href='#centerstring top'>  centerstring color,y-value,the text string</a><ul>
  480. <li><span style="color:blue;font-size:0.8em"> title color,y-value,the text string
  481. </span></li>
  482. <li><span style="color:blue;font-size:0.8em"> draw a string centered on the canvas at y = y-value
  483. </span></li>
  484. <li><span style="color:blue;font-size:0.8em"> can not be set "onclick" or "drag xy" (...)
  485. </span></li>
  486. <li><span style="color:blue;font-size:0.8em"> unicode supported: centerstring red,5,\u2232
  487. </span></li>
  488. <li><span style="color:blue;font-size:0.8em"> use a command like 'fontfamily italic 24px Ariel' <br />to set fonts on browser that support font change
  489. </span></li>
  490. </ul>
  491. <li><a name='circle' href='#circle top'>  circle xc,yc,width (2*r in pixels),color</a><ul>
  492. <li><span style="color:blue;font-size:0.8em"> use command 'fcircle xc,yc,d,color'
  493. </span></li>
  494. <li><span style="color:blue;font-size:0.8em"> alternative: disk for a filled circle
  495. </span></li>
  496. <li><span style="color:blue;font-size:0.8em"> use command 'fillcolor color' to set the fillcolor
  497. </span></li>
  498. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  499. </span></li>
  500. <li><span style="color:blue;font-size:0.8em"> will shrink / expand on zoom out / zoom in
  501. </span></li>
  502. </ul>
  503. <li><a name='circles' href='#circles top'>  circles color,xc1,yc1,r1,xc2,yc2,r2...xc_n,yc_n,r_n</a><ul>
  504. <li><span style="color:blue;font-size:0.8em"> <b>attention</b> r = radius in x-range (!)
  505. </span></li>
  506. <li><span style="color:blue;font-size:0.8em"> use keyword 'filled' or command 'fcircles' to produce solid circles
  507. </span></li>
  508. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='disks' href='#disks top'>disks</a></span></li>
  509. <li><span style="color:blue;font-size:0.8em"> use command 'fillcolor color' to set the fillcolor
  510. </span></li>
  511. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> (individually)
  512. </span></li>
  513. <li><span style="color:blue;font-size:0.8em"> will shrink / expand on zoom out / zoom in
  514. </span></li>
  515. </ul>
  516. <li><a name='clearbutton' href='#clearbutton top'>  clearbutton value</a><ul>
  517. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='delete' href='#delete top'>delete</a></span></li>
  518. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='erase' href='#erase top'>erase</a></span></li>
  519. <li><span style="color:blue;font-size:0.8em"> adds a button to clear the <a href="#userdraw">userdraw</a> canvas with text 'value'
  520. </span></li>
  521. <li><span style="color:blue;font-size:0.8em"> <b>attention</b> command 'clearbutton' is incompatible with <a href="multidraw">multidraw</a> based drawings<br/>(in 'multidraw' there is always a remove_object_button for every drawprimitive)
  522. </span></li>
  523. <li><span style="color:blue;font-size:0.8em"> normally <a href="#userdraw">userdraw</a> primitives have the option to use middle/right mouse button on<br /> a point of the object to remove this specific object...this clear button will remove all drawings
  524. </span></li>
  525. <li><span style="color:blue;font-size:0.8em"> uses the tooltip placeholder div element: may not be used with command 'intooltip'
  526. </span></li>
  527. <li><span style="color:blue;font-size:0.8em"> use command <a href="#inputstyle">'inputstyle'</a> to style the button...
  528. </span></li>
  529. <li><span style="color:blue;font-size:0.8em"> the clearbutton will have id="canvas_scripts[%d]" ; starting with %d=0 for the first script<br />to change the style of all "clearbutton" of all included canvasdraw scripts, use something like<br /><em>if(document.getElementById("clearbutton"+canvas_scripts[0])){<br />&nbsp;var p = 0;<br />&nbsp;while(document.getElementById("clearbutton"+canvas_scripts[p])){<br />&nbsp;&nbsp;document.getElementById("clearbutton"+canvas_scripts[p]).className="some_class_name";<br />&nbsp;&nbsp;&lt;!&minus;&minus; or document.getElementById("clearbutton"+canvas_scripts[p]).setAttribute("style","some_style"); &minus;&minus;&gt;<br />&nbsp;&nbsp;p++;<br />&nbsp;};<br />};<br />
  530. </span></li>
  531. </ul>
  532. <li><a name='clock' href='#clock top'>  clock x,y,r(px),H,M,S,type hourglass,interactive [ ,H_color,M_color,S_color,background_color,foreground_color ]</a><ul>
  533. <li><span style="color:blue;font-size:0.8em"> use command 'opacity stroke-opacity,fill-opacity' to adjust foreground (stroke) and background (fill) transparency
  534. </span></li>
  535. <li><span style="color:blue;font-size:0.8em"> type hourglass:<br />type = 0 : only segments<br />type = 1 : only numbers<br />type = 2 : numbers and segments
  536. </span></li>
  537. <li><span style="color:blue;font-size:0.8em"> colors are optional: if not defined, default values will be used<br />default colours: clock 0,0,60,4,35,45,1,2<br />custom colours: clock 0,0,60,4,35,45,1,2,,,,yellow,red<br />custom colours: clock 0,0,60,4,35,45,1,2,white,green,blue,black,yellow
  538. </span></li>
  539. <li><span style="color:blue;font-size:0.8em"> if you don't want a seconds hand (or minutes...), just make it invisible by using the background color of the hourglass...
  540. </span></li>
  541. <li><span style="color:blue;font-size:0.8em"> interactive <ul><li>0 : not interactive, just clock(s)</li><li>1 : function read_canvas() will read all active clocks in H:M:S format<br />The active clock(s) can be adjusted by pupils</li><li>2 : function read_canvas() will return the clicked clock <br />(like multiplechoice; first clock in script in nr. 0 )</li><li>3: no prefab buttons...create your own buttons (or other means) to make the clock(s) adjustable by javascript function set_clock(num,type,diff)<br />wherein: num = clock id (starts with 0) ; type = 1 (hours) ; type = 2 (minutes) ; type = 3 (seconds) <br />and diff = the increment of 'type' (positive or negative) </li></ul>
  542. </span></li>
  543. <li><span style="color:blue;font-size:0.8em"> canvasdraw will not check validity of colornames...the javascript console is your best friend
  544. </span></li>
  545. <li><span style="color:blue;font-size:0.8em"> no combinations with other reply_types allowed, for now
  546. </span></li>
  547. <li><span style="color:blue;font-size:0.8em"> if interactive is set to '1', 6 buttons per clock will be displayed for adjusting a clock (H+ M+ S+ H- M- S-)<br /> set_clock(clock_id,type,incr) <br />first clock has clock_id=0 ; type : H=1,M=2,S=3 ; incr : increment integer
  548. </span></li>
  549. <li><span style="color:blue;font-size:0.8em"> note: if you need multiple -interactive- clocks on a webpage, use multiple 'clock' commands in a single script !<br />and <i>not multiple canvas scripts</i> in a single page
  550. </span></li>
  551. <li><span style="color:blue;font-size:0.8em"> note: clocks will not zoom or pan, when using command <a href='#zoom'>'zoom'</a>
  552. </span></li>
  553. </ul>
  554. <li><a name='colorpalette' href='#colorpalette top'>  colorpalette color_name_1,color_name_2,...,color_name_8</a><ul>
  555. <li><span style="color:blue;font-size:0.8em"> opacity will be the same for all colors and is set by command <a href="#opacity">opacity [0-255],[0-255]</a>
  556. </span></li>
  557. <li><span style="color:blue;font-size:0.8em"> can be used with command <a href='#userdraw'>'userdraw clickfill,color'</a> when more than one fillcolor is wanted.<br />in that case use for example <a href='#replyformat'>replyformat 10</a> ... reply=x1:y1:color1,x2:y2:color2...<br />the pupil can choose from the given colors by clicking small coloured buttons.<br /> the click coordinates and corresponding fillcolor will be stored in read_canvas()...when using the appropriate replyformat.<br />the first color of the palette is color=0
  558. </span></li>
  559. <li><span style="color:blue;font-size:0.8em"> make sure to include the 'remove button' by using command <a href='#clearbutton'>clearbutton some_text</a>
  560. </span></li>
  561. </ul>
  562. <li><a name='copy' href='#copy top'>  copy x,y,x1,y1,x2,y2,[filename URL]</a><ul>
  563. <li><span style="color:blue;font-size:0.8em"> The image may be "bitmap" or "SVG"
  564. </span></li>
  565. <li><span style="color:blue;font-size:0.8em"> Insert the region from (x1,y1) to (x2,y2) (in pixels) of [filename] to (x,y) in x/y-range
  566. </span></li>
  567. <li><span style="color:blue;font-size:0.8em"> If x1=y1=x2=y2=-1, the whole [filename URL] is copied.
  568. </span></li>
  569. <li><span style="color:blue;font-size:0.8em"> [filename] is the URL of the image
  570. </span></li>
  571. <li><span style="color:blue;font-size:0.8em"> URL is normal URL of network reachable image file location<br />(eg special url for 'classexo' not -yet- implemented)
  572. </span></li>
  573. <li><span style="color:blue;font-size:0.8em"> if command <a href="#drag">'drag x/y/xy'</a> is set before command 'copy', the images will be draggable<br />javascript function read_canvas(); will return the x/y coordinate data in xrange/yrange of all -including non draggable- images<br />the command drag is only valid for the next image<br />draggable / non-draggable images may be mixed<br />may be used together with preceding keywords 'snaptogrid','xsnaptogrid','ysnaptogrid' or 'snaptopoints x1,y1,x2,y2...'
  574. </span></li>
  575. <li><span style="color:blue;font-size:0.8em"> if keyword <a href="#onclick">'onclick'</a> is set before command 'copy' the image(s) is clickable (marked with a green rectangle around the image)<br />use 'read_dragdrop' to get the number of the clicked image(s)<br />use command 'clearbutton some_text' to reset the reply/click array.<br />example: 4 images; student clicked on image 2 and 3 : reply = 0,1,1,0<br />after clicking the clear button: reply = 0,0,0,0<br />May be mixed with commands 'drag x|y|xy' (use javascript read_canvas to get the new coordinates
  576. </span></li>
  577. <li><span style="color:blue;font-size:0.8em"> 'onclick' for external images may be mixed with canvas generated stuff (like lines,curves etc)
  578. </span></li>
  579. <li><span style="color:blue;font-size:0.8em"> you may draw / userdraw / drag other stuff on top of an "imported" image
  580. </span></li>
  581. </ul>
  582. <li><a name='copyresized' href='#copyresized top'>  copyresized x1,y2,x2,y2,dx1,dy1,dx2,dy2,image_file_url</a><ul>
  583. <li><span style="color:blue;font-size:0.8em"> The image may be any "bitmap" or "SVG"
  584. </span></li>
  585. <li><span style="color:blue;font-size:0.8em"> Insert the region from (x1,y1) to (x2,y2) (in pixels) of [ filename], <br />possibly resized,<br />to the region of (dx1,dy1) to (dx2,dy2) in x/y-range
  586. </span></li>
  587. <li><span style="color:blue;font-size:0.8em"> (dx1:dy1) must be left top corner; (dx2 :dy2) must be right bottom corner of inserted image
  588. </span></li>
  589. <li><span style="color:blue;font-size:0.8em"> If x1=y1=x2=y2=-1, the whole [filename / URL ] is copied and resized.
  590. </span></li>
  591. <li><span style="color:blue;font-size:0.8em"> URL is normal URL of network reachable image file location<br />(as seen from public_html-root or network reachable 'http://some_server/my_images/test.gif'<br />(eg no special wims paths are searched !!)
  592. </span></li>
  593. <li><span style="color:blue;font-size:0.8em"> if command <a href="#drag">'drag x/y/xy'</a> is set before command 'copy', the images will be draggable<br />javascript function read_canvas(); will return the x/y coordinate data in xrange/yrange of all -including non draggable- images<br />the command drag is only valid for the next image<br />draggable / non-draggable images may be mixed<br />may be used together with preceding keywords 'snaptogrid','xsnaptogrid','ysnaptogrid' or 'snaptopoints x1,y1,x2,y2...'
  594. </span></li>
  595. <li><span style="color:blue;font-size:0.8em"> if keyword <a href="#onclick">'onclick'</a> is set before command 'copy' the image(s) is clickable (marked with a green rectangle around the image)<br />use 'read_dragdrop' to get the number of the clicked image(s)<br />use command 'clearbutton some_text' to reset the reply/click array.<br />example: 4 images; student clicked on image 2 and 3 : reply = 0,1,1,0<br />after clicking the clear button: reply = 0,0,0,0<br />May be mixed with commands 'drag x|y|xy' (use javascript read_canvas to get the new coordinates
  596. </span></li>
  597. <li><span style="color:blue;font-size:0.8em"> 'onclick' for external images may be mixed with canvas generated stuff (like lines,curves etc)
  598. </span></li>
  599. <li><span style="color:blue;font-size:0.8em"> you may draw / userdraw / drag stuff on top of an "imported" image
  600. </span></li>
  601. </ul>
  602. <li><a name='crosshair' href='#crosshair top'>  crosshair x,y,color</a><ul>
  603. <li><span style="color:blue;font-size:0.8em"> draw a single crosshair point at (x;y) in color 'color'
  604. </span></li>
  605. <li><span style="color:blue;font-size:0.8em"> use command 'crosshairsize int' and / or 'linewidth int' to adust
  606. </span></li>
  607. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  608. </span></li>
  609. </ul>
  610. <li><a name='crosshairs' href='#crosshairs top'>  crosshairs color,x1,y1,x2,y2,...,x_n,y_n</a><ul>
  611. <li><span style="color:blue;font-size:0.8em"> draw multiple crosshair points at given coordinates in color 'color'
  612. </span></li>
  613. <li><span style="color:blue;font-size:0.8em"> use command 'crosshairsize int' and / or 'linewidth int' to adust
  614. </span></li>
  615. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually (!)
  616. </span></li>
  617. </ul>
  618. <li><a name='crosshairsize' href='#crosshairsize top'>  crosshairsize int</a><ul>
  619. <li><span style="color:blue;font-size:0.8em"> default 8 (px)
  620. </span></li>
  621. </ul>
  622. <li><a name='cursor' href='#cursor top'>  cursor 'some CSS cursor_style'</a><ul>
  623. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='pointer' href='#pointer top'>pointer</a></span></li>
  624. <li><span style="color:blue;font-size:0.8em"> style can be any valid CSS property value, like crosshair,grabbing,move etc
  625. </span></li>
  626. <li><span style="color:blue;font-size:0.8em"> wims will not check the validity of your cursor declaration
  627. </span></li>
  628. </ul>
  629. <li><a name='curve' href='#curve top'>  curve color,formula(x)</a><ul>
  630. <li><span style="color:blue;font-size:0.8em"> alernative : plot color,formula(x)
  631. </span></li>
  632. <li><span style="color:blue;font-size:0.8em"> use command <a href="#trange">trange</a> in parametric functions before command curve / plot (trange -pi,pi)<br />curve color,formula1(t),formula2(t)
  633. </span></li>
  634. <li><span style="color:blue;font-size:0.8em"> use command <a href="#precision">"precision" </a>to ncrease the number of digits of the plotted points
  635. </span></li>
  636. <li><span style="color:blue;font-size:0.8em"> use command <a href="#plotsteps">"plotsteps"</a> to increase / decrease the amount of plotted points (default 150)
  637. </span></li>
  638. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  639. </span></li>
  640. <li><span style="color:blue;font-size:0.8em"> if you need a plot beyond xrange / yrange, use <a href="#jsplot">"jsplot"'</a><br />(command "curve" will only calculate points within the xrange)
  641. </span></li>
  642. </ul>
  643. <li><a name='dashed' href='#dashed top'>  dashed</a><ul>
  644. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  645. </span></li>
  646. <li><span style="color:blue;font-size:0.8em"> next object will be drawn with a dashed line
  647. </span></li>
  648. <li><span style="color:blue;font-size:0.8em"> change dashing scheme by using command <a href="#dashtype">dashtype</a>
  649. </span></li>
  650. </ul>
  651. <li><a name='dashtype' href='#dashtype top'>  dashtype line_width_px,space_width_px</a><ul>
  652. <li><span style="color:blue;font-size:0.8em"> every indiviual object may have its own dashtype, if needed...
  653. </span></li>
  654. <li><span style="color:blue;font-size:0.8em"> When keyword <a href='#dashed'>dashed</a> is set, the objects will be drawn with this dashtype
  655. </span></li>
  656. <li><span style="color:blue;font-size:0.8em"> default value "dashtype 2,2" e.g. 2px line and 2px space
  657. </span></li>
  658. <li><span style="color:blue;font-size:0.8em"> html5 canvas specification supports more arguments (dashing schemes) ... but not all modern browsers are yet capable
  659. </span></li>
  660. </ul>
  661. <li><a name='diamondfill' href='#diamondfill top'>  diamondfill x0,y0,dx,dy,color</a><ul>
  662. <li><span style="color:blue;font-size:0.8em"> x0,y0 in xrange / yrange
  663. </span></li>
  664. <li><span style="color:blue;font-size:0.8em"> distances dx,dy in pixels
  665. </span></li>
  666. <li><span style="color:blue;font-size:0.8em"> there is also a command <a href="userdraw">userdraw diamondfill,color</a>
  667. </span></li>
  668. </ul>
  669. <li><a name='dotfill' href='#dotfill top'>  dotfill x0,y0,dx,dy,color</a><ul>
  670. <li><span style="color:blue;font-size:0.8em"> x0,y0 in xrange / yrange
  671. </span></li>
  672. <li><span style="color:blue;font-size:0.8em"> distances dx,dy in pixels
  673. </span></li>
  674. <li><span style="color:blue;font-size:0.8em"> radius of dots is linewidth
  675. </span></li>
  676. <li><span style="color:blue;font-size:0.8em"> there is also a command <a href="userdraw">userdraw dotfill,color</a>
  677. </span></li>
  678. </ul>
  679. <li><a name='drag' href='#drag top'>  drag [x][y][xy]</a><ul>
  680. <li><span style="color:blue;font-size:0.8em"> the next object will be draggable in x / y / xy direction
  681. </span></li>
  682. <li><span style="color:blue;font-size:0.8em"> the displacement can be read by 'javascript:read_dragdrop();'
  683. </span></li>
  684. <li><span style="color:blue;font-size:0.8em"> the precision (default 2 decimals) in the student reply may be set with command <a href="#precision">'precision'.</a><br />Use this 'precision' command before this command 'drag x|y|xy' !
  685. </span></li>
  686. <li><span style="color:blue;font-size:0.8em"> 'onclick' and 'drag x|y|xy' may be combined (for different objects: a single object can either be onclick or drag , not both )
  687. </span></li>
  688. <li><span style="color:blue;font-size:0.8em"> 'multi_objects' will be numbered in the given x/y-sequence (example: points red,0,0,1,1,2,2,3,3 : point (0:0) is object_number 1)
  689. </span></li>
  690. <li><span style="color:blue;font-size:0.8em"> <b>attention</b>: static objects and 'onclick/drag' objects of the same type (like point,circle,etc) with the same coordinates (e.g. objects that overlap) will give problems in the 'recognition algorithm')<br />in this example<br /><em>linewidth 4<br />point 0,0,red<br />drag xy<br />point 0,0,blue<br /></em>the blue point will not be recognised as draggable !<br /><em>linewidth 4<br />drag xy<br />point 0,0,red<br />drag xy<br />point 0,0,blue<br /></em>both points will be recognised
  691. </span></li>
  692. <li><span style="color:blue;font-size:0.8em"> the answer is : drag_or_onclick_object_number : Xorg : Yorg : Xnew : Ynew<br />wherein object_number is the sequence number of the draggable &amp; onclick objects in your script.<br />Only draggable & onclick objects will have an object_number (e.g things like point,crosshair,line,segment,circle,rect,triangle...etc)
  693. </span></li>
  694. <li><span style="color:blue;font-size:0.8em"> use keyword 'snaptogrid' , 'xsnaptogrid' , 'ysnaptogrid' or command 'snaptopoints x1,y1,x2,y2,...' to switch from free to discrete movement
  695. </span></li>
  696. <li><span style="color:blue;font-size:0.8em"> in case of external images (commands copy / copyresized) the external image can be set draggable ; always xy. <br />The function javascript;read_canvas() will return the xy-coordinates of all images.
  697. </span></li>
  698. <li><span style="color:blue;font-size:0.8em"> note: in case an object is dragged , zooming or panning will cause the coordinates to be reset to the original position :( <br />e.g. dragging / panning will get lost. (array with 'drag data' is erased)<br />This is a design flaw and not a feature !!
  699. </span></li>
  700. </ul>
  701. <li><a name='ellipse' href='#ellipse top'>  ellipse xc,yc,radius_x,radius_y,color</a><ul>
  702. <li><span style="color:blue;font-size:0.8em"> a ellipse with center xc/yc in x/y-range
  703. </span></li>
  704. <li><span style="color:blue;font-size:0.8em"> radius_x and radius_y are in pixels
  705. </span></li>
  706. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  707. </span></li>
  708. <li><span style="color:blue;font-size:0.8em"> will shrink / expand on zoom out / zoom in
  709. </span></li>
  710. </ul>
  711. <li><a name='fillall' href='#fillall top'>  fillall color,x1,y1,x2,y2...x_n,y_n</a><ul>
  712. <li><span style="color:blue;font-size:0.8em"> fill all region containing points (x1:y1),(x2:y2)...(x_n:y_n) with color 'color'
  713. </span></li>
  714. <li><span style="color:blue;font-size:0.8em"> any other colors (objects) in the <a href="#canvastype>canvastype</a> will act as border to the bucket fill
  715. </span></li>
  716. <li><span style="color:blue;font-size:0.8em"> use this command after all boundary objects are declared.
  717. </span></li>
  718. <li><span style="color:blue;font-size:0.8em"> Use command 'userdraw clickfill,color' for user click driven flood fill.
  719. </span></li>
  720. <li><span style="color:blue;font-size:0.8em"> use command <a href="#canvastype">canvastype </a> to fill another canvas (default should be fine: DRAG_CANVAS = 5)
  721. </span></li>
  722. <li><span style="color:blue;font-size:0.8em"> note: the fill-family of commands are very (client) cpu intensive operations!<br />filling is done pixel by pixel<br/>e.g. image size of 400x400 uses 160000 pixels : each pixel contains 4 data (R,G,B,Opacity) = 640000 data.<br />on every data a few operations / comparisons are done...<br />So have pity on your students CPU..
  723. </span></li>
  724. </ul>
  725. <li><a name='filled' href='#filled top'>  filled</a><ul>
  726. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  727. </span></li>
  728. <li><span style="color:blue;font-size:0.8em"> the next 'fillable' object (only the next !) will be filled
  729. </span></li>
  730. <li><span style="color:blue;font-size:0.8em"> use command <a href="fillcolor">"fillcolor color"</a> to set fillcolor
  731. </span></li>
  732. <li><span style="color:blue;font-size:0.8em"> use <a href="#fillpattern">fillpattern</a> for non-solid color filling.
  733. </span></li>
  734. <li><span style="color:blue;font-size:0.8em"> use command "opacity 0-255,0-255" to set stroke and fill-opacity
  735. </span></li>
  736. <li><span style="color:blue;font-size:0.8em"> use command "fill x,y,color" or "floodfill x,y,color" to fill the space around (x;y) with color <br />pixel operation implemented in javascript: use with care !
  737. </span></li>
  738. </ul>
  739. <li><a name='fillcolor' href='#fillcolor top'>  fillcolor colorname or #hex</a><ul>
  740. <li><span style="color:blue;font-size:0.8em"> set the color : mainly used for command 'userdraw obj,stroke_color'
  741. </span></li>
  742. <li><span style="color:blue;font-size:0.8em"> all fillable massive objects will have a fillcolor == strokecolor (just to be compatible with flydraw...)
  743. </span></li>
  744. <li><span style="color:blue;font-size:0.8em"> see <a href="#fillpattern">fillpattern</a> for non-solid color filling.
  745. </span></li>
  746. </ul>
  747. <li><a name='fillpattern' href='#fillpattern top'>  fillpattern grid | hatch | diamond | dot | image-url</a><ul>
  748. <li><span style="color:blue;font-size:0.8em"> use a pattern as fillstyle
  749. </span></li>
  750. <li><span style="color:blue;font-size:0.8em"> suitable for all fillable object including the <a href="#userdraw">'userdraw objects' family</a>
  751. </span></li>
  752. <li><span style="color:blue;font-size:0.8em"> noy -yet- implemented in the <a href="#multidraw">multidraw objects family</a>...(will probably be too complex)
  753. </span></li>
  754. <li><span style="color:blue;font-size:0.8em"> the fillcolor is set by the object command, for example:<br />size 370,370<br />xrange -5,5<br />yrange -5,5<br />opacity 165,150<br />fillpattern grid<br />fcircle -6,3,160,blue<br />fillpattern dot<br />fcircle -3,-3,160,red<br />fillpattern hatch<br />fcircle 0,3,160,green<br />filpattern diamond<br />fcircle 3,-3,160,cyan<br />userdraw dotfill,blue<br />zoom red<br />
  755. </span></li>
  756. <li><span style="color:blue;font-size:0.8em"> the pattern dimensions are hardcoded (linewidth ,radius,dx,dy are fixed)
  757. </span></li>
  758. <li><span style="color:blue;font-size:0.8em"> the pattern color is set by command <a href='#fillcolor'>fillcolor</a> and <a href='#opacity'>opacity</a>
  759. </span></li>
  760. <li><span style="color:blue;font-size:0.8em"> see <a href="#fillcolor">fillcolor</a> for solid color filling.
  761. </span></li>
  762. <li><span style="color:blue;font-size:0.8em"> when using an image-url , make sure it contains an '/' in the filename...'fillpattern $$module_dir/gifs/test.jpg' will fill the next fillable object with this image.|<br />the argument to html5 canvas routine 'createPattern(img,argument)' is set to 'repeat'<br />e.g. if the image is smaller then the canvas, multiple copies will be used to fill the area ( e.g. ctx.fillStyle() = pattern)<br />for example:<br />size 150,150<br />xrange -5,5<br />yrange -5,5<br />drag xy<br />fillpattern gifs/en.gif<br />fcircle 0,0,100,red<br />fillpattern gifs/nl.gif<br />drag xy<br />fcircle -3,2,100,green<br />fillpattern gifs/cn.gif<br />drag xy<br />fcircle 3,2,100,green<br />
  763. </span></li>
  764. <li><span style="color:blue;font-size:0.8em"> fillpattern is also active for <a href="#userdraw">userdraw object,color"</a>...<br />the userdraw family a has also 'clickfill type' (e.g. an object gets filled between boundaries, when clicked) commands like:<br />'userdraw dotfill,color'<br />'userdraw hatchfill,color' etc
  765. </span></li>
  766. </ul>
  767. <li><a name='filltoborder' href='#filltoborder top'>  filltoborder x,y,bordercolor,color</a><ul>
  768. <li><span style="color:blue;font-size:0.8em"> fill the region of point (x:y) with color 'color'
  769. </span></li>
  770. <li><span style="color:blue;font-size:0.8em"> any other color will not act as border to the bucket fill
  771. </span></li>
  772. <li><span style="color:blue;font-size:0.8em"> use this command after all boundary objects are declared.
  773. </span></li>
  774. <li><span style="color:blue;font-size:0.8em"> use command <a href="#canvastype">canvastype </a> to fill another canvas (default should be fine: DRAG_CANVAS = 5)
  775. </span></li>
  776. <li><span style="color:blue;font-size:0.8em"> note: filltoborder is a very (client) cpu intensive operation!<br />filling is done pixel by pixel<br/>e.g. image size of 400x400 uses 160000 pixels : each pixel contains 4 data (R,G,B,Opacity) = 640000 data.<br />on every data a few operations / comparisons are done...<br />So have pity on your students CPU..
  777. </span></li>
  778. <li><span style="color:blue;font-size:0.8em"> maybe used together with command <a href="#userdraw">userdraw clickfill,color</a>
  779. </span></li>
  780. </ul>
  781. <li><a name='floodfill' href='#floodfill top'>  floodfill x,y,color</a><ul>
  782. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='fill' href='#fill top'>fill</a></span></li>
  783. <li><span style="color:blue;font-size:0.8em"> fill the region of point (x:y) with color 'color'
  784. </span></li>
  785. <li><span style="color:blue;font-size:0.8em"> any other color or size of picture (borders of picture) will act as border to the bucket fill
  786. </span></li>
  787. <li><span style="color:blue;font-size:0.8em"> use this command after all boundary objects are declared.
  788. </span></li>
  789. <li><span style="color:blue;font-size:0.8em"> Use command 'userdraw clickfill,color' for user click driven flood fill.
  790. </span></li>
  791. <li><span style="color:blue;font-size:0.8em"> use command <a href="#canvastype">canvastype </a> to fill another canvas (default should be fine: DRAG_CANVAS = 5)
  792. </span></li>
  793. <li><span style="color:blue;font-size:0.8em"> note: floodfill is a very (client) cpu intensive operation!<br />filling is done pixel by pixel<br/>e.g. image size of 400x400 uses 160000 pixels : each pixel contains 4 data (R,G,B,Opacity) = 640000 data.<br />on every data a few operations / comparisons are done...<br />So have pity on your students CPU..
  794. </span></li>
  795. </ul>
  796. <li><a name='fontcolor' href='#fontcolor top'>  fontcolor color</a><ul>
  797. <li><span style="color:blue;font-size:0.8em"> color: hexcolor or colorname
  798. </span></li>
  799. <li><span style="color:blue;font-size:0.8em"> default: black
  800. </span></li>
  801. <li><span style="color:blue;font-size:0.8em"> example usage: x/y-axis text
  802. </span></li>
  803. </ul>
  804. <li><a name='fontfamily' href='#fontfamily top'>  fontfamily font_description</a><ul>
  805. <li><span style="color:blue;font-size:0.8em"> set the font family; for browsers that support it
  806. </span></li>
  807. <li><span style="color:blue;font-size:0.8em"> font_description: Ariel ,Courier, Helvetica etc
  808. </span></li>
  809. <li><span style="color:blue;font-size:0.8em"> in case commands<br /> 'string color,x,y,the string'<br /> 'stringup color,x,y,rotation,the string'<br />fontfamily can be something like:<br />italic 34px Ariel
  810. </span></li>
  811. <li><span style="color:blue;font-size:0.8em"> use correct syntax : 'font style' 'font size'px 'fontfamily'
  812. </span></li>
  813. </ul>
  814. <li><a name='fontsize' href='#fontsize top'>  fontsize font_size</a><ul>
  815. <li><span style="color:blue;font-size:0.8em"> default value 12
  816. </span></li>
  817. <li><span style="color:blue;font-size:0.8em"> note:for some macro's (like grid | legend | xaxistext | xlabel etc) sometimes command <a href="#fontfamily">"fontfamily"</a> can be used for some specific font-setting<br />this is however not always very straight forward...so just try and see what happens
  818. </span></li>
  819. </ul>
  820. <li><a name='functionlabel' href='#functionlabel top'>  functionlabel 'some string'</a><ul>
  821. <li><span style="color:blue;font-size:0.8em"> default value "f(x)="
  822. </span></li>
  823. <li><span style="color:blue;font-size:0.8em"> no mathml allowed (just ascii string)
  824. </span></li>
  825. <li><span style="color:blue;font-size:0.8em"> use command 'fontsize int' to adjust the size
  826. </span></li>
  827. <li><span style="color:blue;font-size:0.8em"> use command 'strokecolor colorname' to adjust the labels (individually, if needed)
  828. </span></li>
  829. <li><span style="color:blue;font-size:0.8em"> if needed, use before every command 'userinput function | inputfield | textarea'
  830. </span></li>
  831. </ul>
  832. <li><a name='grid' href='#grid top'>  grid step_x,step_y,gridcolor</a><ul>
  833. <li><span style="color:blue;font-size:0.8em"> if keywords <a href="#axis">"axis"</a> or <a href="#axisnumbering">"axisnumbering"</a> are set, use :<br />grid step_x,step_y,major_color,minor_x,minor_y,tics height in px,axis_color<br />minor x step = step_x / minor_x
  834. </span></li>
  835. <li><span style="color:blue;font-size:0.8em"> in that case, use command <a href="#fontcolor">"fontcolor"</a>, <a href="#fontsize">"fontsize"</a> and / or <a href="#fontfamily">"fontfamily"</a> to adjust font <br />defaults: black,12,Ariel
  836. </span></li>
  837. <li><span style="color:blue;font-size:0.8em"> if xmin > 0 and/or ymin > 0 and zooming / panning is not activ: <br /> be aware that the x/y-axis numbering and x/y major/minor tic marks will not be visual <br /> as they are placed under the x-axis and left to the y-axis (in Quadrant II and IV)
  838. </span></li>
  839. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be set <a href="#onclick">"onclick"</a> or <a href="#drag">"drag xy"</a>
  840. </span></li>
  841. <li><span style="color:blue;font-size:0.8em"> use commands <a href="#xlabel">'xlabel some_string'</a> and/or <a href="#ylabel">'ylabel some_string'</a> to label axis;<br />use command "fontsize" to adjust size:the font family is non-configurable 'italic your_fontsize px Ariel' !
  842. </span></li>
  843. <li><span style="color:blue;font-size:0.8em"> see commands (see <a href="#xaxis">"xaxis" or xaxistext"</a>, <a href="#yaxis">"yaxis" or "yaxistext"</a> to set tailormade values on axis (the used font is set by <a href="fontfamily">command fontfamily</a>; default '12px Ariel')
  844. </span></li>
  845. <li><span style="color:blue;font-size:0.8em"> see command <a href="#legend">"legend"</a>to set a legend for the graph ;<br />use command <a href="#fontsize">"fontsize"</a> to adjust size (the font family is non-configurable 'bold your_fontsize px Ariel')
  846. </span></li>
  847. </ul>
  848. <li><a name='gridfill' href='#gridfill top'>  gridfill x0,y0,dx,dy,color</a><ul>
  849. <li><span style="color:blue;font-size:0.8em"> x0,y0 in xrange / yrange
  850. </span></li>
  851. <li><span style="color:blue;font-size:0.8em"> distances dx,dy in pixels
  852. </span></li>
  853. <li><span style="color:blue;font-size:0.8em"> there is also a command <a href="userdraw">userdraw hatchfill,color</a>
  854. </span></li>
  855. </ul>
  856. <li><a name='demiline' href='#demiline top'>  demiline x1,y1,x2,y2,color</a><ul>
  857. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='halfline' href='#halfline top'>halfline</a></span></li>
  858. <li><span style="color:blue;font-size:0.8em"> draws a halfline starting in (x1:y1) and through (x2:y2) in color 'color' (colorname or hex)
  859. </span></li>
  860. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  861. </span></li>
  862. </ul>
  863. <li><a name='demilines' href='#demilines top'>  demilines color,x1,y1,x2,y2,....</a><ul>
  864. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='halflines' href='#halflines top'>halflines</a></span></li>
  865. <li><span style="color:blue;font-size:0.8em"> draws halflines starting in (x1:y1) and through (x2:y2) in color 'color' (colorname or hex) etc etc
  866. </span></li>
  867. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> indiviually
  868. </span></li>
  869. </ul>
  870. <li><a name='hatchfill' href='#hatchfill top'>  hatchfill x0,y0,dx,dy,color</a><ul>
  871. <li><span style="color:blue;font-size:0.8em"> x0,y0 in xrange / yrange
  872. </span></li>
  873. <li><span style="color:blue;font-size:0.8em"> distances dx,dy in pixels
  874. </span></li>
  875. <li><span style="color:blue;font-size:0.8em"> there is also a command <a href="userdraw">userdraw hatchfill,color</a>
  876. </span></li>
  877. </ul>
  878. <li><a name='hline' href='#hline top'>  hline x,y,color</a><ul>
  879. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='horizontalline' href='#horizontalline top'>horizontalline</a></span></li>
  880. <li><span style="color:blue;font-size:0.8em"> draw a horizontal line through point (x:y) in color 'color'
  881. </span></li>
  882. <li><span style="color:blue;font-size:0.8em"> or use command <a href='#curve'>'curve color,formula'</a> to draw the line <br />(uses more points to draw the line; is however better draggable)
  883. </span></li>
  884. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  885. </span></li>
  886. </ul>
  887. <li><a name='hlines' href='#hlines top'>  hlines color,x1,y1,x2,y2,...</a><ul>
  888. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='horizontallines' href='#horizontallines top'>horizontallines</a></span></li>
  889. <li><span style="color:blue;font-size:0.8em"> draw horizontal lines through points (x1:y1)...(xn:yn) in color 'color'
  890. </span></li>
  891. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually
  892. </span></li>
  893. </ul>
  894. <li><a name='http' href='#http top'>  http x1,y1,x2,y2,http://some_adress.com</a><ul>
  895. <li><span style="color:blue;font-size:0.8em"> an active html-page will be displayed in an "iframe" rectangle left top (x1:y1) , right bottom (x2:y2)
  896. </span></li>
  897. <li><span style="color:blue;font-size:0.8em"> do not use interactivity (or mouse) if the mouse needs to be active in the iframe
  898. </span></li>
  899. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be 'set onclick' or 'drag xy'
  900. </span></li>
  901. </ul>
  902. <li><a name='html' href='#html top'>  html x1,y1,x2,y2,html_string</a><ul>
  903. <li><span style="color:blue;font-size:0.8em"> all tags are allowed<br /> html-code using inputfields could be read using your own javascript-code. Do not use id's like 'canvas_input0' etc.
  904. </span></li>
  905. <li><span style="color:blue;font-size:0.8em"> can be set onclick <br />(however dragging not supported)
  906. </span></li>
  907. </ul>
  908. <li><a name='imagefill' href='#imagefill top'>  imagefill dx,dy,scaling to xsize &times; ysize?,image_url</a><ul>
  909. <li><span style="color:blue;font-size:0.8em"> The next suitable <b>filled object</b> will be filled with "image_url" tiled
  910. </span></li>
  911. <li><span style="color:blue;font-size:0.8em"> scaling to xsize &times; ysize ? ... 1 = yes 0 = no
  912. </span></li>
  913. <li><span style="color:blue;font-size:0.8em"> After pattern filling ,the fill-color should be reset !
  914. </span></li>
  915. <li><span style="color:blue;font-size:0.8em"> wims getins / image from class directory : imagefill 80,80,my_image.gif
  916. </span></li>
  917. <li><span style="color:blue;font-size:0.8em"> normal url : imagefill 80,80,0,$module_dir/gifs/my_image.gif
  918. </span></li>
  919. <li><span style="color:blue;font-size:0.8em"> normal url : imagefill 80,80,1,http://adres/a/b/c/my_image.jpg
  920. </span></li>
  921. <li><span style="color:blue;font-size:0.8em"> if dx,dy is larger than the image, the whole image will be background to the next object.
  922. </span></li>
  923. </ul>
  924. <li><a name='inputstyle' href='#inputstyle top'>  inputstyle style_description</a><ul>
  925. <li><span style="color:blue;font-size:0.8em"> may be used before any 'style-able' html object.(like inputfields or buttons)<br />or any html objects that are generated by some canvasdraw commands
  926. </span></li>
  927. <li><span style="color:blue;font-size:0.8em"> example: inputstyle color:blue;font-weight:bold;font-style:italic;font-size:16pt
  928. </span></li>
  929. </ul>
  930. <li><a name='input' href='#input top'>  input x,y,size,editable,value</a><ul>
  931. <li><span style="color:blue;font-size:0.8em"> to set inputfield "readonly", use editable = 0
  932. </span></li>
  933. <li><span style="color:blue;font-size:0.8em"> only active inputfields (editable = 1) will be read with read_canvas();
  934. </span></li>
  935. <li><span style="color:blue;font-size:0.8em"> if "$status=done" (e.g. in answer.phtml) the inputfield will be cleared and set readonly<br />override this by keyword <a href="#status">'status'</a>
  936. </span></li>
  937. <li><span style="color:blue;font-size:0.8em"> may be further controlled by <a href="#inputstyle">"inputstyle"</a> (inputcss is not yet implemented...)
  938. </span></li>
  939. <li><span style="color:blue;font-size:0.8em"> if mathml inputfields are present and / or some userdraw is performed, these data will <b>not</b> be send as well (javascript:read_canvas();)
  940. </span></li>
  941. <li><span style="color:blue;font-size:0.8em"> use keyword <a href='#xoffset'>xoffset | centered</a> if the inputfield should be centered on (x:y)<br /> default is the left top corner is (x:y)
  942. </span></li>
  943. </ul>
  944. <li><a name='intooltip' href='#intooltip top'>  intooltip link_text</a><ul>
  945. <li><span style="color:blue;font-size:0.8em"> link_text is a single line (span-element)
  946. </span></li>
  947. <li><span style="color:blue;font-size:0.8em"> link_text may also be an image URL 'http://some_server/images/my_image.png' or '$module_dir/gifs/my_image.jpg'
  948. </span></li>
  949. <li><span style="color:blue;font-size:0.8em"> link_text may contain HTML markup
  950. </span></li>
  951. <li><span style="color:blue;font-size:0.8em"> the canvas will be displayed in a tooltip on 'link_text'
  952. </span></li>
  953. <li><span style="color:blue;font-size:0.8em"> the canvas is default transparent: use command <a href="#bgcolor">'bgcolor color'</a> to adjust background-color<br />the link text will also be shown with this 'bgcolor'.
  954. </span></li>
  955. <li><span style="color:blue;font-size:0.8em"> many 'userinput stuff' will use the tooltip_placeholder_div element...only one is defined in the wims-page<br />and are therefor these commands are mutually exclusive.<br />keep this in mind...
  956. </span></li>
  957. </ul>
  958. <li><a name='jscurve' href='#jscurve top'>  jscurve color,formula1(x),formula2(x),formula3(x),...</a><ul>
  959. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='jsplot' href='#jsplot top'>jsplot</a></span></li>
  960. <li><span style="color:blue;font-size:0.8em"> your function will be plotted by the javascript engine of the client browser
  961. </span></li>
  962. <li><span style="color:blue;font-size:0.8em"> if <a href='trange'>trange</a> is defined, the two functions will be plotted parametric<br /><b>note</b>: use <i>x</i> as variable...and not <i>t</i>. Use keyword <a href='#animate'>animate</a> to animate a point on the curve
  963. </span></li>
  964. <li><span style="color:blue;font-size:0.8em"> use only basic math in your curve:<br /> sqrt,^,asin,acos,atan,log,pi,abs,sin,cos,tan,e
  965. </span></li>
  966. <li><span style="color:blue;font-size:0.8em"> use parenthesis and rawmath : use 2*x instead of 2x ; use 2^(sin(x))...etc etc<br />use error console to debug any errors...
  967. </span></li>
  968. <li><span style="color:blue;font-size:0.8em"> <b>attention</b> : last "precision" command in the canvasdraw script determines the calculation precision of the javascript curve plot !
  969. </span></li>
  970. <li><span style="color:blue;font-size:0.8em"> no validity check is done by wims.
  971. </span></li>
  972. <li><span style="color:blue;font-size:0.8em"> zooming & panning are implemented :<br />use command 'zoom color' for mouse driven zooming<br />or use keyword 'setlimits' for inputfields setting xmin/xmax, ymin/ymax
  973. </span></li>
  974. <li><span style="color:blue;font-size:0.8em"> zooming & panning is better than for curves produced by command <a href="#curve">curve color,formula</a> because for avery change in x/y-range the curve is recalculated in javascript
  975. </span></li>
  976. <li><span style="color:blue;font-size:0.8em"> use keyword <a href='animate'>animate</a> for animating a point on the curve
  977. </span></li>
  978. <li><span style="color:blue;font-size:0.8em"> use command 'trace_jscurve formula(x)` for tracing
  979. </span></li>
  980. <li><span style="color:blue;font-size:0.8em"> use command 'jsmath formula(x)` for calculating and displaying indiviual points on the curve
  981. </span></li>
  982. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> (yet)
  983. </span></li>
  984. <li><span style="color:blue;font-size:0.8em"> commands plotjump / plotstep are not active for 'jscurve'
  985. </span></li>
  986. <li><span style="color:blue;font-size:0.8em"> every command jscurve will produce a new canvas (canvastype 111,112,113...) for this one curve.
  987. </span></li>
  988. <li><span style="color:blue;font-size:0.8em"> plotting multiple js-curves on the same canvas <br/>(for example if you want to use 'userdraw clickfill,color' on <a href="#canvastype">canvastype</a> number 111 ,use :<br/> jscurve red,fun1(x),fun2(x)...fun_n(x)<br /> you want to specify individual colors | opacity | linewidth for these multiple js-curves.<br />use commands like: <a href="#multistrokecolors">multistrokecolors</a>,<a href="#multilinewidth">multilinewidth</a>, <a href="#multidash">multidash</a><br />, <a href="multistrokeopacity">multistroke</a><br />the <b>color</b> given for the command "jscurve <b>color</b>,formulas(x)" will not be used in that case...<br />but the color argument must still be given in any case (otherwise syntax error...)
  989. </span></li>
  990. </ul>
  991. <li><a name='jsmath' href='#jsmath top'>  jsmath some_math_function</a><ul>
  992. <li><span style="color:blue;font-size:0.8em"> will calculate an y-value from a userinput x-value and draws a crosshair on these coordinates.
  993. </span></li>
  994. <li><span style="color:blue;font-size:0.8em"> default labels 'x' and 'y'<br />the commands 'xlabel some_x_axis_name' and 'ylabel some_y_axis_name' will set the label for the input fields
  995. </span></li>
  996. <li><span style="color:blue;font-size:0.8em"> use command 'inputstyle some_css' for styling the display fields. Use command 'fontsize int' to size the labels 'x' and 'y'
  997. </span></li>
  998. <li><span style="color:blue;font-size:0.8em"> example: jsmath sin(x^2)
  999. </span></li>
  1000. <li><span style="color:blue;font-size:0.8em"> the client browser will convert your math function to javascript math.<br />use parenthesis and rawmath : use 2*x instead of 2x etc etc<br />no check is done on the validity of your function and/or syntax<br />use error console to debug any errors...
  1001. </span></li>
  1002. <li><span style="color:blue;font-size:0.8em"> be aware that the formula's of the plotted function(s) can be found in the page javascript source
  1003. </span></li>
  1004. </ul>
  1005. <li><a name='killaffine' href='#killaffine top'>  killaffine</a><ul>
  1006. <li><span style="color:blue;font-size:0.8em"> keyword : resets the transformation matrix to 1,0,0,1,0,0
  1007. </span></li>
  1008. </ul>
  1009. <li><a name='killrotate' href='#killrotate top'>  killrotate will reset the command <a href="#rotationcenter">rotationcenter xc,yc</a></a><ul>
  1010. <li><span style="color:blue;font-size:0.8em"> a following rotate command will have the first object point as rotation center
  1011. </span></li>
  1012. <li><span style="color:blue;font-size:0.8em"> if not set, the rotation center will remain unchanged
  1013. </span></li>
  1014. </ul>
  1015. <li><a name='killslider' href='#killslider top'>  killslider</a><ul>
  1016. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  1017. </span></li>
  1018. <li><span style="color:blue;font-size:0.8em"> ends grouping of object under a previously defined slider
  1019. </span></li>
  1020. </ul>
  1021. <li><a name='killtranslation' href='#killtranslation top'>  killtranslation</a><ul>
  1022. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='killtranslate' href='#killtranslate top'>killtranslate</a></span></li>
  1023. <li><span style="color:blue;font-size:0.8em"> resets the translation matrix to 1,0,0,1,0,0
  1024. </span></li>
  1025. </ul>
  1026. <li><a name='line' href='#line top'>  line x1,y1,x2,y2,color</a><ul>
  1027. <li><span style="color:blue;font-size:0.8em"> draw a line through points (x1:y1)--(x2:y2) in color 'color'
  1028. </span></li>
  1029. <li><span style="color:blue;font-size:0.8em"> or use command 'curve color,formula' to draw the line <br />(uses more points to draw the line; is however better draggable)
  1030. </span></li>
  1031. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1032. </span></li>
  1033. </ul>
  1034. <li><a name='lines' href='#lines top'>  lines color,x1,y1,x2,y2...x_n-1,y_n-1,x_n,y_n</a><ul>
  1035. <li><span style="color:blue;font-size:0.8em"> draw multiple lines through points (x1:y1)--(x2:y2) ...(x_n-1:y_n-1)--(x_n:y_n) in color 'color'
  1036. </span></li>
  1037. <li><span style="color:blue;font-size:0.8em"> or use multiple commands 'curve color,formula' or "jscurve color,formule" to draw the line <br />(uses more points to draw the line; is however better draggable)
  1038. </span></li>
  1039. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1040. </span></li>
  1041. <li><span style="color:blue;font-size:0.8em"> <b>attention</b>: the flydraw command "lines" is equivalent to canvasdraw command <a href="#polyline">"polyline"</a>
  1042. </span></li>
  1043. </ul>
  1044. <li><a name='linewidth' href='#linewidth top'>  linewidth int</a><ul>
  1045. <li><span style="color:blue;font-size:0.8em"> default 1
  1046. </span></li>
  1047. </ul>
  1048. <li><a name='lattice' href='#lattice top'>  lattice x0,y0,xv1,yv1,xv2,yv2,n1,n2,color</a><ul>
  1049. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be set "onclick" or "drag xy"
  1050. </span></li>
  1051. </ul>
  1052. <li><a name='levelcurve' href='#levelcurve top'>  levelcurve color,expression in x/y,l1,l2,...</a><ul>
  1053. <li><span style="color:blue;font-size:0.8em"> draws very primitive level curves for expression, with levels l1,l2,l3,...,l_n
  1054. </span></li>
  1055. <li><span style="color:blue;font-size:0.8em"> the quality is <b>not to be compared</b> with the Flydraw levelcurve. <br />(choose flydraw if you want quality...)
  1056. </span></li>
  1057. <li><span style="color:blue;font-size:0.8em"> every individual level curve may be set 'onclick / drag xy' <br />e.g. every single level curve (l1,l2,l3...l_n) has a unique identifier
  1058. </span></li>
  1059. <li><span style="color:blue;font-size:0.8em"> note : the arrays for holding the javascript data are limited in size
  1060. </span></li>
  1061. <li><span style="color:blue;font-size:0.8em"> note : reduce image size if javascript data arrays get overloaded<br />(command 'plotsteps int' will not control the data size of the plot...)
  1062. </span></li>
  1063. </ul>
  1064. <li><a name='legend' href='#legend top'>  legend string1:string2:string3....string_n</a><ul>
  1065. <li><span style="color:blue;font-size:0.8em"> will be used to create a legend for a graph
  1066. </span></li>
  1067. <li><span style="color:blue;font-size:0.8em"> also see command <a href='#piechart'>'piechart'</a>
  1068. </span></li>
  1069. <li><span style="color:blue;font-size:0.8em"> will use the same colors per default as used in the graphs : use command <a href='#legendcolors'>'legendcolors'</a> to override the default
  1070. </span></li>
  1071. <li><span style="color:blue;font-size:0.8em"> use command <a href="#fontsize">fontsize</a> to adjust. (command "fontfamily" is not active for command "legend")
  1072. </span></li>
  1073. </ul>
  1074. <li><a name='legendcolors' href='#legendcolors top'>  legendcolors color1:color2:color3:...:color_n</a><ul>
  1075. <li><span style="color:blue;font-size:0.8em"> will be used to colour a legend: use this command after the legend command ! e.g.<br />legend test1:test2:test3<br />legendcolors blue:red:orange
  1076. </span></li>
  1077. <li><span style="color:blue;font-size:0.8em"> make sure the number of colours match the number of legend items
  1078. </span></li>
  1079. <li><span style="color:blue;font-size:0.8em"> command 'legend' in case of 'piechart' and 'barchart' will use these colours per default (no need to specify 'legendcolors'
  1080. </span></li>
  1081. </ul>
  1082. <li><a name='linegraph' href='#linegraph top'>  linegraph x1:y1:x2:y2...x_n:y_n</a><ul>
  1083. <li><span style="color:blue;font-size:0.8em"> will plot your data in a graph
  1084. </span></li>
  1085. <li><span style="color:blue;font-size:0.8em"> may <b>only</b> to be used together with command <a href='#grid'>'grid'</a>
  1086. </span></li>
  1087. <li><span style="color:blue;font-size:0.8em"> can be used together with freestyle x-axis/y-axis texts : see commands <a href='#xaxis'>'xaxis'</a>,<a href='#xaxisup'>'xaxisup'</a> and <a href='#yaxis'>'yaxis'</a>
  1088. </span></li>
  1089. <li><span style="color:blue;font-size:0.8em"> use command <a href='#legend'>'legend'</a> to provide an optional legend in right-top-corner
  1090. </span></li>
  1091. <li><span style="color:blue;font-size:0.8em"> also see command <a href='#piechart'>'piechart'</a>
  1092. </span></li>
  1093. <li><span style="color:blue;font-size:0.8em"> multiple linegraphs may be used in a single plot
  1094. </span></li>
  1095. <li><span style="color:blue;font-size:0.8em"> note: your arguments are not checked by canvasdraw : use your javascript console in case of trouble...
  1096. </span></li>
  1097. <li><span style="color:blue;font-size:0.8em"> <ul><li>use command <a href='#strokecolor'>'strokecolor'</a> before a command 'linegraph' to set the color of this graph</li><li>use command <a href='#linewidth'>'linewidth'</a> before command 'linegraph' to set linewidth of this graph</li><li>use keyword <a href='#dashed'>'dashed'</a> before command 'linegraph' to set dashing of the graph</li><li>if dashing is set, use command <a href='#dashtype'>'dashtype'</a> before command 'linegraph' to set the type of dashing of the (individual) graph</li></ul>
  1098. </span></li>
  1099. </ul>
  1100. <li><a name='mathml' href='#mathml top'>  mathml x1,y1,x2,y2,mathml_string</a><ul>
  1101. <li><span style="color:blue;font-size:0.8em"> mathml will be displayed in a rectangle left top (x1:y1)...<br />x2 and y2 are still needed, but not used as the right bottom corner of the embedded div element.
  1102. </span></li>
  1103. <li><span style="color:blue;font-size:0.8em"> in case of drag(xy|x|y) | onclick the div rectangle left to corner will be the drag-anchor of the mathml object
  1104. </span></li>
  1105. <li><span style="color:blue;font-size:0.8em"> can be set onclick <br />javascript:read_dragdrop(); will return click numbers of mathml-objects<br />if 4 click_able object are drawn, the reply could be 1,0,1,0 ... meaning clicked on the first and third object
  1106. </span></li>
  1107. <li><span style="color:blue;font-size:0.8em"> can be set draggable<br /> the javascript:read_dragdrop() will return all coordinates <br />in same order as the canvas script: unmoved object will have their original coordinates...
  1108. </span></li>
  1109. <li><span style="color:blue;font-size:0.8em"> snaptogrid is supported...snaptopoints will work, but use with care...due to the primitive dragging<br />technically: the dragstuff library is not used...the mathml is embedded in a new div element and not in the html5-canvas
  1110. </span></li>
  1111. <li><span style="color:blue;font-size:0.8em"> when clicked, the mathml object will be drawn in red color; the div background color will be determined by the <a href="#fillcolor">'fillcolor'</a> and <a href="#opacity">'opacity'</a> settings
  1112. </span></li>
  1113. <li><span style="color:blue;font-size:0.8em"> userdraw may be combined with 'mathml' ; the read_canvas() will contain the drawing.
  1114. </span></li>
  1115. <li><span style="color:blue;font-size:0.8em"> draggable or onclick 'external images' from command <a href='#copyresized'>copy or copyresized</a> can be combined with drag and/or onclick mathml
  1116. </span></li>
  1117. <li><span style="color:blue;font-size:0.8em"> other drag objects (circles/rects etc) are supported , but read_dragdrop() will probably be difficult to interpret...
  1118. </span></li>
  1119. <li><span style="color:blue;font-size:0.8em"> if inputfields are incorporated in mathml (with id's : id='mathml0',id='mathml1',...id='mathml_n')<br />the user_input values will be read by javascript:read_mathml();<br /><b>attention</b>: if after this mathml-input object other user-interactions are included, these will read mathml too using "read_canvas();"
  1120. </span></li>
  1121. <li><span style="color:blue;font-size:0.8em"> If other inputfields (command input / command textarea) or userdraw is performed, the function read_canvas() will not read mathml. Use some generic function to read it....
  1122. </span></li>
  1123. </ul>
  1124. <li><a name='mouse' href='#mouse top'>  mouse color,fontsize</a><ul>
  1125. <li><span style="color:blue;font-size:0.8em"> will display the cursor (x:y) coordinates in 'color' and 'font size'<br /> using default fontfamily Ariel
  1126. </span></li>
  1127. <li><span style="color:blue;font-size:0.8em"> note: use command 'mouse' at the end of your script code (the same is true for command 'zoom')
  1128. </span></li>
  1129. </ul>
  1130. <li><a name='mouse_degree' href='#mouse_degree top'>  mouse_degree color,fontsize</a><ul>
  1131. <li><span style="color:blue;font-size:0.8em"> will display the angle in degrees between x-axis, (0:0) and the cursor (x:y) in 'color' and 'font size'<br /> using a fontfamily Ariel
  1132. </span></li>
  1133. <li><span style="color:blue;font-size:0.8em"> The angle is positive in QI and QIII and the angle value is negative in QII and QIV
  1134. </span></li>
  1135. <li><span style="color:blue;font-size:0.8em"> note: use command 'mouse' at the end of your script code (the same is true for command 'zoom')
  1136. </span></li>
  1137. </ul>
  1138. <li><a name='display' href='#display top'>  display TYPE,color,fontsize</a><ul>
  1139. <li><span style="color:blue;font-size:0.8em"> TYPE may be x | y | xy | degree | radian | radius
  1140. </span></li>
  1141. <li><span style="color:blue;font-size:0.8em"> will display the mouse cursor coordinates as x-only,y-only,(x:y),<br />the radius of a circle (this only in case 'userdraw circle(s),color')<br />or the angle in degrees or radians for commands "userdraw arc,color" or protractor , ruler (if set dynamic)
  1142. </span></li>
  1143. <li><span style="color:blue;font-size:0.8em"> use commands 'xunit' and / or 'yunit' to add the units to the mouse values.<br />The "degree | radian" will always have the appropriate symbol)
  1144. </span></li>
  1145. <li><span style="color:blue;font-size:0.8em"> just like commands 'mouse','mousex','mousey','mouse_degree'...only other name)
  1146. </span></li>
  1147. </ul>
  1148. <li><a name='precision' href='#precision top'>  precision int</a><ul>
  1149. <li><span style="color:blue;font-size:0.8em"> 1 = no decimals ; 10 = 1 decimal ; 100 = 2 decimals etc
  1150. </span></li>
  1151. <li><span style="color:blue;font-size:0.8em"> may be used / changed before every object
  1152. </span></li>
  1153. <li><span style="color:blue;font-size:0.8em"> In case of user interaction (like 'userdraw' or 'multidraw') this value will be used to determine the amount of decimals in the reply / answer
  1154. </span></li>
  1155. </ul>
  1156. <li><a name='mousex' href='#mousex top'>  mousex color,fontsize</a><ul>
  1157. <li><span style="color:blue;font-size:0.8em"> will display the cursor x-coordinate in 'color' and 'font size'<br /> using the fontfamily Ariel
  1158. </span></li>
  1159. <li><span style="color:blue;font-size:0.8em"> note: use command 'mouse' at the end of your script code (the same is true for command 'zoom')
  1160. </span></li>
  1161. </ul>
  1162. <li><a name='mousey' href='#mousey top'>  mousey color,fontsize</a><ul>
  1163. <li><span style="color:blue;font-size:0.8em"> will display the cursor y-coordinate in 'color' and 'font size'<br /> using default fontfamily Ariel
  1164. </span></li>
  1165. <li><span style="color:blue;font-size:0.8em"> note: use command 'mouse' at the end of your script code (the same is true for command 'zoom')
  1166. </span></li>
  1167. </ul>
  1168. <li><a name='multidash' href='#multidash top'>  multidash 0,1,1</a><ul>
  1169. <li><span style="color:blue;font-size:0.8em"> meaning draw objects no. 2 (circle) and 3 (segments), in the list of command like <em>'multifill points,circle,segments'</em>, are dashed
  1170. </span></li>
  1171. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1172. </span></li>
  1173. <li><span style="color:blue;font-size:0.8em"> if not set all objects will be set 'not dashed'...<br />unless a generic keyword <em>'dashed'</em> was given before command <em>'multidraw'</em>
  1174. </span></li>
  1175. <li><span style="color:blue;font-size:0.8em"> the dash-type is not -yet- adjustable <br />(e.g. command <em>dashtype line_px,space_px</em> will give no control over multidraw objects)
  1176. </span></li>
  1177. <li><span style="color:blue;font-size:0.8em"> wims will <b>not</b> check if the number of 0 or 1's matches the amount of draw primitives...
  1178. </span></li>
  1179. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1180. </span></li>
  1181. </ul>
  1182. <li><a name='multidraw' href='#multidraw top'>  multidraw obj_type_1,obj_type_2...obj_type_11</a><ul>
  1183. <li><span style="color:blue;font-size:0.8em"> for simple single object user drawings you could also use command <a href="#userdraw">'userdraw'</a>
  1184. </span></li>
  1185. <li><span style="color:blue;font-size:0.8em"> implemented obj_types:<ul><li>point | points </li><li>circle | circles </li><li>line | lines </li><li>segment | segments </li><li>arrow | arrows <br />use command 'arrowhead int' for size (default value 8 pixels)</li><li>rect | rects </li><li>closedpoly<br /><b>only one</b> closedpolygon may be drawn.The number of 'corner points' is not preset (e.g. not limited,freestyle)<br />the polygone is closed when clicking on the first point again..(+/- 10px) </li><li>triangle | triangles</li><li>parallelogram | parallelograms</li><li>poly[3-9] | polys[3-9] draw 3...9 point polygone(s): polys3 is of course triangles </li></ul>
  1186. </span></li>
  1187. <li><span style="color:blue;font-size:0.8em"> additionally objects may be user labelled, using obj_type 'text'...<br />in this case allways a text input field and if <a href='#multiuserinput'> multiuserinput=1 </a> also (x:y) inputfields will be added to the page.<br />use commands 'fontfamily' and 'fontcolor' to adjust. (command 'multistrokeopacity' may be set to adjust text opacity)<br />note: text is always centered on the mouse-click or user-input coordinates !<br />note: no keyboard listeners are used
  1188. </span></li>
  1189. <li><span style="color:blue;font-size:0.8em"> it makes no sense using something like "multidraw point,points" ... <br />something like "multidraw polys4,polys7" will only result in drawing a '4 point polygone' and not a '7 point polygone' : this is a design flaw and not a feature...
  1190. </span></li>
  1191. <li><span style="color:blue;font-size:0.8em"> note: mouselisteners are only active if "$status != done " (eg only drawing in an active/non-finished exercise) <br /> to overrule use command/keyword "status" (no arguments required)
  1192. </span></li>
  1193. <li><span style="color:blue;font-size:0.8em"> buttons for changing the obj_type (and incase of 'multiuserinput' , some inputfields and buttons) <br />will be present in the reserved div 'tooltip_div' and can be styled using command 'inputstyle some_css'
  1194. </span></li>
  1195. <li><span style="color:blue;font-size:0.8em"> the button label will be default the 'object primitive name' (like 'point', 'circles').<br />If you want a different label (e.g. an other language) ,use command 'multilabel'<br />for example in dutch: <br /><em>multilabel cirkel,lijnstuk,punten,STOP<br />multidraw circle,segment,points</em><br />(see command <a href='#multilabel'>'multilabel'</a> for more details)
  1196. </span></li>
  1197. <li><span style="color:blue;font-size:0.8em"> multidraw is incompatible with command 'tooltip' (the reserved div_area is used for the multidraw control buttons)
  1198. </span></li>
  1199. <li><span style="color:blue;font-size:0.8em"> all 'multidraw' drawings will scale on zooming.<br />this in contrast to the command <a href="#userdraw">'userdraw'</a>.
  1200. </span></li>
  1201. <li><span style="color:blue;font-size:0.8em"> wims will <b>not</b> check the amount or validity of your command arguments ! <br />( use javascript console to debug any typo's )
  1202. </span></li>
  1203. <li><span style="color:blue;font-size:0.8em"> a local function read_canvas%d will read all userbased drawings.<br />The output is always a 11 lines string with fixed sequence.<br/>line 1 = points_x+";"+points_y+"\n"<br/>line 2 = circles_x+";"+circlespoint_y+";"+multi_radius+"\n"<br/>line 3 = segments_x+";"+segments_y+"\n"<br/>line 4 = arrows_x+";"+arrows_y+"\n"<br/>line 5 = lines_x+";"+lines_y+"\n"<br/>line 6 = triangles_x+";"+triangles_y+"\n"<br/>line 7 = polys[3-9]_x+";"+polys[3-9]_y+"\n"<br/>line 8 = rects_x +";"+rects_y+"\n"<br />line 9 = closedpoly_x+";"+closedpoly_y+"\n"<br/>line 10 = parallelogram_x+";"+parallelogram_y"\n"<br/>line 11 = text_x+";"+text_y+";"+text"\n"<br/>The x/y-data are in x/y-coordinate system and display precision may be set by a previous command 'precision 0 | 10 | 100 | 1000...'<br />In case of circles the radius is -for the time being- rounded to pixels<br /><b>use the wims "direct exec" tool to see the format of the reply</b>
  1204. </span></li>
  1205. <li><span style="color:blue;font-size:0.8em"> It is best to prepare / format the student reply in clientside javascript.<br />However in wims language you could use something like this<br />for example you are interested in the polys5 drawings of a pupil (the pupil may draw multiple poly5 objects...)<br />note: the reply for 2 poly5's is: x11,x12,x13,x14,x15,x21,x22,x23,x24,x25 ; y11,y12,y13,y14,y15,y21,y22,y23,y24,y25<br />rep = !line 7 of reply <br />rep = !translate ';' to '\n' in $rep <br />pts = 5 # 5 points for polygon <br />x_rep = !line 1 of $rep <br />y_rep = !line 2 of $rep <br />tot = !itemcnt $x_rep <br />num_poly = $[$tot/$pts] <br />idx = 0 <br />!for p=1 to $num_poly <br />&nbsp;!for s=1 to $pts <br />&nbsp;&nbsp;!increase idx <br />&nbsp;&nbsp;X = !item $idx of $x_rep <br />&nbsp;&nbsp;Y = !item $idx of $y_rep <br />&nbsp;&nbsp;# do some checking <br />&nbsp;!next s <br />!next p <br />
  1206. </span></li>
  1207. <li><span style="color:blue;font-size:0.8em"> <b>attention</b>: for command argument 'closedpoly' only one polygone can be drawn.<br />The last point (e.g. the point clicked near the first point) of the array is removed.
  1208. </span></li>
  1209. <li><span style="color:blue;font-size:0.8em"> <em>technical: all 10 'draw primitives' + 'text' will have their own -transparent- PNG bitmap canvas. <br />So for example there can be a points_canvas entirely separated from a line_canvas.<br />This to avoid the need for a complete redraw when something is drawn to the canvas...(eg only the object_type_canvas is redrawn)<br />This in contrast to many very slow do-it-all HTML5 canvas javascript libraries.<br />The mouselisteners are attached to the canvas-div element.</em>
  1210. </span></li>
  1211. </ul>
  1212. <li><a name='multilabel' href='#multilabel top'>  multilabel button_label_1,button_label_2,...,button_label_8,'stop drawing text'</a><ul>
  1213. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1214. </span></li>
  1215. <li><span style="color:blue;font-size:0.8em"> if not set all labels (e.g. the value='' of input type 'button') will be set by the english names for the draw_primitives (like 'point','circle'...)
  1216. </span></li>
  1217. <li><span style="color:blue;font-size:0.8em"> the 'stop drawing' button text <b>must</b> be the last item on the 'multilabel' -list <br />for example:<br /><em>multilabel punten,lijnen,Stop met Tekenen<br />multidraw points,lines</em>
  1218. </span></li>
  1219. <li><span style="color:blue;font-size:0.8em"> all buttons can be 'styled' by using commant 'inputstyle'<br /><b>note:</b><em>If you want to add some CSS style to the buttons...<br />the id's of the 'draw buttons' are their english command argument<br />(e.g. id="canvasdraw_points" for the draw points button).<br />the id of the 'stop drawing' button is "canvasdraw_stop_drawing".<br />the id of the "OK" button is"canvasdraw_ok_button"</em>
  1220. </span></li>
  1221. <li><span style="color:blue;font-size:0.8em"> wims will not check the amount or validity of your input
  1222. </span></li>
  1223. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1224. </span></li>
  1225. </ul>
  1226. <li><a name='multilinewidth' href='#multilinewidth top'>  multilinewidth linewidth_1,linewidth_2,...,linewidth_8</a><ul>
  1227. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1228. </span></li>
  1229. <li><span style="color:blue;font-size:0.8em"> if not set all line width will be set by a previous command <em>'linewidth int'</em>
  1230. </span></li>
  1231. <li><span style="color:blue;font-size:0.8em"> use these up to 7 different line widths for the draw primitives used by command <em>'multidraw obj_type_1,obj_type_2...obj_type_7</em>
  1232. </span></li>
  1233. <li><span style="color:blue;font-size:0.8em"> wims will <b>not</b> check if the number of 0 or 1's matches the amount of draw primitives...
  1234. </span></li>
  1235. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1236. </span></li>
  1237. </ul>
  1238. <li><a name='multifill' href='#multifill top'>  multifill 0,0,1,0,1,0,0</a><ul>
  1239. <li><span style="color:blue;font-size:0.8em"> meaning draw objects no. 3 and 5, in the list of command 'multifill', are filled<br />(if the object is fillable...and not a line,segment,arrow or point...)
  1240. </span></li>
  1241. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1242. </span></li>
  1243. <li><span style="color:blue;font-size:0.8em"> if not set all objects -except point|points- will be set 'not filled'...<br />unless a command 'filled' was given before command 'multifill'
  1244. </span></li>
  1245. <li><span style="color:blue;font-size:0.8em"> only suitable for draw_primitives like 'circle | circles' , 'triangle | triangles' and 'polygon'
  1246. </span></li>
  1247. <li><span style="color:blue;font-size:0.8em"> wims will <b>not</b> check if the number of 0 or 1's matches the amount of draw primitives...
  1248. </span></li>
  1249. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1250. </span></li>
  1251. </ul>
  1252. <li><a name='multifillcolors' href='#multifillcolors top'>  multifillcolors color_name_1,color_name_2,...,color_name_8</a><ul>
  1253. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1254. </span></li>
  1255. <li><span style="color:blue;font-size:0.8em"> if not set all fillcolors (for circle | triangle | poly[3-9] | closedpoly ) will be 'stroke_color' , 'fill_opacity'
  1256. </span></li>
  1257. <li><span style="color:blue;font-size:0.8em"> use these up to 6 colors for the draw primitives used by command 'multidraw obj_type_1,obj_type_2...obj_type_n
  1258. </span></li>
  1259. <li><span style="color:blue;font-size:0.8em"> wims will <b>not</b> check if the number of colours matches the amount of draw primitives...
  1260. </span></li>
  1261. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1262. </span></li>
  1263. <li><span style="color:blue;font-size:0.8em"> can also be used with command <a href='#userdraw'>'userdraw clickfill,color'</a> when more than one fillcolor is wanted.<br />in that case use for example <a href='#replyformat'>replyformat 10</a> ... reply=x1:y1:color1,x2:y2:color2...<br />the colors will restart at the first color, when there are more fill-clicks than multi-fill-colors<br />if more control over the used colours is wanted , see command <a href='#colorpalette'>colorpalette color1,color2...</a>
  1264. </span></li>
  1265. </ul>
  1266. <li><a name='multifillopacity' href='#multifillopacity top'>  multifillopacity fill_opacity_1,fill_opacity_2,...,fill_opacity_8</a><ul>
  1267. <li><span style="color:blue;font-size:0.8em"> float values 0 - 1 or integer values 0 - 255
  1268. </span></li>
  1269. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1270. </span></li>
  1271. <li><span style="color:blue;font-size:0.8em"> if not set all fill opacity_ will be set by previous command <em>'opacity int,int'</em> and keyword <em>'filled'</em>
  1272. </span></li>
  1273. <li><span style="color:blue;font-size:0.8em"> use these up to 7 different stroke opacities for the draw primitives used by command <em>'multidraw obj_type_1,obj_type_2...obj_type_y</em>
  1274. </span></li>
  1275. <li><span style="color:blue;font-size:0.8em"> wims will not check the amount or validity of your input
  1276. </span></li>
  1277. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1278. </span></li>
  1279. </ul>
  1280. <li><a name='multisnaptogrid' href='#multisnaptogrid top'>  multisnaptogrid 0,1,1</a><ul>
  1281. <li><span style="color:blue;font-size:0.8em"> meaning draw objects no. 2 (circle) and 3 (segments), in the list of command like <em>'multifill points,circle,segments'</em>, will snap to the xy-grid (default 1 in x/y-coordinate system: see command <a href='#snaptogrid'>'snaptogrid'</a>)
  1282. </span></li>
  1283. <li><span style="color:blue;font-size:0.8em"> only the x-values snap_to_grid: <em>multisnaptogrid 0,2,2</em>
  1284. </span></li>
  1285. <li><span style="color:blue;font-size:0.8em"> only the y-values snap_to_grid: <em>multisnaptogrid 0,3,3</em>
  1286. </span></li>
  1287. <li><span style="color:blue;font-size:0.8em"> mixing allowed: <em>multisnaptogrid 1,2,3,0</em> e.g. the first object will snap to the xy-grid, the second draw object will snap to the x-values, the third object will snap to the y-valeus of the grid, the last object may be placed anywhere on the canvas
  1288. </span></li>
  1289. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1290. </span></li>
  1291. <li><span style="color:blue;font-size:0.8em"> if not set all objects will be set 'no snap'...<br />unless a generic command 'snaptogrid' was given before command 'multidraw'
  1292. </span></li>
  1293. <li><span style="color:blue;font-size:0.8em"> commands <a href='#xsnaptogrid'>'xsnaptogrid'</a>, <a href='#ysnaptogrid'>'ysnaptogrid'</a>, <a href='#snaptofunction'>'snaptofunction'</a> and <a href='#snaptopoints'>'snaptopoints</a> x1,y1,x2,y2...' are <b>not</b> supported at this time
  1294. </span></li>
  1295. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1296. </span></li>
  1297. <li><span style="color:blue;font-size:0.8em"> wims will <b>not</b> check if the number of 0 or 1's matches the amount of draw primitives...
  1298. </span></li>
  1299. </ul>
  1300. <li><a name='multistrokecolors' href='#multistrokecolors top'>  multistrokecolors color_name_1,color_name_2,...,color_name_8</a><ul>
  1301. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1302. </span></li>
  1303. <li><span style="color:blue;font-size:0.8em"> if not set all colors will be 'stroke_color' , 'stroke_opacity'
  1304. </span></li>
  1305. <li><span style="color:blue;font-size:0.8em"> use these up to 6 colors for the draw primitives used by command <em>'multidraw obj_type_1,obj_type_2...obj_type_7</em>
  1306. </span></li>
  1307. <li><span style="color:blue;font-size:0.8em"> wims will <b>not</b> check if the number of colours matches the amount of draw primitives...
  1308. </span></li>
  1309. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1310. </span></li>
  1311. </ul>
  1312. <li><a name='multistrokeopacity' href='#multistrokeopacity top'>  multistrokeopacity stroke_opacity_1,stroke_opacity_2,...,stroke_opacity_7</a><ul>
  1313. <li><span style="color:blue;font-size:0.8em"> float values 0 - 1 or integer values 0 - 255
  1314. </span></li>
  1315. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1316. </span></li>
  1317. <li><span style="color:blue;font-size:0.8em"> if not set all stroke opacity_ will be set by previous command <em>'opacity int,int'</em>
  1318. </span></li>
  1319. <li><span style="color:blue;font-size:0.8em"> use these up to 7 different stroke opacities for the draw primitives used by command <em>'multidraw obj_type_1,obj_type_2...obj_type_7</em>
  1320. </span></li>
  1321. <li><span style="color:blue;font-size:0.8em"> wims will not check the amount or validity of your input
  1322. </span></li>
  1323. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1324. </span></li>
  1325. </ul>
  1326. <li><a name='multiuserinput' href='#multiuserinput top'>  multiuserinput 0,1,1,0</a><ul>
  1327. <li><span style="color:blue;font-size:0.8em"> meaning, when the command 'multidraw' is used <br />multidraw circles,points,lines,triangles<br />objects 'points' and 'lines' may additionally be 'drawn' by direct input (inputfields)<br/>all other objects must be drawn with a mouse
  1328. </span></li>
  1329. <li><span style="color:blue;font-size:0.8em"> in case of circle | circles a third inputfield for Radius (R) is added.<br />the radius must be in the x/y coordinate system (x-range) and <b>not</b> in pixels...students don't think in pixels.<br />note: R-values will not snap-to-grid
  1330. </span></li>
  1331. <li><span style="color:blue;font-size:0.8em"> in case of line(s) | segment(s) | arrow(s) the user should write <b>x1:y1</b> in the first inputfield and <b/>x2:y2</b> in the second.<br />These 'hints' are pre-filled into the input field.<br />other coordinate delimiters are ";" and "," e.g. <b>x1;y1</b> or <b>x1,y1</b>.<br />An error message (alert box) will popup when things are not correctly...
  1332. </span></li>
  1333. <li><span style="color:blue;font-size:0.8em"> in case of a triangle | poly3, three inputfields are provided.
  1334. </span></li>
  1335. <li><span style="color:blue;font-size:0.8em"> in case of 'text' and multiuserinput=1 , 3 inputfields will be shown : x,y,text
  1336. </span></li>
  1337. <li><span style="color:blue;font-size:0.8em"> in case of 'text' and multiuserinput=0 , 1 inputfield will be shown : text ... a mouse click will place the text on the canvas.
  1338. </span></li>
  1339. <li><span style="color:blue;font-size:0.8em"> may be styled using command <a href="#inputstyle">"inputstyle"</a>
  1340. </span></li>
  1341. <li><span style="color:blue;font-size:0.8em"> an additional button 'stop drawing' may be used to combine userbased drawings with 'drag&amp;drop' or 'onclick' elements
  1342. </span></li>
  1343. <li><span style="color:blue;font-size:0.8em"> when exercise if finished (status=done) the buttons will not be shown.<br />To override this default behaviour use command / keyword 'status'
  1344. </span></li>
  1345. <li><span style="color:blue;font-size:0.8em"> use before command <a href='#multidraw'>'multidraw'</a>
  1346. </span></li>
  1347. <li><span style="color:blue;font-size:0.8em"> always use the same sequence as is used for 'multidraw'
  1348. </span></li>
  1349. </ul>
  1350. <li><a name='noaxis' href='#noaxis top'>  noaxis</a><ul>
  1351. <li><span style="color:blue;font-size:0.8em"> keyword
  1352. </span></li>
  1353. <li><span style="color:blue;font-size:0.8em"> if set, the automatic x-axis numbering will be ignored
  1354. </span></li>
  1355. <li><span style="color:blue;font-size:0.8em"> use command <a href="#axis">axis</a> to have a visual x/y-axis lines (see command <a href="grid">grid</a>
  1356. </span></li>
  1357. <li><span style="color:blue;font-size:0.8em"> to be used before command grid (see <a href="#grid">command grid</a>)
  1358. </span></li>
  1359. </ul>
  1360. <li><a name='noayis' href='#noayis top'>  noayis</a><ul>
  1361. <li><span style="color:blue;font-size:0.8em"> keyword
  1362. </span></li>
  1363. <li><span style="color:blue;font-size:0.8em"> if set, the automatic y-axis numbering will be ignored
  1364. </span></li>
  1365. <li><span style="color:blue;font-size:0.8em"> use command <a href="#axis">axis</a> to have a visual x/y-axis lines (see command <a href="grid">grid</a>
  1366. </span></li>
  1367. <li><span style="color:blue;font-size:0.8em"> to be used before command grid (see <a href="#grid">command grid</a>)
  1368. </span></li>
  1369. </ul>
  1370. <li><a name='numberline' href='#numberline top'>  numberline x0,x1,xmajor,xminor,y0,y1</a><ul>
  1371. <li><span style="color:blue;font-size:0.8em"> numberline is using xrange/yrange system for all dimensions
  1372. </span></li>
  1373. <li><span style="color:blue;font-size:0.8em"> multiple numberlines are allowed ; combinations with command <a href='#grid'>grid</a> is allowed; multiples commands <a href='#xaxis'>xaxis numbering</a> are allowed
  1374. </span></li>
  1375. <li><span style="color:blue;font-size:0.8em"> x0 is start x-value in xrange
  1376. </span></li>
  1377. <li><span style="color:blue;font-size:0.8em"> x1 is end x-value in xrange
  1378. </span></li>
  1379. <li><span style="color:blue;font-size:0.8em"> xmajor is step for major division
  1380. </span></li>
  1381. <li><span style="color:blue;font-size:0.8em"> xminor is divisor of xmajor; using small (30% of major tick) tick marks: this behaviour is 'hardcoded'
  1382. </span></li>
  1383. <li><span style="color:blue;font-size:0.8em"> is xminor is an even divisor, an extra tickmark (60% of major tick) is added to the numberline : this behaviour is 'hardcoded'
  1384. </span></li>
  1385. <li><span style="color:blue;font-size:0.8em"> y0 is bottom of numberline; y1 endpoint of major tics
  1386. </span></li>
  1387. <li><span style="color:blue;font-size:0.8em"> use command <a href="#linewidth">linewidth</a> to control appearance
  1388. </span></li>
  1389. <li><span style="color:blue;font-size:0.8em"> use <a href="#strokecolor">strokecolor</a> and <a href="#opacity">opacity</a> to controle measure line
  1390. </span></li>
  1391. <li><span style="color:blue;font-size:0.8em"> for all ticks linewidth and color / opacity are identical.
  1392. </span></li>
  1393. <li><span style="color:blue;font-size:0.8em"> if command <a href="#xaxis">xaxis</a> or <a href="#xaxisup">xaxisup</a> is not defined, the labeling will be on major ticks: x0...x1
  1394. </span></li>
  1395. <li><span style="color:blue;font-size:0.8em"> use <a href="#fontfamily">fontfamily</a> and <a href="#fontcolor">fontcolor</a> to control fonts settings
  1396. </span></li>
  1397. <li><span style="color:blue;font-size:0.8em"> may be used together with <a href="#userdraw">userdraw</a> , <a href="#multidraw">multidraw</a> and <a href="#drag">user drag</a> command family for the extra object drawn onto the numberline
  1398. </span></li>
  1399. <li><span style="color:blue;font-size:0.8em"> <a href="#snaptogrid">snaptogrid, snaptopoints etc</a> and <a href="#zoom">zooming and panning</a> is supported
  1400. </span></li>
  1401. <li><span style="color:blue;font-size:0.8em"> onclick and dragging of the numberline are not -yet- supported
  1402. </span></li>
  1403. </ul>
  1404. <li><a name='opacity' href='#opacity top'>  opacity 0-255,0-255</a><ul>
  1405. <li><span style="color:blue;font-size:0.8em"> opacity 0.0 - 1.0,0.0 - 1.0
  1406. </span></li>
  1407. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='transparent' href='#transparent top'>transparent</a></span></li>
  1408. <li><span style="color:blue;font-size:0.8em"> first item is stroke opacity, second is fill opacity
  1409. </span></li>
  1410. </ul>
  1411. <li><a name='onclick' href='#onclick top'>  onclick</a><ul>
  1412. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  1413. </span></li>
  1414. <li><span style="color:blue;font-size:0.8em"> if the next object is clicked, its 'object onclick_or_drag sequence number' in fly script is returned <br /> by javascript:read_canvas();
  1415. </span></li>
  1416. <li><span style="color:blue;font-size:0.8em"> onclick seqeuence numbering starts at '0'.<br />e.g. if there are 6 objects set onclick, the first onclick object will have id-number '0', the last id-number '5'
  1417. </span></li>
  1418. <li><span style="color:blue;font-size:0.8em"> line based objects will show an increase in line width<br />font based objects will show the text in 'bold' when clicked.
  1419. </span></li>
  1420. <li><span style="color:blue;font-size:0.8em"> the click zone (accuracy) is determined by 2&times; the line width of the object
  1421. </span></li>
  1422. <li><span style="color:blue;font-size:0.8em"> onclick and <a href="#drag">drag x|y|xy</a> may be combined in a single flyscript <br />(although a single object can <b>not</b> be onclick and draggable at the same time...)
  1423. </span></li>
  1424. <li><span style="color:blue;font-size:0.8em"> note: not all objects may be set onclick
  1425. </span></li>
  1426. </ul>
  1427. <li><a name='parallel' href='#parallel top'>  parallel x1,y1,x2,y2,dx,dy,n,[colorname or #hexcolor]</a><ul>
  1428. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be set "onclick" or "drag xy"
  1429. </span></li>
  1430. </ul>
  1431. <li><a name='plotsteps' href='#plotsteps top'>  plotsteps a_number</a><ul>
  1432. <li><span style="color:blue;font-size:0.8em"> default 150
  1433. </span></li>
  1434. <li><span style="color:blue;font-size:0.8em"> only used for commands <a href="#curve">"curve / plot"</a> and <a href="#levelcurve">"levelcurve"</a>
  1435. </span></li>
  1436. <li><span style="color:blue;font-size:0.8em"> use with care !
  1437. </span></li>
  1438. </ul>
  1439. <li><a name='point' href='#point top'>  point x,y,color</a><ul>
  1440. <li><span style="color:blue;font-size:0.8em"> draw a single point at (x;y) in color 'color'
  1441. </span></li>
  1442. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adust size
  1443. </span></li>
  1444. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1445. </span></li>
  1446. <li><span style="color:blue;font-size:0.8em"> will not resize on zooming <br />(command 'circle x,y,r,color' will resize on zooming)
  1447. </span></li>
  1448. <li><span style="color:blue;font-size:0.8em"> attention: in case of command <a href="#rotate">'rotate angle'</a> a point has rotation center (0:0) in x/y-range
  1449. </span></li>
  1450. </ul>
  1451. <li><a name='points' href='#points top'>  points color,x1,y1,x2,y2,...,x_n,y_n</a><ul>
  1452. <li><span style="color:blue;font-size:0.8em"> draw multiple points at given coordinates in color 'color'
  1453. </span></li>
  1454. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adust size
  1455. </span></li>
  1456. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually (!)
  1457. </span></li>
  1458. <li><span style="color:blue;font-size:0.8em"> attention: in case of command <a href="#rotate">'rotate angle'</a> the points have rotation center (0:0) in x/y-range
  1459. </span></li>
  1460. </ul>
  1461. <li><a name='poly' href='#poly top'>  poly color,x1,y1,x2,y2...x_n,y_n</a><ul>
  1462. <li><span style="color:blue;font-size:0.8em"> polygon color,x1,y1,x2,y2...x_n,y_n
  1463. </span></li>
  1464. <li><span style="color:blue;font-size:0.8em"> draw closed polygon
  1465. </span></li>
  1466. <li><span style="color:blue;font-size:0.8em"> use command 'fpoly' to fill it or use keyword <a href='#filled'>'filled'</a>
  1467. </span></li>
  1468. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1469. </span></li>
  1470. </ul>
  1471. <li><a name='polyline' href='#polyline top'>  polyline color,x1,y1,x2,y2...x_n,y_n</a><ul>
  1472. <li><span style="color:blue;font-size:0.8em"> brokenline color,x1,y1,x2,y2...x_n,y_n
  1473. </span></li>
  1474. <li><span style="color:blue;font-size:0.8em"> path color,x1,y1,x2,y2...x_n,y_n
  1475. </span></li>
  1476. <li><span style="color:blue;font-size:0.8em"> remark: there is <b>no</b> command polylines | brokenlines | paths ... just use multiple commands "polyline ,x1,y1,x2,y2...x_n,y_n"
  1477. </span></li>
  1478. <li><span style="color:blue;font-size:0.8em"> remark: there are commands "userdraw path(s),color" and "userdraw polyline,color"... these are two entirely different things !<br />the path(s) userdraw commands may be used for freehand drawing(s)<br />the polyline userdraw command is analogue to this polyline|brokenline command
  1479. </span></li>
  1480. <li><span style="color:blue;font-size:0.8em"> the command interconnects the points in the given order with a line (canvasdraw will not close the drawing: use command <a href="#poly">polygon</a> for this)
  1481. </span></li>
  1482. <li><span style="color:blue;font-size:0.8em"> use command <a href='#segments'>'segments'</a> for a series of segments.<br />these may be clicked/dragged individually
  1483. </span></li>
  1484. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1485. </span></li>
  1486. </ul>
  1487. <li><a name='popup' href='#popup top'>  popup</a><ul>
  1488. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments)
  1489. </span></li>
  1490. <li><span style="color:blue;font-size:0.8em"> if fly-script starts with keyword 'popup', the canvas image will be exclusively in a popup window (xsize px &times; ysize px)
  1491. </span></li>
  1492. <li><span style="color:blue;font-size:0.8em"> if keyword 'popup' is used after command 'size xsize,ysize' the canvas will also be displayed in a popup window with size 'xsize &times; ysize'
  1493. </span></li>
  1494. <li><span style="color:blue;font-size:0.8em"> the popup window will be embedded into the page as a 'normal' image , when 'status=done' ; override with keyword <a href="#status"> 'nostatus'</a>
  1495. </span></li>
  1496. <li><span style="color:blue;font-size:0.8em"> to access the read_canvas and read_dragdrop functions in a popup window, use:<br /><em><br /> function read_all(){<br /> if( typeof popup !== 'undefined' ){<br /> var fun1 = popup['read_dragdrop'+canvas_scripts[0]];<br /> var fun2 = popup['read_canvas'+canvas_scripts[0]];<br /> popup.close();<br /> return "dragdrop="+fun1()+"\ncanvas="+fun2();<br /> };<br /></em>
  1497. </span></li>
  1498. <li><span style="color:blue;font-size:0.8em"> to set a canvasdraw produced <a href="#clock">clock</a> or multiple clocks...use something like:<br /><em>popup.set_clock(clock_id,type,diff);</em><br />as js-function for a button (or something else) in your document page.<br />wherein <b>clock_id</b> starts with 0 for the first clock<br /><b>type</b> is 1 for Hours,2 for Minutes and 3 for Seconds<br /><b>diff</b> is the increment (positive or negative) per click
  1499. </span></li>
  1500. </ul>
  1501. <li><a name='protractor' href='#protractor top'>  protractor x,y,x_width,type,mode,use_a_scale</a><ul>
  1502. <li><span style="color:blue;font-size:0.8em"> x,y are the initial location
  1503. </span></li>
  1504. <li><span style="color:blue;font-size:0.8em"> x_width : give the width in x-coordinate system (e.g. not in pixels !)
  1505. </span></li>
  1506. <li><span style="color:blue;font-size:0.8em"> type = 1 : a triangle range 0 - 180<br />type = 2 : a circle shape 0 - 360
  1507. </span></li>
  1508. <li><span style="color:blue;font-size:0.8em"> mode : use -1 to set the protractor interactive (mouse movement of protractor)<br />use mode = '0&deg; - 360&deg;' to set the protractor with a static angle of some value
  1509. </span></li>
  1510. <li><span style="color:blue;font-size:0.8em"> if the value of the user_rotation angle is to be shown...use command <a href='#display'>display degree,color,fontsize</a><a href='#display'>display radian,color,fontsize</a>
  1511. </span></li>
  1512. <li><span style="color:blue;font-size:0.8em"> use_scale = 1 : the protractor will have some scale values printed; use_scale=0 to disable
  1513. </span></li>
  1514. <li><span style="color:blue;font-size:0.8em"> the rotating direction of the mouse around the protractor determines the clockwise/ counter clockwise rotation of the protractor...
  1515. </span></li>
  1516. <li><span style="color:blue;font-size:0.8em"> commands <em>stroke_color | fill_color | linewidth | opacity | font_family</em> will determine the looks of the protractor.
  1517. </span></li>
  1518. <li><span style="color:blue;font-size:0.8em"> default replyformat: reply[0] = x;reply[1] = y;reply[2] = angle_in_radians<br />use command 'precision' to set the reply precision.
  1519. </span></li>
  1520. <li><span style="color:blue;font-size:0.8em"> if combined with a ruler, use replyformat = 32
  1521. </span></li>
  1522. <li><span style="color:blue;font-size:0.8em"> command <em>snap_to_grid</em> may be used to assist the pupil at placing the protractor
  1523. </span></li>
  1524. <li><span style="color:blue;font-size:0.8em"> when using command 'zoom' , pay <b>attention</b> to the size and symmetry of your canvas<br />...to avoid a partial image, locate the start position near the center of the visual canvas<br /><em>technical:<br /> the actual 'protractor' is just a static generated image in a new canvas-memory<br />This image is only generated once, and a copy of its bitmap is translated & rotated onto the visible canvas.<br />That is the reason for the 'high-speed dragging and rotating'.<br />I've limited its size to xsize &times; ysize e.g. the same size as the visual canvas... </em>
  1525. </span></li>
  1526. <li><span style="color:blue;font-size:0.8em"> only one protractor allowed (for the time being)
  1527. </span></li>
  1528. <li><span style="color:blue;font-size:0.8em"> usage: first left click on the protractor will activate dragging;<br />a second left click will activate rotating (just move mouse around)<br />a third click will freeze this position and the x/y-coordinate and angle in radians will be stored in reply(3)<br />a next click will restart this sequence...
  1529. </span></li>
  1530. </ul>
  1531. <li><a name='pixels' href='#pixels top'>  pixels color,x1,y1,x2,y2,x3,y3...</a><ul>
  1532. <li><span style="color:blue;font-size:0.8em"> draw rectangular "points" with diameter 1 pixel
  1533. </span></li>
  1534. <li><span style="color:blue;font-size:0.8em"> pixels can <b>not</b> be dragged or clicked
  1535. </span></li>
  1536. <li><span style="color:blue;font-size:0.8em"> "pixelsize = 1" may be changed by command "pixelsize int"
  1537. </span></li>
  1538. </ul>
  1539. <li><a name='pixelsize' href='#pixelsize top'>  pixelsize int</a><ul>
  1540. <li><span style="color:blue;font-size:0.8em"> in case you want to deviate from default pixelsize = 1(...)
  1541. </span></li>
  1542. </ul>
  1543. <li><a name='piechart' href='#piechart top'>  piechart xc,yc,radius,'data+colorlist'</a><ul>
  1544. <li><span style="color:blue;font-size:0.8em"> (xc : yc) center of circle diagram in xrange/yrange
  1545. </span></li>
  1546. <li><span style="color:blue;font-size:0.8em"> radius in pixels
  1547. </span></li>
  1548. <li><span style="color:blue;font-size:0.8em"> data+color list: a colon separated list of raw data and corresponding colours<br />canvasdraw will not check validity of colornames...<br />in case of trouble look into javascript debugging of your browser
  1549. </span></li>
  1550. <li><span style="color:blue;font-size:0.8em"> example data+colorlist : 32:red:65:green:23:black:43:orange:43:yellow:14:white
  1551. </span></li>
  1552. <li><span style="color:blue;font-size:0.8em"> the number of colors must match the number of data.
  1553. </span></li>
  1554. <li><span style="color:blue;font-size:0.8em"> if defined <a href='#fillpattern'>'fillpattern some_pattern'</a> then the pie pieces will be filled with the respective color and a fill pattern...<br />the pattern is cycled from the 4 pattern primitives: grid,hatch,diamond,dot,grid,hatch,diamond,dot,...
  1555. </span></li>
  1556. <li><span style="color:blue;font-size:0.8em"> use command "<a href='#opacity'>'opacity'</a> to adjust fill_opacity of colours
  1557. </span></li>
  1558. <li><span style="color:blue;font-size:0.8em"> use command <a href='#legend'>'legend'</a> to automatically create a legend <br />using the same colours as pie segments<br />unicode allowed in legend<br />expect javascript trouble if the amount of 'pie-slices', 'pie-colours' 'pie-legend-titles' do not match<br />a javascript console is your best friend...<br />use command 'fontfamily' to set the font of the legend.
  1559. </span></li>
  1560. </ul>
  1561. <li><a name='rays' href='#rays top'>  rays color,xc,yc,x1,y1,x2,y2,x3,y3...x_n,y_n</a><ul>
  1562. <li><span style="color:blue;font-size:0.8em"> draw rays in color 'color' and center (xc:yc)
  1563. </span></li>
  1564. <li><span style="color:blue;font-size:0.8em"> may be set draggable or onclick (every individual ray)
  1565. </span></li>
  1566. </ul>
  1567. <li><a name='rect' href='#rect top'>  rect x1,y1,x2,y2,color</a><ul>
  1568. <li><span style="color:blue;font-size:0.8em"> use command 'frect x1,y1,x2,y2,color' for a filled rectangle
  1569. </span></li>
  1570. <li><span style="color:blue;font-size:0.8em"> use command/keyword <a href='#filled'>'filled'</a> before command 'rect x1,y1,x2,y2,color'
  1571. </span></li>
  1572. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1573. </span></li>
  1574. </ul>
  1575. <li><a name='rects' href='#rects top'>  rects color,x1,y1,x2,y2,.....</a><ul>
  1576. <li><span style="color:blue;font-size:0.8em"> use command 'frect color,x1,y1,x2,y2,.....' for a filled rectangle
  1577. </span></li>
  1578. <li><span style="color:blue;font-size:0.8em"> use command/keyword <a href='#filled'>'filled'</a> before command 'rects color,x1,y1,x2,y2,....'
  1579. </span></li>
  1580. <li><span style="color:blue;font-size:0.8em"> use command 'fillcolor color' before 'frects' to set the fill colour.
  1581. </span></li>
  1582. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually
  1583. </span></li>
  1584. </ul>
  1585. <li><a name='replyformat' href='#replyformat top'>  replyformat number</a><ul>
  1586. <li><span style="color:blue;font-size:0.8em"> use number=-1 to deactivate the js-functions read_canvas() and read_dragdrop()
  1587. </span></li>
  1588. <li><span style="color:blue;font-size:0.8em"> default values should be fine !
  1589. </span></li>
  1590. <li><span style="color:blue;font-size:0.8em"> use command 'precision [0,1,10,100,1000,10000...]' before command 'replyformat' to set the desired number of decimals in the student reply / drawing
  1591. </span></li>
  1592. <li><span style="color:blue;font-size:0.8em"> the last value for 'precision int' will be used to calculate the reply coordinates, if needed (read_canvas();)
  1593. </span></li>
  1594. <li><span style="color:blue;font-size:0.8em"> choose<ul><li>1 = x1,x2,x3,x4....x_n<br />y1,y2,y3,y4....y_n<br /><br />x/y in pixels</li><li>2 = x1,x2,x3,x4....x_n<br /> y1,y2,y3,y4....y_n<br /> x/y in xrange / yrange coordinate system<br /></li><li>3 = x1,x2,x3,x4....x_n<br /> y1,y2,y3,y4....y_n<br /> r1,r2,r3,r4....r_n<br /> x/y in pixels <br /> r in pixels</li><li>4 = x1,x2,x3,x4....x_n<br /> y1,y2,y3,y4....y_n<br /> r1,r2,r3,r4....r_n<br /> x/y in xrange / yrange coordinate system<br /> r in pixels</li><li>5 = Ax1,Ax2,Ax3,Ax4....Ax_n<br /> Ay1,Ay2,Ay3,Ay4....Ay_n<br /> Bx1,Bx2,Bx3,Bx4....Bx_n<br /> By1,By2,By3,By4....By_n<br /> Cx1,Cx2,Cx3,Cx4....Cx_n<br /> Cy1,Cy2,Cy3,Cy4....Cy_n<br /> ....<br /> Zx1,Zx2,Zx3,Zx4....Zx_n<br /> Zy1,Zy2,Zy3,Zy4....Zy_n<br /> x/y in pixels<br /></li><li>6 = Ax1,Ax2,Ax3,Ax4....Ax_n<br /> Ay1,Ay2,Ay3,Ay4....Ay_n<br /> Bx1,Bx2,Bx3,Bx4....Bx_n<br /> By1,By2,By3,By4....By_n<br /> Cx1,Cx2,Cx3,Cx4....Cx_n<br /> Cy1,Cy2,Cy3,Cy4....Cy_n<br /> ....<br /> Zx1,Zx2,Zx3,Zx4....Zx_n<br /> Zy1,Zy2,Zy3,Zy4....Zy_n<br /> x/y in xrange / yrange coordinate system<br /></li><li>7 = x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n<br /> x/y in pixels</li><li>8 = x1:y1,x2:y2,x3:y3,x4:y4...x_n:y_n<br /> x/y in xrange / yrange coordinate system</li><li>9 = x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n<br /> x/y in pixels</li><li>10 = x1:y1:r1,x2:y2:r2,x3:y3:r3,x4:y4:r3...x_n:y_n:r_n<br /> x/y in xrange / yrange coordinate system</li><li>11 = Ax1,Ay1,Ax2,Ay2<br /> Bx1,By1,Bx2,By2<br /> Cx1,Cy1,Cx2,Cy2<br /> Dx1,Dy1,Dx2,Dy2<br /> ......<br /> Zx1,Zy1,Zx2,Zy2<br /> x/y in xrange / yrange coordinate system</li><li>12 = Ax1,Ay1,Ax2,Ay2<br /> Bx1,By1,Bx2,By2<br />Cx1,Cy1,Cx2,Cy2<br /> Dx1,Dy1,Dx2,Dy2<br /> ......<br /> Zx1,Zy1,Zx2,Zy2<br /> x/y in pixels</li><li>13 = Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2,Cx1:Cy1:Cx2:Cy2,Dx1:Dy1:Dx2:Dy2, ... ,Zx1:Zy1:Zx2:Zy2<br /> x/y in xrange / yrange coordinate system</li><li>14 = Ax1:Ay1:Ax2:Ay2,Bx1:By1:Bx2:By2....Zx1:Zy1:Zx2:Zy2<br /> x/y in pixels</li><li>15 = reply from inputfields,textareas<br /> reply1,reply2,reply3,...,reply_n</li><li>16 = mathml input fields </li><li>17 = read "userdraw text,color" only (x1,y1,text1 \n x2,y2,text2...\n...x_n,y_n,text_n <br /> x/y-values are in xrang/yrange</li><li>18 = read_canvas() will read all interactive clocks in H1:M1:S1,H2:M2:S2...Hn:Mn:Sn</li><li>19 = read_canvas() will return the object number of marked / clicked object (clock)<br />analogue to (shape library) onclick command </li><li>20 = read_canvas() will reply "object_number:x:y" of external images : object_number of the first draggable external image in the fly-script starts with 0 <br />e.g. expect something like 0:-5:4,1:6:2,2:-2:-5 <br /> the first image position is (-5:4) , the second image position is (6:2) and the third image position is (-2:-5) <li>21 = (x1:y1) (x2:y2) ... (x_n:y_n)<br />verbatim coordinate return</li><li>22 = returns an array .... reply[0]=x1 reply[1]=y1 reply[2]=x2 reply[3]=y2 ... reply[n-1]=x_n reply[n]=y_n<br /> x/y in xrange / yrange coordinate system</li><li>23 : can only be used for drawtype 'polyline'<br />a typical click sequence in drawtype polyline is x1,y1,x2,y2,x2,y2,x3,y3,x3,y3.....,x(n-1),y(n-1),x(n-1),y(n-1),xn,yn --replyformat 23--> x1,y1,x2,y2,x3,y3,.....x(n-1),y(n-1),xn,yn multiple occurences will be filtered out.The reply will be in x-y-range (xreply \n yreply)</li><li>24 = read all inputfield values: even those set 'readonly'</li><li>25 = angle1,angle2...angle_n : will return the radius (one or many) of the user drawn circle segment in degrees </li><li>26 = rad1,rad2...rad_n : will return the radius (one or many) of the user drawn circle segment in radians </li><li>27 = return (only) userdraw inputfields x1,y1,text1 \n x2,y2,text2...\n...x_n,y_n,text_n</li><li>28 = x1,y1,r1,x2,y2,r2...x_n,y_n,r_n <br />x / y / r in xrange / yrange coordinate system: may be used to reinput into command 'circles color,x1,y1,r1,x2,y2,r2...x_n,y_n,r_n'<br /> will not return anything else (e.g. no inputfields , text etc)</li></ul>
  1595. </span></li>
  1596. </ul>
  1597. <li><a name='roundrect' href='#roundrect top'>  roundrect x1,y1,x2,y2,radius in px,color</a><ul>
  1598. <li><span style="color:blue;font-size:0.8em"> use command 'froundrect x1,y1,x2,y2,radius,color' for a filled rectangle
  1599. </span></li>
  1600. <li><span style="color:blue;font-size:0.8em"> use command/keyword <a href='#filled'>'filled'</a> before command 'roundrect x1,y1,x2,y2,radius,color'
  1601. </span></li>
  1602. <li><span style="color:blue;font-size:0.8em"> fillcolor will be identical to 'color'
  1603. </span></li>
  1604. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1605. </span></li>
  1606. </ul>
  1607. <li><a name='roundrects' href='#roundrects top'>  roundrects color,radius in px,x1,y1,x2,y2,x3,y3,x4,y4,....</a><ul>
  1608. <li><span style="color:blue;font-size:0.8em"> for filled roundrects use command/keyword <a href='#filled'>'filled'</a> before command
  1609. </span></li>
  1610. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually
  1611. </span></li>
  1612. </ul>
  1613. <li><a name='ruler' href='#ruler top'>  ruler x,y,x-width ,y-height,mode</a><ul>
  1614. <li><span style="color:blue;font-size:0.8em"> x,y are the initial location
  1615. </span></li>
  1616. <li><span style="color:blue;font-size:0.8em"> x-width , y-height are the ruler dimensions width &amp; height in xy-coordinate system
  1617. </span></li>
  1618. <li><span style="color:blue;font-size:0.8em"> the ruler scale is by definition the x-scale, set by command 'xrange'<br />for example: a ruler x-width of 6 will have a scale ranging from 0 to 6
  1619. </span></li>
  1620. <li><span style="color:blue;font-size:0.8em"> mode : use -1 to set the ruler interactive (eg mouse movement of ruler; drag &amp; rotate)<br />use mode = '0&deg; - 360&deg;' to set the ruler with a static angle of some value
  1621. </span></li>
  1622. <li><span style="color:blue;font-size:0.8em"> if combined with a protractor, use replyformat = 32
  1623. </span></li>
  1624. <li><span style="color:blue;font-size:0.8em"> only one ruler allowed (for the time being)
  1625. </span></li>
  1626. <li><span style="color:blue;font-size:0.8em"> when using command 'zoom' , pay <b>attention</b> to the size and symmetry of your canvas<br />...to avoid a partial image, locate the start position near the center of the visual canvas<br /><em>technical:<br /> the actual 'ruler' is just a static generated image in a new canvas-memory<br />This image is only generated once, and a copy of its bitmap is translated & rotated onto the visible canvas.<br />That is the reason for the 'high-speed dragging and rotating'.<br />I've limited its size to xsize &times; ysize e.g. the same size as the visual canvas... </em>
  1627. </span></li>
  1628. <li><span style="color:blue;font-size:0.8em"> usage: first left click on the ruler will activate dragging;<br />a second left click will activate rotating (just move mouse around)<br />a third click will freeze this position and the x/y-coordinate and angle in radians will be stored in reply(3)<br />a next click will restart this sequence...
  1629. </span></li>
  1630. </ul>
  1631. <li><a name='resetoffset' href='#resetoffset top'>  resetoffset</a><ul>
  1632. <li><span style="color:blue;font-size:0.8em"> keyword ; use to restore text placement on the canvas to the real (x;y) coordinates of the left bottom corner of the text
  1633. </span></li>
  1634. <li><span style="color:blue;font-size:0.8em"> may be active for commands <a href="#text">text</a> and <a href="#string">string</a> (e.g. objects in the drag/drop/onclick-librariy
  1635. </span></li>
  1636. </ul>
  1637. <li><a name='rotate' href='#rotate top'>  rotate rotation_angle</a><ul>
  1638. <li><span style="color:blue;font-size:0.8em"> angle in degrees
  1639. </span></li>
  1640. <li><span style="color:blue;font-size:0.8em"> (only) the next object will be rotated is given angle
  1641. </span></li>
  1642. <li><span style="color:blue;font-size:0.8em"> positive values rotate counter clockwise
  1643. </span></li>
  1644. <li><span style="color:blue;font-size:0.8em"> attention: all objects will be rotated around their first point...<br /><em>rotate 45</em><br /> <em>triangle 1,1,5,1,3,4,red</em><br />will rotate 45 degrees around point (1:1)
  1645. </span></li>
  1646. <li><span style="color:blue;font-size:0.8em"> if another rotation center is needed, use command <a href="#rotationcenter">'rotationcenter xc,yc'</a>.<br />to reset this rotationcenter, use keyword <a href="killrotate">'killrotate'</a>
  1647. </span></li>
  1648. <li><span style="color:blue;font-size:0.8em"> attention: rotate will mess up the interactivity of the rotated object <br />e.g. if combined with command <a href="#drag">"drag xy"</a> or keyword <a href="onclick">"onclick"</a> : the mouse recognises the original -unrotated- coordinates of the object
  1649. </span></li>
  1650. </ul>
  1651. <li><a name='rotationcenter' href='#rotationcenter top'>  rotationcenter x_center,y_center</a><ul>
  1652. <li><span style="color:blue;font-size:0.8em"> define an rotation center in your x/y-coordinate system
  1653. </span></li>
  1654. <li><span style="color:blue;font-size:0.8em"> wims will not check the validity of your input; use javascript console to debug any erors
  1655. </span></li>
  1656. <li><span style="color:blue;font-size:0.8em"> if not defined a rotation will be around the first point of an object
  1657. </span></li>
  1658. <li><span style="color:blue;font-size:0.8em"> to be used before command <a href="#rotate">rotate</a>
  1659. </span></li>
  1660. <li><span style="color:blue;font-size:0.8em"> all other commands will use this rotation center, unless a <a href="#killrotation">killrotation</a> is given
  1661. </span></li>
  1662. </ul>
  1663. <li><a name='size' href='#size top'>  size width,height</a><ul>
  1664. <li><span style="color:blue;font-size:0.8em"> set canvas size in pixels
  1665. </span></li>
  1666. <li><span style="color:blue;font-size:0.8em"> mandatory first command (can only be preceded by keyword <a href="#popup">'popup'</a>)
  1667. </span></li>
  1668. <li><span style="color:blue;font-size:0.8em"> if xrange and/or yrange is not given the range will be set to pixels :<br />xrange 0,xsize yrange 0,ysize<br />note: lower left corner is Origin (0:0) !!! this in contrast to flydraw
  1669. </span></li>
  1670. </ul>
  1671. <li><a name='segment' href='#segment top'>  segment x1,y1,x2,y2,color</a><ul>
  1672. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='seg' href='#seg top'>seg</a></span></li>
  1673. <li><span style="color:blue;font-size:0.8em"> draw a line segment between points (x1:y1)--(x2:y2) in color 'color'
  1674. </span></li>
  1675. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1676. </span></li>
  1677. </ul>
  1678. <li><a name='segments' href='#segments top'>  segments color,x1,y1,x2,y2,...,x_n,y_n</a><ul>
  1679. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='segs' href='#segs top'>segs</a></span></li>
  1680. <li><span style="color:blue;font-size:0.8em"> draw multiple segments between points (x1:y1)--(x2:y2).....and... (x_n-1:y_n-1)--(x_n:y_n) in color 'color'
  1681. </span></li>
  1682. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adust size
  1683. </span></li>
  1684. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually (!)
  1685. </span></li>
  1686. </ul>
  1687. <li><a name='setlimits' href='#setlimits top'>  setlimits</a><ul>
  1688. <li><span style="color:blue;font-size:0.8em"> keyword : if set, it will produce 4 inputfields for 'xmin,xmax,ymin,ymax' and an 'ok' button
  1689. </span></li>
  1690. <li><span style="color:blue;font-size:0.8em"> may be used for inputfield based zooming / panning
  1691. </span></li>
  1692. <li><span style="color:blue;font-size:0.8em"> may be styled using command <a href="#inputstyle">inputstyle</a>
  1693. </span></li>
  1694. <li><span style="color:blue;font-size:0.8em"> use commands <a href="#xlabel">xlabel / ylabel</a> to change text from xmin to 'xlabel' etc
  1695. </span></li>
  1696. <li><span style="color:blue;font-size:0.8em"> note:the input value will not be checked on validity
  1697. </span></li>
  1698. </ul>
  1699. <li><a name='setpixel' href='#setpixel top'>  setpixel x,y,color</a><ul>
  1700. <li><span style="color:blue;font-size:0.8em"> A rectangular "point" with diameter 1 pixel centered at (x:y) in xrange / yrange
  1701. </span></li>
  1702. <li><span style="color:blue;font-size:0.8em"> pixels can <b>not</b> be dragged or clicked
  1703. </span></li>
  1704. <li><span style="color:blue;font-size:0.8em"> "pixelsize = 1" may be changed by command "pixelsize int"
  1705. </span></li>
  1706. </ul>
  1707. <li><a name='slider' href='#slider top'>  slider start_value,end_value,width px,height px,<em>type</em>,label</a><ul>
  1708. <li><span style="color:blue;font-size:0.8em"> <em>type</em> may be : xy,x,y,angle
  1709. </span></li>
  1710. <li><span style="color:blue;font-size:0.8em"> if a slider value display is desired, use for argument <em>type</em>:<br />xy display<br />x display<br />y display<br />angle radian<br />angle degree
  1711. </span></li>
  1712. <li><span style="color:blue;font-size:0.8em"> if a unit (or something like that...) for x/y-value display is needed, use commands 'xunit' and / or 'yunit'
  1713. </span></li>
  1714. <li><span style="color:blue;font-size:0.8em"> if the translation should be performed using a function, use for type: xy function,x function,y function<br />use commands sliderfunction_x and/or sliderfunction_y before the slider command to define the functions<br />example:<br />sliderfunction_x x^2<br />sliderfunction_y y^2<br />slider -5,5,100,100,xy function,Some_Text<br />...some stuff to slide<br />killslider<br />sliderfunction_x x^2-2<br />slider -15,15,100,10,x function,Some_Other_Text<br />...more stuff to slide<br />killslider<br />... etc
  1715. </span></li>
  1716. <li><span style="color:blue;font-size:0.8em"> use command 'slider' before draggable/clickable objects.
  1717. </span></li>
  1718. <li><span style="color:blue;font-size:0.8em"> drag and drop may be combined with rotation slider<br />for example an arrow rotated by a slider may be placed anywhere (drag&drop)<em>size 300,300<br />xrange -5,5<br />yrange -5,5<br />grid 1,1,grey<br />linewidth 3<br />drag xy<br />fillcolor orange<br />strokecolor blue<br />slider 0,2*pi,250,30,angle degrees,Rotate arrow<br />arrow 2,2,5,5,8,red</em>
  1719. </span></li>
  1720. <li><span style="color:blue;font-size:0.8em"> no slider for a math function, these can be traced using command 'trace_jscurve some_function_in_x'
  1721. </span></li>
  1722. <li><span style="color:blue;font-size:0.8em"> a slider will affect all draggable objects after the 'slider' command...<br />and can be used to group translate / rotate several objects...<br />until a next 'slider' or keyword 'killslider'
  1723. </span></li>
  1724. <li><span style="color:blue;font-size:0.8em"> amount of sliders is not limited.
  1725. </span></li>
  1726. <li><span style="color:blue;font-size:0.8em"> javascript:read_dragdrop(); will return an array with 'object_number:slider_value'
  1727. </span></li>
  1728. <li><span style="color:blue;font-size:0.8em"> type=xy: will produce a 2D 'slider' [rectangle width x heigh px] in your web page
  1729. </span></li>
  1730. <li><span style="color:blue;font-size:0.8em"> every draggable object may have its own slider (no limit in amount of sliders)
  1731. </span></li>
  1732. <li><span style="color:blue;font-size:0.8em"> label: some slider text
  1733. </span></li>
  1734. <li><span style="color:blue;font-size:0.8em"> use fillcolor for slider ball
  1735. </span></li>
  1736. <li><span style="color:blue;font-size:0.8em"> use strokecolor for slider bar
  1737. </span></li>
  1738. <li><span style="color:blue;font-size:0.8em"> use fontfamily / fontcolor to set used fonts
  1739. </span></li>
  1740. <li><span style="color:blue;font-size:0.8em"> use opacity (only fill opacity will be used) to set transparency
  1741. </span></li>
  1742. <li><span style="color:blue;font-size:0.8em"> the slider canvas will be added to the 'tooltip div' : so incompatible with command tooltip ; setlimits etc
  1743. </span></li>
  1744. </ul>
  1745. <li><a name='sliderfunction_x' href='#sliderfunction_x top'>  sliderfunction_x some_function_in_x</a><ul>
  1746. <li><span style="color:blue;font-size:0.8em"> default value "x"
  1747. </span></li>
  1748. <li><span style="color:blue;font-size:0.8em"> the x-value of the slider object(s) will be calculated with this function.
  1749. </span></li>
  1750. <li><span style="color:blue;font-size:0.8em"> default is the x-slider value itself
  1751. </span></li>
  1752. <li><span style="color:blue;font-size:0.8em"> only used by command 'slider'
  1753. </span></li>
  1754. <li><span style="color:blue;font-size:0.8em"> define before a slider command !
  1755. </span></li>
  1756. </ul>
  1757. <li><a name='sliderfunction_y' href='#sliderfunction_y top'>  sliderfunction_y some_function_in_y</a><ul>
  1758. <li><span style="color:blue;font-size:0.8em"> default value "y"
  1759. </span></li>
  1760. <li><span style="color:blue;font-size:0.8em"> the y-value of the slider object(s) will be calculated with this function.
  1761. </span></li>
  1762. <li><span style="color:blue;font-size:0.8em"> only used by command 'slider'
  1763. </span></li>
  1764. <li><span style="color:blue;font-size:0.8em"> define before a slider command !
  1765. </span></li>
  1766. </ul>
  1767. <li><a name='sgraph' href='#sgraph top'>  sgraph xstart,ystart,xmajor,ymajor,xminor,yminor,majorgrid_color,minorgrid_color</a><ul>
  1768. <li><span style="color:blue;font-size:0.8em"> primitive implementation of a 'broken scale' graph...
  1769. </span></li>
  1770. <li><span style="color:blue;font-size:0.8em"> not very versatile: only usable in combination with userdraw <br />eg no other objects will obey this "coordinate system"<br />if you want to place an object into this coordinate system, be aware that 10% or 20% of xsize and/or ysize is 'lost'.<br />Use these "formulas" to recalculate the virtual coordinates:<br />factor=0.8 in case xstart != xmin (or ystart != ymin)<br />factor=0.9 in case xstart = xmin (or ystart = ymin)<br />px_x_point = ((factor*xsize)/(xmax - xstart))*(x_point - xmax)+xsize<br />x_recalculated = px*(xmax - xmin)/xsize + $xmin<br />px_y_point = -1*factor*y_point*ysize/(ymax - ystart) + ymax*factor*ysize/(ymax - ystart)<br />y_recalculated = ymax - py*(ymax - ymin)/ysize<br />
  1771. </span></li>
  1772. <li><span style="color:blue;font-size:0.8em"> example:<br />size 400,400<br />xrange 0,10000<br />yrange 0,100<br />sgraph 9000,50,100,10,4,4,grey,blue<br />userinput_xy<br />linewidth 2<br />userdraw segments,red
  1773. </span></li>
  1774. </ul>
  1775. <li><a name='snaptofunction' href='#snaptofunction top'>  snaptofunction some_function_in_x,some_funtion_in_y</a><ul>
  1776. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='snaptofun' href='#snaptofun top'>snaptofun</a></span></li>
  1777. <li><span style="color:blue;font-size:0.8em"> the next object will snap to the calculated values
  1778. </span></li>
  1779. <li><span style="color:blue;font-size:0.8em"> if you want only modification of y-values,just use: snaptofunction x,5*sin(1/y)
  1780. </span></li>
  1781. <li><span style="color:blue;font-size:0.8em"> if you want only modification of x-values,just use: snaptofunction 5*sin(1/x),y
  1782. </span></li>
  1783. <li><span style="color:blue;font-size:0.8em"> for now only one instance of 'snaptofunction' is allowed
  1784. </span></li>
  1785. <li><span style="color:blue;font-size:0.8em"> use rawmath on your functions: no validity checking is done by wims !
  1786. </span></li>
  1787. <li><span style="color:blue;font-size:0.8em"> example:<br />....<br />snaptofunction 5*(cos(x),4*sin(y)<br />linewidth 3<br />userdraw points,blue<br />....<br />
  1788. </span></li>
  1789. <li><span style="color:blue;font-size:0.8em"> example : switching x and y coordinates?<br />snaptofunction y,x
  1790. </span></li>
  1791. </ul>
  1792. <li><a name='snaptopoints' href='#snaptopoints top'>  snaptopoints x1,y1,x2,y2,x3,y3....</a><ul>
  1793. <li><span style="color:blue;font-size:0.8em"> a userdraw object will snap to these points.
  1794. </span></li>
  1795. <li><span style="color:blue;font-size:0.8em"> the array size (e.g. the number of points) of command 'snaptopoints' is limited by constant MAX_INT (canvasdraw.h)
  1796. </span></li>
  1797. <li><span style="color:blue;font-size:0.8em"> a draggable object (use command "drag x|y|xy") will snap to the clossed of these points when dragged (mouseup)
  1798. </span></li>
  1799. <li><span style="color:blue;font-size:0.8em"> other options: use keyword "snaptogrid", "xsnaptogrid" or "ysnaptogrid"
  1800. </span></li>
  1801. </ul>
  1802. <li><a name='snaptogrid' href='#snaptogrid top'>  snaptogrid</a><ul>
  1803. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  1804. </span></li>
  1805. <li><span style="color:blue;font-size:0.8em"> a draggable object (use command "drag x|y|xy") will snap to the given grid when dragged (mouseup)
  1806. </span></li>
  1807. <li><span style="color:blue;font-size:0.8em"> in case of userdraw the drawn points will snap to xmajor / ymajor grid
  1808. </span></li>
  1809. <li><span style="color:blue;font-size:0.8em"> if no grid is defined ,points will snap to every integer xrange/yrange value. (eg snap_x=1,snap_y=1)
  1810. </span></li>
  1811. <li><span style="color:blue;font-size:0.8em"> if you do not want a visible grid, but you only want a 'snaptogrid' with some value...define this grid with opacity 0.
  1812. </span></li>
  1813. <li><span style="color:blue;font-size:0.8em"> if xminor / yminor is defined,(use keyword 'axis' to activate the minor steps) the drawing will snap to xminor and yminor<br />use only even dividers in x/y-minor...for example<br />snaptogrid<br />axis<br />grid 2,1,grey,4,4,7,red<br /> will snap on x=0, x=0.5, x=1, x=1.5 ....<br /> will snap on y=0, y=0.25 y=0.5 y=0.75 ...<br />
  1814. </span></li>
  1815. </ul>
  1816. <li><a name='square' href='#square top'>  square x,y,side (px) ,color</a><ul>
  1817. <li><span style="color:blue;font-size:0.8em"> draw a square with left top corner (x:y) with side 'side' in color 'color'
  1818. </span></li>
  1819. <li><span style="color:blue;font-size:0.8em"> use command 'fsquare x,y,side,color' for a filled square
  1820. </span></li>
  1821. <li><span style="color:blue;font-size:0.8em"> use command/keyword <a href='#filled'>'filled'</a> before command 'square x,y,side,color'
  1822. </span></li>
  1823. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1824. </span></li>
  1825. </ul>
  1826. <li><a name='status' href='#status top'>  status</a><ul>
  1827. <li><span style="color:blue;font-size:0.8em"> keyword
  1828. </span></li>
  1829. <li><span style="color:blue;font-size:0.8em"> alernative : nostatus
  1830. </span></li>
  1831. <li><span style="color:blue;font-size:0.8em"> used to override the effects of "status=done" in wims (answer.phtml)
  1832. </span></li>
  1833. <li><span style="color:blue;font-size:0.8em"> affects 'readonly' in inputfields / textarea's in canvasimage and all userdraw based commands
  1834. </span></li>
  1835. <li><span style="color:blue;font-size:0.8em"> e.g.: if keyword 'status' is set, the pupil will be able to modify the canvas when the 'wims $status variable' is set to 'done'
  1836. </span></li>
  1837. </ul>
  1838. <li><a name='string' href='#string top'>  string color,x,y,the text string</a><ul>
  1839. <li><span style="color:blue;font-size:0.8em"> may be set "onclick" or "drag xy"
  1840. </span></li>
  1841. <li><span style="color:blue;font-size:0.8em"> unicode supported: string red,0,0,\u2232
  1842. </span></li>
  1843. <li><span style="color:blue;font-size:0.8em"> use a command like 'fontfamily italic 24px Ariel' <br />to set fonts on browser that support font change
  1844. </span></li>
  1845. </ul>
  1846. <li><a name='stringup' href='#stringup top'>  stringup color,x,y,rotation_degrees,the text string</a><ul>
  1847. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be set "onclick" or "drag xy" (because of translaton matrix...mouse incompatible)
  1848. </span></li>
  1849. <li><span style="color:blue;font-size:0.8em"> unicode supported: stringup red,0,0,45,\u2232
  1850. </span></li>
  1851. <li><span style="color:blue;font-size:0.8em"> use a command like 'fontfamily bold 34px Courier' <br />to set fonts on browser that support font change
  1852. </span></li>
  1853. </ul>
  1854. <li><a name='highlight' href='#highlight top'>  highlight color,opacity,linewidth</a><ul>
  1855. <li><span style="color:blue;font-size:0.8em"> NOT IMPLEMENTED
  1856. </span></li>
  1857. <li><span style="color:blue;font-size:0.8em"> use command "onclick" : when the object receives a userclick it will increase its linewidth
  1858. </span></li>
  1859. </ul>
  1860. <li><a name='strokecolor' href='#strokecolor top'>  strokecolor colorname or #hex</a><ul>
  1861. <li><span style="color:blue;font-size:0.8em"> to be used for commands that do not supply a color argument (like command 'linegraph')
  1862. </span></li>
  1863. </ul>
  1864. <li><a name='text' href='#text top'>  text fontcolor,x,y,font,text_string</a><ul>
  1865. <li><span style="color:blue;font-size:0.8em"> font may be described by keywords : giant,huge,normal,small,tiny
  1866. </span></li>
  1867. <li><span style="color:blue;font-size:0.8em"> use command 'fontsize' to increase base fontsize for these keywords
  1868. </span></li>
  1869. <li><span style="color:blue;font-size:0.8em"> may be set "onclick" or "drag xy"
  1870. </span></li>
  1871. <li><span style="color:blue;font-size:0.8em"> backwards compatible with flydraw
  1872. </span></li>
  1873. <li><span style="color:blue;font-size:0.8em"> unicode supported: text red,0,0,huge,\u2232
  1874. </span></li>
  1875. <li><span style="color:blue;font-size:0.8em"> use command 'string' combined with 'fontfamily' for a more fine grained control over html5 canvas text element
  1876. </span></li>
  1877. <li><span style="color:blue;font-size:0.8em"> Avoid mixing old flydraw commands 'text' 'textup' with new canvasdraw commands 'string' stringup'<br />If the fontfamily was set completely like "fontfamily italic 24px Ariel".<br />In that case reset 'fontfamily' to something lke 'fontfamily Ariel' before the old flydraw commands.
  1878. </span></li>
  1879. </ul>
  1880. <li><a name='textarea' href='#textarea top'>  textarea x,y,cols,rows,readonly,value</a><ul>
  1881. <li><span style="color:blue;font-size:0.8em"> may be further controlled by <a href="#inputstyle">"inputstyle"</a>
  1882. </span></li>
  1883. <li><span style="color:blue;font-size:0.8em"> if "$status=done" (e.g. in answer.phtml) the inputfield will be cleared and set readonly<br />override this by keyword <a href="#status">'status'.</a>
  1884. </span></li>
  1885. <li><span style="color:blue;font-size:0.8em"> if mathml inputfields are present and / or some userdraw is performed, these data will <b>not</b> be send as well (javascript:read_canvas();)
  1886. </span></li>
  1887. <li><span style="color:blue;font-size:0.8em"> keyword 'xoffset | centered' is not active for commande 'textarea'
  1888. </span></li>
  1889. </ul>
  1890. <li><a name='textfill' href='#textfill top'>  textfill x0,y0,color,some_text</a><ul>
  1891. <li><span style="color:blue;font-size:0.8em"> x0,y0 in xrange / yrange
  1892. </span></li>
  1893. <li><span style="color:blue;font-size:0.8em"> color will be used for the font color
  1894. </span></li>
  1895. <li><span style="color:blue;font-size:0.8em"> use command <a href="#fontfamily">fontfamily</a> to set font type and size
  1896. </span></li>
  1897. <li><span style="color:blue;font-size:0.8em"> there is also a command <a href="#userdraw">userdraw textfill,color,some_text</a>
  1898. </span></li>
  1899. </ul>
  1900. <li><a name='textup' href='#textup top'>  textup fontcolor,x,y,font,text_string</a><ul>
  1901. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be set "onclick" or "drag xy" (because of translaton matrix...mouse incompatible)
  1902. </span></li>
  1903. <li><span style="color:blue;font-size:0.8em"> font may be described by keywords : giant,huge,normal,small,tiny
  1904. </span></li>
  1905. <li><span style="color:blue;font-size:0.8em"> use command 'fontsize' to increase base fontsize for the keywords
  1906. </span></li>
  1907. <li><span style="color:blue;font-size:0.8em"> backwards compatible with flydraw
  1908. </span></li>
  1909. <li><span style="color:blue;font-size:0.8em"> unicode supported: textup red,0,0,huge,\u2232
  1910. </span></li>
  1911. <li><span style="color:blue;font-size:0.8em"> use command 'stringup' and 'fontfamily' for a more fine grained control over html5 canvas text element
  1912. </span></li>
  1913. <li><span style="color:blue;font-size:0.8em"> Avoid mixing old flydraw commands 'text' 'textup' with new canvasdraw commands 'string' stringup'<br />If the fontfamily was set completely like "fontfamily italic 24px Ariel".<br />In that case reset 'fontfamily' to something lke 'fontfamily Ariel' before the old flydraw commands.
  1914. </span></li>
  1915. </ul>
  1916. <li><a name='trace_jscurve' href='#trace_jscurve top'>  trace_jscurve some_math_function</a><ul>
  1917. <li><span style="color:blue;font-size:0.8em"> will use a crosshair to trace the jsmath curve
  1918. </span></li>
  1919. <li><span style="color:blue;font-size:0.8em"> two inputfields will display the current x/y-values (numerical evaluation by javascript)
  1920. </span></li>
  1921. <li><span style="color:blue;font-size:0.8em"> default labels 'x' and 'y'<br />use commands 'xlabel some_x_axis_name' and 'ylabel some_y_axis_name' to customize the labels for the input fields
  1922. </span></li>
  1923. <li><span style="color:blue;font-size:0.8em"> use commands fontsize and inputstyle to format the fonts for labels and inputfields.
  1924. </span></li>
  1925. <li><span style="color:blue;font-size:0.8em"> use commands linewidth,strokecolor,crosshairsize to adjust the corsshair.
  1926. </span></li>
  1927. <li><span style="color:blue;font-size:0.8em"> the client browser will convert your math function to javascript math.<br />use parenthesis and rawmath : use 2*x instead of 2x etc etc<br />no check is done on the validity of your function and/or syntax<br />use error console to debug any errors...
  1928. </span></li>
  1929. <li><span style="color:blue;font-size:0.8em"> be aware that the formula's of the plotted function(s) can be found in the page javascript source
  1930. </span></li>
  1931. </ul>
  1932. <li><a name='trange' href='#trange top'>  trange tmin,tmax</a><ul>
  1933. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='ranget' href='#ranget top'>ranget</a></span></li>
  1934. <li><span style="color:blue;font-size:0.8em"> default -2,2
  1935. </span></li>
  1936. </ul>
  1937. <li><a name='translation' href='#translation top'>  translation tx,ty</a><ul>
  1938. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='translate' href='#translate top'>translate</a></span></li>
  1939. <li><span style="color:blue;font-size:0.8em"> will translate the next objects tx in xrange and ty in yrange
  1940. </span></li>
  1941. <li><span style="color:blue;font-size:0.8em"> use command 'killtranstation' to end the command
  1942. </span></li>
  1943. </ul>
  1944. <li><a name='triangle' href='#triangle top'>  triangle x1,y1,x2,y2,x3,y3,color</a><ul>
  1945. <li><span style="color:blue;font-size:0.8em"> use ftriangle or keyword <a href='#filled'>'filled'</a> for a solid triangle
  1946. </span></li>
  1947. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  1948. </span></li>
  1949. </ul>
  1950. <li><a name='triangles' href='#triangles top'>  triangles color,x1,y1,x2,y2,x3,y3,...</a><ul>
  1951. <li><span style="color:blue;font-size:0.8em"> use ftriangles or keyword <a href='#filled'>'filled'</a> for solid triangles
  1952. </span></li>
  1953. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually (!)
  1954. </span></li>
  1955. </ul>
  1956. <li><a name='userboxplot' href='#userboxplot top'>  userboxplot</a><ul>
  1957. <li><span style="color:blue;font-size:0.8em"> keyword, no arguments
  1958. </span></li>
  1959. <li><span style="color:blue;font-size:0.8em"> use before command <a href="#boxplot">'boxplot x_or_y,box-height_or_box-width,x_or_y-position'</a>
  1960. </span></li>
  1961. <li><span style="color:blue;font-size:0.8em"> if set, the student will have to calculate "min,Q1,median,Q3,max" and feed these data into the 'draw_boxplot' function
  1962. </span></li>
  1963. <li><span style="color:blue;font-size:0.8em"> for example:<br />put the canvas-script into a html element with id='boxplot'and set style='display:none'<br />define a variable called 'student_boxplot' and fill it with the 5 student-data (from inputfields or something)<br />var student_boxplot = new Array(5)<br />function show_boxplot(){<br />student_boxplot[0] = min;<br />student_boxplot[1] = Q1;<br />student_boxplot[2] = median;<br />student_boxplot[3] = Q3;<br />student_boxplot[4] = max;<br />document.getElementById('boxplot').style.display = "block";<br />draw_boxplot(12345,1,2.00,5.00,[0,0,0,0,0],4,"0,0,255",0.78,"255,165,0",0.60,1,0,1,1);<br />};<br />In the canvas-script the function draw_boxplot has the following arguments:<br />draw_boxplot=function(canvas_type,xy,hw,cxy,data,line_width,stroke_color,stroke_opacity,fill_color,fill_opacity,use_filled,use_dashed,dashtype0,dashtype1)
  1964. </span></li>
  1965. </ul>
  1966. <li><a name='userboxplotdata' href='#userboxplotdata top'>  userboxplotdata</a><ul>
  1967. <li><span style="color:blue;font-size:0.8em"> keyword, no arguments
  1968. </span></li>
  1969. <li><span style="color:blue;font-size:0.8em"> use before command <a href="#boxplot">'boxplot x_or_y,box-height_or_box-width,x_or_y-position'</a>
  1970. </span></li>
  1971. <li><span style="color:blue;font-size:0.8em"> if set, the student will have to generate some statistical data. These data should be put in a named array "student_boxplot_data"
  1972. </span></li>
  1973. <li><span style="color:blue;font-size:0.8em"> "min,Q1,median,Q3,max" are calculated by a js-function and the 'draw_boxplot' function will draw a boxplot.
  1974. </span></li>
  1975. <li><span style="color:blue;font-size:0.8em"> see command <a href="#userboxplot">'userboxplot'</a> for calling 'draw_boxplot()'
  1976. </span></li>
  1977. </ul>
  1978. <li><a name='userdraw' href='#userdraw top'>  userdraw object_type,color</a><ul>
  1979. <li><span style="color:blue;font-size:0.8em"> only a single object_type is allowed.
  1980. </span></li>
  1981. <li><span style="color:blue;font-size:0.8em"> for multiple object user drawings use command <a href="#multidraw">'multidraw'</a>
  1982. </span></li>
  1983. <li><span style="color:blue;font-size:0.8em"> implemented object_type: <ul><li>point</li><li>points</li><li>crosshair</li><li>crosshairs</li><li>line</li><li>lines</li><li>vline</li><li>vlines</li><li>hline</li><li>hlines</li><li>demiline</li><li>demilines</li><li>segment</li><li>segments</li><li>polyline | brokenline </li><li>circle</li><li>circles</li><li>arrow</li><li>arrow2 (double arrow)</li><li>arrows</li><li>arrows2 (double arrows)</li><li>triangle</li><li>polygon</li><li>poly[3-9] (e.g poly3 ... poly7...poly9 </li><li>rect</li><li>roundrect</li><li>rects</li><li>roundrects</li><li>freehandline | path</li><li>freehandlines | paths</li><li>clickfill : fill the clicked area with color<br />multiple areas may be selected <br />multiple colors may be provided using commands <a href='#colorpalette'>colorpalette color1,color2,color3,...</a> or <a href='#multifillcolors'>multifillcolors color1,color2,color_3,...</a> use <a href='#replyformat'>replyformat 10</a> for checking the user click color ... reply=x1:y1:color1,x2:y2:color2...<br/>attention: this will <b>not</b> work for pattern filling, because the pattern image is only generated once and after creation can not be changed !<br />the opacity of this image on a separate canvas is set to 0.01 and not 0 (!!)...in the 'fill algorithm' the opacity of the matching pixels is set to 1</li><li>dotfill : fill the clicked area with a dot pattern; use command linewidth to change dot size</li><li>diamondfill : fill the clicked area with a diamond pattern</li><li>hatchfill : fill the clicked area with a hatch pattern</li><li>gridfill : fill the clicked area with a grid pattern</li><li>textfill: fill the clicked area with a repeating string<br />userdraw textfill,blue,some_text<br />use command <a href="#fontfamily">fontfamily</a> to adjust text style and size</li><li>'clickfill | pattern filling' in general:<br />the clicks may be set <a href="#snaptogrid">'snaptogrid'</a><br />can be used together with command <a href="#floodfill">'floodfill' or 'fill'</a><br /><b>always</b> use together with command <a href="clearbutton">'clearbutton some_text'</a> for removal of all click_colored areas<br />the function read_canvas() will return the click coordinates in the sequence of the user clicks<br />use command <a href="#canvastype">'canvastype'</a> to fill another canvas (default should be fine: DRAG_CANVAS = 5)</li><li>text</li><li>arc</li><li>arcs</li><li>input<br/>place a single inputfield on 'canvas'<br />use commands 'inputstyle' for css styling: use command 'linewidth' for adjusting the input field size (default 1)</li><li>inputs<br/>place multiple inputfield : placing inputfields on top of each other is not possible</li></ul>
  1984. </span></li>
  1985. <li><span style="color:blue;font-size:0.8em"> note: mouselisteners are only active if "$status != done " (eg only drawing in an active/non-finished exercise) <br /> to overrule use command/keyword "status" (no arguments required)
  1986. </span></li>
  1987. <li><span style="color:blue;font-size:0.8em"> note: object_type text: Any string or multiple strings may be placed anywhere on the canvas.<br />"backspace / delete / esc" will remove typed text if the mouse is clicked non the text.<br />You will need to hit "enter" to add the text to the array "userdraw_txt"<br />Placing the cursor somewhere on a typed text and hitting "delete/backspace/esc" , a confirm will popup asking to delete the selected text. This text will be removed from the "userdraw_txt()" answer array.<br />Use commands 'fontsize' and 'fontfamily' to control the text appearance
  1988. </span></li>
  1989. <li><span style="color:blue;font-size:0.8em"> note: object_type polygone: Will be finished (the object is closed) when clicked on the first point of the polygone again.
  1990. </span></li>
  1991. <li><span style="color:blue;font-size:0.8em"> note: all objects will be removed -after a javascript confirm box- when clicked on an object point with middle or right mouse button (e.g. event.which != 1 : all buttons but left)
  1992. </span></li>
  1993. <li><span style="color:blue;font-size:0.8em"> use a prefix 'filled' or 'f' to set fillable objects filled. (fcircles,filledcircles etc)
  1994. </span></li>
  1995. <li><span style="color:blue;font-size:0.8em"> for non solid filling, use command <a href="#fillpattern">fillpattern grid,hatch,diamond,dot</a>
  1996. </span></li>
  1997. <li><span style="color:blue;font-size:0.8em"> use "opacity int,int" and "fillcolor color" to trigger coloured filling of fillable objects
  1998. </span></li>
  1999. <li><span style="color:blue;font-size:0.8em"> use command "dashed" and/or "dashtype int,int" to trigger dashing
  2000. </span></li>
  2001. <li><span style="color:blue;font-size:0.8em"> use command "replyformat int" to control / adjust output formatting of javascript function read_canvas();
  2002. </span></li>
  2003. <li><span style="color:blue;font-size:0.8em"> may be combined with onclick or drag xy of other components of flyscript objects (although not very usefull...)
  2004. </span></li>
  2005. <li><span style="color:blue;font-size:0.8em"> may be combined with keyword 'userinput_xy'
  2006. </span></li>
  2007. <li><span style="color:blue;font-size:0.8em"> note: when zooming / panning after a drawing, the drawing will NOT be zoomed / panned...this is a "design" flaw and not a feature <br />To avoid trouble do not use zooming / panning together width userdraw.!<br />use command <a href="#multidraw">multidraw</a> is this is a problem for you...
  2008. </span></li>
  2009. </ul>
  2010. <li><a name='userinput' href='#userinput top'>  userinput function | textarea | inputfield</a><ul>
  2011. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='userinput_function' href='#userinput_function top'>userinput_function</a></span></li>
  2012. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='userinput_textarea' href='#userinput_textarea top'>userinput_textarea</a></span></li>
  2013. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='userinput_xy' href='#userinput_xy top'>userinput_xy</a></span></li>
  2014. <li><span style="color:blue;font-size:0.8em"> textarea and inputfield are only usable in combination with some 'userdraw draw_ type'
  2015. </span></li>
  2016. <li><span style="color:blue;font-size:0.8em"> function may be used any time (e.g. without userdraw)
  2017. </span></li>
  2018. <li><span style="color:blue;font-size:0.8em"> multiple 'userinput function' commands may be used.
  2019. </span></li>
  2020. <li><span style="color:blue;font-size:0.8em"> use command "functionlabel some_string" to define the inputfield text : default value "f(x)="
  2021. </span></li>
  2022. <li><span style="color:blue;font-size:0.8em"> use command 'strokecolor some_color' to adjust the plot / functionlabel color
  2023. </span></li>
  2024. <li><span style="color:blue;font-size:0.8em"> use command 'inputstyle some_css' to adjust the inputfields
  2025. </span></li>
  2026. <li><span style="color:blue;font-size:0.8em"> use command 'fontsize int' to adjust the label fonts. (default 12px)
  2027. </span></li>
  2028. <li><span style="color:blue;font-size:0.8em"> the user input for the function will be corrected by a simple 'rawmath' implementation...<br />an error message will be shown if javascript can not interpret the user input
  2029. </span></li>
  2030. </ul>
  2031. <li><a name='userinput_xy' href='#userinput_xy top'>  userinput_xy</a><ul>
  2032. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  2033. </span></li>
  2034. <li><span style="color:blue;font-size:0.8em"> to be used in combination with command "userdraw object_type,color"
  2035. </span></li>
  2036. <li><span style="color:blue;font-size:0.8em"> if set two (or three) input fields are added to the document<br />(one for x-values , one for y-values and in case of drawing circle one for radius-values)
  2037. </span></li>
  2038. <li><span style="color:blue;font-size:0.8em"> the student may use this as correction for (x:y) on a drawing (or to draw without mouse, using just the coordinates)
  2039. </span></li>
  2040. <li><span style="color:blue;font-size:0.8em"> math input is allowed (e.g something like: 1+3,2*6,1/3,sqrt(3), sin(pi/4),10^-2,log(2)...)<br />eval function is 'protected' against code injection.
  2041. </span></li>
  2042. <li><span style="color:blue;font-size:0.8em"> can <b>not</b> be combined with command "intooltip tiptext" <br />note: the 'tooltip div element' is used for placing inputfields
  2043. </span></li>
  2044. <li><span style="color:blue;font-size:0.8em"> user drawings will not zoom on zooming (or pan on panning)
  2045. </span></li>
  2046. <li><span style="color:blue;font-size:0.8em"> use command 'inputstyle some_css' to adjust the inputarea.
  2047. </span></li>
  2048. <li><span style="color:blue;font-size:0.8em"> use command 'fontsize int' to adjust the text labels (if needed)
  2049. </span></li>
  2050. </ul>
  2051. <li><a name='userinput_function' href='#userinput_function top'>  userinput_function</a><ul>
  2052. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  2053. </span></li>
  2054. <li><span style="color:blue;font-size:0.8em"> if set , a inputfield will be added to the page
  2055. </span></li>
  2056. <li><span style="color:blue;font-size:0.8em"> repeat keyword for more function input fields
  2057. </span></li>
  2058. <li><span style="color:blue;font-size:0.8em"> the userinput value will be plotted in the canvas
  2059. </span></li>
  2060. <li><span style="color:blue;font-size:0.8em"> this value may be read with 'read_canvas()'. <br />for do it yourself js-scripters : If this is the first inputfield in the script, its id is canvas_input0
  2061. </span></li>
  2062. <li><span style="color:blue;font-size:0.8em"> use before this command 'userinput_function',<br />commands like 'inputstyle some_css' , 'xlabel some_description' , 'opacity int,int' , 'linewidth int' , 'dashed' and 'dashtype int,int' to modify
  2063. </span></li>
  2064. <li><span style="color:blue;font-size:0.8em"> fontsize can be set using command 'fontsize int'
  2065. </span></li>
  2066. <li><span style="color:blue;font-size:0.8em"> incompatible with command 'intooltip link_text_or_image' : it uses the tooltip div for adding the inputfield
  2067. </span></li>
  2068. </ul>
  2069. <li><a name='usertextarea_xy' href='#usertextarea_xy top'>  usertextarea_xy</a><ul>
  2070. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  2071. </span></li>
  2072. <li><span style="color:blue;font-size:0.8em"> to be used in combination with command "userdraw object_type,color" wherein object_type is only segment / polyline for the time being...
  2073. </span></li>
  2074. <li><span style="color:blue;font-size:0.8em"> if set two textareas are added to the document<br />(one for x-values , one for y-values)
  2075. </span></li>
  2076. <li><span style="color:blue;font-size:0.8em"> the student may use this as correction for (x:y) on a drawing (or to draw without mouse, using just the coordinates)
  2077. </span></li>
  2078. <li><span style="color:blue;font-size:0.8em"> user drawings will not zoom on zooming (or pan on panning)
  2079. </span></li>
  2080. <li><span style="color:blue;font-size:0.8em"> use command 'inputstyle some_css' to adjust the inputarea.
  2081. </span></li>
  2082. <li><span style="color:blue;font-size:0.8em"> use command 'fontsize int' to adjust the text labels (if needed)
  2083. </span></li>
  2084. </ul>
  2085. <li><a name='vline' href='#vline top'>  vline x,y,color</a><ul>
  2086. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='verticalline' href='#verticalline top'>verticalline</a></span></li>
  2087. <li><span style="color:blue;font-size:0.8em"> draw a vertical line through point (x:y) in color 'color'
  2088. </span></li>
  2089. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a>
  2090. </span></li>
  2091. </ul>
  2092. <li><a name='vlines' href='#vlines top'>  vlines color,x1,y1,x2,y2....</a><ul>
  2093. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='verticallines' href='#verticallines top'>verticallines</a></span></li>
  2094. <li><span style="color:blue;font-size:0.8em"> draw vertical lines through points (x1:y1),(x2:y2)... in color 'color'
  2095. </span></li>
  2096. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually
  2097. </span></li>
  2098. </ul>
  2099. <li><a name='video' href='#video top'>  video x,y,w,h,videofile location</a><ul>
  2100. <li><span style="color:blue;font-size:0.8em"> x,y : left top corner of audio element (in xrange / yrange)
  2101. </span></li>
  2102. <li><span style="color:blue;font-size:0.8em"> w,y : width and height in pixels
  2103. </span></li>
  2104. <li><span style="color:blue;font-size:0.8em"> example:<br />wims getfile : video 0,0,120,120,myvideo.mp4
  2105. </span></li>
  2106. <li><span style="color:blue;font-size:0.8em"> video format may be in *.mp4 (todo:other formats)
  2107. </span></li>
  2108. </ul>
  2109. <li><a name='xaxis' href='#xaxis top'>  xaxis num1:string1:num2:string2:num3:string3:num4:string4:....num_n:string_n</a><ul>
  2110. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='xaxistext' href='#xaxistext top'>xaxistext</a></span></li>
  2111. <li><span style="color:blue;font-size:0.8em"> usable for commands <a href="numberline">numberline</a> and <a href="grid">grid</a> or combinations thereof
  2112. </span></li>
  2113. <li><span style="color:blue;font-size:0.8em"> use these x-axis num1...num_n values instead of default xmin...xmax
  2114. </span></li>
  2115. <li><span style="color:blue;font-size:0.8em"> in case of command 'grid' . there is no need to use keyword <a href="#axisnumbering">axisnumbering</a>
  2116. </span></li>
  2117. <li><span style="color:blue;font-size:0.8em"> use command <a href="#axis">axis</a> to have visual x/y-axis lines (see command <a href="grid">grid</a>
  2118. </span></li>
  2119. <li><span style="color:blue;font-size:0.8em"> use command "fontcolor", "fontfamily" to adjust font <br />defaults: black,12,Ariel<br />note: command "fontsize" is not active for this command.("fontsize" can be used for the <a href="#legend">"legend"</a> in a <a href="#grid">grid</a>)
  2120. </span></li>
  2121. <li><span style="color:blue;font-size:0.8em"> a javascript error message will flag non-matching value:name pairs
  2122. </span></li>
  2123. <li><span style="color:blue;font-size:0.8em"> if the 'x-axis words' are too big and will overlap, a simple alternating offset will be applied
  2124. </span></li>
  2125. <li><span style="color:blue;font-size:0.8em"> to be used before command grid (see <a href="#grid">command grid</a>)
  2126. </span></li>
  2127. <li><span style="color:blue;font-size:0.8em"> example:<br />size 400,400<br />xrange 0,13<br />yrange -100,500<br />axis<br />xaxis 1:january:2:february:3:march:5:may:6:june:7:july:8:august:9:september:10:october:11:november:12:december<br />#'xmajor' steps should be synchronised with numbers eg. "1" in this example<br />grid 1,100,grey,1,4,6,grey
  2128. </span></li>
  2129. </ul>
  2130. <li><a name='xaxisup' href='#xaxisup top'>  xaxisup num1:string1:num2:string2:num3:string3:num4:string4:....num_n:string_n</a><ul>
  2131. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='xaxistextup' href='#xaxistextup top'>xaxistextup</a></span></li>
  2132. <li><span style="color:blue;font-size:0.8em"> the text will be rotated 90&deg; up
  2133. </span></li>
  2134. <li><span style="color:blue;font-size:0.8em"> no need to use keyword <a href="#axisnumbering">axisnumbering</a>
  2135. </span></li>
  2136. <li><span style="color:blue;font-size:0.8em"> use command <a href="#axis">axis</a> to have visual x/y-axis lines (see command <a href="grid">grid</a>
  2137. </span></li>
  2138. <li><span style="color:blue;font-size:0.8em"> use these x-axis num1...num_n values instead of default xmin...xmax
  2139. </span></li>
  2140. <li><span style="color:blue;font-size:0.8em"> use command "fontcolor","fontfamily" to adjust font <br />defaults: black,12,Ariel<br />note: command "fontsize" is not active for this command.("fontsize" can be used for the <a href="#legend">"legend"</a> in a <a href="#grid">grid</a>)
  2141. </span></li>
  2142. <li><span style="color:blue;font-size:0.8em"> a javascript error message will flag non-matching value:name pairs
  2143. </span></li>
  2144. <li><span style="color:blue;font-size:0.8em"> if the 'x-axis words' are too big, they will overlap the graph<br /> (in this case the text will start from ysize upwards)
  2145. </span></li>
  2146. <li><span style="color:blue;font-size:0.8em"> to be used before command grid (see <a href="#grid">command grid</a>)
  2147. </span></li>
  2148. <li><span style="color:blue;font-size:0.8em"> example:<br />size 400,400<br />xrange 0,13<br />yrange -100,500<br />axis<br />xaxisup 1:january:2:february:3:march:5:may:6:june:7:july:8:august:9:september:10:october:11:november:12:december<br />#'xmajor' steps should be synchronised with numbers eg. "1" in this example<br />grid 1,100,grey,1,4,6,grey
  2149. </span></li>
  2150. </ul>
  2151. <li><a name='xerrorbars' href='#xerrorbars top'>  xerrorbars color,E1,E2,x1,y1,x2,y2,...,x_n,y_n</a><ul>
  2152. <li><span style="color:blue;font-size:0.8em"> draw multiple points with x-errorbars E1 (error value left from point) and E2 (error value right from point) at given coordinates in color 'color'
  2153. </span></li>
  2154. <li><span style="color:blue;font-size:0.8em"> the errors E1 and E2 values are in xrange.
  2155. </span></li>
  2156. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adust size
  2157. </span></li>
  2158. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually (!)
  2159. </span></li>
  2160. </ul>
  2161. <li><a name='xrange' href='#xrange top'>  xrange xmin,xmax</a><ul>
  2162. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='rangex' href='#rangex top'>rangex</a></span></li>
  2163. <li><span style="color:blue;font-size:0.8em"> if not given: 0,xsize (eg in pixels)
  2164. </span></li>
  2165. </ul>
  2166. <li><a name='xsnaptogrid' href='#xsnaptogrid top'>  xsnaptogrid</a><ul>
  2167. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  2168. </span></li>
  2169. <li><span style="color:blue;font-size:0.8em"> a draggable object (use command "drag x|y|xy") will snap to the given x-grid values when dragged (mouseup)
  2170. </span></li>
  2171. <li><span style="color:blue;font-size:0.8em"> in case of userdraw the drawn points will snap to xmajor grid
  2172. </span></li>
  2173. <li><span style="color:blue;font-size:0.8em"> if no grid is defined ,points will snap to every integer xrange value. (eg snap_x=1)
  2174. </span></li>
  2175. <li><span style="color:blue;font-size:0.8em"> if you do not want a visible grid, but you only want a 'snaptogrid' with some value...define this grid with opacity 0.
  2176. </span></li>
  2177. <li><span style="color:blue;font-size:0.8em"> if xminor is defined (use keyword 'axis' to activate xminor), the drawing will snap to xminor <br />use only even dividers in x-minor...for example<br />xsnaptogrid<br />axis<br />grid 2,1,grey,4,4,7,red<br /> will snap on x=0, x=0.5, x=1, x=1.5 ....<br /> will snap on y=0, y=0.25 y=0.5 y=0.75 ...<br />
  2178. </span></li>
  2179. </ul>
  2180. <li><a name='xoffset' href='#xoffset top'>  xoffset | centered</a><ul>
  2181. <li><span style="color:blue;font-size:0.8em"> keyword ; to place the text centered above the text coordinates(x:y) ...
  2182. </span></li>
  2183. <li><span style="color:blue;font-size:0.8em"> may be used for points or other things requirering centered labels
  2184. </span></li>
  2185. <li><span style="color:blue;font-size:0.8em"> may be active for commands <a href="#text">text</a> and <a href="#string">string</a> (e.g. objects in the drag/drop/onclick-library)
  2186. </span></li>
  2187. </ul>
  2188. <li><a name='xyoffset' href='#xyoffset top'>  xyoffset</a><ul>
  2189. <li><span style="color:blue;font-size:0.8em"> keyword ; to place the text (x:y) to (x+dx:y+dy)... dx/dy are dependent on fontsize/fontfamily
  2190. </span></li>
  2191. <li><span style="color:blue;font-size:0.8em"> may be used for points or other things requirering labels
  2192. </span></li>
  2193. <li><span style="color:blue;font-size:0.8em"> only active for commands <a href="#text">text</a> and <a href="#string">string</a> (e.g. objects in the drag/drop/onclick-librariy
  2194. </span></li>
  2195. <li><span style="color:blue;font-size:0.8em"> in case of inputfields the inputfield will be centered x and y on it's coordinates.<br />for example:<br />inputs 1,1,10,? <br />point 1,1,red <br /> the point will be completely invisible<br />note: keyword 'xyoffset' will also provide centering if used with <a href='#<li><span style="color:blue;font-size:0.8em">userdraw'>input(s),color</a>
  2196. </span></li>
  2197. </ul>
  2198. <li><a name='xunit' href='#xunit top'>  xunit some_unit_for_x-values</a><ul>
  2199. <li><span style="color:blue;font-size:0.8em"> unicode allowed (no html code)
  2200. </span></li>
  2201. <li><span style="color:blue;font-size:0.8em"> use together with command mousex
  2202. </span></li>
  2203. <li><span style="color:blue;font-size:0.8em"> will display the cursor x-coordinate in 'unit'
  2204. </span></li>
  2205. </ul>
  2206. <li><a name='xlabel' href='#xlabel top'>  xlabel some_string</a><ul>
  2207. <li><span style="color:blue;font-size:0.8em"> will be used to create a label for the x-axis (label is in quadrant I)
  2208. </span></li>
  2209. <li><span style="color:blue;font-size:0.8em"> can only be used together with command 'grid'</a><br />not depending on keywords 'axis' and 'axisnumbering'
  2210. </span></li>
  2211. <li><span style="color:blue;font-size:0.8em"> font setting: italic Courier, fontsize will be slightly larger (fontsize + 4)<br />use command "fontsize" to adjust.<br />(command "fontfamily" is not active for this command)
  2212. </span></li>
  2213. </ul>
  2214. <li><a name='xlogbase' href='#xlogbase top'>  xlogbase number</a><ul>
  2215. <li><span style="color:blue;font-size:0.8em"> sets the logbase number for the x-axis
  2216. </span></li>
  2217. <li><span style="color:blue;font-size:0.8em"> default value 10
  2218. </span></li>
  2219. <li><span style="color:blue;font-size:0.8em"> use together with commands xlogscale / xylogscale
  2220. </span></li>
  2221. </ul>
  2222. <li><a name='xlogscale' href='#xlogscale top'>  xlogscale ymajor,yminor,majorcolor,minorcolor</a><ul>
  2223. <li><span style="color:blue;font-size:0.8em"> the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
  2224. </span></li>
  2225. <li><span style="color:blue;font-size:0.8em"> ymajor is the major step on the y-axis; yminor is the divisor for the y-step
  2226. </span></li>
  2227. <li><span style="color:blue;font-size:0.8em"> the linewidth is set using command 'linewidth int'
  2228. </span></li>
  2229. <li><span style="color:blue;font-size:0.8em"> the opacity of major / minor grid lines is set by command <a href='#opacity'>'opacity</a>'
  2230. </span></li>
  2231. <li><span style="color:blue;font-size:0.8em"> default logbase number = 10 ... when needed , set the logbase number with command 'xlogbase number'
  2232. </span></li>
  2233. <li><span style="color:blue;font-size:0.8em"> the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use command 'precision' before 'xlogscale' command to set the precision (decimals) of the axis numbering</li><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li><li>use command'fontcolor' to set the colour</li></ul>
  2234. </span></li>
  2235. <li><span style="color:blue;font-size:0.8em"> note: the complete canvas will be used for the 'log paper'
  2236. </span></li>
  2237. <li><span style="color:blue;font-size:0.8em"> note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
  2238. </span></li>
  2239. <li><span style="color:blue;font-size:0.8em"> note: command 'mouse color,fontsize' will show the real values in the logpaper.<br /> <li><span style="color:blue;font-size:0.8em"> note: when using something like 'xrange 0.0001,0.01'...combined with commands <a href='#mouse'>'mouse'</a> and/or <a href='#userdraw'>'userdraw</a>...<br /> make sure the <a href='#precision'>precision</a> is set accordingly
  2240. </span></li>
  2241. <li><span style="color:blue;font-size:0.8em"> note: in case of userdraw , the use of keyword <a href='#userinput_xy'>'userinput_xy'</a> may be handy !
  2242. </span></li>
  2243. <li><span style="color:blue;font-size:0.8em"> <b>attention</b>: keyword 'snaptogrid' may not lead to the desired result...
  2244. </span></li>
  2245. </ul>
  2246. <li><a name='xylogscale' href='#xylogscale top'>  xylogscale majorcolor,minorcolor</a><ul>
  2247. <li><span style="color:blue;font-size:0.8em"> the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
  2248. </span></li>
  2249. <li><span style="color:blue;font-size:0.8em"> the linewidth is set using command 'linewidth int'
  2250. </span></li>
  2251. <li><span style="color:blue;font-size:0.8em"> the opacity of major / minor grid lines is set by command 'opacity [0-255],[0-255]'
  2252. </span></li>
  2253. <li><span style="color:blue;font-size:0.8em"> default logbase number = 10 ... when needed , set the logbase number with command 'xlogbase number' and/or 'ylogbase number'
  2254. </span></li>
  2255. <li><span style="color:blue;font-size:0.8em"> the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li><li>use command'fontcolor' to set the colour</li></ul>
  2256. </span></li>
  2257. <li><span style="color:blue;font-size:0.8em"> note: the complete canvas will be used for the 'log paper'
  2258. </span></li>
  2259. <li><span style="color:blue;font-size:0.8em"> note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
  2260. </span></li>
  2261. <li><span style="color:blue;font-size:0.8em"> note: command 'mouse color,fontsize' will show the real values in the logpaper.<br /> <li><span style="color:blue;font-size:0.8em"> note: when using something like 'yrange 0.0001,0.01'...combined with commands 'mouse color,fontsize' and/or 'userdraw type,color'...<br /> make sure the precision is set accordingly (eg command 'precision 10000')
  2262. </span></li>
  2263. <li><span style="color:blue;font-size:0.8em"> note: in case of userdraw , the use of keyword 'userinput_xy' may be handy !
  2264. </span></li>
  2265. <li><span style="color:blue;font-size:0.8em"> <b>attention</b>: keyword 'snaptogrid' may not lead to the desired result...
  2266. </span></li>
  2267. </ul>
  2268. <li><a name='yaxis' href='#yaxis top'>  yaxis num1:string1:num2:string2:num3:string3:num4:string4:....num_n:string_n</a><ul>
  2269. <li><span style="color:blue;font-size:0.8em"> alternativ : yaxistext num1:string1:num2:string2:num3:string3:num4:string4:....num_n:string_n
  2270. </span></li>
  2271. <li><span style="color:blue;font-size:0.8em"> use command "fontcolor", "fontfamily" to adjust font <br />defaults: black,12,Ariel<br /> note: command "fontsize" is not active for this command.("fontsize" can be used for the <a href="#legend">"legend"</a> in a <a href="#grid">grid</a>)
  2272. </span></li>
  2273. <li><span style="color:blue;font-size:0.8em"> no need to use keyword <a href="#axisnumbering">axisnumbering</a>
  2274. </span></li>
  2275. <li><span style="color:blue;font-size:0.8em"> use command <a href="#axis">axis</a> to have visual x/y-axis lines (see command <a href="grid">grid</a>
  2276. </span></li>
  2277. <li><span style="color:blue;font-size:0.8em"> use these y-axis num1...num_n values instead of default ymin...ymax
  2278. </span></li>
  2279. <li><span style="color:blue;font-size:0.8em"> a javascript error message will flag non-matching value:name pairs
  2280. </span></li>
  2281. <li><span style="color:blue;font-size:0.8em"> to be used before command grid (see <a href="#grid">command grid</a>)
  2282. </span></li>
  2283. <li><span style="color:blue;font-size:0.8em"> example:<br />size 400,400<br />yrange 0,13<br />xrange -100,500<br />axis<br />yaxis 1:january:2:february:3:march:5:may:6:june:7:july:8:august:9:september:10:october:11:november:12:december<br />#'ymajor' steps should be synchronised with numbers eg. "1" in this example<br />grid 100,1,grey,4,1,6,grey
  2284. </span></li>
  2285. </ul>
  2286. <li><a name='yerrorbars' href='#yerrorbars top'>  yerrorbars color,E1,E2,x1,y1,x2,y2,...,x_n,y_n</a><ul>
  2287. <li><span style="color:blue;font-size:0.8em"> draw multiple points with y-errorbars E1 (error value under point) and E2 (error value above point) at given coordinates in color 'color'
  2288. </span></li>
  2289. <li><span style="color:blue;font-size:0.8em"> the errors E1 and E2 values are in yrange.
  2290. </span></li>
  2291. <li><span style="color:blue;font-size:0.8em"> use command 'linewidth int' to adust size
  2292. </span></li>
  2293. <li><span style="color:blue;font-size:0.8em"> may be set <a href="#drag">draggable</a> / <a href="#onclick">onclick</a> individually (!)
  2294. </span></li>
  2295. </ul>
  2296. <li><a name='yoffset' href='#yoffset top'>  yoffset</a><ul>
  2297. <li><span style="color:blue;font-size:0.8em"> keyword, only active for commands <a href="#textup">textup</a> and <a href="#stringup">stringup</a>
  2298. </span></li>
  2299. <li><span style="color:blue;font-size:0.8em"> places the text <b>under</b> the (x:y) coordinates(x:y)<br/ >eg the string 'hello' will end at char 'o' on (x:y) <br />normal behaviour : string starts at (x:y)
  2300. </span></li>
  2301. <li><span style="color:blue;font-size:0.8em"> string ending on (x:y) is valid for all rotation angles
  2302. </span></li>
  2303. <li><span style="color:blue;font-size:0.8em"> may be used for points or other things requirering labels in y-direction
  2304. </span></li>
  2305. <li><span style="color:blue;font-size:0.8em"> other text position manipulations: see <a href="#xoffset">xoffset</a> for centering on x-coordinate or <a href="#xyoffset">xyoffset</a> label placement for points etc.
  2306. </span></li>
  2307. </ul>
  2308. <li><a name='yrange' href='#yrange top'>  yrange ymin,ymax</a><ul>
  2309. <li><span style="color:blue;font-size:0.8em">alternative command:<a name='rangey' href='#rangey top'>rangey</a></span></li>
  2310. <li><span style="color:blue;font-size:0.8em"> if not given 0,ysize (eg in pixels)
  2311. </span></li>
  2312. </ul>
  2313. <li><a name='ysnaptogrid' href='#ysnaptogrid top'>  ysnaptogrid</a><ul>
  2314. <li><span style="color:blue;font-size:0.8em"> keyword (no arguments required)
  2315. </span></li>
  2316. <li><span style="color:blue;font-size:0.8em"> a draggable object (use command "drag x|y|xy") will snap to the given y-grid values when dragged (mouseup)
  2317. </span></li>
  2318. <li><span style="color:blue;font-size:0.8em"> in case of userdraw the drawn points will snap to ymajor grid
  2319. </span></li>
  2320. <li><span style="color:blue;font-size:0.8em"> if no grid is defined ,points will snap to every integer yrange value. (eg snap_y=1)
  2321. </span></li>
  2322. <li><span style="color:blue;font-size:0.8em"> if you do not want a visible grid, but you only want a 'snaptogrid' with some value...define this grid with opacity 0.
  2323. </span></li>
  2324. <li><span style="color:blue;font-size:0.8em"> if yminor is defined (use keyword 'axis' to activate yminor), the drawing will snap to yminor <br />use only even dividers in y-minor...for example<br />ysnaptogrid<br />axis<br />grid 2,1,grey,4,4,7,red<br /> will snap on x=0, x=0.5, x=1, x=1.5 ....<br /> will snap on y=0, y=0.25 y=0.5 y=0.75 ...<br />
  2325. </span></li>
  2326. </ul>
  2327. <li><a name='ylabel' href='#ylabel top'>  ylabel some_string</a><ul>
  2328. <li><span style="color:blue;font-size:0.8em"> will be used to create a (vertical) label for the y-axis (label is in quadrant I)
  2329. </span></li>
  2330. <li><span style="color:blue;font-size:0.8em"> can only be used together with command <a href="#grid">'grid'</a><br />not depending on keywords 'axis' and 'axisnumbering'
  2331. </span></li>
  2332. <li><span style="color:blue;font-size:0.8em"> font setting: italic Courier, fontsize will be slightly larger (fontsize + 4)<br />use command "fontsize" to adjust.<br />(command "fontfamily" is not active for this command)
  2333. </span></li>
  2334. </ul>
  2335. <li><a name='ylogbase' href='#ylogbase top'>  ylogbase number</a><ul>
  2336. <li><span style="color:blue;font-size:0.8em"> sets the logbase number for the y-axis
  2337. </span></li>
  2338. <li><span style="color:blue;font-size:0.8em"> default value 10
  2339. </span></li>
  2340. <li><span style="color:blue;font-size:0.8em"> use together with commands ylogscale / xylogscale
  2341. </span></li>
  2342. </ul>
  2343. <li><a name='ylogscale' href='#ylogscale top'>  ylogscale xmajor,xminor,majorcolor,minorcolor</a><ul>
  2344. <li><span style="color:blue;font-size:0.8em"> the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
  2345. </span></li>
  2346. <li><span style="color:blue;font-size:0.8em"> xmajor is the major step on the x-axis; xminor is the divisor for the x-step
  2347. </span></li>
  2348. <li><span style="color:blue;font-size:0.8em"> the linewidth is set using command 'linewidth int'
  2349. </span></li>
  2350. <li><span style="color:blue;font-size:0.8em"> the opacity of major / minor grid lines is set by command 'opacity [0-255],[0-255]'
  2351. </span></li>
  2352. <li><span style="color:blue;font-size:0.8em"> default logbase number = 10 ... when needed , set the logbase number with command 'ylogbase number'
  2353. </span></li>
  2354. <li><span style="color:blue;font-size:0.8em"> the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use command 'precision' before 'ylogscale' command to set the precision (decimals) of the axis numbering</li><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li><li>use command'fontcolor' to set the colour</li></ul>
  2355. </span></li>
  2356. <li><span style="color:blue;font-size:0.8em"> note: the complete canvas will be used for the 'log paper'
  2357. </span></li>
  2358. <li><span style="color:blue;font-size:0.8em"> note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
  2359. </span></li>
  2360. <li><span style="color:blue;font-size:0.8em"> note: command 'mouse color,fontsize' will show the real values in the logpaper.<br /> <li><span style="color:blue;font-size:0.8em"> note: when using something like 'yrange 0.0001,0.01'...combined with commands 'mouse color,fontsize' and/or 'userdraw type,color'...<br /> make sure the precision is set accordingly (eg command 'precision 10000')
  2361. </span></li>
  2362. <li><span style="color:blue;font-size:0.8em"> note: in case of userdraw , the use of keyword 'userinput_xy' may be handy !
  2363. </span></li>
  2364. <li><span style="color:blue;font-size:0.8em"> <b>attention</b>: keyword 'snaptogrid' may not lead to the desired result...
  2365. </span></li>
  2366. </ul>
  2367. <li><a name='yunit' href='#yunit top'>  yunit some_unit_for_y-values</a><ul>
  2368. <li><span style="color:blue;font-size:0.8em"> unicode allowed (no html code)
  2369. </span></li>
  2370. <li><span style="color:blue;font-size:0.8em"> use together with command mousey
  2371. </span></li>
  2372. <li><span style="color:blue;font-size:0.8em"> will display the cursor y-coordinate in 'unit'
  2373. </span></li>
  2374. </ul>
  2375. <li><a name='zoom' href='#zoom top'>  zoom button_color</a><ul>
  2376. <li><span style="color:blue;font-size:0.8em"> introduce a very small 'controlpanel' at the lower right corner
  2377. </span></li>
  2378. <li><span style="color:blue;font-size:0.8em"> giving six 15&times;15px 'active' rectangle areas<br />(for &times;,leftarrow,rightarrow,uparrow,downarrow and a '-' and a '+' sign ) for zooming and/or panning of the image
  2379. </span></li>
  2380. <li><span style="color:blue;font-size:0.8em"> the 'x' symbol will do a 'location.reload' of the page, and thus reset all canvas drawings.
  2381. </span></li>
  2382. <li><span style="color:blue;font-size:0.8em"> choose an appropriate colour, so the small 'x,arrows,-,+' are clearly visible
  2383. </span></li>
  2384. <li><span style="color:blue;font-size:0.8em"> command 'opacity' may be used to set stroke_opacity of 'buttons
  2385. </span></li>
  2386. <li><span style="color:blue;font-size:0.8em"> note: use command 'zoom' at the end of your script code (the same is true for command 'mouse')
  2387. </span></li>
  2388. <li><span style="color:blue;font-size:0.8em"> note: only objects that may be set draggable / clickable will be zoomed / panned
  2389. </span></li>
  2390. <li><span style="color:blue;font-size:0.8em"> note: when an object is dragged, zooming / panning will cause the coordinates to be reset to the original position :( <br />e.g. dragging / panning will get lost. (array with 'drag data' is erased)<br />This is a design flaw and not a feature !!
  2391. </span></li>
  2392. </ul>
  2393.  
  2394. </li>
  2395. </ul>
  2396. <script type='text/javascript'>
  2397. var keys = ['canvasdraw' ,'canvasdraw','affine','angle','animate','arc','arrow','vector','arrows','vectors','arrow2','arrows2','arrowhead','audio','axisnumbering','axis','barchart','bezier','bgcolor','bgimage','blink','boxplot','boxplotdata','canvastype','centerstring','circle','circles','disks','clearbutton','delete','erase','clock','colorpalette','copy','copyresized','crosshair','crosshairs','crosshairsize','cursor','pointer','curve','dashed','dashtype','diamondfill','dotfill','drag','ellipse','fillall','filled','fillcolor','fillpattern','filltoborder','floodfill','fill','fontcolor','fontfamily','fontsize','functionlabel','grid','gridfill','demiline','halfline','demilines','halflines','hatchfill','hline','horizontalline','hlines','horizontallines','http','html','imagefill','inputstyle','input','intooltip','jscurve','jsplot','jsmath','killaffine','killrotate','killslider','killtranslation','killtranslate','line','lines','linewidth','lattice','levelcurve','legend','legendcolors','linegraph','mathml','mouse','mouse_degree','display','precision','mousex','mousey','multidash','multidraw','multilabel','multilinewidth','multifill','multifillcolors','multifillopacity','multisnaptogrid','multistrokecolors','multistrokeopacity','multiuserinput','noaxis','noayis','numberline','opacity','transparent','onclick','parallel','plotsteps','point','points','poly','polyline','popup','protractor','pixels','pixelsize','piechart','rays','rect','rects','replyformat','roundrect','roundrects','ruler','resetoffset','rotate','rotationcenter','size','segment','seg','segments','segs','setlimits','setpixel','slider','sliderfunction_x','sliderfunction_y','sgraph','snaptofunction','snaptofun','snaptopoints','snaptogrid','square','status','string','stringup','highlight','strokecolor','text','textarea','textfill','textup','trace_jscurve','trange','ranget','translation','translate','triangle','triangles','userboxplot','userboxplotdata','userdraw','userinput','userinput_function','userinput_textarea','userinput_xy','userinput_xy','userinput_function','usertextarea_xy','vline','verticalline','vlines','verticallines','video','xaxis','xaxistext','xaxisup','xaxistextup','xerrorbars','xrange','rangex','xsnaptogrid','xoffset','xyoffset','xunit','xlabel','xlogbase','xlogscale','xylogscale','yaxis','yerrorbars','yoffset','yrange','rangey','ysnaptogrid','ylabel','ylogbase','ylogscale','yunit','zoom'];
  2398. var keys_len = keys.length;
  2399. function match(s1,s2){
  2400.  var n1 = s1.length;
  2401.  if(n1 < 3){return 0;}
  2402.  var n2 = s2.length;
  2403.  var c1,c2,found;
  2404.  var count = n1 - Math.abs(n1 - n2);
  2405.  for(var p = 0;p < n1;p++){
  2406.   c1=s1.charAt(p);
  2407.   found = false;
  2408.   for(var i = 0;i < n2;i++){
  2409.    c2 = s2.charAt(i);
  2410.    if(c1 == c2){found = true;count = count + n1 - Math.abs(p - i);}
  2411.   };
  2412.   if(! found ){count = count - n2;}
  2413.  };
  2414.  return count;
  2415. };
  2416. function look(){
  2417.  var s = ((document.getElementById('search').value).replace(/\s/g, '')).toLowerCase();
  2418.  var typo;var next_best = -1;var next_idx = s.length;var tmp;var ss;
  2419.  for(var p = 0; p < keys_len ; p++){
  2420.   ss = keys[p];
  2421.   if( s == ss ){
  2422.    window.location.href = '#'+ss;
  2423.    return;
  2424.    };
  2425.    /* not ok? ... try to find a match for a reasonable typo... */
  2426.    tmp = match(s,ss);
  2427.    if(tmp > next_idx){
  2428.     next_idx = tmp;
  2429.     next_best = p;
  2430.    };
  2431.   };
  2432.   if(next_best != -1 ){
  2433.    typo = keys[next_best];
  2434.    if(confirm('"'+s+'" is not a valid canvasdraw command\ndid you mean "'+typo+'" ?')){
  2435.     window.location.href = '#'+typo;
  2436.     return;
  2437.    };
  2438.   }
  2439.   else
  2440.   {
  2441.    alert(s+' is not a valid canvasdraw command');
  2442.   };
  2443.   return;
  2444.  };
  2445. </script>
  2446.