1 /*global JXG:true, define: true*/ 2 3 import JXG from "./jxg"; 4 import Options from "./options"; 5 6 JXG.extend(Options, { 7 // infobox: { 8 // strokeColor: 'black' 9 // }, 10 11 axes3d: { 12 /**#@+ 13 * @visprop 14 */ 15 16 /** 17 * Position of the main axes in a View3D element. Possible values are 18 * 'center' and 'border'. 19 * 20 * @type String 21 * @name View3D#axesPosition 22 * @default 'center' 23 */ 24 axesPosition: "center", // Possible values: 'center', otherwise: border 25 26 // Main axes 27 28 /** 29 * Attributes of the 3D x-axis. 30 * 31 * @type Line3D 32 * @name View3D#xAxis 33 */ 34 xAxis: { visible: true, point2: { name: "x" } }, 35 36 /** 37 * Attributes of the 3D y-axis. 38 * 39 * @type Line3D 40 * @name View3D#yAxis 41 */ 42 yAxis: { visible: true, point2: { name: "y" } }, 43 44 /** 45 * Attributes of the 3D z-axis. 46 * 47 * @type Line3D 48 * @name View3D#zAxis 49 */ 50 zAxis: { visible: true, point2: { name: "z" } }, 51 52 // Planes 53 /** 54 * Attributes of the 3D plane orthogonal to the x-axis at the "rear" of the cube. 55 * @type Plane3D 56 * @name View3D#xPlaneRear 57 */ 58 xPlaneRear: { visible: true, layer: 0, mesh3d: { layer: 1 } }, 59 /** 60 * Attributes of the 3D plane orthogonal to the y-axis at the "rear" of the cube. 61 * @type Plane3D 62 * @name View3D#yPlaneRear 63 */ 64 yPlaneRear: { visible: true, layer: 0, mesh3d: { layer: 1 } }, 65 /** 66 * Attributes of the 3D plane orthogonal to the z-axis at the "rear" of the cube. 67 * @type Plane3D 68 * @name View3D#zPlaneRear 69 */ 70 zPlaneRear: { visible: true, layer: 0, mesh3d: { layer: 1 } }, 71 72 /** 73 * Attributes of the 3D plane orthogonal to the x-axis at the "front" of the cube. 74 * @type Plane3D 75 * @name View3D#xPlaneFront 76 */ 77 xPlaneFront: { visible: false, layer: 0, mesh3d: { layer: 1 } }, 78 /** 79 * Attributes of the 3D plane orthogonal to the y-axis at the "front" of the cube. 80 * @type Plane3D 81 * @name View3D#yPlaneFront 82 */ 83 yPlaneFront: { visible: false, layer: 0, mesh3d: { layer: 1 } }, 84 /** 85 * Attributes of the 3D plane orthogonal to the z-axis at the "front" of the cube. 86 * @type Plane3D 87 * @name View3D#zPlaneFront 88 */ 89 zPlaneFront: { visible: false, layer: 0, mesh3d: { layer: 1 } }, 90 91 // Axes on the planes 92 /** 93 * Attributes of the 3D y-axis on the 3D plane orthogonal to the x-axis at the "rear" of the cube. 94 * @type Plane3D 95 * @name View3D#xPlaneRearYAxis 96 */ 97 xPlaneRearYAxis: { 98 visible: "inherit", 99 strokeColor: "#888888", 100 strokeWidth: 1 101 }, 102 /** 103 * Attributes of the 3D z-axis on the 3D plane orthogonal to the x-axis at the "rear" of the cube. 104 * @type Plane3D 105 * @name View3D#xPlaneRearZAxis 106 */ 107 xPlaneRearZAxis: { 108 visible: "inherit", 109 strokeColor: "#888888", 110 strokeWidth: 1 111 }, 112 /** 113 * Attributes of the 3D y-axis on the 3D plane orthogonal to the x-axis at the "front" of the cube. 114 * @type Plane3D 115 * @name View3D#xPlaneFrontYAxis 116 */ 117 xPlaneFrontYAxis: { 118 visible: "inherit", 119 strokeColor: "#888888", 120 strokeWidth: 1 121 }, 122 /** 123 * Attributes of the 3D z-axis on the 3D plane orthogonal to the x-axis at the "front" of the cube. 124 * @type Plane3D 125 * @name View3D#xPlaneFrontZAxis 126 */ 127 xPlaneFrontZAxis: { 128 visible: "inherit", 129 strokeColor: "#888888", 130 strokeWidth: 1 131 }, 132 133 /** 134 * Attributes of the 3D x-axis on the 3D plane orthogonal to the y-axis at the "rear" of the cube. 135 * @type Plane3D 136 * @name View3D#yPlaneRearXAxis 137 */ 138 yPlaneRearXAxis: { 139 visible: "inherit", 140 strokeColor: "#888888", 141 strokeWidth: 1 142 }, 143 /** 144 * Attributes of the 3D z-axis on the 3D plane orthogonal to the y-axis at the "rear" of the cube. 145 * @type Plane3D 146 * @name View3D#yPlaneRearZAxis 147 */ 148 yPlaneRearZAxis: { 149 visible: "inherit", 150 strokeColor: "#888888", 151 strokeWidth: 1 152 }, 153 /** 154 * Attributes of the 3D x-axis on the 3D plane orthogonal to the y-axis at the "front" of the cube. 155 * @type Plane3D 156 * @name View3D#yPlaneFrontXAxis 157 */ 158 yPlaneFrontXAxis: { 159 visible: "inherit", 160 strokeColor: "#888888", 161 strokeWidth: 1 162 }, 163 /** 164 * Attributes of the 3D z-axis on the 3D plane orthogonal to the y-axis at the "front" of the cube. 165 * @type Plane3D 166 * @name View3D#yPlaneFrontZAxis 167 */ 168 yPlaneFrontZAxis: { 169 visible: "inherit", 170 strokeColor: "#888888", 171 strokeWidth: 1 172 }, 173 174 /** 175 * Attributes of the 3D x-axis on the 3D plane orthogonal to the z-axis at the "rear" of the cube. 176 * @type Plane3D 177 * @name View3D#zPlaneRearXAxis 178 */ 179 zPlaneRearXAxis: { 180 visible: "inherit", 181 strokeColor: "#888888", 182 strokeWidth: 1 183 }, 184 /** 185 * Attributes of the 3D y-axis on the 3D plane orthogonal to the z-axis at the "rear" of the cube. 186 * @type Plane3D 187 * @name View3D#zPlaneRearYAxis 188 */ 189 zPlaneRearYAxis: { 190 visible: "inherit", 191 strokeColor: "#888888", 192 strokeWidth: 1 193 }, 194 /** 195 * Attributes of the 3D x-axis on the 3D plane orthogonal to the z-axis at the "front" of the cube. 196 * @type Plane3D 197 * @name View3D#zPlaneFrontXAxis 198 */ 199 zPlaneFrontXAxis: { 200 visible: "inherit", 201 strokeColor: "#888888", 202 strokeWidth: 1 203 }, 204 /** 205 * Attributes of the 3D y-axis on the 3D plane orthogonal to the z-axis at the "front" of the cube. 206 * @type Plane3D 207 * @name View3D#zPlaneFrontYAxis 208 */ 209 zPlaneFrontYAxis: { 210 visible: "inherit", 211 strokeColor: "#888888", 212 strokeWidth: 1 213 } 214 215 /**#@-*/ 216 }, 217 218 axis3d: { 219 highlight: false, 220 strokecolor: "black", 221 strokeWidth: 1, 222 tabindex: null, 223 224 point1: { visible: false, name: "" }, 225 point2: { visible: false, name: "", label: { visible: true } } 226 }, 227 228 curve3d: { 229 /**#@+ 230 * @visprop 231 */ 232 233 highlight: false, 234 tabindex: -1, 235 strokeWidth: 1, 236 numberPointsHigh: 200 237 238 /**#@-*/ 239 }, 240 241 mesh3d: { 242 /**#@+ 243 * @visprop 244 */ 245 246 strokeWidth: 1, 247 strokeColor: "#9a9a9a", 248 strokeOpacity: 0.6, 249 highlight: false, 250 fillColor: "#9a9a9a", 251 fillOpacity: 0.1, 252 tabindex: null, 253 254 visible: "inherit" 255 /**#@-*/ 256 }, 257 258 line3d: { 259 strokeWidth: 1, 260 strokeColor: "black", 261 fixed: true, 262 tabindex: null, 263 gradient: "linear", 264 gradientSecondColor: "#ffffff", 265 266 point: { visible: false, name: "" }, // Used in cases of point/direction/range 267 point1: { visible: false, name: "" }, // Used in point/point 268 point2: { visible: false, name: "" } 269 }, 270 271 plane3d: { 272 strokeWidth: 0, 273 strokeColor: "black", 274 strokeOpacity: 1, 275 highlight: false, 276 tabindex: null, 277 278 gradient: "linear", 279 gradientSecondColor: "#ffffff", 280 gradientAngle: Math.PI, 281 fillColor: "#a7a7a7", 282 fillOpacity: 0.6, 283 284 point: { visible: false, name: "", fixed: true } 285 }, 286 287 point3d: { 288 infoboxDigits: "auto", 289 strokeWidth: 0, 290 gradient: "radial", 291 gradientSecondColor: "#555555", 292 fillColor: "yellow", 293 highlightStrokeColor: "#555555" 294 }, 295 296 surface3d: { 297 /**#@+ 298 * @visprop 299 */ 300 301 highlight: false, 302 tabindex: -1, 303 strokeWidth: 1, 304 305 /** 306 * Number of intervals the mesh is divided into in direction of parameter u. 307 * @type Number 308 * @name ParametricSurface3D#stepsU 309 */ 310 stepsU: 30, 311 312 /** 313 * Number of intervals the mesh is divided into in direction of parameter v. 314 * @type Number 315 * @name ParametricSurface3D#stepsV 316 */ 317 stepsV: 30 318 319 /**#@-*/ 320 }, 321 322 vectorfield3d: { 323 /**#@+ 324 * @visprop 325 */ 326 327 /** 328 * Scaling factor of the vectors. This in contrast to slope fields, where this attribute sets the vector to the given length. 329 * @name scale 330 * @memberOf Vectorfield3D.prototype 331 * @type {Number|Function} 332 * @see Slopefield.scale 333 * @default 1 334 */ 335 scale: 1, 336 337 /** 338 * Customize arrow heads of vectors. Be careful! If enabled this will slow down the performance. 339 * Fields are: 340 * <ul> 341 * <li> enabled: Boolean 342 * <li> size: length of the arrow head legs (in pixel) 343 * <li> angle: angle of the arrow head legs In radians. 344 * </ul> 345 * @name arrowhead 346 * @memberOf Vectorfield3D.prototype 347 * @type {Object} 348 * @default <tt>{enabled: true, size: 5, angle: Math.PI * 0.125}</tt> 349 */ 350 arrowhead: { 351 enabled: true, 352 size: 5, 353 angle: Math.PI * 0.125 354 } 355 356 /**#@-*/ 357 }, 358 359 view3d: { 360 /**#@+ 361 * @visprop 362 */ 363 364 needsRegularUpdate: true, 365 366 /** 367 * Choose the projection is to be used: `parallel` or `central`. 368 * 369 * @name View3D#projection 370 * @type String 371 * @default 'parallel' 372 */ 373 projection: 'parallel', 374 375 /** 376 * Allow vertical dragging of objects, i.e. in direction of the z-axis. 377 * Subobjects are 378 * <ul> 379 * <li>enabled: true 380 * <li>key: 'shift' 381 * </ul> 382 * <p> 383 * Possible values for attribute <i>key</i>: 'shift' or 'ctrl'. 384 * 385 * @name View3D#verticalDrag 386 * @type Object 387 * @default <tt>{enabled: true, key: 'shift'}</tt> 388 */ 389 verticalDrag: { 390 enabled: true, 391 key: 'shift' 392 }, 393 394 /** 395 * Specify the user handling of the azimuth. 396 * <ul> 397 * <li><tt>pointer</tt> sub-attributes: 398 * <ul> 399 * <li><tt>enabled</tt>: Boolean that specifies whether pointer navigation is allowed by azimuth. 400 * <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. 401 * <li><tt>outside</tt>: Boolean that specifies whether the pointer navigation is continued when the cursor leaves the board. 402 * <li><tt>button</tt>: Which button of the pointer should be used? (<tt>'-1'</tt> (=no button), <tt>'0'</tt> or <tt>'2'</tt>) 403 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 404 * </ul> 405 * <li><tt>keyboard</tt> sub-attributes: 406 * <ul> 407 * <li><tt>enabled</tt>: Boolean that specifies whether the keyboard (arrow keys) can be used to navigate the board. 408 * <li><tt>step</tt>: Size of the step per keystroke. 409 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 410 * </ul> 411 * <li><tt>continuous</tt>: Boolean that specifies whether the az_slider starts again from the beginning when its end is reached. 412 * <li><tt>slider</tt> attributes of the az_slider ({@link Slider}) with additional 413 * <ul> 414 * <li><tt>min</tt>: Minimum value. 415 * <li><tt>max</tt>: Maximum value. 416 * <li><tt>start</tt>: Start value. 417 * </ul> 418 * </ul> 419 * 420 * @name View3D#az 421 * @type Object 422 * @default <pre>{ 423 * pointer: {enabled: true, speed: 1, outside: true, button: -1, key: 'none'}, 424 * keyboard: {enabled: true, step: 10, key: 'ctrl'}, 425 * continuous: true, 426 * slider: { 427 * visible: true, 428 * style: 6, 429 * point1: {frozen: true}, 430 * point2: {frozen: true}, 431 * min: 0, 432 * max: 2 * Math.PI, 433 * start: 1.0 434 * }, 435 * }</pre> 436 */ 437 az: { 438 pointer: { 439 enabled: true, 440 speed: 1, 441 outside: true, 442 button: -1, 443 key: 'none' 444 }, 445 keyboard: { 446 enabled: true, 447 step: 10, 448 key: 'ctrl' 449 }, 450 continuous: true, 451 slider: { 452 visible: true, 453 style: 6, 454 point1: { frozen: true }, 455 point2: { frozen: true }, 456 min: 0, 457 max: 2 * Math.PI, 458 start: 1.0 459 } 460 }, 461 462 /** 463 * Specify the user handling of the elevation. 464 * <ul> 465 * <li><tt>pointer</tt> sub-attributes: 466 * <ul> 467 * <li><tt>enabled</tt>: Boolean that specifies whether pointer navigation is allowed by elevation. 468 * <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. 469 * <li><tt>outside</tt>: Boolean that specifies whether the pointer navigation is continued when the cursor leaves the board. 470 * <li><tt>button</tt>: Which button of the pointer should be used? (<tt>'-1'</tt> (=no button), <tt>'0'</tt> or <tt>'2'</tt>) 471 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 472 * </ul> 473 * <li><tt>keyboard</tt> sub-attributes: 474 * <ul> 475 * <li><tt>enabled</tt>: Boolean that specifies whether the keyboard (arrow keys) can be used to navigate the board. 476 * <li><tt>step</tt>: Size of the step per keystroke. 477 * <li><tt>key</tt>: Should an additional key be pressed? (<tt>'none'</tt>, <tt>'shift'</tt> or <tt>'ctrl'</tt>) 478 * </ul> 479 * <li><tt>continuous</tt>: Boolean that specifies whether the el_slider starts again from the beginning when its end is reached. 480 * <li><tt>slider</tt> attributes of the el_slider ({@link Slider}) with additional 481 * <ul> 482 * <li><tt>min</tt>: Minimum value. 483 * <li><tt>max</tt>: Maximum value. 484 * <li><tt>start</tt>: Start value. 485 * </ul> 486 * </ul> 487 * 488 * @name View3D#el 489 * @type Object 490 * @default <pre>{ 491 * pointer: {enabled: true, speed: 1, outside: true, button: -1, key: 'none'}, 492 * keyboard: {enabled: true, step: 10, key: 'ctrl'}, 493 * continuous: true, 494 * slider: { 495 * visible: true, 496 * style: 6, 497 * point1: {frozen: true}, 498 * point2: {frozen: true}, 499 * min: 0, 500 * max: 2 * Math.PI, 501 * start: 0.3 502 * }, 503 * }<pre> 504 */ 505 el: { 506 pointer: { 507 enabled: true, 508 speed: 1, 509 outside: true, 510 button: -1, 511 key: 'none' 512 }, 513 keyboard: { 514 enabled: true, 515 step: 10, 516 key: 'ctrl' 517 }, 518 continuous: true, 519 slider: { 520 visible: true, 521 style: 6, 522 point1: { frozen: true }, 523 point2: { frozen: true }, 524 min: 0, 525 max: 2 * Math.PI, 526 start: 0.3 527 } 528 }, 529 530 /** 531 * Distance of the camera to the center of the view. 532 * If set to 'auto', r will be calculated automatically. 533 * 534 * @type {Number|String} 535 * @default 'auto' 536 */ 537 r: 'auto', 538 539 /** 540 * Field of View defines the angle of view (in radians) of the camera, determining how much of the scene is captured within the frame. 541 * 542 * @type Number 543 * @default 2/5*Math.PI 544 */ 545 fov: 1 / 5 * 2 * Math.PI, 546 547 /** 548 * Fixed values for the view, which can be changed using keyboard keys `picture-up` and `picture-down`. 549 * Array of the form: [[el0, az0, r0], [el1, az1, r1, ...[eln, azn, rn]] 550 * 551 * @name View3D#values 552 * @type Array 553 * @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> 554 */ 555 values: [ 556 [0, 1.57], 557 [0.78, 0.62], 558 [0, 0], 559 [5.49, 0.62], 560 [4.71, 0], 561 [3.93, 0.62], 562 [3.14, 0], 563 [2.36, 0.62], 564 [1.57, 1.57] 565 ], 566 567 /** 568 * @class 569 * @ignore 570 */ 571 _currentView: -1 572 573 /**#@-*/ 574 } 575 }); 576 577 export default JXG.Options; 578