1 /*
  2     Copyright 2008-2018
  3         Matthias Ehmann,
  4         Michael Gerhaeuser,
  5         Carsten Miller,
  6         Bianca Valentin,
  7         Alfred Wassermann,
  8         Peter Wilfahrt
  9 
 10     This file is part of JSXGraph.
 11 
 12     JSXGraph is free software dual licensed under the GNU LGPL or MIT License.
 13 
 14     You can redistribute it and/or modify it under the terms of the
 15 
 16       * GNU Lesser General Public License as published by
 17         the Free Software Foundation, either version 3 of the License, or
 18         (at your option) any later version
 19       OR
 20       * MIT License: https://github.com/jsxgraph/jsxgraph/blob/master/LICENSE.MIT
 21 
 22     JSXGraph is distributed in the hope that it will be useful,
 23     but WITHOUT ANY WARRANTY; without even the implied warranty of
 24     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 25     GNU Lesser General Public License for more details.
 26 
 27     You should have received a copy of the GNU Lesser General Public License and
 28     the MIT License along with JSXGraph. If not, see <http://www.gnu.org/licenses/>
 29     and <http://opensource.org/licenses/MIT/>.
 30  */
 31 
 32 
 33 /*global JXG:true, define: true*/
 34 /*jslint nomen: true, plusplus: true*/
 35 
 36 /* depends:
 37  jxg
 38  base/constants
 39  math/math
 40  utils/color
 41  utils/type
 42  */
 43 
 44 define([
 45     'jxg', 'base/constants', 'math/math', 'utils/color', 'utils/type'
 46 ], function (JXG, Const, Mat, Color, Type) {
 47 
 48     "use strict";
 49 
 50     /**
 51      * Options Namespace
 52      * @description These are the default options of the board and of all geometry elements.
 53      * @namespace
 54      * @name JXG.Options
 55      */
 56     JXG.Options = {
 57         jc: {
 58             enabled: true,
 59             compile: true
 60         },
 61 
 62         /*
 63          * Options that are used directly within the board class
 64          */
 65         board: {
 66             /**#@+
 67              * @visprop
 68              */
 69 
 70             //updateType: 'hierarchical', // 'all'
 71 
 72             /**
 73              * Bounding box of the visible area in user coordinates.
 74              * It is an array consisting of four values:
 75              * [x<sub>1</sub>, y<sub>1</sub>, x<sub>2</sub>, y<sub>2</sub>]
 76              *
 77              * The canvas will be spanned from the upper left corner (<sub>1</sub>, y<sub>1</sub>)
 78              * to the lower right corner (x<sub>2</sub>, y<sub>2</sub>).
 79              *
 80              * @name JXG.Board#boundingbox
 81              * @type Array
 82              * @default [-5, 5, 5, -5]
 83              */
 84             boundingBox: [-5, 5, 5, -5],
 85 
 86             /**
 87              * Additional zoom factor multiplied to {@link JXG.Board#zoomX} and {@link JXG.Board#zoomY}.
 88              *
 89              * @name JXG.Board#zoomFactor
 90              * @type Number
 91              * @default 1.0
 92              */
 93             zoomFactor: 1,
 94 
 95             /**
 96              * Zoom factor in horizontal direction.
 97              *
 98              * @name JXG.Board#zoomX
 99              * @see JXG.Board#zoomY
100              * @type Number
101              * @default 1.0
102              */
103             zoomX: 1,
104 
105             /**
106              * Zoom factor in vertical direction.
107              *
108              * @name JXG.Board#zoomY
109              * @see JXG.Board#zoomX
110              * @type Number
111              * @default 1.0
112              */
113             zoomY: 1,
114 
115             /**
116              * Show copyright string in canvas.
117              *
118              * @name JXG.Board#showCopyright
119              * @type Boolean
120              * @default true
121              */
122             showCopyright: true,
123 
124             /**
125              * Show default axis.
126              * If shown, the horizontal axis can be accessed via JXG.Board.defaultAxes.x, the
127              * vertical axis can be accessed via JXG.Board.defaultAxes.y.
128              * Both axes have a sub-element "defaultTicks".
129              *
130              * Value can be Boolean or an object containing axis attributes.
131              *
132              * @name JXG.Board#axis
133              * @type Boolean
134              * @default false
135              */
136             axis: false,
137 
138             /**
139              * Attributes for the default axes in case of the attribute
140              * axis:true in {@link JXG.JSXGraph#initBoard}.
141              *
142              * @name JXG.Board#defaultAxes
143              * @type {Object}
144              * @default {x: {name:'x'}, y: {name: 'y'}}
145              *
146              */
147             defaultAxes: {
148                 x: {
149                     name: 'x',
150                     ticks: {
151                         label: {
152                             visible: 'inherit',
153                             anchorX: 'middle',
154                             anchorY: 'top',
155                             fontSize: 12,
156                             offset: [0, -3]
157                         },
158                         drawZero: false,
159                         visible: 'inherit'
160                     }
161                 },
162                 y: {
163                     name: 'y',
164                     ticks: {
165                         label: {
166                             visible: 'inherit',
167                             anchorX: 'right',
168                             anchorY: 'middle',
169                             fontSize: 12,
170                             offset: [-6, 0]
171                         },
172                         tickEndings: [1, 0],
173                         drawZero: false,
174                         visible: 'inherit'
175                     }
176                 }
177             },
178 
179             /**
180              * Display of navigation arrows and zoom buttons
181              *
182              * @name JXG.Board#showNavigation
183              * @type Boolean
184              * @default true
185              */
186             showNavigation: true,
187 
188             /**
189              * Display of zoom buttons. To show zoom buttons, additionally
190              * showNavigation has to be set to true.
191              *
192              * @name JXG.Board#showZoom
193              * @type Boolean
194              * @default true
195              */
196             showZoom: true,
197 
198             /**
199              * Show a button to force reload of a construction.
200              * Works only with the JessieCode tag
201              *
202              * @name JXG.Board#showReload
203              * @type Boolean
204              * @default false
205              */
206             showReload: false,
207 
208             showScreenshot: false,
209 
210             screenshot: {
211                 scale: 1.0,
212                 type: 'png',
213                 symbol: '\u2318', //'\u22b9', //'\u26f6',
214                 css: 'background-color:#eeeeee; opacity:1.0; border:2px solid black; border-radius:10px; text-align:center',
215                 cssButton:  'padding: 4px 10px; border: solid #356AA0 1px; border-radius: 5px; position: absolute; right: 2ex; top: 2ex; background-color: rgba(255, 255, 255, 0.3);'
216             },
217 
218             /**
219              * Show a button which allows to clear all traces of a board.
220              *
221              * @name JXG.Board#showClearTraces
222              * @type Boolean
223              * @default false
224              */
225             showClearTraces: false,
226 
227             /**
228              * If set to true the bounding box might be changed such that
229              * the ratio of width and height of the hosting HTML div is equal
230              * to the ratio of wifth and height of the bounding box.
231              *
232              * This is necessary if circles should look like circles and not
233              * like ellipses. It is recommended to set keepAspectRatio = true
234              * for geometric applets. For function plotting keepAspectRatio = false
235              * might be the better choice.
236              *
237              * @name JXG.Board#keepAspectRatio
238              * @see JXG.Board#boundingbox
239              * @see JXG.Board#setBoundingBox
240              * @type Boolean
241              * @default false
242              */
243             keepAspectRatio: false,
244 
245             /**
246              * If set true and
247              * hasPoint() is true for both an element and it's label,
248              * the element (and not the label) is taken as drag element.
249              *
250              * If set false and hasPoint() is true for both an element and it's label,
251              * the label is taken (if it is on a higher layer than the element)
252              *
253              * @name JXG.Board#ignoreLabels
254              * @type Booelan
255              * @default true
256              */
257             ignoreLabels: true,
258 
259             /**
260              * Maximum number of digits in automatic label generation.
261              * For example, if set to 1 automatic point labels end at "Z".
262              * If set to 2, point labels end at "ZZ".
263              *
264              * @name JXG.Board#maxNameLength
265              * @see JXG.Board#generateName
266              * @type Number
267              * @default 1
268              */
269             maxNameLength: 1,
270 
271             /**
272              * Supply the document object. Defaults to window.document
273              *
274              * @name JXG.Board#document
275              * @type DOM object
276              * @default false (meaning window.document)
277              */
278             document: false,
279 
280             /**
281              * If true the first element of the set JXG.board.objects having hasPoint==true is taken as drag element.
282              *
283              * @name JXG.Board#takeFirst
284              * @type Boolean
285              * @default false
286              */
287             takeFirst: false,
288 
289             /**
290             * If true, when read from a file or string - the size of the div can be changed by the construction text.
291             *
292             * @name JXG.Board#takeSizeFromFile
293             * @type Boolean
294             * @default false
295             */
296             takeSizeFromFile: false,
297 
298             /**
299              * Default rendering engine. Possible values are 'svg', 'canvas', 'vml', 'no', or 'auto'.
300              * If the rendering engine is not available JSXGraph tries to detect a different engine.
301              *
302              * <p>
303              * In case of 'canvas' it is advisable to call 'board.update()' after all elements have been
304              * constructed. This ensures that all elements are drawn with their intended visual appearance.
305              *
306              * @name JXG.Board#renderer
307              * @type String
308              * @default 'auto'
309              */
310             renderer: 'auto',
311 
312             /**
313              * Time (in msec) between two animation steps. Used in
314              * {@link JXG.CoordsElement#moveAlong}, {@link JXG.CoordsElement#moveTo} and
315              * {@link JXG.CoordsElement#visit}.
316              *
317              * @name JXG.Board#animationDelay
318              * @type Number
319              * @default 35
320              * @see JXG.CoordsElement#moveAlong
321              * @see JXG.CoordsElement#moveTo
322              * @see JXG.CoordsElement#visit
323              */
324             animationDelay: 35,
325 
326             /**
327              * Allow user interaction by registering mouse and touch events.
328              *
329              * @name JXG.Board#registerEvents
330              * @type Boolean
331              * @default true
332              */
333             registerEvents: true,
334 
335             /**
336              * Change redraw strategy in SVG rendering engine.
337              *
338              * If set to 'svg', before every redrawing of the JSXGraph construction
339              * the SVG sub-tree of the DOM tree is taken out of the DOM.
340              *
341              * If set to 'all', before every redrawing of the JSXGraph construction the
342              * complete DOM tree is taken out of the DOM.
343              * If set to 'none' the redrawing is done in-place.
344              *
345              * Using 'svg' or 'all' speeds up the update process considerably. The risk
346              * is that if there is an exception, only a white div or window is left.
347              *
348              * @name JXG.Board#minimizeReflow
349              * @type String
350              * @default 'svg'
351              */
352             minimizeReflow: 'svg',
353 
354             /**
355              * A number that will be added to the absolute position of the board used in mouse coordinate
356              * calculations in {@link JXG.Board#getCoordsTopLeftCorner}.
357              *
358              * @name JXG.Board#offsetX
359              * @see JXG.Board#offsetY
360              * @type Number
361              * @default 0
362              */
363             offsetX: 0,
364 
365             /**
366              * A number that will be added to the absolute position of the board used in mouse coordinate
367              * calculations in {@link JXG.Board#getCoordsTopLeftCorner}.
368              *
369              * @name JXG.Board#offsetY
370              * @see JXG.Board#offsetX
371              * @type Number
372              * @default 0
373              */
374             offsetY: 0,
375 
376             /**
377              * Control the possibilities for zoom interaction.
378              *
379              * Possible sub-attributes with default values are:
380              * <pre>
381              * zoom: {
382              *   factorX: 1.25,  // horizontal zoom factor (multiplied to {@link JXG.Board#zoomX})
383              *   factorY: 1.25,  // vertical zoom factor (multiplied to {@link JXG.Board#zoomY})
384              *   wheel: true,     // allow zooming by mouse wheel or
385              *   				   // by pinch-to-toom gesture on touch devices
386              *   needShift: true, // mouse wheel zooming needs pressing of the shift key
387              *   min: 0.001        // minimal values of {@link JXG.Board#zoomX} and {@link JXG.Board#zoomY}, limits zoomOut
388              *   max: 1000.0       // maximal values of {@link JXG.Board#zoomX} and {@link JXG.Board#zoomY}, limits zoomIn
389              *
390              *   pinchHorizontal: true // Allow pinch-to-zoom to zoom only horizontal axis
391              *   pinchVertical: true   // Allow pinch-to-zoom to zoom only vertical axis
392              *   pinchSensitivity: 7   // Sensitivity (in degrees) for recognizing horizontal or vertical pinch-to-zoom gestures.
393              * }
394              * </pre>
395              *
396              * Deprecated: zoom.eps which is superseded by zoom.min
397              *
398              * @name JXG.Board#zoom
399              * @type Object
400              * @default
401              */
402             zoom: {
403                 enabled: true,
404                 factorX: 1.25,
405                 factorY: 1.25,
406                 wheel: true,
407                 needShift: true,
408                 min: 0.0001,
409                 max: 10000.0,
410                 pinchHorizontal: true,
411                 pinchVertical: true,
412                 pinchSensitivity: 7
413             },
414 
415             /**
416              * Control the possibilities for panning interaction (i.e. moving the origin).
417              *
418              * Possible sub-attributes with default values are:
419              * <pre>
420              * pan: {
421              *   enabled: true   // Allow panning
422              *   needTwoFingers: true, // panning is done with two fingers on touch devices
423              *   needShift: true, // mouse panning needs pressing of the shift key
424              * }
425              * </pre>
426              *
427              * @name JXG.Board#pan
428              * @type Object
429              * @default
430              */
431             pan: {
432                 needShift: true,
433                 needTwoFingers: false,
434                 enabled: true
435             },
436 
437             /**
438              * Control the possibilities for a selection rectangle.
439              * Starting a selection event triggers the "startselecting" event.
440              * When the mouse pointer is released, the "stopselecting" event is fired.
441              * The "stopselecting" event must be supplied by the user.
442              * <p>
443              * Possible sub-attributes with default values are:
444              * <pre>
445              * selection: {
446              *   enabled: false,
447              *   name: 'selectionPolygon',
448              *   needShift: false,  // mouse selection needs pressing of the shift key
449              *   needCtrl: true,    // mouse selection needs pressing of the shift key
450              *   withLines: false,  // Selection polygon has border lines
451              *   vertices: {
452              *       visible: false
453              *   },
454              *   fillColor: '#ffff00',
455              *   visible: false      // Initial visibility. Should be set to false always
456              * }
457              * </pre>
458              *
459              * @example
460              * board.on('stopselecting', function(){
461              *     var box = board.stopSelectionMode(),
462              *     // bbox has the coordinates of the selectionr rectangle.
463              *     // Attention: box[i].usrCoords have the form [1, x, y], i.e.
464              *     // are homogeneous coordinates.
465              *     bbox = box[0].usrCoords.slice(1).concat(box[1].usrCoords.slice(1));
466              *     // Set a new bounding box
467              *     board.setBoundingBox(bbox, false);
468              * });
469              *
470              * @name JXG.Board#selection
471              * @see JXG.Board#startselecting
472              * @see JXG.Board#stopselecting
473              * @see JXG.Board#mousestartselecting
474              * @see JXG.Board#pointerstartselecting
475              * @see JXG.Board#touchstartselecting
476              * @see JXG.Board#mousestopselecting
477              * @see JXG.Board#pointerstopselecting
478              * @see JXG.Board#touchstopselecting
479              * @type Object
480              * @default
481              */
482             selection: {
483                 enabled: false,
484                 name: 'selectionPolygon',
485                 needShift: false,
486                 needCtrl: true,
487                 withLines: false,
488                 vertices: {
489                     visible: false
490                 },
491                 fillColor: '#ffff00',
492                 visible: false
493             }
494             /**#@-*/
495         },
496 
497         /**
498          * Options that are used by the navigation bar.
499          *
500          * Default values are
501          * <pre>
502          * JXG.Option.navbar: {
503          *   strokeColor: '#333333',
504          *   fillColor: 'transparent',
505          *   highlightFillColor: '#aaaaaa',
506          *   padding: '2px',
507          *   position: 'absolute',
508          *   fontSize: '14px',
509          *   cursor: 'pointer',
510          *   zIndex: '100',
511          *   right: '5px',
512          *   bottom: '5px'
513          * },
514          * </pre>
515          */
516         navbar: {
517             strokeColor: '#333333', //'#aaaaaa',
518             fillColor: 'transparent', //#f5f5f5',
519             highlightFillColor: '#aaaaaa',
520             padding: '2px',
521             position: 'absolute',
522             fontSize: '14px',
523             cursor: 'pointer',
524             zIndex: '100',
525             right: '5px',
526             bottom: '5px'
527             //border: 'none 1px black',
528             //borderRadius: '4px'
529         },
530 
531          /*
532           *  Generic options used by {@link JXG.GeometryElement}
533           */
534         elements: {
535             // the following tag is a meta tag: http://code.google.com/p/jsdoc-toolkit/wiki/MetaTags
536 
537             /**#@+
538              * @visprop
539              */
540 
541             /**
542              * The stroke color of the given geometry element.
543              * @type String
544              * @name JXG.GeometryElement#strokeColor
545              * @see JXG.GeometryElement#highlightStrokeColor
546              * @see JXG.GeometryElement#strokeWidth
547              * @see JXG.GeometryElement#strokeOpacity
548              * @see JXG.GeometryElement#highlightStrokeOpacity
549              * @default {@link JXG.Options.elements.color#strokeColor}
550              */
551             strokeColor: '#0000ff',
552 
553             /**
554              * The stroke color of the given geometry element when the user moves the mouse over it.
555              * @type String
556              * @name JXG.GeometryElement#highlightStrokeColor
557              * @see JXG.GeometryElement#strokeColor
558              * @see JXG.GeometryElement#strokeWidth
559              * @see JXG.GeometryElement#strokeOpacity
560              * @see JXG.GeometryElement#highlightStrokeOpacity
561              * @default {@link JXG.Options.elements.color#highlightStrokeColor}
562              */
563             highlightStrokeColor: '#C3D9FF',
564 
565             /**
566              * The fill color of this geometry element.
567              * @type String
568              * @name JXG.GeometryElement#fillColor
569              * @see JXG.GeometryElement#highlightFillColor
570              * @see JXG.GeometryElement#fillOpacity
571              * @see JXG.GeometryElement#highlightFillOpacity
572              * @default {@link JXG.Options.elements.color#fillColor}
573              */
574             fillColor: 'red',
575 
576             /**
577              * The fill color of the given geometry element when the mouse is pointed over it.
578              * @type String
579              * @name JXG.GeometryElement#highlightFillColor
580              * @see JXG.GeometryElement#fillColor
581              * @see JXG.GeometryElement#fillOpacity
582              * @see JXG.GeometryElement#highlightFillOpacity
583              * @default {@link JXG.Options.elements.color#highlightFillColor}
584              */
585             highlightFillColor: 'none',
586 
587             /**
588              * Opacity for element's stroke color.
589              * @type number
590              * @name JXG.GeometryElement#strokeOpacity
591              * @see JXG.GeometryElement#strokeColor
592              * @see JXG.GeometryElement#highlightStrokeColor
593              * @see JXG.GeometryElement#strokeWidth
594              * @see JXG.GeometryElement#highlightStrokeOpacity
595              * @default {@link JXG.Options.elements#strokeOpacity}
596              */
597             strokeOpacity: 1,
598 
599             /**
600              * Opacity for stroke color when the object is highlighted.
601              * @type number
602              * @name JXG.GeometryElement#highlightStrokeOpacity
603              * @see JXG.GeometryElement#strokeColor
604              * @see JXG.GeometryElement#highlightStrokeColor
605              * @see JXG.GeometryElement#strokeWidth
606              * @see JXG.GeometryElement#strokeOpacity
607              * @default {@link JXG.Options.elements#highlightStrokeOpacity}
608              */
609             highlightStrokeOpacity: 1,
610 
611             /**
612              * Opacity for fill color.
613              * @type number
614              * @name JXG.GeometryElement#fillOpacity
615              * @see JXG.GeometryElement#fillColor
616              * @see JXG.GeometryElement#highlightFillColor
617              * @see JXG.GeometryElement#highlightFillOpacity
618              * @default {@link JXG.Options.elements.color#fillOpacity}
619              */
620             fillOpacity: 1,
621 
622             /**
623              * Opacity for fill color when the object is highlighted.
624              * @type number
625              * @name JXG.GeometryElement#highlightFillOpacity
626              * @see JXG.GeometryElement#fillColor
627              * @see JXG.GeometryElement#highlightFillColor
628              * @see JXG.GeometryElement#fillOpacity
629              * @default {@link JXG.Options.elements.color#highlightFillOpacity}
630              */
631             highlightFillOpacity: 1,
632 
633             /**
634              * Transition duration (in milliseconds) for color and opacity
635              * changes. Works in SVG renderer, only.
636              * @type Number
637              * @name JXG.GeometryElement#transitionDuration
638              * @see JXG.GeometryElement#strokeColor
639              * @see JXG.GeometryElement#highlightStrokeColor
640              * @see JXG.GeometryElement#strokeOpacity
641              * @see JXG.GeometryElement#highlightStrokeOpacity
642              * @see JXG.GeometryElement#fillColor
643              * @see JXG.GeometryElement#highlightFillColor
644              * @see JXG.GeometryElement#fillOpacity
645              * @see JXG.GeometryElement#highlightFillOpacity
646              * @default {@link JXG.Options.elements#transitionDuration}
647              */
648             transitionDuration: 100,
649 
650             /**
651              * Width of the element's stroke.
652              * @type number
653              * @name JXG.GeometryElement#strokeWidth
654              * @see JXG.GeometryElement#strokeColor
655              * @see JXG.GeometryElement#highlightStrokeColor
656              * @see JXG.GeometryElement#strokeOpacity
657              * @see JXG.GeometryElement#highlightStrokeOpacity
658              * @default {@link JXG.Options.elements#strokeWidth}
659              */
660             strokeWidth: 2,
661 
662             /**
663              * Width of the element's stroke when the mouse is pointed over it.
664              * @type number
665              * @name JXG.GeometryElement#highlightStrokeWidth
666              * @see JXG.GeometryElement#strokeColor
667              * @see JXG.GeometryElement#highlightStrokeColor
668              * @see JXG.GeometryElement#strokeOpacity
669              * @see JXG.GeometryElement#highlightStrokeOpacity
670              * @see JXG.GeometryElement#highlightFillColor
671              * @default {@link JXG.Options.elements#strokeWidth}
672              */
673             highlightStrokeWidth: 2,
674 
675             /**
676              * If true the element is fixed and can not be dragged around. The element
677              * will be repositioned on zoom and moveOrigin events.
678              * @type Boolean
679              * @default false
680              * @name JXG.GeometryElement#fixed
681              */
682             fixed: false,
683 
684             /**
685              * If true the element is fixed and can not be dragged around. The element
686              * will even stay at its position on zoom and moveOrigin events.
687              * Only free elements like points, texts, curves can be frozen.
688              * @type Boolean
689              * @default false
690              * @name JXG.GeometryElement#frozen
691              */
692             frozen: false,
693 
694             /**
695              * If true a label will display the element's name.
696              * @type Boolean
697              * @default false
698              * @name JXG.GeometryElement#withLabel
699              */
700             withLabel: false,
701 
702             /**
703              * If false the element won't be visible on the board, otherwise it is shown.
704              * @type boolean
705              * @name JXG.GeometryElement#visible
706              * @see JXG.GeometryElement#hideElement
707              * @see JXG.GeometryElement#showElement
708              * @default true
709              */
710             visible: true,
711 
712             /**
713              * A private element will be inaccessible in certain environments, e.g. a graphical user interface.
714              * @default false
715              */
716             priv: false,
717 
718             /**
719              * Display layer which will contain the element.
720              * @see JXG.Options#layer
721              * @default See {@link JXG.Options#layer}
722              */
723             layer: 0,
724 
725             /**
726              * Determines the elements border-style.
727              * Possible values are:
728              * <ul><li>0 for a solid line</li>
729              * <li>1 for a dotted line</li>
730              * <li>2 for a line with small dashes</li>
731 
732 
733              * <li>3 for a line with medium dashes</li>
734              * <li>4 for a line with big dashes</li>
735              * <li>5 for a line with alternating medium and big dashes and large gaps</li>
736              * <li>6 for a line with alternating medium and big dashes and small gaps</li></ul>
737              * @type Number
738              * @name JXG.GeometryElement#dash
739              * @default 0
740              */
741             dash: 0,
742 
743             /**
744              * If true the element will get a shadow.
745              * @type boolean
746              * @name JXG.GeometryElement#shadow
747              * @default false
748              */
749             shadow: false,
750 
751             /**
752              * If true the element will be traced, i.e. on every movement the element will be copied
753              * to the background. Use {@link JXG.GeometryElement#clearTrace} to delete the trace elements.
754              * @see JXG.GeometryElement#clearTrace
755              * @see JXG.GeometryElement#traces
756              * @see JXG.GeometryElement#numTraces
757              * @type Boolean
758              * @default false
759              * @name JXG.GeometryElement#trace
760              */
761             trace: false,
762 
763             /**
764              * Extra visual properties for traces of an element
765              * @type Object
766              * @see JXG.GeometryElement#trace
767              * @name JXG.GeometryElement#traceAttributes
768              */
769             traceAttributes: {},
770 
771             /**
772              *
773              * @type Boolean
774              * @default true
775              * @name JXG.GeometryElement#highlight
776              */
777             highlight: true,
778 
779             /**
780              * If this is set to true, the element is updated in every update
781              * call of the board. If set to false, the element is updated only after
782              * zoom events or more generally, when the bounding box has been changed.
783              * Examples for the latter behaviour should be axes.
784              * @type Boolean
785              * @default true
786              * @see JXG.GeometryElement#needsRegularUpdate
787              * @name JXG.GeometryElement#needsRegularUpdate
788              */
789             needsRegularUpdate: true,
790 
791             /**
792              * Snaps the element or its parents to the grid. Currently only relevant for points, circles,
793              * and lines. Points are snapped to grid directly, on circles and lines it's only the parent
794              * points that are snapped
795              * @type Boolean
796              * @default false
797              * @name JXG.GeometryElement#snapToGrid
798              */
799             snapToGrid: false,
800 
801             /**
802              * Determines whether two-finger manipulation of this object may change its size.
803              * If set to false, the object is only rotated and translated.
804              * <p>
805              * In case the element is a horizontal or vertical line having ticks, "scalable==true"
806              * enables zooming of the board by dragging ticks lines. This feature is enabled,
807              * for the ticks element of the line element the attribute "fixed" has to be false
808              * and the line element's scalable attribute has to be true.
809              *
810              * @type Boolean
811              * @default true
812              * @name JXG.GeometryElement#scalable
813              * @see JXG.Ticks#fixed
814              */
815             scalable: true,
816 
817             /**
818              * If the element is dragged it will be moved on mousedown or touchstart to the
819              * top of its layer. Works only for SVG renderer and for ssimple elements
820              * consisting of one SVG node.
821              * @type Boolean
822              * @default false
823              * @name JXG.GeometryElement#scalable
824              */
825             dragToTopOfLayer: false,
826 
827             /*draft options */
828             draft: {
829                 /**
830                  * If true the element will be drawn in grey scale colors to visualize that it's only a draft.
831                  * @type boolean
832                  * @name JXG.GeometryElement#draft
833                  * @default {@link JXG.Options.elements.draft#draft}
834                  */
835                 draft: false,
836                 strokeColor: '#565656',
837                 fillColor: '#565656',
838                 strokeOpacity: 0.8,
839                 fillOpacity: 0.8,
840                 strokeWidth: 1
841             },
842 
843             /**
844              * @private
845              * By default, an element is not a label. Do not change this.
846              */
847             isLabel: false
848             // close the meta tag
849             /**#@-*/
850         },
851 
852          /*
853           *  Generic options used by {@link JXG.Ticks}
854           */
855         ticks: {
856             /**#@+
857              * @visprop
858              */
859 
860             /**
861              * A function that expects two {@link JXG.Coords}, the first one representing the coordinates of the
862              * tick that is to be labeled, the second one the coordinates of the center (the tick with position 0).
863              *
864              * @type function
865              * @name Ticks#generateLabelText
866              */
867             generateLabelText: null,
868 
869             /**
870              * A function that expects two {@link JXG.Coords}, the first one representing the coordinates of the
871              * tick that is to be labeled, the second one the coordinates of the center (the tick with position 0).
872              *
873              * @deprecated Use {@link JGX.Options@generateLabelValue}
874              * @type function
875              * @name Ticks#generateLabelValue
876              */
877             generateLabelValue: null,
878 
879             /**
880              * Draw labels yes/no
881              *
882              * @type Boolean
883              * @name Ticks#drawLabels
884              * @default false
885              */
886             drawLabels: false,
887             label: {
888             },
889 
890             /**
891              * Use the unicode character 0x2212, i.e. the HTML entity &minus; as minus sign.
892              * That is −1 instead of -1.
893              *
894              * @type Boolean
895              * @name Ticks#useUnicodeMinus
896              * @default true
897              */
898             useUnicodeMinus: true,
899 
900             /**
901              * Determine the position of the tick with value 0. 'left' means point1 of the line, 'right' means point2,
902              * and 'middle' is equivalent to the midpoint of the defining points. This attribute is ignored if the parent
903              * line is of type axis and is parallel to either the x (i.e. y = 0) or the y (i.e. x = 0) axis.
904              *
905              * @type String
906              * @name Ticks#anchor
907              * @default 'left'
908              */
909             anchor: 'left',
910 
911             /**
912              * Draw the zero tick, that lies at line.point1?
913              *
914              * @type Boolean
915              * @name Ticks#drawZero
916              * @default false
917              */
918             drawZero: false,
919 
920             /**
921              * If the distance between two ticks is too big we could insert new ticks. If insertTicks
922              * is <tt>true</tt>, we'll do so, otherwise we leave the distance as is.
923              * This option is ignored if equidistant is false. In the example below the distance between
924              * two ticks is given as <tt>1</tt> but because insertTicks is set to true many ticks will
925              * be omitted in the rendering process to keep the display clear.
926              *
927              * @type Boolean
928              * @name Ticks#insertTicks
929              * @see Ticks#equidistant
930              * @see Ticks#minTicksDistance
931              * @default false
932              * @example
933              * // Create an axis providing two coord pairs.
934              *   var p1 = board.create('point', [0, 0]);
935              *   var p2 = board.create('point', [50, 25]);
936              *   var l1 = board.create('line', [p1, p2]);
937              *   var t = board.create('ticks', [l1, 1], {
938              *      insertTicks: true,
939              *      majorHeight: -1,
940              *      label: {
941              *          offset: [4, -9]
942              *      },
943              *      drawLabels: true
944              *  });
945              * </pre><div class="jxgbox" id="2f6fb842-40bd-4223-aa28-3e9369d2097f" style="width: 300px; height: 300px;"></div>
946              * <script type="text/javascript">
947              * (function () {
948              *   var board = JXG.JSXGraph.initBoard('2f6fb842-40bd-4223-aa28-3e9369d2097f', {boundingbox: [-100, 70, 70, -100], showcopyright: false, shownavigation: false});
949              *   var p1 = board.create('point', [0, 0]);
950              *   var p2 = board.create('point', [50, 25]);
951              *   var l1 = board.create('line', [p1, p2]);
952              *   var t = board.create('ticks', [l1, 1], {insertTicks: true, majorHeight: -1, label: {offset: [4, -9]}, drawLabels: true});
953              * })();
954              * </script><pre>
955              */
956             insertTicks: false,
957             minTicksDistance: 10,
958 
959             /**
960              * Total height of a minor tick. If negative the full height of the board is taken.
961              *
962              * @type Number
963              * @name Ticks#minorHeight
964              * @default 4
965              */
966             minorHeight: 4,
967 
968             /**
969              * Total height of a major tick. If negative the full height of the board is taken.
970              *
971              * @type Number
972              * @name Ticks#majorHeight
973              * @default 10
974              */
975             majorHeight: 10,
976 
977             /**
978              * Decides in which direction finite ticks are visible. Possible values are either the constants
979              * 0=false or 1=true or a function returning 0 or 1.
980              *
981              * In case of [0,1] the tick is only visible to the right of the line. In case of
982              * [1,0] the tick is only visible to the left of the line.
983              *
984              * @type Array
985              * @name Ticks#tickEndings
986              * @default [1, 1]
987              */
988             tickEndings: [1, 1],
989 
990             /**
991              * The number of minor ticks between two major ticks.
992              * @type Number
993              * @name Ticks#minorTicks
994              * @default 4
995              */
996             minorTicks: 4,
997 
998             /**
999              * Scale the ticks but not the tick labels.
1000              * @type Number
1001              * @default 1
1002              * @name Ticks#scale
1003              * @see Ticks#scaleSymbol
1004              */
1005             scale: 1,
1006 
1007             /**
1008              * A string that is appended to every tick, used to represent the scale
1009              * factor given in {@link JXG.Ticks#scaleSymbol}.
1010              *
1011              * @type String
1012              * @default ''
1013              * @name Ticks#scaleSymbol
1014              * @see Ticks#scale
1015              */
1016             scaleSymbol: '',
1017 
1018             /**
1019              * User defined labels for special ticks. Instead of the i-th tick's position, the i-th string stored in this array
1020              * is shown. If the number of strings in this array is less than the number of special ticks, the tick's position is
1021              * shown as a fallback.
1022              *
1023              * @type Array
1024              * @name Ticks#labels
1025              * @default []
1026              */
1027             labels: [],
1028 
1029             /**
1030              * The maximum number of characters a tick label can use.
1031              *
1032              * @type Number
1033              * @name Ticks#maxLabelLength
1034              * @see Ticks#precision
1035              * @default 5
1036              */
1037             maxLabelLength: 5,
1038 
1039             /**
1040              * If a label exceeds {@link JXG.Ticks#maxLabelLength} this determines the precision used to shorten the tick label.
1041              *
1042              * @type Number
1043              * @name Ticks#precision
1044              * @see Ticks#maxLabelLength
1045              * @default 3
1046              */
1047             precision: 3,
1048 
1049             /**
1050              * The default distance between two ticks. Please be aware that this value does not have
1051              * to be used if {@link JXG.Ticks#insertTicks} is set to true.
1052              *
1053              * @type Number
1054              * @name Ticks#ticksDistance
1055              * @see Ticks#equidistant
1056              * @see Ticks#insertTicks
1057              * @default 1
1058              */
1059             ticksDistance: 1,
1060             strokeOpacity: 1,
1061             strokeWidth: 1,
1062             strokeColor: 'black',
1063             highlightStrokeColor: '#888888',
1064             visible: 'inherit',
1065 
1066             /**
1067              * Whether line boundaries should be counted or not in the lower and upper bounds when
1068              * creating ticks.
1069              *
1070              * @type Boolean
1071              * @name Ticks#includeBoundaries
1072              * @default false
1073              */
1074             includeBoundaries: false
1075             // close the meta tag
1076             /**#@-*/
1077         },
1078 
1079          /*
1080           *  Generic options used by {@link JXG.Hatch}
1081           */
1082         hatch: {
1083             drawLabels: false,
1084             drawZero: true,
1085             majorHeight: 20,
1086             anchor: 'middle',
1087             strokeWidth: 2,
1088             strokeColor: 'blue',
1089             ticksDistance: 0.2
1090         },
1091 
1092         /**
1093          * Precision options.
1094          *
1095          * The default values are
1096          * <pre>
1097          * JXG.Options.precision: {
1098          *   touch: 30,
1099          *   touchMax: 100,
1100          *   mouse: 4,
1101          *   epsilon: 0.0001,
1102          *   hasPoint: 4
1103          * }
1104          * </pre>
1105          */
1106         precision: {
1107             touch: 15,
1108             touchMax: 100,
1109             mouse: 4,
1110             epsilon: 0.0001,
1111             hasPoint: 4
1112         },
1113 
1114         /**
1115          * Default ordering of the layers.
1116          *
1117          * The default values are
1118          * <pre>
1119          * JXG.Options.layer: {
1120          *   numlayers: 20, // only important in SVG
1121          *   text: 9,
1122          *   point: 9,
1123          *   glider: 9,
1124          *   arc: 8,
1125          *   line: 7,
1126          *   circle: 6,
1127          *   curve: 5,
1128          *   turtle: 5,
1129          *   polygon: 3,
1130          *   sector: 3,
1131          *   angle: 3,
1132          *   integral: 3,
1133          *   axis: 2,
1134          *   ticks: 2,
1135          *   grid: 1,
1136          *   image: 0,
1137          *   trace: 0
1138          * }
1139          * </pre>
1140          */
1141         layer: {
1142             numlayers: 20, // only important in SVG
1143             text: 9,
1144             point: 9,
1145             glider: 9,
1146             arc: 8,
1147             line: 7,
1148             circle: 6,
1149             curve: 5,
1150             turtle: 5,
1151             polygon: 3,
1152             sector: 3,
1153             angle: 3,
1154             integral: 3,
1155             axis: 2,
1156             ticks: 2,
1157             grid: 1,
1158             image: 0,
1159             trace: 0
1160         },
1161 
1162         /* special angle options */
1163         angle: {
1164             /**#@+
1165              * @visprop
1166              */
1167 
1168             withLabel: true,
1169 
1170             /**
1171              * Radius of the sector, displaying the angle.
1172              *
1173              * @type Number
1174              * @name Angle#radius
1175              * @default 0.5
1176              * @visprop
1177              */
1178             radius: 0.5,
1179 
1180             /**
1181              * Display type of the angle field. Possible values are
1182              * 'sector' or 'sectordot' or 'square' or 'none'.
1183              *
1184              * @type String
1185              * @default 'sector'
1186              * @name Angle#type
1187              * @visprop
1188              */
1189             type: 'sector',
1190 
1191             /**
1192              * Display type of the angle field in case of a right angle. Possible values are
1193              * 'sector' or 'sectordot' or 'square' or 'none'.
1194              *
1195              * @type String
1196              * @default square
1197              * @name Angle#orthoType
1198              * @see Angle#orthoSensitivity
1199              * @visprop
1200              */
1201             orthoType: 'square',
1202 
1203             /**
1204              * Sensitivity (in degrees) to declare an angle as right angle.
1205              * If the angle measure is inside this distance from a rigth angle, the orthoType
1206              * of the angle is used for display.
1207              *
1208              * @type Number
1209              * @default 1.0
1210              * @name Angle#orthoSensitivity
1211              * @see Angle#orthoType
1212              * @visprop
1213              */
1214             orthoSensitivity: 1.0,
1215 
1216             fillColor: '#FF7F00',
1217             highlightFillColor: '#FF7F00',
1218             strokeColor: '#FF7F00',
1219             fillOpacity: 0.3,
1220             highlightFillOpacity: 0.3,
1221 
1222             /**
1223              * @deprecated
1224              */
1225             radiuspoint: {
1226                 withLabel: false,
1227                 visible: false,
1228                 name: ''
1229             },
1230             /**
1231              * @deprecated
1232              */
1233             pointsquare: {
1234                 withLabel: false,
1235                 visible: false,
1236                 name: ''
1237             },
1238 
1239             dot: {
1240                 visible: false,
1241                 strokeColor: 'none',
1242                 fillColor: 'black',
1243                 size: 2,
1244                 face: 'o',
1245                 withLabel: false,
1246                 name: ''
1247             },
1248             label: {
1249                 position: 'top',
1250                 offset: [0, 0],
1251                 strokeColor: '#0000FF'
1252             },
1253 
1254             arc: {
1255                 visible: false
1256             }
1257 
1258             /**#@-*/
1259         },
1260 
1261         /* special arc options */
1262         arc: {
1263             /**#@+
1264              * @visprop
1265              */
1266 
1267             /**
1268              * Type of arc. Possible values are 'minor', 'major', and 'auto'.
1269              *
1270              * @type String
1271              * @name Arc#selection
1272              * @default 'auto'
1273              */
1274             selection: 'auto',
1275 
1276             /**
1277              * If <tt>true</tt>, moving the mouse over inner points triggers hasPoint.
1278              *
1279              * @see JXG.GeometryElement#hasPoint
1280              * @name Arc#hasInnerPoints
1281              * @type Boolean
1282              * @default false
1283              */
1284             hasInnerPoints: false,
1285 
1286             label: {
1287                 anchorX: 'auto',
1288                 anchorY: 'auto'
1289             },
1290             firstArrow: false,
1291             lastArrow: false,
1292             fillColor: 'none',
1293             highlightFillColor: 'none',
1294             strokeColor: '#0000ff',
1295             highlightStrokeColor: '#C3D9FF',
1296             useDirection: false,
1297 
1298             /**
1299              * Attributes for center point.
1300              *
1301              * @type Point
1302              * @name Arc#center
1303              */
1304             center: {
1305             },
1306 
1307             /**
1308              * Attributes for radius point.
1309              *
1310              * @type Point
1311              * @name Arc#radiuspoint
1312              */
1313             radiuspoint: {
1314             },
1315 
1316             /**
1317              * Attributes for angle point.
1318              *
1319              * @type Point
1320              * @name Arc#anglepoint
1321              */
1322             anglepoint: {
1323             }
1324 
1325             /**#@-*/
1326         },
1327 
1328         /* special axis options */
1329         axis: {
1330             /**#@+
1331              * @visprop
1332              */
1333 
1334             name: '',                            // By default, do not generate names for axes.
1335             needsRegularUpdate: false,           // Axes only updated after zooming and moving of the origin.
1336             strokeWidth: 1,
1337             lastArrow: {
1338                 type: 1,
1339                 size: 8
1340             },
1341             strokeColor: '#666666',
1342             highlightStrokeWidth: 1,
1343             highlightStrokeColor: '#888888',
1344 
1345 
1346             /**
1347              * Show / hide ticks.
1348              *
1349              * Deprecated. Suggested alternative is "ticks: {visible: false}"
1350              *
1351              * @type Boolean
1352              * @name Axis#withTicks
1353              * @default true
1354              * @deprecated
1355              */
1356             withTicks: true,
1357             straightFirst: true,
1358             straightLast: true,
1359             margin: -4,
1360             withLabel: false,
1361             scalable: false,
1362 
1363             /**
1364              * Attributes for ticks of the axis.
1365              *
1366              * @type Ticks
1367              * @name Axis#ticks
1368              */
1369             ticks: {
1370                 label: {
1371                     offset: [4, -12 + 3],     // This seems to be a good offset for 12 point fonts
1372                     parse: false,
1373                     needsRegularUpdate: false,
1374                     display: 'internal',
1375                     visible: 'inherit',
1376                     layer: 9
1377                 },
1378                 visible: 'inherit',
1379                 needsRegularUpdate: false,
1380                 strokeWidth: 1,
1381                 strokeColor: '#666666',
1382                 highlightStrokeColor: '#888888',
1383                 drawLabels: true,
1384                 drawZero: false,
1385                 insertTicks: true,
1386                 minTicksDistance: 5,
1387                 minorHeight: 10,          // if <0: full width and height
1388                 majorHeight: -1,          // if <0: full width and height
1389                 tickEndings: [0, 1],
1390                 minorTicks: 4,
1391                 ticksDistance: 1,         // TODO doc
1392                 strokeOpacity: 0.25
1393             },
1394 
1395             /**
1396              * Attributes for first point the axis.
1397              *
1398              * @type Point
1399              * @name Axis#point1
1400              */
1401             point1: {                  // Default values for point1 if created by line
1402                 needsRegularUpdate: false,
1403                 visible: false
1404             },
1405 
1406             /**
1407              * Attributes for second point the axis.
1408              *
1409              * @type Point
1410              * @name Axis#point2
1411              */
1412             point2: {                  // Default values for point2 if created by line
1413                 needsRegularUpdate: false,
1414                 visible: false
1415             },
1416 
1417             /**
1418              * Attributes for the axis label.
1419              *
1420              * @type Label
1421              * @name Axis#label
1422              */
1423             label: {
1424                 position: 'lft',
1425                 offset: [10, 10]
1426             }
1427             /**#@-*/
1428         },
1429 
1430         /* special options for angle bisector of 3 points */
1431         bisector: {
1432             /**#@+
1433              * @visprop
1434              */
1435 
1436             strokeColor: '#000000', // Bisector line
1437 
1438             /**
1439              * Attributes for the helper point of the bisector.
1440              *
1441              * @type Point
1442              * @name Bisector#point
1443              */
1444             point: {               // Bisector point
1445                 visible: false,
1446                 fixed: false,
1447                 withLabel: false,
1448                 name: ''
1449             }
1450 
1451             /**#@-*/
1452         },
1453 
1454         /* special options for the 2 bisectors of 2 lines */
1455         bisectorlines: {
1456             /**#@+
1457              * @visprop
1458              */
1459 
1460             /**
1461              * Attributes for first line.
1462              *
1463              * @type Line
1464              * @name Bisectorlines#line1
1465              */
1466             line1: {               //
1467                 strokeColor: 'black'
1468             },
1469 
1470             /**
1471              * Attributes for second line.
1472              *
1473              * @type Line
1474              * @name Bisectorlines#line2
1475              */
1476             line2: {               //
1477                 strokeColor: 'black'
1478             }
1479 
1480             /**#@-*/
1481         },
1482 
1483         /* special button options */
1484         button: {
1485             /**#@+
1486              * @visprop
1487              */
1488 
1489             /**
1490              * Control the attribute "disabled" of the HTML button.
1491              *
1492              * @name disabled
1493              * @memberOf Button.prototype
1494              *
1495              * @type Boolean
1496              * @default false
1497              */
1498             disabled: false
1499 
1500             /**#@-*/
1501         },
1502 
1503         /* special cardinal spline options */
1504         cardinalspline: {
1505             /**#@+
1506              * @visprop
1507              */
1508 
1509              /**
1510               * Controls if the data points of the cardinal spline when given as
1511               * arrays should be converted into {@link JXG.Points}.
1512               *
1513               * @name createPoints
1514               * @memberOf Cardinalspline.prototype
1515               *
1516               * @see Cardinalspline#points
1517               *
1518               * @type Boolean
1519               * @default true
1520               */
1521             createPoints: true,
1522 
1523             /**
1524              * If set to true, the supplied coordinates are interpreted as
1525              * [[x_0, y_0], [x_1, y_1], p, ...].
1526              * Otherwise, if the data consists of two arrays of equal length,
1527              * it is interpreted as
1528              * [[x_o x_1, ..., x_n], [y_0, y_1, ..., y_n]]
1529              *
1530              * @name isArrayOfCoordinates
1531              * @memberOf Cardinalspline.prototype
1532              * @type {Boolean}
1533              * @default false
1534              */
1535             isArrayOfCoordinates: false,
1536 
1537             /**
1538              * Attributes for the points generated by Cardinalspline in cases
1539              * {@link createPoints} is set to true
1540              *
1541              * @name points
1542              * @memberOf Cardinalspline.prototype
1543              *
1544              * @see Cardinalspline#createPoints
1545              * @type Object
1546              */
1547             points: {
1548                 strokeOpacity: 0.05,
1549                 fillOpacity: 0.05,
1550                 highlightStrokeOpacity: 1.0,
1551                 highlightFillOpacity: 1.0,
1552                 withLabel: false,
1553                 name: '',
1554                 fixed: false
1555             }
1556 
1557             /**#@-*/
1558         },
1559 
1560         /* special chart options */
1561         chart: {
1562             /**#@+
1563              * @visprop
1564              */
1565 
1566             chartStyle: 'line',
1567             colors: ['#B02B2C', '#3F4C6B', '#C79810', '#D15600', '#FFFF88', '#C3D9FF', '#4096EE', '#008C00'],
1568             highlightcolors: null,
1569             fillcolor: null,
1570             highlightonsector: false,
1571             highlightbysize: false,
1572 
1573             fillOpacity: 0.6,
1574             withLines:  false,
1575 
1576             label: {
1577             }
1578             /**#@-*/
1579         },
1580 
1581         /* special html slider options */
1582         checkbox: {
1583             /**#@+
1584              * @visprop
1585              */
1586 
1587             /**
1588              * Control the attribute "disabled" of the HTML checkbox.
1589              *
1590              * @name disabled
1591              * @memberOf Checkbox.prototype
1592              *
1593              * @type Boolean
1594              * @default false
1595              */
1596             disabled: false,
1597 
1598             /**
1599              * Control the attribute "checked" of the HTML checkbox.
1600              *
1601              * @name checked
1602              * @memberOf Checkbox.prototype
1603              *
1604              * @type Boolean
1605              * @default false
1606              */
1607              checked: false
1608 
1609 
1610             /**#@-*/
1611         },
1612 
1613         /*special circle options */
1614         circle: {
1615             /**#@+
1616              * @visprop
1617              */
1618 
1619             /**
1620              * If <tt>true</tt>, moving the mouse over inner points triggers hasPoint.
1621              *
1622              * @see JXG.GeometryElement#hasPoint
1623              * @name Circle#hasInnerPoints
1624              * @type Boolean
1625              * @default false
1626              */
1627             hasInnerPoints: false,
1628 
1629             fillColor: 'none',
1630             highlightFillColor: 'none',
1631             strokeColor: '#0000ff',
1632             highlightStrokeColor: '#C3D9FF',
1633 
1634             /**
1635              * Attributes for center point.
1636              *
1637              * @type Point
1638              * @name Circle#center
1639              */
1640             center: {
1641                 visible: false,
1642                 withLabel: false,
1643                 fixed: false,
1644                 name: ''
1645             },
1646 
1647             /**
1648              * Attributes for circle label.
1649              *
1650              * @type Label
1651              * @name Circle#label
1652              */
1653             label: {
1654                 position: 'urt'
1655             }
1656             /**#@-*/
1657         },
1658 
1659         /* special options for circumcircle of 3 points */
1660         circumcircle: {
1661             /**#@+
1662              * @visprop
1663              */
1664 
1665             fillColor: 'none',
1666             highlightFillColor: 'none',
1667             strokeColor: '#0000ff',
1668             highlightStrokeColor: '#C3D9FF',
1669 
1670             /**
1671              * Attributes for center point.
1672              *
1673              * @type Point
1674              * @name Circumcircle#center
1675              */
1676             center: {               // center point
1677                 visible: false,
1678                 fixed: false,
1679                 withLabel: false,
1680                 name: ''
1681             }
1682             /**#@-*/
1683         },
1684 
1685         circumcirclearc: {
1686             /**#@+
1687              * @visprop
1688              */
1689 
1690             fillColor: 'none',
1691             highlightFillColor: 'none',
1692             strokeColor: '#0000ff',
1693             highlightStrokeColor: '#C3D9FF',
1694 
1695             /**
1696              * Attributes for center point.
1697              *
1698              * @type Point
1699              * @name CircumcircleArc#center
1700              */
1701             center: {
1702                 visible: false,
1703                 withLabel: false,
1704                 fixed: false,
1705                 name: ''
1706             }
1707             /**#@-*/
1708         },
1709 
1710         /* special options for circumcircle sector of 3 points */
1711         circumcirclesector: {
1712             /**#@+
1713              * @visprop
1714              */
1715 
1716             useDirection: true,
1717             fillColor: '#00FF00',
1718             highlightFillColor: '#00FF00',
1719             fillOpacity: 0.3,
1720             highlightFillOpacity: 0.3,
1721             strokeColor: '#0000ff',
1722             highlightStrokeColor: '#C3D9FF',
1723 
1724             /**
1725              * Attributes for center point.
1726              *
1727              * @type Point
1728              * @name Circle#point
1729              */
1730             point: {
1731                 visible: false,
1732                 fixed: false,
1733                 withLabel: false,
1734                 name: ''
1735             }
1736             /**#@-*/
1737         },
1738 
1739         /* special conic options */
1740         conic: {
1741             /**#@+
1742              * @visprop
1743              */
1744 
1745             fillColor: 'none',
1746             highlightFillColor: 'none',
1747             strokeColor: '#0000ff',
1748             highlightStrokeColor: '#C3D9FF',
1749 
1750             /**
1751              * Attributes for foci points.
1752              *
1753              * @type Point
1754              * @name Conic#foci
1755              */
1756             foci: {
1757                 // points
1758                 fixed: false,
1759                 visible: false,
1760                 withLabel: false,
1761                 name: ''
1762             },
1763 
1764             /**
1765              * Attributes for center point.
1766              *
1767              * @type Point
1768              * @name Conic#center
1769              */
1770             center: {
1771                 visible: false,
1772                 withLabel: false,
1773                 name: ''
1774             },
1775 
1776             /**
1777              * Attributes for five points defining the conic, if some of them are given as coordinates.
1778              *
1779              * @type Point
1780              * @name Conic#point
1781              */
1782             point: {
1783                 withLabel: false,
1784                 name: ''
1785             }
1786 
1787             /**#@-*/
1788         },
1789 
1790         /* special curve options */
1791         curve: {
1792             strokeWidth: 1,
1793             strokeColor: '#0000ff',
1794             fillColor: 'none',
1795             fixed: true,
1796 
1797             useQDT: false,
1798 
1799             /**#@+
1800              * @visprop
1801              */
1802 
1803             /**
1804              * The data points of the curve are not connected with straight lines but with bezier curves.
1805              * @name Curve#handDrawing
1806              * @type Boolean
1807              * @default false
1808              */
1809             handDrawing: false,
1810 
1811             /**
1812              * The curveType is set in {@link JXG.Curve#generateTerm} and used in {@link JXG.Curve#updateCurve}.
1813              * Possible values are <ul>
1814              * <li>'none'</li>
1815              * <li>'plot': Data plot</li>
1816              * <li>'parameter': we can not distinguish function graphs and parameter curves</li>
1817              * <li>'functiongraph': function graph</li>
1818              * <li>'polar'</li>
1819              * <li>'implicit' (not yet)</li></ul>
1820              * Only parameter and plot are set directly. Polar is set with {@link JXG.GeometryElement#setAttribute} only.
1821              * @name Curve#curveType
1822              * @type String
1823              * @default null
1824              */
1825             curveType: null,
1826 
1827             /**
1828              * Apply Ramer-Douglas-Peuker smoothing.
1829              *
1830              * @type Boolean
1831              * @name Curve#RDPsmoothing
1832              * @default false
1833              */
1834             RDPsmoothing: false,     // Apply the Ramer-Douglas-Peuker algorithm
1835 
1836             /**
1837              * Number of points used for plotting triggered by up events
1838              * (i.e. high quality plotting) in case
1839              * {@link Curve#doAdvancedPlot} is false.
1840              *
1841              * @name Curve#numberPointsHigh
1842              * @see Curve#doAdvancedPlot
1843              * @type Number
1844              * @default 1600
1845              */
1846             numberPointsHigh: 1600,  // Number of points on curves after mouseUp
1847 
1848             /**
1849              * Number of points used for plotting triggered by move events
1850              * (i.e. lower quality plotting but fast) in case
1851              * {@link Curve#doAdvancedPlot} is false.
1852              *
1853              * @name Curve#numberPointsLow
1854              * @see Curve#doAdvancedPlot
1855              * @type Number
1856              * @default 400
1857              */
1858             numberPointsLow: 400,    // Number of points on curves after mousemove
1859 
1860             /**
1861              * If true use a recursive bisection algorithm.
1862              * It is slower, but usually the result is better. It tries to detect jumps
1863              * and singularities.
1864              *
1865              * @name Curve#doAdvancedPlot
1866              * @type Boolean
1867              * @default true
1868              */
1869             doAdvancedPlot: true,
1870 
1871             /**
1872              *
1873              * Recursion depth used for plotting triggered by up events
1874              * (i.e. high quality plotting) in case
1875              * {@link Curve#doAdvancedPlot} is true.
1876              *
1877              * @name Curve#recursionDepthHigh
1878              * @see Curve#doAdvancedPlot
1879              * @type Number
1880              * @default 17
1881              */
1882              recursionDepthHigh: 17,
1883 
1884             /**
1885              * Number of points used for plotting triggered by move events in case
1886              * (i.e. lower quality plotting but fast)
1887              * {@link Curve#doAdvancedPlot} is true.
1888              *
1889              * @name Curve#recursionDepthLow
1890              * @see Curve#doAdvancedPlot
1891              * @type Number
1892              * @default 13
1893              */
1894              recursionDepthLow: 13,
1895 
1896             /**
1897              * If true use the algorithm by Gillam and Hohenwarter, which was default until version 0.98.
1898              *
1899              * @name Curve#doAdvancedPlotOld
1900              * @see Curve#doAdvancedPlot
1901              * @type Boolean
1902              * @default false
1903              */
1904             doAdvancedPlotOld: false,
1905 
1906             /**
1907              * Attributes for circle label.
1908              *
1909              * @type Label
1910              * @name Circle#label
1911              */
1912             label: {
1913                 position: 'lft'
1914             }
1915 
1916             /**#@-*/
1917         },
1918 
1919         glider: {
1920             /**#@+
1921              * @visprop
1922              */
1923 
1924             label: {}
1925             /**#@-*/
1926         },
1927 
1928         /* special grid options */
1929         grid: {
1930             /**#@+
1931              * @visprop
1932              */
1933 
1934             /* grid styles */
1935             needsRegularUpdate: false,
1936             hasGrid: false,
1937             gridX: 1,
1938             gridY: 1,
1939             //strokeColor: '#C0C0C0',
1940             strokeColor: '#C0C0C0',
1941             strokeOpacity: 0.5,
1942             strokeWidth: 1,
1943             dash: 0,    // dashed grids slow down the iPad considerably
1944             /* snap to grid options */
1945 
1946             /**
1947              * @deprecated
1948              */
1949             snapToGrid: false,
1950             /**
1951              * @deprecated
1952              */
1953             snapSizeX: 10,
1954             /**
1955              * @deprecated
1956              */
1957             snapSizeY: 10
1958 
1959             /**#@-*/
1960         },
1961 
1962         group: {
1963             needsRegularUpdate: true
1964         },
1965 
1966         /* special html slider options */
1967         htmlslider: {
1968             /**#@+
1969              * @visprop
1970              */
1971 
1972             /**
1973              *
1974              * These affect the DOM element input type="range".
1975              * The other attributes affect the DOM element div containing the range element.
1976              */
1977             widthRange: 100,
1978             widthOut: 34,
1979             step: 0.01,
1980 
1981             frozen: true,
1982             isLabel: false,
1983             strokeColor: 'black',
1984             display: 'html',
1985             anchorX: 'left',
1986             anchorY: 'middle',
1987             withLabel: false
1988 
1989             /**#@-*/
1990         },
1991 
1992         /* special image options */
1993         image: {
1994             /**#@+
1995              * @visprop
1996              */
1997 
1998             imageString: null,
1999             fillOpacity: 1.0,
2000             highlightFillOpacity: 0.6,
2001 
2002 
2003             /**
2004              * Defines the CSS class used by the image. CSS attributes defined in
2005              * this class will overwrite the corresponding JSXGraph attributes, e.g.
2006              * opacity.
2007              * The default CSS class is defined in jsxgraph.css.
2008              *
2009              * @name Image#cssClass
2010              *
2011              * @see Image#highlightCssClass
2012              * @type String
2013              * @default 'JXGimage'
2014              */
2015             cssClass: 'JXGimage',
2016 
2017             /**
2018              * Defines the CSS class used by the image when highlighted.
2019              * CSS attributes defined in this class will overwrite the
2020              * corresponding JSXGraph attributes, e.g. highlightFillOpacity.
2021              * The default CSS class is defined in jsxgraph.css.
2022              *
2023              * @name Image#highlightCssClass
2024              *
2025              * @see Image#cssClass
2026              * @type String
2027              * @default 'JXGimageHighlight'
2028              */
2029             highlightCssClass: 'JXGimageHighlight',
2030 
2031             /**
2032              * Image rotation in degrees.
2033              *
2034              * @name Image#rotate
2035              * @type Number
2036              * @default 0
2037              */
2038             rotate: 0,
2039 
2040             /**
2041              * Defines together with {@link Image#snapSizeY} the grid the image snaps on to.
2042              * The image will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
2043              * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks
2044              * of the default ticks of the default x axes of the board.
2045              *
2046              * @name Image#snapSizeX
2047              *
2048              * @see JXG.Point#snapToGrid
2049              * @see Image#snapSizeY
2050              * @see JXG.Board#defaultAxes
2051              * @type Number
2052              * @default 1
2053              */
2054             snapSizeX: 1,
2055 
2056             /**
2057              * Defines together with {@link Image#snapSizeX} the grid the image snaps on to.
2058              * The image will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
2059              * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks
2060              * of the default ticks of the default y axes of the board.
2061              *
2062              * @name Image#snapSizeY
2063              *
2064              * @see JXG.Point#snapToGrid
2065              * @see Image#snapSizeX
2066              * @see JXG.Board#defaultAxes
2067              * @type Number
2068              * @default 1
2069              */
2070             snapSizeY: 1,
2071 
2072             /**
2073              * List of attractor elements. If the distance of the image is less than
2074              * attractorDistance the image is made to glider of this element.
2075              *
2076              * @name Image#attractors
2077              *
2078              * @type array
2079              * @default empty
2080              */
2081             attractors: []
2082 
2083             /**#@-*/
2084         },
2085 
2086         /* special options for incircle of 3 points */
2087         incircle: {
2088             /**#@+
2089              * @visprop
2090              */
2091 
2092             fillColor: 'none',
2093             highlightFillColor: 'none',
2094             strokeColor: '#0000ff',
2095             highlightStrokeColor: '#C3D9FF',
2096 
2097             /**
2098              * Attributes of circle center.
2099              *
2100              * @type Point
2101              * @name Incircle#center
2102              */
2103             center: {               // center point
2104                 visible: false,
2105                 fixed: false,
2106                 withLabel: false,
2107                 name: ''
2108             }
2109             /**#@-*/
2110         },
2111 
2112         inequality: {
2113             /**#@+
2114              * @visprop
2115              */
2116 
2117             fillColor: 'red',
2118             fillOpacity: 0.2,
2119             strokeColor: 'none',
2120 
2121             /**
2122              * By default an inequality is less (or equal) than. Set inverse to <tt>true</tt> will consider the inequality
2123              * greater (or equal) than.
2124              *
2125              * @type Boolean
2126              * @default false
2127              * @name Inequality#inverse
2128              * @visprop
2129              */
2130             inverse: false
2131             /**#@-*/
2132         },
2133 
2134         infobox: {
2135             /**#@+
2136              * @visprop
2137              */
2138 
2139             fontSize: 12,
2140             isLabel: false,
2141             strokeColor: '#bbbbbb',
2142             display: 'html',             // 'html' or 'internal'
2143             anchorX: 'left',             //  'left', 'middle', or 'right': horizontal alignment
2144                                          //  of the text.
2145             anchorY: 'middle',           //  'top', 'middle', or 'bottom': vertical alignment
2146                                          //  of the text.
2147             cssClass: 'JXGinfobox',
2148             rotate: 0,                   // works for non-zero values only in combination
2149                                          // with display=='internal'
2150             visible: true,
2151             parse: false,
2152             transitionDuration: 0,
2153             needsRegularUpdate: false
2154 
2155             /**#@-*/
2156         },
2157 
2158         /* special options for integral */
2159         integral: {
2160             /**#@+
2161              * @visprop
2162              */
2163 
2164             axis: 'x',        // 'x' or 'y'
2165             withLabel: true,    // Show integral value as text
2166             fixed: true,
2167             strokeWidth: 0,
2168             strokeOpacity: 0,
2169             fillColor: 'red',
2170             fillOpacity: 0.4,
2171             highlightFillColor: 'red',
2172             highlightFillOpacity: 0.2,
2173 
2174             /**
2175              * Attributes of the (left) starting point of the integral.
2176              *
2177              * @type Point
2178              * @name Integral#curveLeft
2179              * @see Integral#baseLeft
2180              */
2181             curveLeft: {    // Start point
2182                 visible: true,
2183                 withLabel: false,
2184                 color: 'red',
2185                 fillOpacity: 0.8,
2186                 layer: 9
2187             },
2188 
2189             /**
2190              * Attributes of the (left) base point of the integral.
2191              *
2192              * @type Point
2193              * @name Integral#baseLeft
2194              * @see Integral#curveLeft
2195              */
2196             baseLeft: {    // Start point
2197                 visible: false,
2198                 fixed: false,
2199                 withLabel: false,
2200                 name: ''
2201             },
2202 
2203             /**
2204              * Attributes of the (right) end point of the integral.
2205              *
2206              * @type Point
2207              * @name Integral#curveRight
2208              * @see Integral#baseRight
2209              */
2210             curveRight: {      // End point
2211                 visible: true,
2212                 withLabel: false,
2213                 color: 'red',
2214                 fillOpacity: 0.8,
2215                 layer: 9
2216             },
2217 
2218             /**
2219              * Attributes of the (right) base point of the integral.
2220              *
2221              * @type Point
2222              * @name Integral#baseRight
2223              * @see Integral#curveRight
2224              */
2225             baseRight: {      // End point
2226                 visible: false,
2227                 fixed: false,
2228                 withLabel: false,
2229                 name: ''
2230             },
2231 
2232             /**
2233              * Attributes for integral label.
2234              *
2235              * @type Label
2236              * @name Integral#label
2237              */
2238             label: {
2239                 fontSize: 20
2240             }
2241             /**#@-*/
2242         },
2243 
2244         /* special input options */
2245         input: {
2246             /**#@+
2247              * @visprop
2248              */
2249 
2250             /**
2251              * Control the attribute "disabled" of the HTML input field.
2252              *
2253              * @name disabled
2254              * @memberOf Input.prototype
2255              *
2256              * @type Boolean
2257              * @default false
2258              */
2259             disabled: false,
2260 
2261             /**
2262              * Control the attribute "maxlength" of the HTML input field.
2263              *
2264              * @name maxlength
2265              * @memberOf Input.prototype
2266              *
2267              * @type Number
2268              * @default 524288 (as in HTML)
2269              */
2270             maxlength: 524288
2271 
2272             /**#@-*/
2273         },
2274 
2275         /* special intersection point options */
2276         intersection: {
2277             /**#@+
2278              * @visprop
2279              */
2280 
2281             /**
2282              * Used in {@link JXG.Intersection}.
2283              * This flag sets the behaviour of intersection points of e.g.
2284              * two segments. If true, the intersection is treated as intersection of lines. If false
2285              * the intersection point exists if the segments intersect setwise.
2286              *
2287              * @name Intersection.alwaysIntersect
2288              * @type Boolean
2289              * @default true
2290              */
2291             alwaysIntersect: true
2292 
2293             /**#@-*/
2294         },
2295 
2296         /* special label options */
2297         label: {
2298             /**#@+
2299              * @visprop
2300              */
2301 
2302             visible: 'inherit',
2303             strokeColor: 'black',
2304             strokeOpacity: 1,
2305             highlightStrokeOpacity: 0.666666,
2306             highlightStrokeColor: 'black',
2307 
2308             fixed: true,
2309 
2310             /**
2311              * Possible string values for the position of a label for
2312              * label anchor points are:
2313              * <ul>
2314              * <li> 'lft'
2315              * <li> 'rt'
2316              * <li> 'top'
2317              * <li> 'bot'
2318              * <li> 'ulft'
2319              * <li> 'urt'
2320              * <li> 'llft'
2321              * <li> 'lrt'
2322              * </ul>
2323              * This is relevant for non-points: line, circle, curve.
2324              *
2325              * The names have been borrowed from <a href="https://www.tug.org/metapost.html">MetaPost</a>.
2326              *
2327              * @name Label#position
2328              * @see Label#offset
2329              * @type String
2330              * @default 'urt'
2331              */
2332             position: 'urt',
2333 
2334             /**
2335              *  Label offset from label anchor
2336              *  The label anchor is determined by JXG.GeometryElement#label.position
2337              *
2338              * @name Label#offset
2339              * @see Label#position
2340              * @type Array
2341              * @default [10,10]
2342              **/
2343             offset: [10, 10]
2344 
2345             /**#@-*/
2346         },
2347 
2348         /* special legend options */
2349         legend: {
2350             /**
2351              * @visprop
2352              */
2353             style: 'vertical',
2354             labels: ['1', '2', '3', '4', '5', '6', '7', '8'],
2355             colors: ['#B02B2C', '#3F4C6B', '#C79810', '#D15600', '#FFFF88', '#C3D9FF', '#4096EE', '#008C00']
2356             /**#@-*/
2357         },
2358 
2359         /* special line options */
2360         line: {
2361             /**#@+
2362              * @visprop
2363              */
2364 
2365             /**
2366              * Line has an arrow head at the position of its first point or the corresponding
2367              * intersection with the canvas border.
2368              *
2369              * @name Line#firstArrow
2370              * @see Line#lastArrow
2371              * @see Line#touchFirstPoint
2372              * @type Boolean / Object
2373              * @default false
2374              */
2375             firstArrow: false,
2376 
2377             /**
2378              * Line has an arrow head at the position of its second point or the corresponding
2379              * intersection with the canvas border.
2380              *
2381              * @name Line#lastArrow
2382              * @see Line#firstArrow
2383              * @see Line#touchLastPoint
2384              * @type Boolean / Object
2385              * @default false
2386              */
2387             lastArrow: false,
2388 
2389 
2390             /**
2391              * This number (pixel value) controls where infinite lines end at the canvas border. If zero, the line
2392              * ends exactly at the border, if negative there is a margin to the inside, if positive the line
2393              * ends outside of the canvas (which is invisible).
2394              * @type {Number}
2395              * @default 0
2396              */
2397             margin: 0,
2398 
2399             /**
2400              * If true, line stretches infinitely in direction of its first point.
2401              * Otherwise it ends at point1.
2402              *
2403              * @name Line#straightFirst
2404              * @see Line#straightLast
2405              * @type Boolean
2406              * @default true
2407              */
2408             straightFirst: true,
2409 
2410             /**
2411              * If true, line stretches infinitely in direction of its second point.
2412              * Otherwise it ends at point2.
2413              *
2414              * @name Line#straightLast
2415              * @see Line#straightFirst
2416              * @type Boolean
2417              * @default true
2418              */
2419             straightLast: true,
2420 
2421             fillColor: 'none',               // Important for VML on IE
2422             highlightFillColor: 'none',  // Important for VML on IE
2423             strokeColor: '#0000ff',
2424             highlightStrokeColor: '#888888',
2425             withTicks: false,
2426 
2427             /**
2428              * Attributes for first defining point of the line.
2429              *
2430              * @type Point
2431              * @name Line#point1
2432              */
2433             point1: {                  // Default values for point1 if created by line
2434                 visible: false,
2435                 withLabel: false,
2436                 fixed: false,
2437                 name: ''
2438             },
2439 
2440             /**
2441              * Attributes for second defining point of the line.
2442              *
2443              * @type Point
2444              * @name Line#point2
2445              */
2446             point2: {                  // Default values for point2 if created by line
2447                 visible: false,
2448                 withLabel: false,
2449                 fixed: false,
2450                 name: ''
2451             },
2452 
2453             /**
2454              * Attributes for ticks of the line.
2455              *
2456              * @type Ticks
2457              * @name Line#ticks
2458              */
2459             ticks: {
2460                 drawLabels: true,
2461                 label: {
2462                     offset: [4, -12 + 3] // This seems to be a good offset for 12 point fonts
2463                 },
2464                 drawZero: false,
2465                 insertTicks: false,
2466                 minTicksDistance: 50,
2467                 minorHeight: 4,          // if <0: full width and height
2468                 majorHeight: -1,         // if <0: full width and height
2469                 minorTicks: 4,
2470                 defaultDistance: 1,
2471                 strokeOpacity: 0.3,
2472                 visible: 'inherit'
2473             },
2474 
2475             /**
2476              * Attributes for the line label.
2477              *
2478              * @type Label
2479              * @name Line#label
2480              */
2481             label: {
2482                 position: 'llft'
2483             },
2484 
2485             /**
2486              * If set to true, the point will snap to a grid defined by
2487              * {@link JXG.Point#snapSizeX} and {@link JXG.Point#snapSizeY}.
2488              *
2489              * @see Point#snapSizeX
2490              * @see Point#snapSizeY
2491              * @type Boolean
2492              * @name Line#snapToGrid
2493              * @default false
2494              */
2495             snapToGrid: false,
2496 
2497             /**
2498              * Defines together with {@link JXG.Point#snapSizeY} the grid the point snaps on to.
2499              * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
2500              * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks
2501              * of the default ticks of the default x axes of the board.
2502              *
2503              * @see Point#snapToGrid
2504              * @see Point#snapSizeY
2505              * @see JXG.Board#defaultAxes
2506              * @type Number
2507              * @name Line#snapSizeX
2508              * @default 1
2509              */
2510             snapSizeX: 1,
2511 
2512             /**
2513              * Defines together with {@link JXG.Point#snapSizeX} the grid the point snaps on to.
2514              * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
2515              * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks
2516              * of the default ticks of the default y axes of the board.
2517              *
2518              * @see Point#snapToGrid
2519              * @see Point#snapSizeX
2520              * @see Board#defaultAxes
2521              * @type Number
2522              * @name Line#snapSizeY
2523              * @default 1
2524              */
2525             snapSizeY: 1,
2526 
2527             /**
2528              * If set to true and {@link Line#firstArrow} is set to true, the arrow head will just touch
2529              * the circle line of the start point of the line.
2530              *
2531              * @see Line#firstArrow
2532              * @type Boolean
2533              * @name Line#touchFirstPoint
2534              * @default false
2535              */
2536             touchFirstPoint: false,
2537 
2538             /**
2539              * If set to true and {@link Line#lastArrow} is set to true, the arrow head will just touch
2540              * the circle line of the start point of the line.
2541              * @see Line#firstArrow
2542              * @type Boolean
2543              * @name Line#touchLastPoint
2544              * @default false
2545              */
2546             touchLastPoint: false,
2547 
2548             /**
2549              * Line endings (linecap) of a straight line.
2550              * Possible values are:
2551              * <ul>
2552              * <li> 'butt',
2553              * <li> 'round',
2554              * <li> 'square'.
2555              * </ul>
2556              * Not available for VML renderer.
2557              * [lineCap description]
2558              * @name Line#lineCap
2559              * @type {String}
2560              * @default 'butt'
2561              */
2562             lineCap: 'butt'
2563 
2564 
2565             /**#@-*/
2566         },
2567 
2568         /* special options for locus curves */
2569         locus: {
2570             /**#@+
2571              * @visprop
2572              */
2573 
2574             translateToOrigin: false,
2575             translateTo10: false,
2576             stretch: false,
2577             toOrigin: null,
2578             to10: null
2579             /**#@-*/
2580         },
2581 
2582         // /* special options for Msector of 3 points */
2583         // msector: {
2584         //     strokeColor: '#000000', // Msector line
2585         //     point: {               // Msector point
2586         //         visible: false,
2587         //         fixed: false,
2588         //         withLabel: false,
2589         //         name: ''
2590         //     }
2591         // },
2592 
2593         /* special options for normal lines */
2594         normal: {
2595             /**#@+
2596              * @visprop
2597              */
2598 
2599             strokeColor: '#000000', //  normal line
2600 
2601             /**
2602              * Attributes of helper point of normal.
2603              *
2604              * @type Point
2605              * @name Normal#point
2606              */
2607             point: {
2608                 visible: false,
2609                 fixed: false,
2610                 withLabel: false,
2611                 name: ''
2612             }
2613             /**#@-*/
2614         },
2615 
2616         /* special options for orthogonal projection points */
2617         orthogonalprojection: {
2618             /**#@+
2619              * @visprop
2620              */
2621 
2622 
2623             /**#@-*/
2624         },
2625 
2626         /* special options for parallel lines */
2627         parallel: {
2628             /**#@+
2629              * @visprop
2630              */
2631 
2632             strokeColor: '#000000', // Parallel line
2633 
2634             /**
2635              * Attributes of helper point of normal.
2636              *
2637              * @type Point
2638              * @name Parallel#point
2639              */
2640             point: {
2641                 visible: false,
2642                 fixed: false,
2643                 withLabel: false,
2644                 name: ''
2645             },
2646 
2647             label: {
2648                 position: 'llft'
2649             }
2650             /**#@-*/
2651         },
2652 
2653         /* special perpendicular options */
2654         perpendicular: {
2655             /**#@+
2656              * @visprop
2657              */
2658 
2659             strokeColor: '#000000', // Perpendicular line
2660             straightFirst: true,
2661             straightLast: true
2662             /**#@-*/
2663         },
2664 
2665         /* special perpendicular options */
2666         perpendicularsegment: {
2667             /**#@+
2668              * @visprop
2669              */
2670 
2671             strokeColor: '#000000', // Perpendicular segment
2672             straightFirst: false,
2673             straightLast: false,
2674             point: {               // Perpendicular point
2675                 visible: false,
2676                 fixed: true,
2677                 withLabel: false,
2678                 name: ''
2679             }
2680             /**#@-*/
2681         },
2682 
2683         /* special point options */
2684         point: {
2685             /**#@+
2686              * @visprop
2687              */
2688 
2689             withLabel: true,
2690             label: {},
2691 
2692             /**
2693              * This attribute was used to determined the point layout. It was derived from GEONExT and was
2694              * replaced by {@link Point#face} and {@link Point#size}.
2695              *
2696              * @name Point#style
2697              *
2698              * @see Point#face
2699              * @see Point#size
2700              * @type Number
2701              * @default 5
2702              * @deprecated
2703              */
2704             style: 5,
2705 
2706             /**
2707              * There are different point styles which differ in appearance.
2708              * Posssible values are
2709              * <table><tr><th>Value</th></tr>
2710              * <tr><td>cross</td></tr>
2711              * <tr><td>circle</td></tr>
2712              * <tr><td>square</td></tr>
2713              * <tr><td>plus</td></tr>
2714              * <tr><td>diamond</td></tr>
2715              * <tr><td>triangleUp</td></tr>
2716              * <tr><td>triangleDown</td></tr>
2717              * <tr><td>triangleLeft</td></tr>
2718              * <tr><td>triangleRight</td></tr>
2719              * </table>
2720              *
2721              * @name Point#face
2722              *
2723              * @type string
2724              * @see Point#setStyle
2725              * @default circle
2726              */
2727             face: 'o',
2728 
2729             /**
2730              * Size of a point, either in pixel or user coordinates.
2731              * Means radius resp. half the width of a point (depending on the face).
2732              *
2733              * @name Point#size
2734              *
2735              * @see Point#face
2736              * @see Point#setStyle
2737              * @see Point#sizeUnit
2738              * @type number
2739              * @default 3
2740              */
2741             size: 3,
2742 
2743             /**
2744              * Unit for size.
2745              * Possible values are 'screen' and 'user.
2746              *
2747              * @name Point#sizeUnit
2748              *
2749              * @see Point#size
2750              * @type string
2751              * @default 'screen'
2752              */
2753             sizeUnit: 'screen',
2754 
2755             fillColor: '#ff0000',
2756             highlightFillColor: '#EEEEEE',
2757             strokeWidth: 2,
2758             strokeColor: '#ff0000',
2759             highlightStrokeColor: '#C3D9FF',
2760 
2761             /**
2762              * If true, the point size changes on zoom events.
2763              *
2764              * @type Boolean
2765              * @name Point#zoom
2766              * @default false
2767              *
2768              */
2769             zoom: false,             // Change the point size on zoom
2770 
2771             /**
2772              * If true, the infobox is shown on mouse over, else not.
2773              *
2774              * @name Point#showInfobox
2775              *
2776              * @type Boolean
2777              * @default true
2778              */
2779             showInfobox: true,
2780 
2781             /**
2782              * Truncating rule for the digits in the infobox.
2783              * <ul>
2784              * <li>'auto': done automatically by JXG#autoDigits
2785              * <li>'none': no truncation
2786              * <li>number: truncate after "number digits" with JXG.toFixed();
2787              * </ul>
2788              *
2789              * @name Point#infoboxDigits
2790              *
2791              * @type String, Number
2792              * @default 'auto'
2793              */
2794             infoboxDigits: 'auto',
2795 
2796             draft: false,
2797 
2798             /**
2799              * List of attractor elements. If the distance of the point is less than
2800              * attractorDistance the point is made to glider of this element.
2801              *
2802              * @name Point#attractors
2803              *
2804              * @type array
2805              * @default empty
2806              */
2807             attractors: [],
2808 
2809             /**
2810              * Unit for attractorDistance and snatchDistance, used for magnetized points and for snapToPoints.
2811              * Possible values are 'screen' and 'user.
2812              *
2813              * @name Point#attractorUnit
2814              *
2815              * @see Point#attractorDistance
2816              * @see Point#snatchDistance
2817              * @see Point#snapToPoints
2818              * @see Point#attractors
2819              * @type string
2820              * @default 'user'
2821              */
2822             attractorUnit: 'user',    // 'screen', 'user'
2823 
2824             /**
2825              * If the distance of the point to one of its attractors is less
2826              * than this number the point will be a glider on this
2827              * attracting element.
2828              * If set to zero nothing happens.
2829              *
2830              * @name Point#attractorDistance
2831              *
2832              * @type number
2833              * @default 0.0
2834              */
2835             attractorDistance: 0.0,
2836 
2837             /**
2838              * If the distance of the point to one of its attractors is at least
2839              * this number the point will be released from being a glider on the
2840              * attracting element.
2841              * If set to zero nothing happens.
2842              *
2843              * @name Point#snatchDistance
2844              *
2845              * @type number
2846              * @default 0.0
2847              */
2848             snatchDistance: 0.0,
2849 
2850             /**
2851              * If set to true, the point will snap to a grid defined by
2852              * {@link Point#snapSizeX} and {@link Point#snapSizeY}.
2853              *
2854              * @name Point#snapToGrid
2855              *
2856              * @see JXG.Point#snapSizeX
2857              * @see JXG.Point#snapSizeY
2858              * @type Boolean
2859              * @default false
2860              */
2861             snapToGrid: false,
2862 
2863             /**
2864              * Defines together with {@link Point#snapSizeY} the grid the point snaps on to.
2865              * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
2866              * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks
2867              * of the default ticks of the default x axes of the board.
2868              *
2869              * @name Point#snapSizeX
2870              *
2871              * @see Point#snapToGrid
2872              * @see Point#snapSizeY
2873              * @see Board#defaultAxes
2874              * @type Number
2875              * @default 1
2876              */
2877             snapSizeX: 1,
2878 
2879             /**
2880              * Defines together with {@link Point#snapSizeX} the grid the point snaps on to.
2881              * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
2882              * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks
2883              * of the default ticks of the default y axes of the board.
2884              *
2885              * @name Point#snapSizeY
2886              *
2887              * @see Point#snapToGrid
2888              * @see Point#snapSizeX
2889              * @see Board#defaultAxes
2890              * @type Number
2891              * @default 1
2892              */
2893             snapSizeY: 1,
2894 
2895             /**
2896              * If set to true, the point will snap to the nearest point in distance of
2897              * {@link Point#attractorDistance}.
2898              *
2899              * @name Point#snapToPoints
2900              *
2901              * @see Point#attractorDistance
2902              * @type Boolean
2903              * @default false
2904              */
2905             snapToPoints: false,
2906 
2907             /**
2908              * List of elements which are ignored by snapToPoints.
2909              * @name Point#ignoredSnapToPoints
2910              *
2911              * @type array
2912              * @default empty
2913              */
2914             ignoredSnapToPoints: []
2915 
2916             /**#@-*/
2917         },
2918 
2919         /* special polygon options */
2920         polygon: {
2921             /**#@+
2922              * @visprop
2923              */
2924 
2925             /**
2926              * If <tt>true</tt>, moving the mouse over inner points triggers hasPoint.
2927              *
2928              * @see JXG.GeometryElement#hasPoint
2929              * @name Polygon#hasInnerPoints
2930              * @type Boolean
2931              * @default false
2932              */
2933             hasInnerPoints: false,
2934 
2935             fillColor: '#00FF00',
2936             highlightFillColor: '#00FF00',
2937             fillOpacity: 0.3,
2938             highlightFillOpacity: 0.3,
2939 
2940             /**
2941              * Is the polygon bordered by lines?
2942              *
2943              * @type Boolean
2944              * @name Polygon#withLines
2945              * @default true
2946              */
2947             withLines: true,
2948 
2949             /**
2950              * Attributes for the polygon border lines.
2951              *
2952              * @type Line
2953              * @name Polygon#borders
2954              */
2955             borders: {
2956                 withLabel: false,
2957                 strokeWidth: 1,
2958                 highlightStrokeWidth: 1,
2959                 // Polygon layer + 1
2960                 layer: 5,
2961                 label: {
2962                     position: 'top'
2963                 },
2964                 visible: 'inherit'
2965             },
2966 
2967             /**
2968              * Attributes for the polygon vertices.
2969              *
2970              * @type Point
2971              * @name Polygon#vertices
2972              */
2973             vertices: {
2974                 layer: 9,
2975                 withLabel: false,
2976                 name: '',
2977                 strokeColor: '#ff0000',
2978                 fillColor: '#ff0000',
2979                 fixed: false,
2980                 visible: 'inherit'
2981             },
2982 
2983             /**
2984              * Attributes for the polygon label.
2985              *
2986              * @type Label
2987              * @name Polygon#label
2988              */
2989             label: {
2990                 offset: [0, 0]
2991             }
2992 
2993             /**#@-*/
2994         },
2995 
2996         /* special prescribed angle options
2997         * Not yet implemented. But angle.setAngle(val) is implemented.
2998         */
2999         prescribedangle: {
3000             /**#@+
3001              * @visprop
3002              */
3003 
3004             /**
3005              * Attributes for the helper point of the prescribed angle.
3006              *
3007              * @type Point
3008              * @name PrescribedAngle#anglepoint
3009              */
3010             anglepoint: {
3011                 size: 2,
3012                 visible: false,
3013                 withLabel: false
3014             }
3015 
3016             /**#@-*/
3017         },
3018 
3019         /* special regular polygon options */
3020         regularpolygon: {
3021             /**#@+
3022              * @visprop
3023              */
3024 
3025             /**
3026              * If <tt>true</tt>, moving the mouse over inner points triggers hasPoint.
3027              * @see JXG.GeometryElement#hasPoint
3028              *
3029              * @name RegularPolygon#hasInnerPoints
3030              * @type Boolean
3031              * @default false
3032              */
3033             hasInnerPoints: false,
3034             fillColor: '#00FF00',
3035             highlightFillColor: '#00FF00',
3036             fillOpacity: 0.3,
3037             highlightFillOpacity: 0.3,
3038 
3039             /**
3040              * Is the polygon bordered by lines?
3041              *
3042              * @type Boolean
3043              * @name RegularPolygon#withLines
3044              * @default true
3045              */
3046             withLines: true,
3047 
3048             /**
3049              * Attributes for the polygon border lines.
3050              *
3051              * @type Line
3052              * @name RegularPolygon#borders
3053              */
3054             borders: {
3055                 withLabel: false,
3056                 strokeWidth: 1,
3057                 highlightStrokeWidth: 1,
3058                 // Polygon layer + 1
3059                 layer: 5,
3060                 label: {
3061                     position: 'top'
3062                 }
3063             },
3064 
3065             /**
3066              * Attributes for the polygon vertices.
3067              *
3068              * @type Point
3069              * @name RegularPolygon#vertices
3070              */
3071             vertices: {
3072                 layer: 9,
3073                 withLabel: true,
3074                 strokeColor: '#ff0000',
3075                 fillColor: '#ff0000',
3076                 fixed: false
3077             },
3078 
3079             /**
3080              * Attributes for the polygon label.
3081              *
3082              * @type Label
3083              * @name Polygon#label
3084              */
3085             label: {
3086                 offset: [0, 0]
3087             }
3088 
3089             /**#@-*/
3090         },
3091 
3092         /* special options for riemann sums */
3093         riemannsum: {
3094             /**#@+
3095              * @visprop
3096              */
3097 
3098             withLabel: false,
3099             fillOpacity: 0.3,
3100             fillColor: '#ffff00'
3101 
3102             /**#@-*/
3103         },
3104 
3105         /* special sector options */
3106         sector: {
3107             /**#@+
3108              * @visprop
3109              */
3110 
3111             fillColor: '#00FF00',
3112             highlightFillColor: '#00FF00',
3113             fillOpacity: 0.3,
3114             highlightFillOpacity: 0.3,
3115             highlightOnSector: false,
3116             highlightStrokeWidth: 0,
3117 
3118             /**
3119              * Type of sector. Possible values are 'minor', 'major', and 'auto'.
3120              *
3121              * @type String
3122              * @name Sector#selection
3123              * @default 'auto'
3124              */
3125             selection: 'auto',
3126 
3127             /**
3128              * Attributes for sub-element arc. It is only available, if the sector is defined by three points.
3129              *
3130              * @type Arc
3131              * @name Sector#arc
3132              */
3133             arc: {
3134                 visible: false,
3135                 fillColor: 'none'
3136             },
3137 
3138             /**
3139              * Attributes for helper point radiuspoint in case it is provided by coordinates.
3140              *
3141              * @type Point
3142              * @name Sector#radiuspoint
3143              */
3144             radiuspoint: {
3145                 visible: false,
3146                 withLabel: false
3147             },
3148 
3149             /**
3150              * Attributes for helper point center in case it is provided by coordinates.
3151              *
3152              * @type Point
3153              * @name Sector#center
3154              */
3155             center: {
3156                 visible: false,
3157                 withLabel: false
3158             },
3159 
3160             /**
3161              * Attributes for helper point anglepoint in case it is provided by coordinates.
3162              *
3163              * @type Point
3164              * @name Sector#anglepoint
3165              */
3166             anglepoint: {
3167                 visible: false,
3168                 withLabel: false
3169             },
3170 
3171             /**
3172              * Attributes for the sector label.
3173              *
3174              * @type Label
3175              * @name Sector#label
3176              */
3177             label: {
3178                 offset: [0, 0],
3179                 anchorX: 'auto',
3180                 anchorY: 'auto'
3181             }
3182 
3183             /**#@-*/
3184         },
3185 
3186         /* special segment options */
3187         segment: {
3188             /**#@+
3189              * @visprop
3190              */
3191 
3192             label: {
3193                 position: 'top'
3194             }
3195             /**#@-*/
3196         },
3197 
3198         semicircle: {
3199             /**#@+
3200              * @visprop
3201              */
3202 
3203             /**
3204              * Attributes for center point of the semicircle.
3205              *
3206              * @type Point
3207              * @name Semicircle#center
3208              */
3209             center: {
3210                 visible: false,
3211                 withLabel: false,
3212                 fixed: false,
3213                 name: ''
3214             }
3215 
3216             /**#@-*/
3217         },
3218 
3219         /* special slider options */
3220         slider: {
3221             /**#@+
3222              * @visprop
3223              */
3224 
3225             /**
3226              * The slider only returns integer multiples of this value, e.g. for discrete values set this property to <tt>1</tt>. For
3227              * continuous results set this to <tt>-1</tt>.
3228              *
3229              * @memberOf Slider.prototype
3230              * @name snapWidth
3231              * @type Number
3232              */
3233             snapWidth: -1,      // -1 = deactivated
3234 
3235             /**
3236              * The precision of the slider value displayed in the optional text.
3237              * @memberOf Slider.prototype
3238              * @name precision
3239              * @type Number
3240              * @default 2
3241              */
3242             precision: 2,
3243 
3244             firstArrow: false,
3245             lastArrow: false,
3246 
3247             /**
3248              * Show slider ticks.
3249              *
3250              * @type Boolean
3251              * @name Slider#withTicks
3252              * @default true
3253              */
3254             withTicks: true,
3255 
3256             /**
3257              * Show slider label.
3258              *
3259              * @type Boolean
3260              * @name Slider#withLabel
3261              * @default true
3262              */
3263             withLabel: true,
3264 
3265             /**
3266              * If not null, this replaces the part "name = " in the slider label.
3267              * Possible types: string, number or function.
3268              * @type {String}
3269              * @name suffixLabel
3270              * @memberOf Slider.prototype
3271              * @default null
3272              * @see JXG.Slider#unitLabel
3273              * @see JXG.Slider#postLabel
3274              */
3275             suffixLabel: null,
3276 
3277             /**
3278              * If not null, this is appended to the value in the slider label.
3279              * Possible types: string, number or function.
3280              * @type {String}
3281              * @name unitLabel
3282              * @memberOf Slider.prototype
3283              * @default null
3284              * @see JXG.Slider#suffixLabel
3285              * @see JXG.Slider#postLabel
3286              */
3287             unitLabel: null,
3288 
3289             /**
3290              * If not null, this is appended to the value and to unitLabel in the slider label.
3291              * Possible types: string, number or function.
3292              * @type {String}
3293              * @name postLabel
3294              * @memberOf Slider.prototype
3295              * @default null
3296              * @see JXG.Slider#suffixLabel
3297              * @see JXG.Slider#unitLabel
3298              */
3299             postLabel: null,
3300 
3301             layer: 9,
3302             showInfobox: false,
3303             name: '',
3304             visible: true,
3305             strokeColor: '#000000',
3306             highlightStrokeColor: '#888888',
3307             fillColor: '#ffffff',
3308             highlightFillColor: 'none',
3309 
3310             /**
3311              * Size of slider point.
3312              *
3313              * @type Number
3314              * @name Slider#size
3315              * @default 6
3316              * @see Point#size
3317              */
3318             size: 6,
3319 
3320             /**
3321              * Attributes for first (left) helper point defining the slider position.
3322              *
3323              * @type Point
3324              * @name Slider#point1
3325              */
3326             point1: {
3327                 needsRegularUpdate: false,
3328                 showInfobox: false,
3329                 withLabel: false,
3330                 visible: false,
3331                 fixed: true,
3332                 name: ''
3333             },
3334 
3335             /**
3336              * Attributes for second (right) helper point defining the slider position.
3337              *
3338              * @type Point
3339              * @name Slider#point2
3340              */
3341             point2: {
3342                 needsRegularUpdate: false,
3343                 showInfobox: false,
3344                 withLabel: false,
3345                 visible: false,
3346                 fixed: true,
3347                 name: ''
3348             },
3349 
3350             /**
3351              * Attributes for the base line of the slider.
3352              *
3353              * @type Line
3354              * @name Slider#baseline
3355              */
3356             baseline: {
3357                 needsRegularUpdate: false,
3358                 fixed: true,
3359                 scalable: false,
3360                 name: '',
3361                 strokeWidth: 1,
3362                 strokeColor: '#000000',
3363                 highlightStrokeColor: '#888888'
3364             },
3365 
3366             /**
3367              * Attributes for the ticks of the base line of the slider.
3368              *
3369              * @type Ticks
3370              * @name Slider#ticks
3371              */
3372             ticks: {
3373                 needsRegularUpdate: false,
3374                 fixed: true,
3375 
3376                 // Label drawing
3377                 drawLabels: false,
3378                 precision: 2,
3379                 includeBoundaries: 1,
3380                 drawZero: true,
3381                 label: {
3382                     offset: [-4, -14],
3383                     display: 'internal'
3384                 },
3385 
3386                 minTicksDistance: 30,
3387                 insertTicks: true,
3388                 minorHeight: 4,         // if <0: full width and height
3389                 majorHeight: 5,        // if <0: full width and height
3390                 minorTicks: 0,
3391                 defaultDistance: 1,
3392                 strokeOpacity: 1,
3393                 strokeWidth: 1,
3394                 tickEndings: [0, 1],
3395                 strokeColor: '#000000',
3396                 visible: 'inherit'
3397 
3398             },
3399 
3400             /**
3401              * Attributes for the highlighting line of the slider.
3402              *
3403              * @type Line
3404              * @name Slider#highline
3405              */
3406             highline: {
3407                 strokeWidth: 3,
3408                 fixed: true,
3409                 name: '',
3410                 strokeColor: '#000000',
3411                 highlightStrokeColor: '#888888'
3412             },
3413 
3414             /**
3415              * Attributes for the slider label.
3416              *
3417              * @type Label
3418              * @name Slider#label
3419              */
3420             label: {
3421                 strokeColor: '#000000'
3422             }
3423 
3424             /**#@-*/
3425         },
3426 
3427         /* special options for comb */
3428         comb: {
3429             /**#@+
3430              * @visprop
3431              */
3432 
3433             /**
3434              * Frequency of comb elements.
3435              *
3436              * @type Number
3437              * @name Comb#frequency
3438              * @default 0.2
3439              */
3440             frequency: 0.2,
3441 
3442             /**
3443              * Width of the comb.
3444              *
3445              * @type Number
3446              * @name Comb#width
3447              * @default 0.4
3448              */
3449             width: 0.4,
3450 
3451             /**
3452              * Angle under which comb elements are positioned.
3453              *
3454              * @type Number
3455              * @name Comb#angle
3456              * @default 60 degrees
3457              */
3458             angle: Math.PI / 3,
3459 
3460             /**
3461              * Should the comb go right to left instead of left to right.
3462              *
3463              * @type Boolean
3464              * @name Comb#reverse
3465              * @default false
3466              */
3467             reverse: false,
3468 
3469             /**
3470              * Attributes for first defining point of the comb.
3471              *
3472              * @type Point
3473              * @name Comb#point1
3474              */
3475             point1: {
3476                 visible: false,
3477                 withLabel: false,
3478                 fixed: false,
3479                 name: ''
3480             },
3481 
3482             /**
3483              * Attributes for second defining point of the comb.
3484              *
3485              * @type Point
3486              * @name Comb#point2
3487              */
3488             point2: {
3489                 visible: false,
3490                 withLabel: false,
3491                 fixed: false,
3492                 name: ''
3493             },
3494 
3495             /**
3496              * Attributes for the curve displaying the comb.
3497              *
3498              * @type Curve
3499              * @name Comb#curve
3500              */
3501             curve: {
3502                 strokeWidth: 1,
3503                 strokeColor: '#000000',
3504                 fillColor: 'none'
3505             }
3506         },
3507 
3508         /* special options for slope triangle */
3509         slopetriangle: {
3510             /**#@+
3511              * @visprop
3512              */
3513 
3514             fillColor: 'red',
3515             fillOpacity: 0.4,
3516             highlightFillColor: 'red',
3517             highlightFillOpacity: 0.3,
3518 
3519             borders: {
3520                 lastArrow: {
3521                     type: 1,
3522                     size: 6
3523                 }
3524             },
3525 
3526             /**
3527              * Attributes for the gliding helper point.
3528              *
3529              * @type Point
3530              * @name Slopetriangle#glider
3531              */
3532             glider: {
3533                 fixed: true,
3534                 visible: false,
3535                 withLabel: false
3536             },
3537 
3538             /**
3539              * Attributes for the base line.
3540              *
3541              * @type Line
3542              * @name Slopetriangle#baseline
3543              */
3544             baseline: {
3545                 visible: false,
3546                 withLabel: false,
3547                 name: ''
3548             },
3549 
3550             /**
3551              * Attributes for the base point.
3552              *
3553              * @type Point
3554              * @name Slopetriangle#basepoint
3555              */
3556             basepoint: {
3557                 visible: false,
3558                 withLabel: false,
3559                 name: ''
3560             },
3561 
3562             /**
3563              * Attributes for the tangent.
3564              * The tangent is constructed by slop triangle if the construction
3565              * is based on a glider, solely.
3566              *
3567              * @type Line
3568              * @name Slopetriangle#tangent
3569              */
3570             tangent: {
3571                 visible: false,
3572                 withLabel: false,
3573                 name: ''
3574             },
3575 
3576             /**
3577              * Attributes for the top point.
3578              *
3579              * @type Point
3580              * @name Slopetriangle#toppoint
3581              */
3582             toppoint: {
3583                 visible: false,
3584                 withLabel: false,
3585                 name: ''
3586             },
3587 
3588             /**
3589              * Attributes for the slope triangle label.
3590              *
3591              * @type Label
3592              * @name Slopetriangle#label
3593              */
3594             label: {
3595                 visible: true
3596             }
3597             /**#@-*/
3598         },
3599 
3600         /* special options for step functions */
3601         stepfunction: {
3602             /**#@+
3603              * @visprop
3604              */
3605 
3606             /**#@-*/
3607         },
3608 
3609         /* special tape measure options */
3610         tapemeasure: {
3611             /**#@+
3612              * @visprop
3613              */
3614 
3615             strokeColor: '#000000',
3616             strokeWidth: 2,
3617             highlightStrokeColor: '#000000',
3618 
3619             /**
3620              * Show tape measure ticks.
3621              *
3622              * @type Boolean
3623              * @name Tapemeasure#withTicks
3624              * @default true
3625              */
3626             withTicks: true,
3627 
3628             /**
3629              * Show tape measure label.
3630              *
3631              * @type Boolean
3632              * @name Tapemeasure#withLabel
3633              * @default true
3634              */
3635             withLabel: true,
3636 
3637             /**
3638              * The precision of the tape measure value displayed in the optional text.
3639              * @memberOf Tapemeasure.prototype
3640              * @name precision
3641              * @type Number
3642              * @default 2
3643              */
3644             precision: 2,
3645 
3646             /**
3647              * Attributes for first helper point defining the tape measure position.
3648              *
3649              * @type Point
3650              * @name Tapemeasure#point1
3651              */
3652             point1: {
3653                 visible: 'inherit',
3654                 strokeColor: '#000000',
3655                 fillColor: '#ffffff',
3656                 fillOpacity: 0.0,
3657                 highlightFillOpacity: 0.1,
3658                 size: 6,
3659                 snapToPoints: true,
3660                 attractorUnit: 'screen',
3661                 attractorDistance: 20,
3662                 showInfobox: false,
3663                 withLabel: false,
3664                 name: ''
3665             },
3666 
3667             /**
3668              * Attributes for second helper point defining the tape measure position.
3669              *
3670              * @type Point
3671              * @name Tapemeasure#point2
3672              */
3673             point2: {
3674                 visible: 'inherit',
3675                 strokeColor: '#000000',
3676                 fillColor: '#ffffff',
3677                 fillOpacity: 0.0,
3678                 highlightFillOpacity: 0.1,
3679                 size: 6,
3680                 snapToPoints: true,
3681                 attractorUnit: 'screen',
3682                 attractorDistance: 20,
3683                 showInfobox: false,
3684                 withLabel: false,
3685                 name: ''
3686             },
3687 
3688             /**
3689              * Attributes for the ticks of the tape measure.
3690              *
3691              * @type Ticks
3692              * @name Tapemeasure#ticks
3693              */
3694             ticks: {
3695                 drawLabels: false,
3696                 drawZero: true,
3697                 insertTicks: true,
3698                 minorHeight: 8,
3699                 majorHeight: 16,
3700                 minorTicks: 4,
3701                 tickEndings: [0, 1],
3702                 defaultDistance: 0.1,
3703                 strokeOpacity: 1,
3704                 strokeWidth: 1,
3705                 strokeColor: '#000000',
3706                 visible: 'inherit'
3707             },
3708 
3709             /**
3710              * Attributes for the tape measure label.
3711              *
3712              * @type Label
3713              * @name Tapemeasure#label
3714              */
3715             label: {
3716                 position: 'top'
3717             }
3718             /**#@-*/
3719         },
3720 
3721         /* special text options */
3722         text: {
3723             /**#@+
3724              * @visprop
3725              */
3726 
3727             /**
3728              * The font size in pixels.
3729              *
3730              * @name fontSize
3731              * @memberOf Text.prototype
3732              * @default 12
3733              * @type Number
3734              */
3735             fontSize: 12,
3736 
3737             /**
3738              * Used to round texts given by a number.
3739              *
3740              * @name digits
3741              * @memberOf Text.prototype
3742              * @default 2
3743              * @type Number
3744              */
3745             digits: 2,
3746 
3747             /**
3748              * If set to true, the text is parsed and evaluated.
3749              * For labels parse==true results in converting names of the form k_a to subscripts.
3750              * If the text is given by string and parse==true, the string is parsed as
3751              * JessieCode expression.
3752              *
3753              * @name parse
3754              * @memberOf Text.prototype
3755              * @default true
3756              * @type Boolean
3757              */
3758             parse: true,
3759 
3760             /**
3761              * If set to true and caja's sanitizeHTML function can be found it
3762              * will be used to sanitize text output.
3763              *
3764              * @name useCaja
3765              * @memberOf Text.prototype
3766              * @default false
3767              * @type Boolean
3768              */
3769             useCaja: false,
3770 
3771             /**
3772              * If enabled, the text will be handled as label. Intended for internal use.
3773              *
3774              * @name isLabel
3775              * @memberOf Text.prototype
3776              * @default false
3777              * @type Boolean
3778              */
3779             isLabel: false,
3780 
3781             strokeColor: 'black',
3782             highlightStrokeColor: 'black',
3783             highlightStrokeOpacity: 0.666666,
3784 
3785             /**
3786              * Default CSS properties of the HTML text element.
3787              * <p>
3788              * The CSS properties which are set here, are handed over to the style property
3789              * of the HTML text element. That means, they have higher property than any
3790              * CSS class.
3791              * <p>
3792              * If a property which is set here should be overruled by a CSS class
3793              * then this property should be removed here.
3794              * <p>
3795              * The reason, why this attribute should be kept to its default value at all,
3796              * is that screen dumps of SVG boards with <tt>board.renderer.dumpToCanvas()</tt>
3797              * will ignore the font-family if it is set in a CSS class.
3798              * It has to be set explicitly as style attribute.
3799              * <p>
3800              * In summary, the order of priorities from high to low is
3801              * <ol>
3802              *  <li> JXG.Options.text.cssStyle
3803              *  <li> JXG.Options.text.cssDefaultStyle
3804              *  <li> JXG.Options.text.cssClass
3805              * </ol>
3806              * @example
3807              * If all texts should get its font-family from the default CSS class
3808              * before initializing the board
3809              * <pre>
3810              *   JXG.Options.text.cssDefaultStyle = '';
3811              * </pre>
3812              * should be called.
3813              *
3814              * @name cssDefaultStyle
3815              * @memberOf Text.prototype
3816              * @default  'font-family: Arial, Helvetica, Geneva, sans-serif;'
3817              * @type String
3818              * @see JXG.Text#highlightCssDefaultStyle
3819              * @see JXG.Text#cssStyle
3820              * @see JXG.Text#highlightCssStyle
3821              */
3822             cssDefaultStyle: 'font-family: Arial, Helvetica, Geneva, sans-serif;',
3823 
3824             /**
3825              * Default CSS properties of the HTML text element in case of highlighting.
3826              * <p>
3827              * The CSS properties which are set here, are haded over to the style property
3828              * of the HTML text element. That means, they have higher property than any
3829              * CSS class.
3830              *
3831              * @name highlightCssDefaultStyle
3832              * @memberOf Text.prototype
3833              * @default  'font-family: Arial, Helvetica, Geneva, sans-serif;'
3834              * @type String
3835              * @see JXG.Text#cssDefaultStyle
3836              * @see JXG.Text#cssStyle
3837              * @see JXG.Text#highlightCssStyle
3838             */
3839             highlightCssDefaultStyle: 'font-family: Arial, Helvetica, Geneva, sans-serif;',
3840 
3841             /**
3842              * CSS properties of the HTML text element.
3843              * <p>
3844              * The CSS properties which are set here, are haded over to the style property
3845              * of the HTML text element. That means, they have higher property than any
3846              * CSS class.
3847              *
3848              * @name cssStyle
3849              * @memberOf Text.prototype
3850              * @default  ''
3851              * @type String
3852              * @see JXG.Text#cssDefaultStyle
3853              * @see JXG.Text#highlightCssDefaultStyle
3854              * @see JXG.Text#highlightCssStyle
3855             */
3856             cssStyle: '',
3857 
3858             /**
3859              * CSS properties of the HTML text element in case of highlighting.
3860              * <p>
3861              * The CSS properties which are set here, are haded over to the style property
3862              * of the HTML text element. That means, they have higher property than any
3863              * CSS class.
3864              *
3865              * @name highlightCssStyle
3866              * @memberOf Text.prototype
3867              * @default  ''
3868              * @type String
3869              * @see JXG.Text#cssDefaultStyle
3870              * @see JXG.Text#highlightCssDefaultStyle
3871              * @see JXG.Text#cssStyle
3872             */
3873             highlightCssStyle: '',
3874 
3875             /**
3876              * If true the input will be given to ASCIIMathML before rendering.
3877              *
3878              * @name useASCIIMathML
3879              * @memberOf Text.prototype
3880              * @default false
3881              * @type Boolean
3882              */
3883             useASCIIMathML: false,
3884 
3885             /**
3886              * If true MathJax will be used to render the input string.
3887              *
3888              * @name useMathJax
3889              * @memberOf Text.prototype
3890              * @default false
3891              * @type Boolean
3892              */
3893             useMathJax: false,
3894 
3895             /**
3896              * Determines the rendering method of the text. Possible values
3897              * include <tt>'html'</tt> and <tt>'internal</tt>.
3898              *
3899              * @name display
3900              * @memberOf Text.prototype
3901              * @default 'html'
3902              * @type String
3903              */
3904             display: 'html',
3905 
3906             /**
3907              * Anchor element {@link Point}, {@link Text} or {@link Image} of the text. If it exists, the coordinates of the text are relative
3908              * to this anchor element.
3909              *
3910              * @name anchor
3911              * @memberOf Text.prototype
3912              * @default null
3913              * @type Object
3914              */
3915             anchor: null,
3916 
3917             /**
3918              * The horizontal alignment of the text. Possible values include <tt>'auto</tt>, <tt>'left'</tt>, <tt>'middle'</tt>, and
3919              * <tt>'right'</tt>.
3920              *
3921              * @name anchorX
3922              * @memberOf Text.prototype
3923              * @default 'left'
3924              * @type String
3925              */
3926             anchorX: 'left',
3927 
3928             /**
3929              * The vertical alignment of the text. Possible values include <tt>'auto</tt>, <tt>'top'</tt>, <tt>'middle'</tt>, and
3930              * <tt>'bottom'</tt>.
3931              *
3932              * @name anchorY
3933              * @memberOf Text.prototype
3934              * @default 'auto'
3935              * @type String
3936              */
3937             anchorY: 'middle',
3938 
3939             /**
3940              * CSS class of the text in non-highlighted view.
3941              *
3942              * @name cssClass
3943              * @memberOf Text.prototype
3944              * @type String
3945              */
3946             cssClass: 'JXGtext',
3947 
3948             /**
3949              * CSS class of the text in highlighted view.
3950              *
3951              * @name highlightCssClass
3952              * @memberOf Text.prototype
3953              * @type String
3954              */
3955             highlightCssClass: 'JXGtext',
3956 
3957             /**
3958              * Sensitive area for dragging the text.
3959              * Possible values are 'all', or something else.
3960              * This may be extended to left, right, ... in the future.
3961              *
3962              * @name Text#dragArea
3963              * @type String
3964              * @default 'all'
3965              */
3966             dragArea: 'all',
3967 
3968             withLabel: false,
3969 
3970             /**
3971              * Text rotation in degrees.
3972              * Works for non-zero values only in combination with display=='internal'.
3973              *
3974              * @name Text#rotate
3975              * @type Number
3976              * @default 0
3977              */
3978             rotate: 0,
3979 
3980             visible: true,
3981 
3982             /**
3983              * Defines together with {@link Text#snapSizeY} the grid the text snaps on to.
3984              * The text will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
3985              * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks
3986              * of the default ticks of the default x axes of the board.
3987              *
3988              * @name snapSizeX
3989              * @memberOf Text.prototype
3990              *
3991              * @see JXG.Point#snapToGrid
3992              * @see Text#snapSizeY
3993              * @see JXG.Board#defaultAxes
3994              * @type Number
3995              * @default 1
3996              */
3997             snapSizeX: 1,
3998 
3999             /**
4000              * Defines together with {@link Text#snapSizeX} the grid the text snaps on to.
4001              * The text will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
4002              * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks
4003              * of the default ticks of the default y axes of the board.
4004              *
4005              * @name snapSizeY
4006              * @memberOf Text.prototype
4007              *
4008              * @see JXG.Point#snapToGrid
4009              * @see Text#snapSizeX
4010              * @see JXG.Board#defaultAxes
4011              * @type Number
4012              * @default 1
4013              */
4014             snapSizeY: 1,
4015 
4016             /**
4017              * List of attractor elements. If the distance of the text is less than
4018              * attractorDistance the text is made to glider of this element.
4019              *
4020              * @name attractors
4021              * @memberOf Text.prototype
4022              * @type array
4023              * @default empty
4024              */
4025             attractors: []
4026 
4027             /**#@-*/
4028         },
4029 
4030         /* special options for trace curves */
4031         tracecurve: {
4032             /**#@+
4033              * @visprop
4034              */
4035             strokeColor: '#000000',
4036             fillColor: 'none',
4037 
4038             /**
4039              * The number of evaluated data points.
4040              * @memberOf Tracecurve.prototype
4041              * @default 100
4042              * @name numberPoints
4043              * @type Number
4044              */
4045             numberPoints: 100
4046 
4047             /**#@-*/
4048         },
4049 
4050         /*special turtle options */
4051         turtle: {
4052             /**#@+
4053              * @visprop
4054              */
4055 
4056             strokeWidth: 1,
4057             fillColor: 'none',
4058             strokeColor: '#000000',
4059 
4060             /**
4061              * Attributes for the turtle arrow.
4062              *
4063              * @type Curve
4064              * @name Turtle#arrow
4065              */
4066             arrow: {
4067                 strokeWidth: 2,
4068                 withLabel: false,
4069                 strokeColor: '#ff0000'
4070             }
4071             /**#@-*/
4072         },
4073 
4074         /**
4075          * Abbreviations of properties. Setting the shortcut means setting abbreviated properties
4076          * to the same value.
4077          * It is used in {@link JXG.GeometryElement#setAttribute} and in
4078          * the constructor {@link JXG.GeometryElement}.
4079          * Attention: In Options.js abbreviations are not allowed.
4080          */
4081         shortcuts: {
4082             color: ['strokeColor', 'fillColor'],
4083             opacity: ['strokeOpacity', 'fillOpacity'],
4084             highlightColor: ['highlightStrokeColor', 'highlightFillColor'],
4085             highlightOpacity: ['highlightStrokeOpacity', 'highlightFillOpacity'],
4086             strokeWidth: ['strokeWidth', 'highlightStrokeWidth']
4087         }
4088 
4089     };
4090 
4091     /**
4092      * Holds all possible properties and the according validators for geometry elements. A validator is either a function
4093      * which takes one parameter and returns true, if the value is valid for the property, or it is false if no validator
4094      * is required.
4095      */
4096     JXG.Validator = (function () {
4097         var i,
4098             validatePixel = function (v) {
4099                 return (/^[0-9]+px$/).test(v);
4100             },
4101             validateDisplay = function (v) {
4102                 return (v  === 'html' || v === 'internal');
4103             },
4104             validateColor = function (v) {
4105                 // for now this should do it...
4106                 return Type.isString(v);
4107             },
4108             validatePointFace = function (v) {
4109                 return Type.exists(JXG.normalizePointFace(v));
4110             },
4111             validateInteger = function (v) {
4112                 return (Math.abs(v - Math.round(v)) < Mat.eps);
4113             },
4114             validatePositiveInteger = function (v) {
4115                 return validateInteger(v) && v > 0;
4116             },
4117             validateScreenCoords = function (v) {
4118                 return v.length >= 2 && validateInteger(v[0]) && validateInteger(v[1]);
4119             },
4120             validateRenderer = function (v) {
4121                 return (v === 'vml' || v === 'svg' || v === 'canvas' || v === 'no');
4122             },
4123             validatePositive = function (v) {
4124                 return v > 0;
4125             },
4126             validateNotNegative = function (v) {
4127                 return v >= 0;
4128             },
4129             v = {},
4130             validators = {
4131                 attractorDistance: validateNotNegative,
4132                 color: validateColor,
4133                 defaultDistance: Type.isNumber,
4134                 display: validateDisplay,
4135                 doAdvancedPlot: false,
4136                 draft: false,
4137                 drawLabels: false,
4138                 drawZero: false,
4139                 face: validatePointFace,
4140                 factor: Type.isNumber,
4141                 fillColor: validateColor,
4142                 fillOpacity: Type.isNumber,
4143                 firstArrow: false,
4144                 fontSize: validateInteger,
4145                 dash: validateInteger,
4146                 gridX: Type.isNumber,
4147                 gridY: Type.isNumber,
4148                 hasGrid: false,
4149                 highlightFillColor: validateColor,
4150                 highlightFillOpacity: Type.isNumber,
4151                 highlightStrokeColor: validateColor,
4152                 highlightStrokeOpacity: Type.isNumber,
4153                 insertTicks: false,
4154                 //: validateScreenCoords,
4155                 lastArrow: false,
4156                 majorHeight: validateInteger,
4157                 minorHeight: validateInteger,
4158                 minorTicks: validateNotNegative,
4159                 minTicksDistance: validatePositiveInteger,
4160                 numberPointsHigh: validatePositiveInteger,
4161                 numberPointsLow: validatePositiveInteger,
4162                 opacity: Type.isNumber,
4163                 radius: Type.isNumber,
4164                 RDPsmoothing: false,
4165                 renderer: validateRenderer,
4166                 right: validatePixel,
4167                 showCopyright: false,
4168                 showInfobox: false,
4169                 showNavigation: false,
4170                 size: validateInteger,
4171                 snapSizeX: validatePositive,
4172                 snapSizeY: validatePositive,
4173                 snapWidth: Type.isNumber,
4174                 snapToGrid: false,
4175                 snatchDistance: validateNotNegative,
4176                 straightFirst: false,
4177                 straightLast: false,
4178                 stretch: false,
4179                 strokeColor: validateColor,
4180                 strokeOpacity: Type.isNumber,
4181                 strokeWidth: validateInteger,
4182                 takeFirst: false,
4183                 takeSizeFromFile: false,
4184                 to10: false,
4185                 toOrigin: false,
4186                 translateTo10: false,
4187                 translateToOrigin: false,
4188                 useASCIIMathML: false,
4189                 useDirection: false,
4190                 useMathJax: false,
4191                 withLabel: false,
4192                 withTicks: false,
4193                 zoom: false
4194             };
4195 
4196         // this seems like a redundant step but it makes sure that
4197         // all properties in the validator object have lower case names
4198         // and the validator object is easier to read.
4199         for (i in validators) {
4200             if (validators.hasOwnProperty(i)) {
4201                 v[i.toLowerCase()] = validators[i];
4202             }
4203         }
4204 
4205         return v;
4206     }());
4207 
4208     /**
4209      * All point faces can be defined with more than one name, e.g. a cross faced point can be given
4210      * by face equal to 'cross' or equal to 'x'. This method maps all possible values to fixed ones to
4211      * simplify if- and switch-clauses regarding point faces. The translation table is as follows:
4212      * <table>
4213      * <tr><th>Input</th><th>Output</th></tr>
4214      * <tr><td>cross, x</td><td>x</td></tr>
4215      * <tr><td>circle, o</td><td>o</td></tr>
4216      * <tr><td>square, []</td><td>[]</td></tr>
4217      * <tr><td>plus, +</td><td>+</td></tr>
4218      * <tr><td>diamond, <></td><td><></td></tr>
4219      * <tr><td>triangleup, a, ^</td><td>A</td></tr>
4220      * <tr><td>triangledown, v</td><td>v</td></tr>
4221      * <tr><td>triangleleft, <</td><td><</td></tr>
4222      * <tr><td>triangleright, ></td><td>></td></tr>
4223      * </table>
4224      * @param {String} s A string which should determine a valid point face.
4225      * @returns {String} Returns a normalized string or undefined if the given string is not a valid
4226      * point face.
4227      */
4228     JXG.normalizePointFace = function (s) {
4229         var map = {
4230             cross: 'x',
4231             x: 'x',
4232             circle: 'o',
4233             o: 'o',
4234             square: '[]',
4235             '[]': '[]',
4236             plus: '+',
4237             '+': '+',
4238             diamond: '<>',
4239             '<>': '<>',
4240             triangleup: '^',
4241             a: '^',
4242             '^': '^',
4243             triangledown: 'v',
4244             v: 'v',
4245             triangleleft: '<',
4246             '<': '<',
4247             triangleright: '>',
4248             '>': '>'
4249         };
4250 
4251         return map[s];
4252     };
4253 
4254 
4255     /**
4256      * Apply the options stored in this object to all objects on the given board.
4257      * @param {JXG.Board} board The board to which objects the options will be applied.
4258      */
4259     JXG.useStandardOptions = function (board) {
4260         var el, t, p, copyProps,
4261             o = JXG.Options,
4262             boardHadGrid = board.hasGrid;
4263 
4264         board.options.grid.hasGrid = o.grid.hasGrid;
4265         board.options.grid.gridX = o.grid.gridX;
4266         board.options.grid.gridY = o.grid.gridY;
4267         board.options.grid.gridColor = o.grid.gridColor;
4268         board.options.grid.gridOpacity = o.grid.gridOpacity;
4269         board.options.grid.gridDash = o.grid.gridDash;
4270         board.options.grid.snapToGrid = o.grid.snapToGrid;
4271         board.options.grid.snapSizeX = o.grid.SnapSizeX;
4272         board.options.grid.snapSizeY = o.grid.SnapSizeY;
4273         board.takeSizeFromFile = o.takeSizeFromFile;
4274 
4275         copyProps = function (p, o) {
4276             p.visProp.fillcolor = o.fillColor;
4277             p.visProp.highlightfillcolor = o.highlightFillColor;
4278             p.visProp.strokecolor = o.strokeColor;
4279             p.visProp.highlightstrokecolor = o.highlightStrokeColor;
4280         };
4281 
4282         for (el in board.objects) {
4283             if (board.objects.hasOwnProperty(el)) {
4284                 p = board.objects[el];
4285                 if (p.elementClass === Const.OBJECT_CLASS_POINT) {
4286                     copyProps(p, o.point);
4287                 } else if (p.elementClass === Const.OBJECT_CLASS_LINE) {
4288                     copyProps(p, o.line);
4289 
4290                     for (t = 0; t < p.ticks.length; t++) {
4291                         p.ticks[t].majorTicks = o.line.ticks.majorTicks;
4292                         p.ticks[t].minTicksDistance = o.line.ticks.minTicksDistance;
4293                         p.ticks[t].visProp.minorheight = o.line.ticks.minorHeight;
4294                         p.ticks[t].visProp.majorheight = o.line.ticks.majorHeight;
4295                     }
4296                 } else if (p.elementClass === Const.OBJECT_CLASS_CIRCLE) {
4297                     copyProps(p, o.circle);
4298                 } else if (p.type === Const.OBJECT_TYPE_ANGLE) {
4299                     copyProps(p, o.angle);
4300                 } else if (p.type === Const.OBJECT_TYPE_ARC) {
4301                     copyProps(p, o.arc);
4302                 } else if (p.type === Const.OBJECT_TYPE_POLYGON) {
4303                     copyProps(p, o.polygon);
4304                 } else if (p.type === Const.OBJECT_TYPE_CONIC) {
4305                     copyProps(p, o.conic);
4306                 } else if (p.type === Const.OBJECT_TYPE_CURVE) {
4307                     copyProps(p, o.curve);
4308                 } else if (p.type === Const.OBJECT_TYPE_SECTOR) {
4309                     p.arc.visProp.fillcolor = o.sector.fillColor;
4310                     p.arc.visProp.highlightfillcolor = o.sector.highlightFillColor;
4311                     p.arc.visProp.fillopacity = o.sector.fillOpacity;
4312                     p.arc.visProp.highlightfillopacity = o.sector.highlightFillOpacity;
4313                 }
4314             }
4315         }
4316 
4317         board.fullUpdate();
4318         if (boardHadGrid && !board.hasGrid) {
4319             board.removeGrids(board);
4320         } else if (!boardHadGrid && board.hasGrid) {
4321             board.create('grid', []);
4322         }
4323     };
4324 
4325     /**
4326      * Converts all color values to greyscale and calls useStandardOption to put them onto the board.
4327      * @param {JXG.Board} board The board to which objects the options will be applied.
4328      * @see #useStandardOptions
4329      */
4330     JXG.useBlackWhiteOptions = function (board) {
4331         var o = JXG.Options;
4332         o.point.fillColor = Color.rgb2bw(o.point.fillColor);
4333         o.point.highlightFillColor = Color.rgb2bw(o.point.highlightFillColor);
4334         o.point.strokeColor = Color.rgb2bw(o.point.strokeColor);
4335         o.point.highlightStrokeColor = Color.rgb2bw(o.point.highlightStrokeColor);
4336 
4337         o.line.fillColor = Color.rgb2bw(o.line.fillColor);
4338         o.line.highlightFillColor = Color.rgb2bw(o.line.highlightFillColor);
4339         o.line.strokeColor = Color.rgb2bw(o.line.strokeColor);
4340         o.line.highlightStrokeColor = Color.rgb2bw(o.line.highlightStrokeColor);
4341 
4342         o.circle.fillColor = Color.rgb2bw(o.circle.fillColor);
4343         o.circle.highlightFillColor = Color.rgb2bw(o.circle.highlightFillColor);
4344         o.circle.strokeColor = Color.rgb2bw(o.circle.strokeColor);
4345         o.circle.highlightStrokeColor = Color.rgb2bw(o.circle.highlightStrokeColor);
4346 
4347         o.arc.fillColor = Color.rgb2bw(o.arc.fillColor);
4348         o.arc.highlightFillColor = Color.rgb2bw(o.arc.highlightFillColor);
4349         o.arc.strokeColor = Color.rgb2bw(o.arc.strokeColor);
4350         o.arc.highlightStrokeColor = Color.rgb2bw(o.arc.highlightStrokeColor);
4351 
4352         o.polygon.fillColor = Color.rgb2bw(o.polygon.fillColor);
4353         o.polygon.highlightFillColor  = Color.rgb2bw(o.polygon.highlightFillColor);
4354 
4355         o.sector.fillColor = Color.rgb2bw(o.sector.fillColor);
4356         o.sector.highlightFillColor  = Color.rgb2bw(o.sector.highlightFillColor);
4357 
4358         o.curve.strokeColor = Color.rgb2bw(o.curve.strokeColor);
4359         o.grid.gridColor = Color.rgb2bw(o.grid.gridColor);
4360 
4361         JXG.useStandardOptions(board);
4362     };
4363 
4364     // needs to be exported
4365     JXG.Options.normalizePointFace = JXG.normalizePointFace;
4366 
4367     return JXG.Options;
4368 });
4369