1 /* 2 Copyright 2008-2014 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 boundingBox: [-5, 5, 5, -5], 67 zoomFactor: 1, 68 zoomX: 1, 69 zoomY: 1, 70 showCopyright: true, 71 axis: false, 72 73 /** 74 * Display of navigation arrors and zoom buttons 75 */ 76 showNavigation: true, 77 78 /** 79 * Show a button to force reload of a construction. 80 * Works only with the JessieCode tag 81 */ 82 showReload: false, 83 84 /** 85 * Show a buttons which allows to clear all traces of a board. 86 */ 87 showClearTraces: false, 88 89 keepAspectRatio: false, 90 91 /** 92 * Supply the document object. 93 * Defaults to window.document 94 */ 95 document: false, // document 96 97 // if true the first element with hasPoint==true is taken. 98 takeFirst: false, 99 // If true, the construction - when read from a file or string - the size of the div can be changed. 100 takeSizeFromFile: false, 101 renderer: 'svg', 102 animationDelay: 35, 103 registerEvents: true, 104 minimizeReflow: 'svg', 105 /** 106 * A number that will be added to the absolute position of the board used in mouse coordinate 107 * calculations in {@link #getCoordsTopLeftCorner}. 108 * @type {number} 109 */ 110 offsetX: 0, 111 /** 112 * A number that will be added to the absolute position of the board used in mouse coordinate 113 * calculations in {@link #getCoordsTopLeftCorner}. 114 * @type {number} 115 */ 116 offsetY: 0, 117 zoom: { 118 factorX: 1.25, 119 factorY: 1.25, 120 wheel: false, 121 needshift: false, 122 eps: 0.1 123 }, 124 pan: { 125 needShift: true, 126 needTwoFingers: true, 127 enabled: true 128 } 129 }, 130 131 /** 132 * Options that are used for by the navigation bar 133 */ 134 navbar: { 135 strokeColor: '#333333', //'#aaaaaa', 136 fillColor: 'transparent', //#f5f5f5', 137 highlightFillColor: '#aaaaaa', 138 padding: '2px', 139 position: 'absolute', 140 fontSize: '14px', 141 cursor: 'pointer', 142 zIndex: '100', 143 right: '5px', 144 bottom: '5px' 145 //border: 'none 1px black', 146 //borderRadius: '4px' 147 }, 148 149 /* Generic options used by {@link JXG.GeometryElement} */ 150 elements: { 151 // the following tag is a meta tag: http://code.google.com/p/jsdoc-toolkit/wiki/MetaTags 152 153 /**#@+ 154 * @visprop 155 */ 156 157 /** 158 * The stroke color of the given geometry element. 159 * @type String 160 * @name JXG.GeometryElement#strokeColor 161 * @see JXG.GeometryElement#highlightStrokeColor 162 * @see JXG.GeometryElement#strokeWidth 163 * @see JXG.GeometryElement#strokeOpacity 164 * @see JXG.GeometryElement#highlightStrokeOpacity 165 * @default {@link JXG.Options.elements.color#strokeColor} 166 */ 167 strokeColor: '#0000ff', 168 169 /** 170 * The stroke color of the given geometry element when the user moves the mouse over it. 171 * @type String 172 * @name JXG.GeometryElement#highlightStrokeColor 173 * @see JXG.GeometryElement#strokeColor 174 * @see JXG.GeometryElement#strokeWidth 175 * @see JXG.GeometryElement#strokeOpacity 176 * @see JXG.GeometryElement#highlightStrokeOpacity 177 * @default {@link JXG.Options.elements.color#highlightStrokeColor} 178 */ 179 highlightStrokeColor: '#C3D9FF', 180 181 /** 182 * The fill color of this geometry element. 183 * @type String 184 * @name JXG.GeometryElement#fillColor 185 * @see JXG.GeometryElement#highlightFillColor 186 * @see JXG.GeometryElement#fillOpacity 187 * @see JXG.GeometryElement#highlightFillOpacity 188 * @default {@link JXG.Options.elements.color#fillColor} 189 */ 190 fillColor: 'red', 191 192 /** 193 * The fill color of the given geometry element when the mouse is pointed over it. 194 * @type String 195 * @name JXG.GeometryElement#highlightFillColor 196 * @see JXG.GeometryElement#fillColor 197 * @see JXG.GeometryElement#fillOpacity 198 * @see JXG.GeometryElement#highlightFillOpacity 199 * @default {@link JXG.Options.elements.color#highlightFillColor} 200 */ 201 highlightFillColor: 'none', 202 203 /** 204 * Opacity for element's stroke color. 205 * @type number 206 * @name JXG.GeometryElement#strokeOpacity 207 * @see JXG.GeometryElement#strokeColor 208 * @see JXG.GeometryElement#highlightStrokeColor 209 * @see JXG.GeometryElement#strokeWidth 210 * @see JXG.GeometryElement#highlightStrokeOpacity 211 * @default {@link JXG.Options.elements#strokeOpacity} 212 */ 213 strokeOpacity: 1, 214 215 /** 216 * Opacity for stroke color when the object is highlighted. 217 * @type number 218 * @name JXG.GeometryElement#highlightStrokeOpacity 219 * @see JXG.GeometryElement#strokeColor 220 * @see JXG.GeometryElement#highlightStrokeColor 221 * @see JXG.GeometryElement#strokeWidth 222 * @see JXG.GeometryElement#strokeOpacity 223 * @default {@link JXG.Options.elements#highlightStrokeOpacity} 224 */ 225 highlightStrokeOpacity: 1, 226 227 /** 228 * Opacity for fill color. 229 * @type number 230 * @name JXG.GeometryElement#fillOpacity 231 * @see JXG.GeometryElement#fillColor 232 * @see JXG.GeometryElement#highlightFillColor 233 * @see JXG.GeometryElement#highlightFillOpacity 234 * @default {@link JXG.Options.elements.color#fillOpacity} 235 */ 236 fillOpacity: 1, 237 238 /** 239 * Opacity for fill color when the object is highlighted. 240 * @type number 241 * @name JXG.GeometryElement#highlightFillOpacity 242 * @see JXG.GeometryElement#fillColor 243 * @see JXG.GeometryElement#highlightFillColor 244 * @see JXG.GeometryElement#fillOpacity 245 * @default {@link JXG.Options.elements.color#highlightFillOpacity} 246 */ 247 highlightFillOpacity: 1, 248 249 /** 250 * Width of the element's stroke. 251 * @type number 252 * @name JXG.GeometryElement#strokeWidth 253 * @see JXG.GeometryElement#strokeColor 254 * @see JXG.GeometryElement#highlightStrokeColor 255 * @see JXG.GeometryElement#strokeOpacity 256 * @see JXG.GeometryElement#highlightStrokeOpacity 257 * @default {@link JXG.Options.elements#strokeWidth} 258 */ 259 strokeWidth: 2, 260 261 /** 262 * Width of the element's stroke when the mouse is pointed over it. 263 * @type number 264 * @name JXG.GeometryElement#highlightStrokeWidth 265 * @see JXG.GeometryElement#strokeColor 266 * @see JXG.GeometryElement#highlightStrokeColor 267 * @see JXG.GeometryElement#strokeOpacity 268 * @see JXG.GeometryElement#highlightStrokeOpacity 269 * @see JXG.GeometryElement#highlightFillColor 270 * @default {@link JXG.Options.elements#strokeWidth} 271 */ 272 highlightStrokeWidth: 2, 273 274 275 /** 276 * If true the element is fixed and can not be dragged around. The element 277 * will be repositioned on zoom and moveOrigin events. 278 * @type Boolean 279 * @default false 280 * @name JXG.GeometryElement#fixed 281 */ 282 fixed: false, 283 284 /** 285 * If true the element is fixed and can not be dragged around. The element 286 * will even stay at its position on zoom and moveOrigin events. 287 * Only free elements like points, texts, curves can be frozen. 288 * @type Boolean 289 * @default false 290 * @name JXG.GeometryElement#frozen 291 */ 292 frozen: false, 293 294 /** 295 * If true a label will display the element's name. 296 * @type Boolean 297 * @default false 298 * @name JXG.GeometryElement#withLabel 299 */ 300 withLabel: false, 301 302 /** 303 * If false the element won't be visible on the board, otherwise it is shown. 304 * @type boolean 305 * @name JXG.GeometryElement#visible 306 * @see JXG.GeometryElement#hideElement 307 * @see JXG.GeometryElement#showElement 308 * @default true 309 */ 310 visible: true, 311 312 /** 313 * A private element will be inaccessible in certain environments, e.g. a graphical user interface. 314 * @default false 315 */ 316 priv: false, 317 318 /** 319 * Display layer which will contain the element. 320 * @see JXG.Options#layer 321 * @default See {@link JXG.Options#layer} 322 */ 323 layer: 0, 324 325 326 /** 327 * Determines the elements border-style. 328 * Possible values are: 329 * <ul><li>0 for a solid line</li> 330 * <li>1 for a dotted line</li> 331 * <li>2 for a line with small dashes</li> 332 333 334 * <li>3 for a line with medium dashes</li> 335 * <li>4 for a line with big dashes</li> 336 * <li>5 for a line with alternating medium and big dashes and large gaps</li> 337 * <li>6 for a line with alternating medium and big dashes and small gaps</li></ul> 338 * @type Number 339 * @name JXG.GeometryElement#dash 340 * @default 0 341 */ 342 dash: 0, 343 344 /** 345 * If true the element will get a shadow. 346 * @type boolean 347 * @name JXG.GeometryElement#shadow 348 * @default false 349 */ 350 shadow: false, 351 352 /** 353 * If true the element will be traced, i.e. on every movement the element will be copied 354 * to the background. Use {@link JXG.GeometryElement#clearTrace} to delete the trace elements. 355 * @see JXG.GeometryElement#clearTrace 356 * @see JXG.GeometryElement#traces 357 * @see JXG.GeometryElement#numTraces 358 * @type Boolean 359 * @default false 360 * @name JXG.GeometryElement#trace 361 */ 362 trace: false, 363 364 /** 365 * Extra visual properties for traces of an element 366 * @type Object 367 * @see JXG.GeometryElement#trace 368 * @name JXG.GeometryElement#traceAttributes 369 */ 370 traceAttributes: {}, 371 372 /** 373 * 374 * @type Boolean 375 * @default true 376 * @name JXG.GeometryElement#highlight 377 */ 378 highlight: true, 379 380 /** 381 * If this is set to true, the element is updated in every update 382 * call of the board. If set to false, the element is updated only after 383 * zoom events or more generally, when the bounding box has been changed. 384 * Examples for the latter behaviour should be axes. 385 * @type Boolean 386 * @default true 387 * @see JXG.GeometryElement#needsRegularUpdate 388 * @name JXG.GeometryElement#needsRegularUpdate 389 */ 390 needsRegularUpdate: true, 391 392 /** 393 * Snaps the element or its parents to the grid. Currently only relevant for points, circles, 394 * and lines. Points are snapped to grid directly, on circles and lines it's only the parent 395 * points that are snapped 396 * @type Boolean 397 * @default false 398 * @name JXG.GeometryElement#snapToGrid 399 */ 400 snapToGrid: false, 401 402 /** 403 * Determines whether two-finger manipulation of this object may change its size. 404 * If set to false, the object is only rotated and translated. 405 * @type Boolean 406 * @default true 407 * @name JXG.GeometryElement#scalable 408 */ 409 scalable: true, 410 411 /*draft options */ 412 draft: { 413 /** 414 * If true the element will be drawn in grey scale colors to visualize that it's only a draft. 415 * @type boolean 416 * @name JXG.GeometryElement#draft 417 * @default {@link JXG.Options.elements.draft#draft} 418 */ 419 draft: false, 420 strokeColor: '#565656', 421 fillColor: '#565656', 422 strokeOpacity: 0.8, 423 fillOpacity: 0.8, 424 strokeWidth: 1 425 }, 426 427 /** 428 * @private 429 * By default, an element is not a label. Do not change this. 430 */ 431 isLabel: false 432 // close the meta tag 433 /**#@-*/ 434 }, 435 436 ticks: { 437 /**#@+ 438 * @visprop 439 */ 440 441 /** 442 * A function that expects two {@link JXG.Coords}, the first one representing the coordinates of the 443 * tick that is to be labeled, the second one the coordinates of the center (the tick with position 0). 444 * @type function 445 * @name JXG.Ticks#generateLabelValue 446 */ 447 generateLabelValue: null, 448 449 /** 450 * Draw labels yes/no 451 * @type Boolean 452 * @name JXG.Ticks#drawLabels 453 * @default false 454 */ 455 drawLabels: false, 456 label: {}, 457 458 /** 459 * Determine the position of the tick with value 0. 'left' means point1 of the line, 'right' means point2, 460 * and 'middle' is equivalent to the midpoint of the defining points. This attribute is ignored if the parent 461 * line is of type axis and is parallel to either the x (i.e. y = 0) or the y (i.e. x = 0) axis. 462 * @type String 463 * @name JXG.Ticks#anchor 464 * @default 'left' 465 */ 466 anchor: 'left', 467 468 /** 469 * Draw the zero tick, that lies at line.point1? 470 * @type Boolean 471 * @name JXG.Ticks#drawZero 472 * @default false 473 */ 474 drawZero: false, 475 476 /** 477 * If the distance between two ticks is too big we could insert new ticks. If insertTicks 478 * is <tt>true</tt>, we'll do so, otherwise we leave the distance as is. 479 * This option is ignored if equidistant is false. In the example below the distance between 480 * two ticks is given as <tt>1</tt> but because insertTicks is set to true many ticks will 481 * be omitted in the rendering process to keep the display clear. 482 * @type Boolean 483 * @name JXG.Ticks#insertTicks 484 * @see JXG.Ticks#equidistant 485 * @see JXG.Ticks#minTicksDistance 486 * @default false 487 * @example 488 * // Create an axis providing two coord pairs. 489 * var p1 = board.create('point', [0, 0]); 490 * var p2 = board.create('point', [50, 25]); 491 * var l1 = board.create('line', [p1, p2]); 492 * var t = board.create('ticks', [l1, 1], { 493 * insertTicks: true, 494 * majorHeight: -1, 495 * label: { 496 * offset: [4, -9] 497 * }, 498 * drawLabels: true 499 * }); 500 * </pre><div id="2f6fb842-40bd-4223-aa28-3e9369d2097f" style="width: 300px; height: 300px;"></div> 501 * <script type="text/javascript"> 502 * (function () { 503 * var board = JXG.JSXGraph.initBoard('2f6fb842-40bd-4223-aa28-3e9369d2097f', {boundingbox: [-100, 70, 70, -100], showcopyright: false, shownavigation: false}); 504 * var p1 = board.create('point', [0, 0]); 505 * var p2 = board.create('point', [50, 25]); 506 * var l1 = board.create('line', [p1, p2]); 507 * var t = board.create('ticks', [l1, 1], {insertTicks: true, majorHeight: -1, label: {offset: [4, -9]}, drawLabels: true}); 508 * })(); 509 * </script><pre> 510 */ 511 insertTicks: false, 512 minTicksDistance: 10, 513 514 /** 515 * Total height of a minor tick. If negative the full height of the board is taken. 516 * @type Number 517 * @name JXG.Ticks#minorHeight 518 */ 519 minorHeight: 4, 520 521 /** 522 * Total height of a major tick. If negative the full height of the board is taken. 523 * @type Number 524 * @name JXG.Ticks#majorHeight 525 */ 526 majorHeight: 10, 527 528 /** 529 * Decides in which direction finite ticks are visible. Possible values are 0=false or 1=true. 530 * In case of [0,1] the tick is only visible to the right of the line. In case of 531 * [1,0] the tick is only visible to the left of the line. 532 * @type Array 533 * @name JXG.Ticks#tickEndings 534 */ 535 tickEndings: [1, 1], 536 537 /** 538 * The number of minor ticks between two major ticks. 539 * @type Number 540 * @name JXG.Ticks#minorTicks 541 */ 542 minorTicks: 4, 543 544 /** 545 * Scale the ticks but not the tick labels. 546 * @type Number 547 * @default 1 548 * @name JXG.Ticks#scale 549 * @see JXG.Ticks#scaleSymbol 550 */ 551 scale: 1, 552 553 /** 554 * A string that is appended to every tick, used to represent the scale 555 * factor given in {@link JXG.Ticks#scaleSymbol}. 556 * @type String 557 * @default '' 558 * @name JXG.Ticks#scaleSymbol 559 * @see JXG.Ticks#scale 560 */ 561 scaleSymbol: '', 562 563 /** 564 * User defined labels for special ticks. Instead of the i-th tick's position, the i-th string stored in this array 565 * is shown. If the number of strings in this array is less than the number of special ticks, the tick's position is 566 * shown as a fallback. 567 * @type Array 568 * @name JXG.Ticks#labels 569 * @default [] 570 */ 571 labels: [], 572 573 /** 574 * The maximum number of characters a tick label can use. 575 * @type Number 576 * @name JXG.Ticks#maxLabelLength 577 * @see JXG.Ticks#precision 578 * @default 3 579 */ 580 maxLabelLength: 5, 581 582 /** 583 * If a label exceeds {@link JXG.Ticks#maxLabelLength} this determines the precision used to shorten the tick label. 584 * @type Number 585 * @name JXG.Ticks#precision 586 * @see JXG.Ticks#maxLabelLength 587 * @default 3 588 */ 589 precision: 3, 590 591 /** 592 * The default distance between two ticks. Please be aware that this value does not have 593 * to be used if {@link JXG.Ticks#insertTicks} is set to true. 594 * @type Number 595 * @name JXG.Ticks#ticksDistance 596 * @see JXG.Ticks#equidistant 597 * @see JXG.Ticks#insertTicks 598 * @default 1 599 */ 600 ticksDistance: 1, 601 strokeOpacity: 1, 602 strokeWidth: 1, 603 strokeColor: 'black', 604 highlightStrokeColor: '#888888', 605 606 /** 607 * Whether line boundaries should be counted or not in the lower and upper bounds when 608 * creating ticks. 609 * @type Boolean 610 * @name JXG.Ticks#includeBoundaries 611 * @default false 612 */ 613 includeBoundaries: false 614 // close the meta tag 615 /**#@-*/ 616 }, 617 618 hatch: { 619 drawLabels: false, 620 drawZero: true, 621 majorHeight: 20, 622 anchor: 'middle', 623 strokeWidth: 2, 624 strokeColor: 'blue', 625 ticksDistance: 0.2 626 }, 627 628 /* precision options */ 629 precision: { 630 touch: 30, 631 touchMax: 100, 632 mouse: 4, 633 epsilon: 0.0001, 634 hasPoint: 4 635 }, 636 637 /* Default ordering of the layers */ 638 layer: { 639 numlayers: 20, // only important in SVG 640 text: 9, 641 point: 9, 642 glider: 9, 643 arc: 8, 644 line: 7, 645 circle: 6, 646 curve: 5, 647 turtle: 5, 648 polygon: 3, 649 sector: 3, 650 angle: 3, 651 integral: 3, 652 axis: 2, 653 grid: 1, 654 image: 0, 655 trace: 0 656 }, 657 658 /* element type specific options */ 659 angle: { 660 /**#@+ 661 * @visprop 662 */ 663 664 withLabel: true, 665 666 /** 667 * Radius of the sector, displaying the angle. 668 * @type Number 669 * @default 0.5 670 * @name Angle#radius 671 * @visprop 672 */ 673 radius: 0.5, 674 675 /** 676 * Display type of the angle field. Possible values are 677 * 'sector' or 'sectordot' or 'square' or 'none'. 678 * @type String 679 * @default sector 680 * @name Angle#type 681 * @visprop 682 */ 683 type: 'sector', 684 685 /** 686 * Display type of the angle field in case of a right angle. Possible values are 687 * 'sector' or 'sectordot' or 'square' or 'none'. 688 * @type String 689 * @default square 690 * @name Angle#orthoType 691 * @see Angle#orthoSensitivity 692 * @visprop 693 */ 694 orthoType: 'square', 695 696 /** 697 * Sensitivity (in degrees) to declare an angle as right angle. 698 * If the angle measure is inside this distance from a rigth angle, the orthoType 699 * of the angle is used for display. 700 * @type Number 701 * @default 1.0 702 * @name Angle#orthoSensitivity 703 * @see Angle#orthoType 704 * @visprop 705 */ 706 orthoSensitivity: 1.0, 707 fillColor: '#FF7F00', 708 highlightFillColor: '#FF7F00', 709 strokeColor: '#FF7F00', 710 fillOpacity: 0.3, 711 highlightFillOpacity: 0.3, 712 713 /** 714 * @deprecated 715 */ 716 radiuspoint: { 717 withLabel: false, 718 visible: false, 719 name: '' 720 }, 721 /** 722 * @deprecated 723 */ 724 pointsquare: { 725 withLabel: false, 726 visible: false, 727 name: '' 728 }, 729 730 dot: { 731 visible: false, 732 strokeColor: 'none', 733 fillColor: 'black', 734 size: 2, 735 face: 'o', 736 withLabel: false, 737 name: '' 738 }, 739 label: { 740 position: 'top', 741 offset: [0, 0], 742 strokeColor: '#0000FF' 743 } 744 745 /**#@-*/ 746 }, 747 748 /* special arc options */ 749 arc: { 750 /**#@+ 751 * @visprop 752 */ 753 754 label: {}, 755 firstArrow: false, 756 lastArrow: false, 757 fillColor: 'none', 758 highlightFillColor: 'none', 759 strokeColor: '#0000ff', 760 highlightStrokeColor: '#C3D9FF', 761 useDirection: false 762 /**#@-*/ 763 }, 764 765 /* special axis options */ 766 axis: { 767 /**#@+ 768 * @visprop 769 */ 770 771 name: '', // By default, do not generate names for axes. 772 needsRegularUpdate: false, // Axes only updated after zooming and moving of the origin. 773 strokeWidth: 1, 774 strokeColor: '#666666', 775 highlightStrokeWidth: 1, 776 highlightStrokeColor: '#888888', 777 withTicks: true, 778 straightFirst: true, 779 straightLast: true, 780 lastArrow: true, 781 withLabel: false, 782 scalable: false, 783 /* line ticks options */ 784 ticks: { 785 label: { 786 offset: [4, -12 + 3], // This seems to be a good offset for 12 point fonts 787 parse: false 788 }, 789 needsRegularUpdate: false, 790 strokeWidth: 1, 791 strokeColor: '#666666', 792 highlightStrokeColor: '#888888', 793 drawLabels: true, 794 drawZero: false, 795 insertTicks: true, 796 minTicksDistance: 10, 797 minorHeight: 10, // if <0: full width and height 798 majorHeight: -1, // if <0: full width and height 799 tickEndings: [0, 1], 800 minorTicks: 4, 801 ticksDistance: 1, // TODO doc 802 strokeOpacity: 0.25 803 }, 804 point1: { // Default values for point1 if created by line 805 needsRegularUpdate: false 806 }, 807 point2: { // Default values for point2 if created by line 808 needsRegularUpdate: false 809 }, 810 label: { 811 position: 'lft', 812 offset: [10, 10] 813 } 814 /**#@-*/ 815 }, 816 817 /* special options for bisector of 3 points */ 818 bisector: { 819 /**#@+ 820 * @visprop 821 */ 822 823 strokeColor: '#000000', // Bisector line 824 point: { // Bisector point 825 visible: false, 826 fixed: false, 827 withLabel: false, 828 name: '' 829 } 830 /**#@-*/ 831 }, 832 833 /* special options for the 2 bisectors of 2 lines */ 834 bisectorlines: { 835 /**#@+ 836 * @visprop 837 */ 838 839 line1: { // 840 strokeColor: 'black' 841 }, 842 line2: { // 843 strokeColor: 'black' 844 } 845 /**#@-*/ 846 }, 847 848 /* special chart options */ 849 chart: { 850 /**#@+ 851 * @visprop 852 */ 853 854 chartStyle: 'line', 855 colors: ['#B02B2C', '#3F4C6B', '#C79810', '#D15600', '#FFFF88', '#C3D9FF', '#4096EE', '#008C00'], 856 highlightcolors: null, 857 fillcolor: null, 858 highlightonsector: false, 859 highlightbysize: false, 860 label: { 861 } 862 /**#@-*/ 863 }, 864 865 /*special circle options */ 866 circle: { 867 /**#@+ 868 * @visprop 869 */ 870 871 hasInnerPoints: false, 872 fillColor: 'none', 873 highlightFillColor: 'none', 874 strokeColor: '#0000ff', 875 highlightStrokeColor: '#C3D9FF', 876 center: { 877 visible: false, 878 withLabel: false, 879 fixed: false, 880 name: '' 881 }, 882 label: { 883 position: 'urt' 884 } 885 /**#@-*/ 886 }, 887 888 /* special options for circumcircle of 3 points */ 889 circumcircle: { 890 /**#@+ 891 * @visprop 892 */ 893 894 fillColor: 'none', 895 highlightFillColor: 'none', 896 strokeColor: '#0000ff', 897 highlightStrokeColor: '#C3D9FF', 898 center: { // center point 899 visible: false, 900 fixed: false, 901 withLabel: false, 902 name: '' 903 } 904 /**#@-*/ 905 }, 906 907 circumcirclearc: { 908 /**#@+ 909 * @visprop 910 */ 911 912 fillColor: 'none', 913 highlightFillColor: 'none', 914 strokeColor: '#0000ff', 915 highlightStrokeColor: '#C3D9FF', 916 center: { 917 visible: false, 918 withLabel: false, 919 fixed: false, 920 name: '' 921 } 922 /**#@-*/ 923 }, 924 925 /* special options for circumcircle sector of 3 points */ 926 circumcirclesector: { 927 /**#@+ 928 * @visprop 929 */ 930 931 useDirection: true, 932 fillColor: '#00FF00', 933 highlightFillColor: '#00FF00', 934 fillOpacity: 0.3, 935 highlightFillOpacity: 0.3, 936 strokeColor: '#0000ff', 937 highlightStrokeColor: '#C3D9FF', 938 point: { 939 visible: false, 940 fixed: false, 941 withLabel: false, 942 name: '' 943 } 944 /**#@-*/ 945 }, 946 947 /* special conic options */ 948 conic: { 949 /**#@+ 950 * @visprop 951 */ 952 953 fillColor: 'none', 954 highlightFillColor: 'none', 955 strokeColor: '#0000ff', 956 highlightStrokeColor: '#C3D9FF', 957 foci: { 958 // points 959 fixed: false, 960 visible: false, 961 withLabel: false, 962 name: '' 963 } 964 /**#@-*/ 965 }, 966 967 /* special curve options */ 968 curve: { 969 strokeWidth: 1, 970 strokeColor: '#0000ff', 971 fillColor: 'none', 972 fixed: true, 973 974 useQDT: false, 975 976 /**#@+ 977 * @visprop 978 */ 979 980 /** 981 * The data points of the curve are not connected with straight lines but with bezier curves. 982 * @name JXG.Curve#handDrawing 983 * @type Boolean 984 * @default false 985 */ 986 handDrawing: false, 987 988 /** 989 * The curveType is set in @see generateTerm and used in {@link JXG.Curve#updateCurve}. 990 * Possible values are <ul> 991 * <li>'none'</li> 992 * <li>'plot': Data plot</li> 993 * <li>'parameter': we can not distinguish function graphs and parameter curves</li> 994 * <li>'functiongraph': function graph</li> 995 * <li>'polar'</li> 996 * <li>'implicit' (not yet)</li></ul> 997 * Only parameter and plot are set directly. Polar is set with {@link JXG.GeometryElement#setAttribute} only. 998 * @name JXG.Curve#curveType 999 */ 1000 curveType: null, 1001 RDPsmoothing: false, // Apply the Ramer-Douglas-Peuker algorithm 1002 numberPointsHigh: 1600, // Number of points on curves after mouseUp 1003 numberPointsLow: 400, // Number of points on curves after mousemove 1004 doAdvancedPlot: true, // Use a recursive bisection algorithm 1005 // It is slower, but the result is better 1006 doAdvancedPlotOld: false, // Use the algorithm by Gillam and Hohenwarter, which was default until version 0.98 1007 1008 label: { 1009 position: 'lft' 1010 } 1011 1012 /**#@-*/ 1013 }, 1014 1015 glider: { 1016 /**#@+ 1017 * @visprop 1018 */ 1019 1020 label: {} 1021 /**#@-*/ 1022 }, 1023 1024 /* special grid options */ 1025 grid: { 1026 /**#@+ 1027 * @visprop 1028 */ 1029 1030 /* grid styles */ 1031 needsRegularUpdate: false, 1032 hasGrid: false, 1033 gridX: 1, 1034 gridY: 1, 1035 //strokeColor: '#C0C0C0', 1036 strokeColor: '#C0C0C0', 1037 strokeOpacity: 0.5, 1038 strokeWidth: 1, 1039 dash: 0, // dashed grids slow down the iPad considerably 1040 /* snap to grid options */ 1041 1042 /** 1043 * @deprecated 1044 */ 1045 snapToGrid: false, 1046 /** 1047 * @deprecated 1048 */ 1049 snapSizeX: 10, 1050 /** 1051 * @deprecated 1052 */ 1053 snapSizeY: 10 1054 1055 /**#@-*/ 1056 }, 1057 1058 /* special html slider options */ 1059 htmlslider: { 1060 /**#@+ 1061 * @visprop 1062 */ 1063 1064 /** 1065 * 1066 * These affect the DOM element input type="range". 1067 * The other attributes affect the DOM element div containing the range element. 1068 */ 1069 widthRange: 100, 1070 widthOut: 34, 1071 step: 0.01, 1072 1073 frozen: true, 1074 isLabel: false, 1075 strokeColor: 'black', 1076 display: 'html', 1077 anchorX: 'left', 1078 anchorY: 'middle', 1079 withLabel: false 1080 1081 /**#@-*/ 1082 }, 1083 1084 1085 /* special grid options */ 1086 image: { 1087 /**#@+ 1088 * @visprop 1089 */ 1090 1091 imageString: null, 1092 fillOpacity: 1.0, 1093 cssClass: 'JXGimage', 1094 highlightCssClass: 'JXGimageHighlight', 1095 rotate: 0, 1096 1097 /** 1098 * Defines together with {@link JXG.Point#snapSizeY} the grid the point snaps on to. 1099 * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. 1100 * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks 1101 * of the default ticks of the default x axes of the board. 1102 * @see JXG.Point#snapToGrid 1103 * @see JXG.Point#snapSizeY 1104 * @see JXG.Board#defaultAxes 1105 * @type Number 1106 * @name JXG.Point#snapSizeX 1107 * @default 1 1108 */ 1109 snapSizeX: 1, 1110 1111 /** 1112 * Defines together with {@link JXG.Point#snapSizeX} the grid the point snaps on to. 1113 * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. 1114 * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks 1115 * of the default ticks of the default y axes of the board. 1116 * @see JXG.Point#snapToGrid 1117 * @see JXG.Point#snapSizeX 1118 * @see JXG.Board#defaultAxes 1119 * @type Number 1120 * @name JXG.Point#snapSizeY 1121 * @default 1 1122 */ 1123 snapSizeY: 1 1124 /**#@-*/ 1125 }, 1126 1127 /* special options for incircle of 3 points */ 1128 incircle: { 1129 /**#@+ 1130 * @visprop 1131 */ 1132 1133 fillColor: 'none', 1134 highlightFillColor: 'none', 1135 strokeColor: '#0000ff', 1136 highlightStrokeColor: '#C3D9FF', 1137 center: { // center point 1138 visible: false, 1139 fixed: false, 1140 withLabel: false, 1141 name: '' 1142 } 1143 /**#@-*/ 1144 }, 1145 1146 inequality: { 1147 /**#@+ 1148 * @visprop 1149 */ 1150 1151 fillColor: 'red', 1152 fillOpacity: 0.2, 1153 strokeColor: 'none', 1154 1155 /** 1156 * By default an inequality is less (or equal) than. Set inverse to <tt>true</tt> will consider the inequality 1157 * greater (or equal) than. 1158 * @type Boolean 1159 * @default false 1160 * @name Inequality#inverse 1161 * @visprop 1162 */ 1163 inverse: false 1164 /**#@-*/ 1165 }, 1166 1167 infobox: { 1168 /**#@+ 1169 * @visprop 1170 */ 1171 1172 fontSize: 12, 1173 isLabel: false, 1174 strokeColor: '#bbbbbb', 1175 display: 'html', // 'html' or 'internal' 1176 anchorX: 'left', // 'left', 'middle', or 'right': horizontal alignment of the text. 1177 anchorY: 'middle', // 'top', 'middle', or 'bottom': vertical alignment of the text. 1178 cssClass: 'JXGinfobox', 1179 rotate: 0, // works for non-zero values only in combination with display=='internal' 1180 visible: true, 1181 parse: false 1182 1183 /**#@-*/ 1184 }, 1185 1186 1187 /* special options for integral */ 1188 integral: { 1189 /**#@+ 1190 * @visprop 1191 */ 1192 1193 axis: 'x', // 'x' or 'y' 1194 withLabel: true, // Show integral value as text 1195 strokeWidth: 0, 1196 strokeOpacity: 0, 1197 fillOpacity: 0.8, 1198 curveLeft: { // Start point 1199 visible: true, 1200 withLabel: false, 1201 layer: 9 1202 }, 1203 baseLeft: { // Start point 1204 visible: false, 1205 fixed: false, 1206 withLabel: false, 1207 name: '' 1208 }, 1209 curveRight: { // End point 1210 visible: true, 1211 withLabel: false, 1212 layer: 9 1213 }, 1214 baseRight: { // End point 1215 visible: false, 1216 fixed: false, 1217 withLabel: false, 1218 name: '' 1219 }, 1220 label: { 1221 fontSize: 20 1222 } 1223 /**#@-*/ 1224 }, 1225 1226 /* special intersection point options */ 1227 intersection: { 1228 /**#@+ 1229 * @visprop 1230 */ 1231 /** 1232 * Used in {@link JXG.Intersection}. 1233 * This flag sets the behaviour of intersection points of e.g. 1234 * two segments. If true, the intersection is treated as intersection of lines. If false 1235 * the intersection point exists if the segments intersect setwise. 1236 * @name JXG.Intersection.alwaysIntersect 1237 * @type Boolean 1238 * @default true 1239 */ 1240 alwaysIntersect: true 1241 /**#@-*/ 1242 }, 1243 1244 /* special label options */ 1245 label: { 1246 /**#@+ 1247 * @visprop 1248 */ 1249 strokeColor: 'black', 1250 strokeOpacity: 1, 1251 highlightStrokeOpacity: 0.666666, 1252 highlightStrokeColor: 'black', 1253 1254 fixed: true, 1255 /** 1256 * Possible string values for the position of a label for 1257 * label anchor points are: 1258 * 'lft'|'rt'|'top'|'bot'|'ulft'|'urt'|'llft'|'lrt' 1259 * This is relevant for non-points: line, circle, curve. 1260 * @type String 1261 * @default 'urt' 1262 * @name JXG.GeometryElement#label.position 1263 */ 1264 position: 'urt', 1265 1266 /** 1267 * Label offset from label anchor 1268 * The label anchor is determined by JXG.GeometryElement#label.position 1269 * @type Array 1270 * @default [10,10] 1271 * @name JXG.GeometryElement#label.offset 1272 **/ 1273 offset: [10, 10] 1274 1275 /**#@-*/ 1276 }, 1277 1278 /* special legend options */ 1279 legend: { 1280 /** 1281 * @visprop 1282 */ 1283 style: 'vertical', 1284 labels: ['1', '2', '3', '4', '5', '6', '7', '8'], 1285 colors: ['#B02B2C', '#3F4C6B', '#C79810', '#D15600', '#FFFF88', '#C3D9FF', '#4096EE', '#008C00'] 1286 /**#@-*/ 1287 }, 1288 1289 /* special line options */ 1290 line: { 1291 /**#@+ 1292 * @visprop 1293 */ 1294 1295 firstArrow: false, 1296 lastArrow: false, 1297 straightFirst: true, 1298 straightLast: true, 1299 fillColor: 'none', // Important for VML on IE 1300 highlightFillColor: 'none', // Important for VML on IE 1301 strokeColor: '#0000ff', 1302 highlightStrokeColor: '#888888', 1303 withTicks: false, 1304 1305 point1: { // Default values for point1 if created by line 1306 visible: false, 1307 withLabel: false, 1308 fixed: false, 1309 name: '' 1310 }, 1311 point2: { // Default values for point2 if created by line 1312 visible: false, 1313 withLabel: false, 1314 fixed: false, 1315 name: '' 1316 }, 1317 ticks: { 1318 drawLabels: true, 1319 label: { 1320 offset: [4, -12 + 3] // This seems to be a good offset for 12 point fonts 1321 }, 1322 drawZero: false, 1323 insertTicks: false, 1324 minTicksDistance: 50, 1325 minorHeight: 4, // if <0: full width and height 1326 majorHeight: -1, // if <0: full width and height 1327 minorTicks: 4, 1328 defaultDistance: 1, 1329 strokeOpacity: 0.3 1330 }, 1331 1332 label: { 1333 position: 'llft' 1334 }, 1335 1336 /** 1337 * If set to true, the point will snap to a grid defined by 1338 * {@link JXG.Point#snapSizeX} and {@link JXG.Point#snapSizeY}. 1339 * @see JXG.Point#snapSizeX 1340 * @see JXG.Point#snapSizeY 1341 * @type Boolean 1342 * @name JXG.Point#snapToGrid 1343 * @default false 1344 */ 1345 snapToGrid: false, 1346 1347 /** 1348 * Defines together with {@link JXG.Point#snapSizeY} the grid the point snaps on to. 1349 * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. 1350 * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks 1351 * of the default ticks of the default x axes of the board. 1352 * @see JXG.Point#snapToGrid 1353 * @see JXG.Point#snapSizeY 1354 * @see JXG.Board#defaultAxes 1355 * @type Number 1356 * @name JXG.Point#snapSizeX 1357 * @default 1 1358 */ 1359 snapSizeX: 1, 1360 1361 /** 1362 * Defines together with {@link JXG.Point#snapSizeX} the grid the point snaps on to. 1363 * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. 1364 * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks 1365 * of the default ticks of the default y axes of the board. 1366 * @see JXG.Point#snapToGrid 1367 * @see JXG.Point#snapSizeX 1368 * @see JXG.Board#defaultAxes 1369 * @type Number 1370 * @name JXG.Point#snapSizeY 1371 * @default 1 1372 */ 1373 snapSizeY: 1 1374 /**#@-*/ 1375 }, 1376 1377 /* special options for locus curves */ 1378 locus: { 1379 /**#@+ 1380 * @visprop 1381 */ 1382 1383 translateToOrigin: false, 1384 translateTo10: false, 1385 stretch: false, 1386 toOrigin: null, 1387 to10: null 1388 /**#@-*/ 1389 }, 1390 1391 /* special options for normal lines */ 1392 normal: { 1393 /**#@+ 1394 * @visprop 1395 */ 1396 1397 strokeColor: '#000000', // normal line 1398 point: { 1399 visible: false, 1400 fixed: false, 1401 withLabel: false, 1402 name: '' 1403 } 1404 /**#@-*/ 1405 }, 1406 1407 /* special options for orthogonal projectionn points */ 1408 orthogonalprojection: { 1409 /**#@+ 1410 * @visprop 1411 */ 1412 1413 1414 /**#@-*/ 1415 }, 1416 1417 /* special options for parallel lines */ 1418 parallel: { 1419 /**#@+ 1420 * @visprop 1421 */ 1422 1423 strokeColor: '#000000', // Parallel line 1424 point: { 1425 visible: false, 1426 fixed: false, 1427 withLabel: false, 1428 name: '' 1429 }, 1430 label: { 1431 position: 'llft' 1432 } 1433 /**#@-*/ 1434 }, 1435 1436 /* special perpendicular options */ 1437 perpendicular: { 1438 /**#@+ 1439 * @visprop 1440 */ 1441 1442 strokeColor: '#000000', // Perpendicular line 1443 straightFirst: true, 1444 straightLast: true 1445 /**#@-*/ 1446 }, 1447 1448 /* special perpendicular options */ 1449 perpendicularsegment: { 1450 /**#@+ 1451 * @visprop 1452 */ 1453 1454 strokeColor: '#000000', // Perpendicular segment 1455 straightFirst: false, 1456 straightLast: false, 1457 point: { // Perpendicular point 1458 visible: false, 1459 fixed: true, 1460 withLabel: false, 1461 name: '' 1462 } 1463 /**#@-*/ 1464 }, 1465 1466 /* special point options */ 1467 point: { 1468 /**#@+ 1469 * @visprop 1470 */ 1471 1472 withLabel: true, 1473 label: {}, 1474 1475 /** 1476 * This attribute was used to determined the point layout. It was derived from GEONExT and was 1477 * replaced by {@link JXG.Point#face} and {@link JXG.Point#size}. 1478 * @see JXG.Point#face 1479 * @see JXG.Point#size 1480 * @type Number 1481 * @default JXG.Options.point#style 1482 * @name JXG.Point#style 1483 * @deprecated 1484 */ 1485 style: 5, 1486 1487 /** 1488 * There are different point styles which differ in appearance. 1489 * Posssible values are 1490 * <table><tr><th>Value</th></tr> 1491 * <tr><td>cross</td></tr> 1492 * <tr><td>circle</td></tr> 1493 * <tr><td>square</td></tr> 1494 * <tr><td>plus</td></tr> 1495 * <tr><td>diamond</td></tr> 1496 * <tr><td>triangleUp</td></tr> 1497 * <tr><td>triangleDown</td></tr> 1498 * <tr><td>triangleLeft</td></tr> 1499 * <tr><td>triangleRight</td></tr> 1500 * </table> 1501 * @type string 1502 * @see JXG.Point#setStyle 1503 * @default circle 1504 * @name JXG.Point#face 1505 */ 1506 face: 'o', 1507 1508 /** 1509 * Size of a point. 1510 * Means radius resp. half the width of a point (depending on the face). 1511 * @see JXG.Point#face 1512 * @type number 1513 * @see JXG.Point#setStyle 1514 * @default 3 1515 * @name JXG.Point#size 1516 */ 1517 size: 3, 1518 fillColor: '#ff0000', 1519 highlightFillColor: '#EEEEEE', 1520 strokeWidth: 2, 1521 strokeColor: '#ff0000', 1522 highlightStrokeColor: '#C3D9FF', 1523 zoom: false, // Change the point size on zoom 1524 1525 /** 1526 * If true, the infobox is shown on mouse over, else not. 1527 * @name JXG.Point#showInfobox 1528 * @type Boolean 1529 * @default true 1530 */ 1531 showInfobox: true, 1532 1533 /** 1534 * Truncating rule for the digits in the infobox. 1535 * 'auto': done automatically by JXG#autoDigits 1536 * 'none': no truncation 1537 * number: use String.toFixed(); 1538 * @name JXG.Point#showInfobox 1539 * @type String, Number 1540 * @default true 1541 */ 1542 infoboxDigits: 'auto', 1543 1544 draft: false, 1545 1546 /** 1547 * List of attractor elements. If the distance of the point is less than 1548 * attractorDistance the point is made to glider of this element. 1549 * @type array 1550 * @name JXG.Point#attractors 1551 * @default empty 1552 */ 1553 attractors: [], 1554 1555 /** 1556 * Unit for attractorDistance and snatchDistance, used for magnetized points and for snapToPoints. 1557 * Possible values are 'screen' and 'user. 1558 * @see JXG.Point#attractorDistance 1559 * @see JXG.Point#snatchDistance 1560 * @see JXG.Point#snapToPoints 1561 * @see JXG.Point#attractors 1562 * @type string 1563 * @name JXG.Point#attractorDistance 1564 * @default 'user' 1565 */ 1566 attractorUnit: 'user', // 'screen', 'user' 1567 1568 /** 1569 * If the distance of the point to one of its attractors is less 1570 * than this number the point will be a glider on this 1571 * attracting element. 1572 * If set to zero nothing happens. 1573 * @type number 1574 * @name JXG.Point#attractorDistance 1575 * @default 0 1576 */ 1577 attractorDistance: 0.0, 1578 1579 /** 1580 * If the distance of the point to one of its attractors is at least 1581 * this number the point will be released from being a glider on the 1582 * attracting element. 1583 * If set to zero nothing happens. 1584 * @type number 1585 * @name JXG.Point#snatchDistance 1586 * @default 0 1587 */ 1588 snatchDistance: 0.0, 1589 1590 /** 1591 * If set to true, the point will snap to a grid defined by 1592 * {@link JXG.Point#snapSizeX} and {@link JXG.Point#snapSizeY}. 1593 * @see JXG.Point#snapSizeX 1594 * @see JXG.Point#snapSizeY 1595 * @type Boolean 1596 * @name JXG.Point#snapToGrid 1597 * @default false 1598 */ 1599 snapToGrid: false, 1600 1601 /** 1602 * Defines together with {@link JXG.Point#snapSizeY} the grid the point snaps on to. 1603 * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. 1604 * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks 1605 * of the default ticks of the default x axes of the board. 1606 * @see JXG.Point#snapToGrid 1607 * @see JXG.Point#snapSizeY 1608 * @see JXG.Board#defaultAxes 1609 * @type Number 1610 * @name JXG.Point#snapSizeX 1611 * @default 1 1612 */ 1613 snapSizeX: 1, 1614 1615 /** 1616 * Defines together with {@link JXG.Point#snapSizeX} the grid the point snaps on to. 1617 * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. 1618 * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks 1619 * of the default ticks of the default y axes of the board. 1620 * @see JXG.Point#snapToGrid 1621 * @see JXG.Point#snapSizeX 1622 * @see JXG.Board#defaultAxes 1623 * @type Number 1624 * @name JXG.Point#snapSizeY 1625 * @default 1 1626 */ 1627 snapSizeY: 1, 1628 1629 /** 1630 * If set to true, the point will snap to the nearest point in distance of 1631 * {@link JXG.Point#attractorDistance}. 1632 * @see JXG.Point#attractorDistance 1633 * @type Boolean 1634 * @name JXG.Point#snapToPoints 1635 * @default false 1636 */ 1637 snapToPoints: false 1638 1639 /**#@-*/ 1640 }, 1641 1642 /* special polygon options */ 1643 polygon: { 1644 /**#@+ 1645 * @visprop 1646 */ 1647 1648 /** 1649 * If <tt>true</tt>, moving the mouse over inner points triggers hasPoint. 1650 * @see JXG.GeometryElement#hasPoint 1651 * @name JXG.Polygon#hasInnerPoints 1652 * @type Boolean 1653 * @default false 1654 */ 1655 hasInnerPoints: false, 1656 fillColor: '#00FF00', 1657 highlightFillColor: '#00FF00', 1658 fillOpacity: 0.3, 1659 highlightFillOpacity: 0.3, 1660 1661 /** 1662 * Is the polygon bordered by lines? 1663 * @type Boolean 1664 * @name JXG.Polygon#withLines 1665 * @default true 1666 */ 1667 withLines: true, 1668 1669 /**#@-*/ 1670 1671 borders: { 1672 withLabel: false, 1673 strokeWidth: 1, 1674 highlightStrokeWidth: 1, 1675 // Polygon layer + 1 1676 layer: 5, 1677 label: { 1678 position: 'top' 1679 } 1680 }, 1681 1682 /** 1683 * Points for regular polygons 1684 */ 1685 vertices: { 1686 withLabel: true, 1687 strokeColor: '#ff0000', 1688 fillColor: '#ff0000', 1689 fixed: true 1690 }, 1691 1692 label: { 1693 offset: [0, 0] 1694 } 1695 }, 1696 1697 /* special prescribed angle options */ 1698 prescribedangle: { 1699 /**#@+ 1700 * @visprop 1701 */ 1702 1703 anglepoint: { 1704 size: 2, 1705 visible: false, 1706 withLabel: false 1707 } 1708 /**#@-*/ 1709 }, 1710 1711 /* special options for riemann sums */ 1712 riemannsum: { 1713 /**#@+ 1714 * @visprop 1715 */ 1716 1717 withLabel: false, 1718 fillOpacity: 0.3, 1719 fillColor: '#ffff00' 1720 /**#@-*/ 1721 }, 1722 1723 /* special sector options */ 1724 sector: { 1725 /**#@+ 1726 * @visprop 1727 */ 1728 1729 fillColor: '#00FF00', 1730 highlightFillColor: '#00FF00', 1731 fillOpacity: 0.3, 1732 highlightFillOpacity: 0.3, 1733 highlightOnSector: false, 1734 radiuspoint: { 1735 visible: false, 1736 withLabel: false 1737 }, 1738 center: { 1739 visible: false, 1740 withLabel: false 1741 }, 1742 anglepoint: { 1743 visible: false, 1744 withLabel: false 1745 }, 1746 label: { 1747 offset: [0, 0] 1748 } 1749 /**#@-*/ 1750 }, 1751 1752 /* special segment options */ 1753 segment: { 1754 /**#@+ 1755 * @visprop 1756 */ 1757 1758 label: { 1759 position: 'top' 1760 } 1761 /**#@-*/ 1762 }, 1763 1764 semicircle: { 1765 /**#@+ 1766 * @visprop 1767 */ 1768 1769 midpoint: { 1770 visible: false, 1771 withLabel: false, 1772 fixed: false, 1773 name: '' 1774 } 1775 /**#@-*/ 1776 }, 1777 1778 /* special slider options */ 1779 slider: { 1780 /**#@+ 1781 * @visprop 1782 */ 1783 1784 /** 1785 * The slider only returns integer multiples of this value, e.g. for discrete values set this property to <tt>1</tt>. For 1786 * continuous results set this to <tt>-1</tt>. 1787 * @memberOf Slider.prototype 1788 * @name snapWidth 1789 * @type Number 1790 */ 1791 snapWidth: -1, // -1 = deactivated 1792 1793 /** 1794 * The precision of the slider value displayed in the optional text. 1795 * @memberOf Slider.prototype 1796 * @name precision 1797 * @type Number 1798 */ 1799 precision: 2, 1800 firstArrow: false, 1801 lastArrow: false, 1802 withTicks: true, 1803 withLabel: true, 1804 1805 layer: 9, 1806 showInfobox: false, 1807 name: '', 1808 visible: true, 1809 strokeColor: '#000000', 1810 highlightStrokeColor: '#888888', 1811 fillColor: '#ffffff', 1812 highlightFillColor: 'none', 1813 size: 6, 1814 1815 /**#@-*/ 1816 1817 point1: { 1818 needsRegularUpdate: false, 1819 showInfobox: false, 1820 withLabel: false, 1821 visible: false, 1822 fixed: true, 1823 name: '' 1824 }, 1825 point2: { 1826 needsRegularUpdate: false, 1827 showInfobox: false, 1828 withLabel: false, 1829 visible: false, 1830 fixed: true, 1831 name: '' 1832 }, 1833 baseline: { 1834 needsRegularUpdate: false, 1835 fixed: true, 1836 name: '', 1837 strokeWidth: 1, 1838 strokeColor: '#000000', 1839 highlightStrokeColor: '#888888' 1840 }, 1841 /* line ticks options */ 1842 ticks: { 1843 needsRegularUpdate: false, 1844 fixed: true, 1845 drawLabels: false, 1846 drawZero: true, 1847 insertTicks: true, 1848 minorHeight: 4, // if <0: full width and height 1849 majorHeight: 10, // if <0: full width and height 1850 minorTicks: 0, 1851 defaultDistance: 1, 1852 strokeOpacity: 1, 1853 strokeWidth: 1, 1854 strokeColor: '#000000' 1855 }, 1856 highline: { 1857 strokeWidth: 3, 1858 fixed: true, 1859 name: '', 1860 strokeColor: '#000000', 1861 highlightStrokeColor: '#888888' 1862 }, 1863 label: { 1864 strokeColor: '#000000' 1865 } 1866 }, 1867 1868 /* special options for slope triangle */ 1869 slopetriangle: { 1870 /**#@+ 1871 * @visprop 1872 */ 1873 1874 fillColor: 'red', 1875 fillOpacity: 0.4, 1876 highlightFillColor: 'red', 1877 highlightFillOpacity: 0.3, 1878 1879 glider: { 1880 fixed: true, 1881 visible: false, 1882 withLabel: false 1883 }, 1884 1885 baseline: { 1886 visible: false, 1887 withLabel: false, 1888 name: '' 1889 }, 1890 1891 basepoint: { 1892 visible: false, 1893 withLabel: false, 1894 name: '' 1895 }, 1896 1897 toppoint: { 1898 visible: false, 1899 withLabel: false, 1900 name: '' 1901 }, 1902 1903 label: { 1904 visible: true 1905 } 1906 /**#@-*/ 1907 }, 1908 1909 /* special options for step functions */ 1910 stepfunction: { 1911 /**#@+ 1912 * @visprop 1913 */ 1914 1915 /**#@-*/ 1916 }, 1917 1918 /* special tape measure options */ 1919 tapemeasure: { 1920 /**#@+ 1921 * @visprop 1922 */ 1923 1924 strokeColor: '#000000', 1925 strokeWidth: 2, 1926 highlightStrokeColor: '#000000', 1927 withTicks: true, 1928 withLabel: true, 1929 precision: 2, 1930 1931 //layer: 9, 1932 point1: { 1933 strokeColor: '#000000', 1934 fillColor: '#ffffff', 1935 fillOpacity: 0.0, 1936 highlightFillOpacity: 0.1, 1937 size: 6, 1938 snapToPoints: true, 1939 attractorUnit: 'screen', 1940 attractorDistance: 20, 1941 showInfobox: false, 1942 withLabel: false, 1943 name: '' 1944 }, 1945 point2: { 1946 strokeColor: '#000000', 1947 fillColor: '#ffffff', 1948 fillOpacity: 0.0, 1949 highlightFillOpacity: 0.1, 1950 size: 6, 1951 snapToPoints: true, 1952 attractorUnit: 'screen', 1953 attractorDistance: 20, 1954 showInfobox: false, 1955 withLabel: false, 1956 name: '' 1957 }, 1958 ticks: { 1959 drawLabels: false, 1960 drawZero: true, 1961 insertTicks: true, 1962 minorHeight: 8, 1963 majorHeight: 16, 1964 minorTicks: 4, 1965 tickEndings: [0, 1], 1966 defaultDistance: 0.1, 1967 strokeOpacity: 1, 1968 strokeWidth: 1, 1969 strokeColor: '#000000' 1970 }, 1971 1972 label: { 1973 position: 'top' 1974 } 1975 /**#@-*/ 1976 }, 1977 1978 /* special text options */ 1979 text: { 1980 /**#@+ 1981 * @visprop 1982 */ 1983 1984 /** 1985 * The font size in pixels. 1986 * @memberOf Text.prototype 1987 * @default 12 1988 * @name fontSize 1989 * @type Number 1990 */ 1991 fontSize: 12, 1992 1993 /** 1994 * Used to round texts given by a number. 1995 * @memberOf Text.prototype 1996 * @default 2 1997 * @name digits 1998 * @type Number 1999 */ 2000 digits: 2, 2001 2002 /** 2003 * If set to 2004 * @memberOf Text.prototype 2005 * @default true 2006 * @name parse 2007 * @type Boolean 2008 */ 2009 parse: true, 2010 2011 /** 2012 * If set to true and caja's sanitizeHTML function can be found it 2013 * will be used to sanitize text output. 2014 * @memberOf Text.prototype 2015 * @default false 2016 * @name useCaja 2017 * @type Boolean 2018 */ 2019 useCaja: false, 2020 2021 /** 2022 * If enabled, the text will be handled as label. Intended for internal use. 2023 * @memberOf Text.prototype 2024 * @default false 2025 * @name isLabel 2026 * @type Boolean 2027 */ 2028 isLabel: false, 2029 2030 strokeColor: 'black', 2031 highlightStrokeColor: 'black', 2032 highlightStrokeOpacity: 0.666666, 2033 2034 /** 2035 * If true the input will be given to ASCIIMathML before rendering. 2036 * @memberOf Text.prototype 2037 * @default false 2038 * @name useASCIIMathML 2039 * @type Boolean 2040 */ 2041 useASCIIMathML: false, 2042 2043 /** 2044 * If true MathJax will be used to render the input string. 2045 * @memberOf Text.prototype 2046 * @default false 2047 * @name useMathJax 2048 * @type Boolean 2049 */ 2050 useMathJax: false, 2051 2052 /** 2053 * Determines the rendering method of the text. Possible values 2054 * include <tt>'html'</tt> and <tt>'internal</tt>. 2055 * @memberOf Text.prototype 2056 * @default 'html' 2057 * @name display 2058 * @type String 2059 */ 2060 display: 'html', 2061 2062 /** 2063 * The horizontal alignment of the text. Possible values include <tt>'left'</tt>, <tt>'middle'</tt>, and 2064 * <tt>'right'</tt>. 2065 * @memberOf Text.prototype 2066 * @default 'left' 2067 * @name anchorX 2068 * @type String 2069 */ 2070 anchorX: 'left', 2071 2072 /** 2073 * The vertical alignment of the text. Possible values include <tt>'top'</tt>, <tt>'middle'</tt>, and 2074 * <tt>'bottom'</tt>. 2075 * @memberOf Text.prototype 2076 * @default 'middle' 2077 * @name anchorY 2078 * @type String 2079 */ 2080 anchorY: 'middle', 2081 /** 2082 * The precision of the slider value displayed in the optional text. 2083 * @memberOf Text.prototype 2084 * @name cssClass 2085 * @type String 2086 */ 2087 cssClass: 'JXGtext', 2088 2089 /** 2090 * The precision of the slider value displayed in the optional text. 2091 * @memberOf Text.prototype 2092 * @name highlightCssClass 2093 * @type String 2094 */ 2095 highlightCssClass: 'JXGtext', 2096 dragArea: 'all', // 'all', or something else (may be extended to left, right, ...) 2097 withLabel: false, 2098 rotate: 0, // works for non-zero values only in combination with display=='internal' 2099 visible: true, 2100 2101 /** 2102 * Defines together with {@link JXG.Point#snapSizeY} the grid the point snaps on to. 2103 * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. 2104 * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks 2105 * of the default ticks of the default x axes of the board. 2106 * @see JXG.Point#snapToGrid 2107 * @see JXG.Point#snapSizeY 2108 * @see JXG.Board#defaultAxes 2109 * @type Number 2110 * @name JXG.Point#snapSizeX 2111 * @default 1 2112 */ 2113 snapSizeX: 1, 2114 2115 /** 2116 * Defines together with {@link JXG.Point#snapSizeX} the grid the point snaps on to. 2117 * The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. 2118 * If this value is equal to or less than <tt>0</tt>, it will use the grid displayed by the major ticks 2119 * of the default ticks of the default y axes of the board. 2120 * @see JXG.Point#snapToGrid 2121 * @see JXG.Point#snapSizeX 2122 * @see JXG.Board#defaultAxes 2123 * @type Number 2124 * @name JXG.Point#snapSizeY 2125 * @default 1 2126 */ 2127 snapSizeY: 1 2128 2129 /**#@-*/ 2130 }, 2131 2132 /* special options for trace curves */ 2133 tracecurve: { 2134 /**#@+ 2135 * @visprop 2136 */ 2137 strokeColor: '#000000', 2138 fillColor: 'none', 2139 2140 /** 2141 * The number of evaluated data points. 2142 * @memberOf Tracecurve.prototype 2143 * @default 100 2144 * @name numberPoints 2145 * @type Number 2146 */ 2147 numberPoints: 100 2148 2149 /**#@-*/ 2150 }, 2151 2152 /*special turtle options */ 2153 turtle: { 2154 /**#@+ 2155 * @visprop 2156 */ 2157 2158 strokeWidth: 1, 2159 fillColor: 'none', 2160 strokeColor: '#000000', 2161 arrow: { 2162 strokeWidth: 2, 2163 withLabel: false, 2164 strokeColor: '#ff0000' 2165 } 2166 /**#@-*/ 2167 }, 2168 2169 2170 /** 2171 * Abbreviations of properties. Setting the shortcut means setting abbreviated properties 2172 * to the same value. 2173 * It is used in JXG.GeometryElement#setAttribute and in 2174 * the constructor JXG.GeometryElement. 2175 * Attention: In Options.js abbreviations are not allowed. 2176 */ 2177 shortcuts: { 2178 color: ['strokeColor', 'fillColor'], 2179 opacity: ['strokeOpacity', 'fillOpacity'], 2180 highlightColor: ['highlightStrokeColor', 'highlightFillColor'], 2181 highlightOpacity: ['highlightStrokeOpacity', 'highlightFillOpacity'], 2182 strokeWidth: ['strokeWidth', 'highlightStrokeWidth'] 2183 } 2184 2185 }; 2186 2187 /** 2188 * Holds all possible properties and the according validators for geometry elements. A validator is either a function 2189 * which takes one parameter and returns true, if the value is valid for the property, or it is false if no validator 2190 * is required. 2191 */ 2192 JXG.Validator = (function () { 2193 var i, 2194 validatePixel = function (v) { 2195 return (/^[0-9]+px$/).test(v); 2196 }, 2197 validateDisplay = function (v) { 2198 return (v === 'html' || v === 'internal'); 2199 }, 2200 validateColor = function (v) { 2201 // for now this should do it... 2202 return Type.isString(v); 2203 }, 2204 validatePointFace = function (v) { 2205 return Type.exists(JXG.normalizePointFace(v)); 2206 }, 2207 validateInteger = function (v) { 2208 return (Math.abs(v - Math.round(v)) < Mat.eps); 2209 }, 2210 validatePositiveInteger = function (v) { 2211 return validateInteger(v) && v > 0; 2212 }, 2213 validateScreenCoords = function (v) { 2214 return v.length >= 2 && validateInteger(v[0]) && validateInteger(v[1]); 2215 }, 2216 validateRenderer = function (v) { 2217 return (v === 'vml' || v === 'svg' || v === 'canvas' || v === 'no'); 2218 }, 2219 validatePositive = function (v) { 2220 return v > 0; 2221 }, 2222 validateNotNegative = function (v) { 2223 return v >= 0; 2224 }, 2225 v = {}, 2226 validators = { 2227 attractorDistance: validateNotNegative, 2228 color: validateColor, 2229 defaultDistance: Type.isNumber, 2230 display: validateDisplay, 2231 doAdvancedPlot: false, 2232 draft: false, 2233 drawLabels: false, 2234 drawZero: false, 2235 face: validatePointFace, 2236 factor: Type.isNumber, 2237 fillColor: validateColor, 2238 fillOpacity: Type.isNumber, 2239 firstArrow: false, 2240 fontSize: validateInteger, 2241 dash: validateInteger, 2242 gridX: Type.isNumber, 2243 gridY: Type.isNumber, 2244 hasGrid: false, 2245 highlightFillColor: validateColor, 2246 highlightFillOpacity: Type.isNumber, 2247 highlightStrokeColor: validateColor, 2248 highlightStrokeOpacity: Type.isNumber, 2249 insertTicks: false, 2250 //: validateScreenCoords, 2251 lastArrow: false, 2252 majorHeight: validateInteger, 2253 minorHeight: validateInteger, 2254 minorTicks: validatePositiveInteger, 2255 minTicksDistance: validatePositiveInteger, 2256 numberPointsHigh: validatePositiveInteger, 2257 numberPointsLow: validatePositiveInteger, 2258 opacity: Type.isNumber, 2259 radius: Type.isNumber, 2260 RDPsmoothing: false, 2261 renderer: validateRenderer, 2262 right: validatePixel, 2263 showCopyright: false, 2264 showInfobox: false, 2265 showNavigation: false, 2266 size: validateInteger, 2267 snapSizeX: validatePositive, 2268 snapSizeY: validatePositive, 2269 snapWidth: Type.isNumber, 2270 snapToGrid: false, 2271 snatchDistance: validateNotNegative, 2272 straightFirst: false, 2273 straightLast: false, 2274 stretch: false, 2275 strokeColor: validateColor, 2276 strokeOpacity: Type.isNumber, 2277 strokeWidth: validateInteger, 2278 takeFirst: false, 2279 takeSizeFromFile: false, 2280 to10: false, 2281 toOrigin: false, 2282 translateTo10: false, 2283 translateToOrigin: false, 2284 useASCIIMathML: false, 2285 useDirection: false, 2286 useMathJax: false, 2287 withLabel: false, 2288 withTicks: false, 2289 zoom: false 2290 }; 2291 2292 // this seems like a redundant step but it makes sure that 2293 // all properties in the validator object have lower case names 2294 // and the validator object is easier to read. 2295 for (i in validators) { 2296 if (validators.hasOwnProperty(i)) { 2297 v[i.toLowerCase()] = validators[i]; 2298 } 2299 } 2300 2301 return v; 2302 }()); 2303 2304 /** 2305 * All point faces can be defined with more than one name, e.g. a cross faced point can be given 2306 * by face equal to 'cross' or equal to 'x'. This method maps all possible values to fixed ones to 2307 * simplify if- and switch-clauses regarding point faces. The translation table is as follows: 2308 * <table> 2309 * <tr><th>Input</th><th>Output</th></tr> 2310 * <tr><td>cross, x</td><td>x</td></tr> 2311 * <tr><td>circle, o</td><td>o</td></tr> 2312 * <tr><td>square, []</td><td>[]</td></tr> 2313 * <tr><td>plus, +</td><td>+</td></tr> 2314 * <tr><td>diamond, <></td><td><></td></tr> 2315 * <tr><td>triangleup, a, ^</td><td>A</td></tr> 2316 * <tr><td>triangledown, v</td><td>v</td></tr> 2317 * <tr><td>triangleleft, <</td><td><</td></tr> 2318 * <tr><td>triangleright, ></td><td>></td></tr> 2319 * </table> 2320 * @param {String} s A string which should determine a valid point face. 2321 * @returns {String} Returns a normalized string or undefined if the given string is not a valid 2322 * point face. 2323 */ 2324 JXG.normalizePointFace = function (s) { 2325 var map = { 2326 cross: 'x', 2327 x: 'x', 2328 circle: 'o', 2329 o: 'o', 2330 square: '[]', 2331 '[]': '[]', 2332 plus: '+', 2333 '+': '+', 2334 diamond: '<>', 2335 '<>': '<>', 2336 triangleup: '^', 2337 a: '^', 2338 '^': '^', 2339 triangledown: 'v', 2340 v: 'v', 2341 triangleleft: '<', 2342 '<': '<', 2343 triangleright: '>', 2344 '>': '>' 2345 }; 2346 2347 return map[s]; 2348 }; 2349 2350 2351 /** 2352 * Apply the options stored in this object to all objects on the given board. 2353 * @param {JXG.Board} board The board to which objects the options will be applied. 2354 */ 2355 JXG.useStandardOptions = function (board) { 2356 var el, t, p, copyProps, 2357 o = JXG.Options, 2358 boardHadGrid = board.hasGrid; 2359 2360 board.options.grid.hasGrid = o.grid.hasGrid; 2361 board.options.grid.gridX = o.grid.gridX; 2362 board.options.grid.gridY = o.grid.gridY; 2363 board.options.grid.gridColor = o.grid.gridColor; 2364 board.options.grid.gridOpacity = o.grid.gridOpacity; 2365 board.options.grid.gridDash = o.grid.gridDash; 2366 board.options.grid.snapToGrid = o.grid.snapToGrid; 2367 board.options.grid.snapSizeX = o.grid.SnapSizeX; 2368 board.options.grid.snapSizeY = o.grid.SnapSizeY; 2369 board.takeSizeFromFile = o.takeSizeFromFile; 2370 2371 copyProps = function (p, o) { 2372 p.visProp.fillcolor = o.fillColor; 2373 p.visProp.highlightfillcolor = o.highlightFillColor; 2374 p.visProp.strokecolor = o.strokeColor; 2375 p.visProp.highlightstrokecolor = o.highlightStrokeColor; 2376 }; 2377 2378 for (el in board.objects) { 2379 if (board.objects.hasOwnProperty(el)) { 2380 p = board.objects[el]; 2381 if (p.elementClass === Const.OBJECT_CLASS_POINT) { 2382 copyProps(p, o.point); 2383 } else if (p.elementClass === Const.OBJECT_CLASS_LINE) { 2384 copyProps(p, o.line); 2385 2386 for (t = 0; t < p.ticks.length; t++) { 2387 p.ticks[t].majorTicks = o.line.ticks.majorTicks; 2388 p.ticks[t].minTicksDistance = o.line.ticks.minTicksDistance; 2389 p.ticks[t].visProp.minorheight = o.line.ticks.minorHeight; 2390 p.ticks[t].visProp.majorheight = o.line.ticks.majorHeight; 2391 } 2392 } else if (p.elementClass === Const.OBJECT_CLASS_CIRCLE) { 2393 copyProps(p, o.circle); 2394 } else if (p.type === Const.OBJECT_TYPE_ANGLE) { 2395 copyProps(p, o.angle); 2396 } else if (p.type === Const.OBJECT_TYPE_ARC) { 2397 copyProps(p, o.arc); 2398 } else if (p.type === Const.OBJECT_TYPE_POLYGON) { 2399 copyProps(p, o.polygon); 2400 } else if (p.type === Const.OBJECT_TYPE_CONIC) { 2401 copyProps(p, o.conic); 2402 } else if (p.type === Const.OBJECT_TYPE_CURVE) { 2403 copyProps(p, o.curve); 2404 } else if (p.type === Const.OBJECT_TYPE_SECTOR) { 2405 p.arc.visProp.fillcolor = o.sector.fillColor; 2406 p.arc.visProp.highlightfillcolor = o.sector.highlightFillColor; 2407 p.arc.visProp.fillopacity = o.sector.fillOpacity; 2408 p.arc.visProp.highlightfillopacity = o.sector.highlightFillOpacity; 2409 } 2410 } 2411 } 2412 2413 board.fullUpdate(); 2414 if (boardHadGrid && !board.hasGrid) { 2415 board.removeGrids(board); 2416 } else if (!boardHadGrid && board.hasGrid) { 2417 board.create('grid', []); 2418 } 2419 }; 2420 2421 /** 2422 * Converts all color values to greyscale and calls useStandardOption to put them onto the board. 2423 * @param {JXG.Board} board The board to which objects the options will be applied. 2424 * @see #useStandardOptions 2425 */ 2426 JXG.useBlackWhiteOptions = function (board) { 2427 var o = JXG.Options; 2428 o.point.fillColor = Color.rgb2bw(o.point.fillColor); 2429 o.point.highlightFillColor = Color.rgb2bw(o.point.highlightFillColor); 2430 o.point.strokeColor = Color.rgb2bw(o.point.strokeColor); 2431 o.point.highlightStrokeColor = Color.rgb2bw(o.point.highlightStrokeColor); 2432 2433 o.line.fillColor = Color.rgb2bw(o.line.fillColor); 2434 o.line.highlightFillColor = Color.rgb2bw(o.line.highlightFillColor); 2435 o.line.strokeColor = Color.rgb2bw(o.line.strokeColor); 2436 o.line.highlightStrokeColor = Color.rgb2bw(o.line.highlightStrokeColor); 2437 2438 o.circle.fillColor = Color.rgb2bw(o.circle.fillColor); 2439 o.circle.highlightFillColor = Color.rgb2bw(o.circle.highlightFillColor); 2440 o.circle.strokeColor = Color.rgb2bw(o.circle.strokeColor); 2441 o.circle.highlightStrokeColor = Color.rgb2bw(o.circle.highlightStrokeColor); 2442 2443 o.arc.fillColor = Color.rgb2bw(o.arc.fillColor); 2444 o.arc.highlightFillColor = Color.rgb2bw(o.arc.highlightFillColor); 2445 o.arc.strokeColor = Color.rgb2bw(o.arc.strokeColor); 2446 o.arc.highlightStrokeColor = Color.rgb2bw(o.arc.highlightStrokeColor); 2447 2448 o.polygon.fillColor = Color.rgb2bw(o.polygon.fillColor); 2449 o.polygon.highlightFillColor = Color.rgb2bw(o.polygon.highlightFillColor); 2450 2451 o.sector.fillColor = Color.rgb2bw(o.sector.fillColor); 2452 o.sector.highlightFillColor = Color.rgb2bw(o.sector.highlightFillColor); 2453 2454 o.curve.strokeColor = Color.rgb2bw(o.curve.strokeColor); 2455 o.grid.gridColor = Color.rgb2bw(o.grid.gridColor); 2456 2457 JXG.useStandardOptions(board); 2458 }; 2459 2460 // needs to be exported 2461 JXG.Options.normalizePointFace = JXG.normalizePointFace; 2462 2463 return JXG.Options; 2464 }); 2465