1 /*global JXG:true, define: true*/ 2 3 import JXG from "./jxg.js"; 4 import Options from "./options.js"; 5 6 JXG.extend(Options, { 7 // infobox: { 8 // // strokeColor: 'black', 9 // // useKatex: false, 10 // // useMathjax: false 11 // }, 12 13 axes3d: { 14 /**#@+ 15 * @visprop 16 */ 17 18 /** 19 * Position of the main axes in a View3D element. Possible values are 20 * 'center', 'border' or 'none'. 21 * 22 * @type String 23 * @name View3D#axesPosition 24 * @default 'center' 25 */ 26 axesPosition: "center", // Possible values: 'center', 'border', 'none' 27 28 // Main axes 29 /** 30 * Attributes of the centered 3D x-axis. 31 * 32 * @type Line3D 33 * @name View3D#xAxis 34 * @see View3D#axesPosition 35 */ 36 xAxis: { visible: true, point2: { name: "x" }, strokeColor: JXG.palette.red }, 37 38 /** 39 * Attributes of the centered 3D y-axis. 40 * 41 * @type Line3D 42 * @name View3D#yAxis 43 * @see View3D#axesPosition 44 */ 45 yAxis: { visible: true, point2: { name: "y" }, strokeColor: JXG.palette.green }, 46 47 /** 48 * Attributes of the centered 3D z-axis. 49 * 50 * @type Line3D 51 * @name View3D#zAxis 52 * @see View3D#axesPosition 53 */ 54 zAxis: { visible: true, point2: { name: "z" }, strokeColor: JXG.palette.blue }, 55 56 /** 57 * Attributes of the 3D x-axis at the border. 58 * 59 * @type Line3D 60 * @name View3D#xAxisBorder 61 * @see View3D#axesPosition 62 * @default <pre>{ 63 * name: 'x', 64 * withLabel: false, 65 * label: { 66 * position: '50% left', 67 * offset: [30, 0], 68 * fontsize: 15 69 * }, 70 * strokeWidth: 1, 71 * lastArrow: false, 72 * ticks3d: { 73 * label: { 74 * anchorX: 'middle', 75 * anchorY: 'middle' 76 * } 77 * } 78 *} 79 *</pre> 80 */ 81 xAxisBorder: { 82 name: 'x', 83 visible: 'ìnherit', 84 withLabel: false, 85 label: { 86 position: '50% left', 87 offset: [30, 0], 88 fontsize: 15 89 }, 90 strokeWidth: 1, 91 lastArrow: false, 92 ticks3d: { 93 visible: 'ìnherit', 94 label: { 95 anchorX: 'middle', 96 anchorY: 'middle' 97 } 98 99 } 100 }, 101 102 /** 103 * Attributes of the 3D y-axis at the border. 104 * 105 * @type Line3D 106 * @name View3D#yAxisBorder 107 * @see View3D#axesPosition 108 * @default <pre>{ 109 * name: 'x', 110 * withLabel: false, 111 * label: { 112 * position: '50% right', 113 * offset: [0, -30], 114 * fontsize: 15 115 * }, 116 * strokeWidth: 1, 117 * lastArrow: false, 118 * ticks3d: { 119 * label: { 120 * anchorX: 'middle', 121 * } 122 * } 123 *} 124 *</pre> 125 */ 126 yAxisBorder: { 127 name: 'y', 128 visible: 'ìnherit', 129 withLabel: false, 130 label: { 131 position: '50% right', 132 offset: [0, -30], 133 fontsize: 15 134 }, 135 strokeWidth: 1, 136 lastArrow: false, 137 ticks3d: { 138 visible: 'ìnherit', 139 label: { 140 anchorX: 'middle' 141 } 142 } 143 }, 144 145 /** 146 * Attributes of the 3D z-axis at the border. 147 * 148 * @type Line3D 149 * @name View3D#zAxisBorder 150 * @see View3D#axesPosition 151 * @default <pre>{ 152 * name: 'z', 153 * withLabel: false, 154 * label: { 155 * position: '50% right', 156 * offset: [30, 0], 157 * fontsize: 15 158 * }, 159 * strokeWidth: 1, 160 * lastArrow: false, 161 * ticks3d: { 162 * label: { 163 * anchorX: 'middle', 164 * anchorY: 'middle' 165 * } 166 * } 167 *} 168 *</pre> 169 */ 170 zAxisBorder: { 171 name: 'z', 172 visible: 'ìnherit', 173 withLabel: false, 174 label: { 175 position: '50% right', 176 offset: [30, 0], 177 fontsize: 15 178 }, 179 strokeWidth: 1, 180 lastArrow: false, 181 ticks3d: { 182 visible: 'ìnherit', 183 label: { 184 anchorX: 'middle', 185 anchorY: 'middle' 186 } 187 } 188 }, 189 190 // Planes 191 /** 192 * Attributes of the 3D plane orthogonal to the x-axis at the "rear" of the cube. 193 * @type Plane3D 194 * @name View3D#xPlaneRear 195 */ 196 xPlaneRear: { 197 visible: true, 198 layer: 0, 199 strokeWidth: 1, 200 strokeColor: '#dddddd', 201 fillColor: '#dddddd', 202 mesh3d: { layer: 1 } 203 }, 204 205 /** 206 * Attributes of the 3D plane orthogonal to the y-axis at the "rear" of the cube. 207 * @type Plane3D 208 * @name View3D#yPlaneRear 209 */ 210 yPlaneRear: { 211 visible: true, 212 strokeWidth: 1, 213 strokeColor: '#dddddd', 214 fillColor: '#dddddd', 215 layer: 0, 216 mesh3d: { layer: 1 } 217 }, 218 219 /** 220 * Attributes of the 3D plane orthogonal to the z-axis at the "rear" of the cube. 221 * @type Plane3D 222 * @name View3D#zPlaneRear 223 */ 224 zPlaneRear: { 225 visible: true, 226 strokeWidth: 1, 227 strokeColor: '#dddddd', 228 fillColor: '#dddddd', 229 layer: 0, 230 mesh3d: { layer: 1 } 231 }, 232 233 /** 234 * Attributes of the 3D plane orthogonal to the x-axis at the "front" of the cube. 235 * @type Plane3D 236 * @name View3D#xPlaneFront 237 */ 238 xPlaneFront: { 239 visible: false, 240 strokeWidth: 1, 241 strokeColor: '#dddddd', 242 fillColor: '#dddddd', 243 layer: 0, 244 mesh3d: { layer: 1 } 245 }, 246 /** 247 * Attributes of the 3D plane orthogonal to the y-axis at the "front" of the cube. 248 * @type Plane3D 249 * @name View3D#yPlaneFront 250 */ 251 yPlaneFront: { 252 visible: false, 253 strokeWidth: 1, 254 strokeColor: '#dddddd', 255 fillColor: '#dddddd', 256 layer: 0, 257 mesh3d: { layer: 1 } 258 }, 259 /** 260 * Attributes of the 3D plane orthogonal to the z-axis at the "front" of the cube. 261 * @type Plane3D 262 * @name View3D#zPlaneFront 263 */ 264 zPlaneFront: { 265 visible: false, 266 strokeWidth: 1, 267 strokeColor: '#dddddd', 268 fillColor: '#dddddd', 269 layer: 0, 270 mesh3d: { layer: 1 } 271 }, 272 273 // Axes on the planes 274 /** 275 * Attributes of the 3D y-axis on the 3D plane orthogonal to the x-axis at the "rear" of the cube. 276 * @type Plane3D 277 * @name View3D#xPlaneRearYAxis 278 */ 279 xPlaneRearYAxis: { 280 visible: "inherit", 281 strokeColor: "#888888", 282 strokeWidth: 1 283 }, 284 /** 285 * Attributes of the 3D z-axis on the 3D plane orthogonal to the x-axis at the "rear" of the cube. 286 * @type Plane3D 287 * @name View3D#xPlaneRearZAxis 288 */ 289 xPlaneRearZAxis: { 290 visible: "inherit", 291 strokeColor: "#888888", 292 strokeWidth: 1 293 }, 294 /** 295 * Attributes of the 3D y-axis on the 3D plane orthogonal to the x-axis at the "front" of the cube. 296 * @type Plane3D 297 * @name View3D#xPlaneFrontYAxis 298 */ 299 xPlaneFrontYAxis: { 300 visible: "inherit", 301 strokeColor: "#888888", 302 strokeWidth: 1 303 }, 304 /** 305 * Attributes of the 3D z-axis on the 3D plane orthogonal to the x-axis at the "front" of the cube. 306 * @type Plane3D 307 * @name View3D#xPlaneFrontZAxis 308 */ 309 xPlaneFrontZAxis: { 310 visible: "inherit", 311 strokeColor: "#888888", 312 strokeWidth: 1 313 }, 314 315 /** 316 * Attributes of the 3D x-axis on the 3D plane orthogonal to the y-axis at the "rear" of the cube. 317 * @type Plane3D 318 * @name View3D#yPlaneRearXAxis 319 */ 320 yPlaneRearXAxis: { 321 visible: "inherit", 322 strokeColor: "#888888", 323 strokeWidth: 1 324 }, 325 /** 326 * Attributes of the 3D z-axis on the 3D plane orthogonal to the y-axis at the "rear" of the cube. 327 * @type Plane3D 328 * @name View3D#yPlaneRearZAxis 329 */ 330 yPlaneRearZAxis: { 331 visible: "inherit", 332 strokeColor: "#888888", 333 strokeWidth: 1 334 }, 335 /** 336 * Attributes of the 3D x-axis on the 3D plane orthogonal to the y-axis at the "front" of the cube. 337 * @type Plane3D 338 * @name View3D#yPlaneFrontXAxis 339 */ 340 yPlaneFrontXAxis: { 341 visible: "inherit", 342 strokeColor: "#888888", 343 strokeWidth: 1 344 }, 345 /** 346 * Attributes of the 3D z-axis on the 3D plane orthogonal to the y-axis at the "front" of the cube. 347 * @type Plane3D 348 * @name View3D#yPlaneFrontZAxis 349 */ 350 yPlaneFrontZAxis: { 351 visible: "inherit", 352 strokeColor: "#888888", 353 strokeWidth: 1 354 }, 355 356 /** 357 * Attributes of the 3D x-axis on the 3D plane orthogonal to the z-axis at the "rear" of the cube. 358 * @type Plane3D 359 * @name View3D#zPlaneRearXAxis 360 */ 361 zPlaneRearXAxis: { 362 visible: "inherit", 363 strokeColor: "#888888", 364 strokeWidth: 1 365 }, 366 /** 367 * Attributes of the 3D y-axis on the 3D plane orthogonal to the z-axis at the "rear" of the cube. 368 * @type Plane3D 369 * @name View3D#zPlaneRearYAxis 370 */ 371 zPlaneRearYAxis: { 372 visible: "inherit", 373 strokeColor: "#888888", 374 strokeWidth: 1 375 }, 376 /** 377 * Attributes of the 3D x-axis on the 3D plane orthogonal to the z-axis at the "front" of the cube. 378 * @type Plane3D 379 * @name View3D#zPlaneFrontXAxis 380 */ 381 zPlaneFrontXAxis: { 382 visible: "inherit", 383 strokeColor: "#888888", 384 strokeWidth: 1 385 }, 386 /** 387 * Attributes of the 3D y-axis on the 3D plane orthogonal to the z-axis at the "front" of the cube. 388 * @type Plane3D 389 * @name View3D#zPlaneFrontYAxis 390 */ 391 zPlaneFrontYAxis: { 392 visible: "inherit", 393 strokeColor: "#888888", 394 strokeWidth: 1 395 } 396 397 /**#@-*/ 398 }, 399 400 axis3d: { 401 highlight: false, 402 fixed: true, 403 strokeColor: "black", 404 strokeWidth: 1, 405 tabindex: null, 406 407 point1: { visible: false, name: "" }, 408 point2: { visible: false, name: "", label: { visible: true } } 409 }, 410 411 circle3d: { 412 413 point: { visible: false, name: "" } 414 }, 415 416 curve3d: { 417 /**#@+ 418 * @visprop 419 */ 420 421 highlight: false, 422 tabindex: -1, 423 strokeWidth: 1, 424 numberPointsHigh: 200 425 426 /**#@-*/ 427 }, 428 429 intersectionline3d: { 430 point1: { visible: false, name: "" }, // Used in point/point 431 point2: { visible: false, name: "" } 432 }, 433 434 line3d: { 435 strokeWidth: 1, 436 strokeColor: "black", 437 fixed: true, 438 tabindex: null, 439 gradient: "linear", 440 gradientSecondColor: "#ffffff", 441 442 point: { visible: false, name: "" }, // Used in cases of point/direction/range 443 point1: { visible: false, name: "" }, // Used in point/point 444 point2: { visible: false, name: "" } 445 }, 446 447 mesh3d: { 448 /**#@+ 449 * @visprop 450 */ 451 452 strokeWidth: 1, 453 strokeColor: "#9a9a9a", 454 strokeOpacity: 0.6, 455 highlight: false, 456 tabindex: null, 457 458 visible: "inherit" 459 460 /**#@-*/ 461 }, 462 463 plane3d: { 464 strokeWidth: 0, 465 strokeColor: "black", 466 strokeOpacity: 1, 467 highlight: false, 468 tabindex: null, 469 470 gradient: "linear", 471 gradientSecondColor: "#ffffff", 472 gradientAngle: Math.PI, 473 fillColor: "#a7a7a7", 474 fillOpacity: 0.6, 475 476 point: { visible: false, name: "", fixed: true } 477 }, 478 479 point3d: { 480 infoboxDigits: "auto", 481 strokeWidth: 0, 482 gradient: "radial", 483 gradientSecondColor: "#555555", 484 fillColor: "yellow", 485 highlightStrokeColor: "#555555", 486 gradientFX: 0.7, 487 gradientFY: 0.3 488 }, 489 490 polygon3d: { 491 /**#@+ 492 * @visprop 493 */ 494 495 highlight: false, 496 tabindex: -1, 497 strokeWidth: 1, 498 fillColor: 'none' 499 500 /**#@-*/ 501 }, 502 503 sphere3d: { 504 /**#@+ 505 * @visprop 506 */ 507 508 highlight: false, 509 510 strokeWidth: 1, 511 strokeColor: '#00ff80', 512 fillColor: 'white', 513 gradient: 'radial', 514 gradientSecondColor: '#00ff80', 515 gradientFX: 0.7, 516 gradientFY: 0.3, 517 fillOpacity: 0.4 518 519 /**#@-*/ 520 }, 521 522 surface3d: { 523 /**#@+ 524 * @visprop 525 */ 526 527 highlight: false, 528 tabindex: -1, 529 strokeWidth: 1, 530 531 /** 532 * Number of intervals the mesh is divided into in direction of parameter u. 533 * @type Number 534 * @name ParametricSurface3D#stepsU 535 */ 536 stepsU: 30, 537 538 /** 539 * Number of intervals the mesh is divided into in direction of parameter v. 540 * @type Number 541 * @name ParametricSurface3D#stepsV 542 */ 543 stepsV: 30 544 545 /**#@-*/ 546 }, 547 548 text3d: { 549 /**#@+ 550 * @visprop 551 */ 552 553 /**#@-*/ 554 }, 555 556 ticks3d: { 557 /**#@+ 558 * @visprop 559 */ 560 561 visible: true, 562 563 ticksDistance: 1, 564 majorHeight: 10, 565 minorTicks: 0, 566 tickEndings: [0, 1], 567 drawLabels: true, 568 569 label: { 570 visible: true 571 } 572 573 /**#@-*/ 574 }, 575 576 vectorfield3d: { 577 /**#@+ 578 * @visprop 579 */ 580 581 /** 582 * Scaling factor of the vectors. This in contrast to slope fields, where this attribute sets the vector to the given length. 583 * @name scale 584 * @memberOf Vectorfield3D.prototype 585 * @type {Number|Function} 586 * @see Slopefield.scale 587 * @default 1 588 */ 589 scale: 1, 590 591 /** 592 * Customize arrow heads of vectors. Be careful! If enabled this will slow down the performance. 593 * Fields are: 594 * <ul> 595 * <li> enabled: Boolean 596 * <li> size: length of the arrow head legs (in pixel) 597 * <li> angle: angle of the arrow head legs In radians. 598 * </ul> 599 * @name arrowhead 600 * @memberOf Vectorfield3D.prototype 601 * @type {Object} 602 * @default <tt>{enabled: true, size: 5, angle: Math.PI * 0.125}</tt> 603 */ 604 arrowhead: { 605 enabled: true, 606 size: 5, 607 angle: Math.PI * 0.125 608 } 609 610 /**#@-*/ 611 }, 612 613 view3d: { 614 /**#@+ 615 * @visprop 616 */ 617 618 needsRegularUpdate: true, 619 620 /** 621 * Choose the projection type to be used: `parallel` or `central`. 622 * <ul> 623 * <li> `parallel` is parallel projection, also called orthographic projection 624 * <li> `central` is central projection, also called perspective projection 625 * </ul> 626 * 627 * 628 * @name View3D#projection 629 * @type String 630 * @default 'parallel' 631 */ 632 projection: 'parallel', 633 634 /** 635 * Allow vertical dragging of objects, i.e. in direction of the z-axis. 636 * Subobjects are 637 * <ul> 638 * <li>enabled: true 639 * <li>key: 'shift' 640 * </ul> 641 * <p> 642 * Possible values for attribute <i>key</i>: 'shift' or 'ctrl'. 643 * 644 * @name View3D#verticalDrag 645 * @type Object 646 * @default <tt>{enabled: true, key: 'shift'}</tt> 647 */ 648 verticalDrag: { 649 enabled: true, 650 key: 'shift' 651 }, 652 653 /** 654 * Specify the user handling of the azimuth. 655 * <ul> 656 * <li><tt>pointer</tt> sub-attributes: 657 * <ul> 658 * <li><tt>enabled</tt>: Boolean that specifies whether pointer navigation is allowed by azimuth. 659 * <li><tt>speed</tt>: Number indicating how many passes the range of the az_slider makes when the cursor crosses the entire board once in the horizontal direction. 660 * <li><tt>outside</tt>: Boolean that specifies whether the pointer navigation is continued when the cursor leaves the board. 661 * <li><tt>button</tt>: Which button of the pointer should be used? (<tt>'-1'</tt> (=no button), <tt>'0'</tt> or <tt>'2'</tt>) 662 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 663 * </ul> 664 * <li><tt>keyboard</tt> sub-attributes: 665 * <ul> 666 * <li><tt>enabled</tt>: Boolean that specifies whether the keyboard (arrow keys) can be used to navigate the board. 667 * <li><tt>step</tt>: Size of the step per keystroke. 668 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 669 * </ul> 670 * <li><tt>continuous</tt>: Boolean that specifies whether the az_slider starts again from the beginning when its end is reached. 671 * <li><tt>slider</tt> attributes of the az_slider ({@link Slider}) with additional 672 * <ul> 673 * <li><tt>min</tt>: Minimum value. 674 * <li><tt>max</tt>: Maximum value. 675 * <li><tt>start</tt>: Start value. 676 * </ul> 677 * </ul> 678 * 679 * @name View3D#az 680 * @type Object 681 * @default <pre>{ 682 * pointer: {enabled: true, speed: 1, outside: true, button: -1, key: 'none'}, 683 * keyboard: {enabled: true, step: 10, key: 'ctrl'}, 684 * continuous: true, 685 * slider: { 686 * visible: true, 687 * style: 6, 688 * point1: {frozen: true}, 689 * point2: {frozen: true}, 690 * min: 0, 691 * max: 2 * Math.PI, 692 * start: 1.0 693 * }, 694 * }</pre> 695 * @example 696 * var bound = [-4, 6]; 697 * var view = board.create('view3d', 698 * [[-4, -3], [8, 8], 699 * [bound, bound, bound]], 700 * { 701 * projection: 'parallel', 702 * az: { 703 * slider: {visible: true} 704 * } 705 * }); 706 * 707 * </pre><div id="JXG4c381f21-f043-4419-941d-75f384c026d0" class="jxgbox" style="width: 300px; height: 300px;"></div> 708 * <script type="text/javascript"> 709 * (function() { 710 * var board = JXG.JSXGraph.initBoard('JXG4c381f21-f043-4419-941d-75f384c026d0', 711 * {boundingbox: [-8, 8, 8,-8], axis: false, showcopyright: false, shownavigation: false}); 712 * var bound = [-4, 6]; 713 * var view = board.create('view3d', 714 * [[-4, -3], [8, 8], 715 * [bound, bound, bound]], 716 * { 717 * projection: 'parallel', 718 * az: { 719 * slider: {visible: true} 720 * } 721 * }); 722 * 723 * })(); 724 * 725 * </script><pre> 726 * 727 */ 728 az: { 729 pointer: { 730 enabled: true, 731 speed: 1, 732 outside: true, 733 button: -1, 734 key: 'none' 735 }, 736 keyboard: { 737 enabled: true, 738 step: 10, 739 key: 'ctrl' 740 }, 741 continuous: true, 742 slider: { 743 visible: 'inherit', 744 style: 6, 745 point1: { frozen: true }, 746 point2: { frozen: true }, 747 min: 0, 748 max: 2 * Math.PI, 749 start: 1.0 750 } 751 }, 752 753 /** 754 * Specify the user handling of the elevation. 755 * <ul> 756 * <li><tt>pointer</tt> sub-attributes: 757 * <ul> 758 * <li><tt>enabled</tt>: Boolean that specifies whether pointer navigation is allowed by elevation. 759 * <li><tt>speed</tt>: Number indicating how many passes the range of the el_slider makes when the cursor crosses the entire board once in the horizontal direction. 760 * <li><tt>outside</tt>: Boolean that specifies whether the pointer navigation is continued when the cursor leaves the board. 761 * <li><tt>button</tt>: Which button of the pointer should be used? (<tt>'-1'</tt> (=no button), <tt>'0'</tt> or <tt>'2'</tt>) 762 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 763 * </ul> 764 * <li><tt>keyboard</tt> sub-attributes: 765 * <ul> 766 * <li><tt>enabled</tt>: Boolean that specifies whether the keyboard (arrow keys) can be used to navigate the board. 767 * <li><tt>step</tt>: Size of the step per keystroke. 768 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 769 * </ul> 770 * <li><tt>continuous</tt>: Boolean that specifies whether the el_slider starts again from the beginning when its end is reached. 771 * <li><tt>slider</tt> attributes of the el_slider ({@link Slider}) with additional 772 * <ul> 773 * <li><tt>min</tt>: Minimum value. 774 * <li><tt>max</tt>: Maximum value. 775 * <li><tt>start</tt>: Start value. 776 * </ul> 777 * </ul> 778 * 779 * @name View3D#el 780 * @type Object 781 * @default <pre>{ 782 * pointer: {enabled: true, speed: 1, outside: true, button: -1, key: 'none'}, 783 * keyboard: {enabled: true, step: 10, key: 'ctrl'}, 784 * continuous: true, 785 * slider: { 786 * visible: true, 787 * style: 6, 788 * point1: {frozen: true}, 789 * point2: {frozen: true}, 790 * min: 0, 791 * max: 2 * Math.PI, 792 * start: 0.3 793 * }, 794 * }<pre> 795 * @example 796 * var bound = [-4, 6]; 797 * var view = board.create('view3d', 798 * [[-4, -3], [8, 8], 799 * [bound, bound, bound]], 800 * { 801 * projection: 'parallel', 802 * el: { 803 * slider: {visible: true} 804 * } 805 * }); 806 * 807 * </pre><div id="JXG8926f733-c42e-466b-853c-74feb795e879" class="jxgbox" style="width: 300px; height: 300px;"></div> 808 * <script type="text/javascript"> 809 * (function() { 810 * var board = JXG.JSXGraph.initBoard('JXG8926f733-c42e-466b-853c-74feb795e879', 811 * {boundingbox: [-8, 8, 8,-8], axis: false, showcopyright: false, shownavigation: false}); 812 * var bound = [-4, 6]; 813 * var view = board.create('view3d', 814 * [[-4, -3], [8, 8], 815 * [bound, bound, bound]], 816 * { 817 * projection: 'parallel', 818 * el: { 819 * slider: {visible: true} 820 * } 821 * }); 822 * 823 * })(); 824 * 825 * </script><pre> 826 * 827 */ 828 el: { 829 pointer: { 830 enabled: true, 831 speed: 1, 832 outside: true, 833 button: -1, 834 key: 'none' 835 }, 836 keyboard: { 837 enabled: true, 838 step: 10, 839 key: 'ctrl' 840 }, 841 continuous: true, 842 slider: { 843 visible: 'inherit', 844 style: 6, 845 point1: { frozen: true }, 846 point2: { frozen: true }, 847 min: 0, 848 max: 2 * Math.PI, 849 start: 0.3 850 } 851 }, 852 853 /** 854 * Specify the user handling of the bank angle. 855 * <ul> 856 * <li><tt>pointer</tt> sub-attributes: 857 * <ul> 858 * <li><tt>enabled</tt>: Boolean that specifies whether pointer navigation is allowed by elevation. 859 * <li><tt>speed</tt>: Number indicating how many passes the range of the el_slider makes when the cursor crosses the entire board once in the horizontal direction. 860 * <li><tt>outside</tt>: Boolean that specifies whether the pointer navigation is continued when the cursor leaves the board. 861 * <li><tt>button</tt>: Which button of the pointer should be used? (<tt>'-1'</tt> (=no button), <tt>'0'</tt> or <tt>'2'</tt>) 862 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 863 * </ul> 864 * <li><tt>keyboard</tt> sub-attributes: 865 * <ul> 866 * <li><tt>enabled</tt>: Boolean that specifies whether the keyboard (arrow keys) can be used to navigate the board. 867 * <li><tt>step</tt>: Size of the step per keystroke. 868 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 869 * </ul> 870 * <li><tt>continuous</tt>: Boolean that specifies whether the el_slider starts again from the beginning when its end is reached. 871 * <li><tt>slider</tt> attributes of the el_slider ({@link Slider}) with additional 872 * <ul> 873 * <li><tt>min</tt>: Minimum value. 874 * <li><tt>max</tt>: Maximum value. 875 * <li><tt>start</tt>: Start value. 876 * </ul> 877 * </ul> 878 * 879 * @name View3D#bank 880 * @type Object 881 * @default <pre>{ 882 * pointer: {enabled: true, speed: 1, outside: true, button: -1, key: 'none'}, 883 * keyboard: {enabled: true, step: 10, key: 'ctrl'}, 884 * continuous: true, 885 * slider: { 886 * visible: true, 887 * style: 6, 888 * point1: {frozen: true}, 889 * point2: {frozen: true}, 890 * min: 0, 891 * max: 2 * Math.PI, 892 * start: 0.3 893 * }, 894 * }<pre> 895 * @example 896 * var bound = [-4, 6]; 897 * var view = board.create('view3d', 898 * [[-4, -3], [8, 8], 899 * [bound, bound, bound]], 900 * { 901 * projection: 'parallel', 902 * bank: { 903 * slider: {visible: true} 904 * } 905 * }); 906 * 907 * </pre><div id="JXGb67811ea-c1e3-4d1e-b13c-3537b3436f6c" class="jxgbox" style="width: 300px; height: 300px;"></div> 908 * <script type="text/javascript"> 909 * (function() { 910 * var board = JXG.JSXGraph.initBoard('JXGb67811ea-c1e3-4d1e-b13c-3537b3436f6c', 911 * {boundingbox: [-8, 8, 8,-8], axis: true, showcopyright: false, shownavigation: false}); 912 * var bound = [-4, 6]; 913 * var view = board.create('view3d', 914 * [[-4, -3], [8, 8], 915 * [bound, bound, bound]], 916 * { 917 * projection: 'parallel', 918 * bank: { 919 * slider: {visible: true} 920 * } 921 * }); 922 * 923 * })(); 924 * 925 * </script><pre> 926 * 927 */ 928 bank: { 929 pointer: { 930 enabled: true, 931 speed: 0.08, 932 outside: true, 933 button: -1, 934 key: 'none' 935 }, 936 keyboard: { 937 enabled: true, 938 step: 10, 939 key: 'ctrl' 940 }, 941 continuous: true, 942 slider: { 943 visible: 'inherit', 944 style: 6, 945 point1: { frozen: true }, 946 point2: { frozen: true }, 947 min: -Math.PI, 948 max: Math.PI, 949 start: 0.0 950 } 951 }, 952 953 /** 954 * Enable user handling by a virtual trackball. 955 * Sub-attributes: 956 * <ul> 957 * <li><tt>enabled</tt>: Boolean that specifies whether pointer navigation is allowed by elevation. 958 * <li><tt>outside</tt>: Boolean that specifies whether the pointer navigation is continued when the cursor leaves the board. 959 * <li><tt>button</tt>: Which button of the pointer should be used? (<tt>'-1'</tt> (=no button), <tt>'0'</tt> or <tt>'2'</tt>) 960 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 961 * </ul> 962 * 963 * @name View3D#trackball 964 * @type Object 965 * @default <pre>{ 966 * enabled: false, 967 * outside: true, 968 * button: -1, 969 * key: 'none' 970 * } 971 * </pre> 972 */ 973 trackball: { 974 enabled: false, 975 outside: true, 976 button: -1, 977 key: 'none' 978 }, 979 980 /** 981 * Distance of the camera to the center of the view. 982 * If set to 'auto', r will be calculated automatically. 983 * 984 * @type {Number|String} 985 * @default 'auto' 986 */ 987 r: 'auto', 988 989 /** 990 * Field of View defines the angle of view (in radians) of the camera, determining how much of the scene is captured within the frame. 991 * 992 * @type Number 993 * @default 2/5*Math.PI 994 */ 995 fov: 1 / 5 * 2 * Math.PI, 996 997 /** 998 * When this option is enabled, points closer to the screen are drawn 999 * over points further from the screen within each layer. 1000 * 1001 * @name View3D#depthOrderPoints 1002 * @default false 1003 */ 1004 depthOrderPoints: false, 1005 1006 /** 1007 * Fixed values for the view, which can be changed using keyboard keys `picture-up` and `picture-down`. 1008 * Array of the form: [[el0, az0, r0], [el1, az1, r1, ...[eln, azn, rn]] 1009 * 1010 * @name View3D#values 1011 * @type Array 1012 * @default <tt>{[[0, 1.57], [0.78, 0.62], [0, 0], [5.49, 0.62], [4.71, 0], [3.93, 0.62], [3.14, 0], [2.36, 0.62], [1.57, 1.57]]}<tt> 1013 */ 1014 values: [ 1015 [0, 1.57], 1016 [0.78, 0.62], 1017 [0, 0], 1018 [5.49, 0.62], 1019 [4.71, 0], 1020 [3.93, 0.62], 1021 [3.14, 0], 1022 [2.36, 0.62], 1023 [1.57, 1.57] 1024 ], 1025 1026 infobox: { 1027 // strokeColor: '#888888', 1028 strokeColor: '#000000', 1029 fontSize: 24, 1030 useKatex: false, 1031 useMathjax: false 1032 }, 1033 1034 /** 1035 * @class 1036 * @ignore 1037 */ 1038 _currentView: -1 1039 1040 /**#@-*/ 1041 } 1042 }); 1043 1044 export default JXG.Options; 1045