jsxgraph 1.4.2 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/distrib/README.md +24 -0
- package/distrib/geogebra.min.js +1 -1
- package/distrib/geonext.min.js +1 -1
- package/distrib/index.d.ts +351 -39
- package/distrib/intergeo.min.js +1 -1
- package/distrib/jsxgraphcore.js +4 -4
- package/distrib/jsxgraphsrc.js +2909 -389
- package/distrib/sketch.min.js +2 -2
- package/package.json +1 -1
- package/src/3d/box3d.js +268 -0
- package/src/3d/curve3d.js +97 -0
- package/src/3d/linspace3d.js +375 -0
- package/src/3d/point3d.js +238 -0
- package/src/3d/surface3d.js +220 -0
- package/src/3d/threed.js +38 -0
- package/src/3d/view3d.js +529 -0
- package/src/base/board.js +160 -84
- package/src/base/constants.js +1 -1
- package/src/base/coordselement.js +1 -4
- package/src/base/element.js +22 -13
- package/src/base/foreignobject.js +7 -1
- package/src/base/line.js +1 -1
- package/src/base/polygon.js +88 -33
- package/src/base/text.js +42 -13
- package/src/base/ticks.js +3 -1
- package/src/element/composition.js +62 -23
- package/src/element/slider.js +12 -0
- package/src/jsxgraph.js +8 -5
- package/src/loadjsxgraph.js +17 -11
- package/src/math/clip.js +0 -1
- package/src/math/geometry.js +187 -2
- package/src/math/math.js +9 -0
- package/src/math/nlp.js +205 -173
- package/src/options.js +35 -13
- package/src/options3d.js +265 -0
- package/src/parser/jessiecode.js +1 -1
- package/src/reader/sketch.js +2 -2
- package/src/renderer/svg.js +7 -4
- package/src/utils/env.js +10 -10
- package/src/utils/type.js +2 -2
package/distrib/index.d.ts
CHANGED
|
@@ -14,21 +14,31 @@
|
|
|
14
14
|
//
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* JSXGraph in the namespace JXG.
|
|
18
18
|
*/
|
|
19
|
-
declare
|
|
19
|
+
declare namespace JXG {
|
|
20
|
+
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* Store a reference to every board in this central list.
|
|
23
|
+
* This will at some point replace JXG.JSXGraph.boards.
|
|
22
24
|
*/
|
|
23
|
-
export
|
|
25
|
+
export const boards: unknown;
|
|
26
|
+
|
|
24
27
|
/**
|
|
25
|
-
*
|
|
28
|
+
*
|
|
26
29
|
*/
|
|
27
|
-
export
|
|
30
|
+
export type CoordType = 1 | 2
|
|
31
|
+
|
|
28
32
|
/**
|
|
29
33
|
* Screen coordinates in pixel relative to the upper left corner of the div element.
|
|
30
34
|
*/
|
|
31
35
|
export const COORDS_BY_SCREEN: 0x0002;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* User coordinates relative to the coordinates system defined by the bounding box.
|
|
39
|
+
*/
|
|
40
|
+
export const COORDS_BY_USER: 0x0001;
|
|
41
|
+
|
|
32
42
|
/**
|
|
33
43
|
* A composition is a simple container that manages none or more GeometryElements.
|
|
34
44
|
*/
|
|
@@ -147,6 +157,11 @@ declare module JXG {
|
|
|
147
157
|
isReal(): boolean;
|
|
148
158
|
}
|
|
149
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Associative array that keeps track of all constructable elements registered via JXG.registerElement.
|
|
162
|
+
*/
|
|
163
|
+
export const elements: { [elementType: string]: unknown };
|
|
164
|
+
|
|
150
165
|
/**
|
|
151
166
|
* A JessieCode object provides an interface to the parser and stores all variables and objects used within a JessieCode script.
|
|
152
167
|
* The optional argument code is interpreted after initializing.
|
|
@@ -235,6 +250,12 @@ declare module JXG {
|
|
|
235
250
|
export function cloneAndCopy<S extends object, T extends object>(obj: S, obj2: T): S | T;
|
|
236
251
|
export function cmpArrays(a1: unknown[], a2: unknown[]): boolean;
|
|
237
252
|
export function coordsArrayToMatrix(coords: unknown[], split: boolean): unknown[];
|
|
253
|
+
/**
|
|
254
|
+
* Generates an attributes object that is filled with default values from the Options object and overwritten by the user specified attributes.
|
|
255
|
+
* @param attributes user specified attributes
|
|
256
|
+
* @param options defaults options
|
|
257
|
+
* @param s variable number of strings, e.g. 'slider', subtype 'point1'.
|
|
258
|
+
*/
|
|
238
259
|
export function copyAttributes<T>(attributes: T, options: JXGSettings, ...s: string[]): T;
|
|
239
260
|
export function createEvalFunction<T>(board: Board, param: T[], n: number): (k: number) => T;
|
|
240
261
|
export function createFunction(term: string | number | Function, board: Board, variableName: string, evalGeonext?: boolean): Function;
|
|
@@ -285,6 +306,22 @@ declare module JXG {
|
|
|
285
306
|
export function escapeHTML(str: string): string;
|
|
286
307
|
export function evalSlider(s: unknown): number;
|
|
287
308
|
export function evaluate(val: unknown): unknown;
|
|
309
|
+
/**
|
|
310
|
+
* Checks if a given variable is neither undefined nor null. You should not use this together with global variables!
|
|
311
|
+
* @param v A variable of any type.
|
|
312
|
+
* @param checkEmptyString If set to true, it is also checked whether v is not equal to ''. Default: false.
|
|
313
|
+
* @returns True, if v is neither undefined nor null.
|
|
314
|
+
*/
|
|
315
|
+
export function exists(v: unknown, checkEmptyString?: boolean): boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Copy all properties of the extension object to object.
|
|
318
|
+
* @param obj
|
|
319
|
+
* @param extension
|
|
320
|
+
* @param onlyOwn Only consider properties that belong to extension itself, not any inherited properties. Default: false.
|
|
321
|
+
* @param toLower If true the keys are convert to lower case. This is needed for visProp, see JXG#copyAttributes. Default: false.
|
|
322
|
+
*/
|
|
323
|
+
export function extend(obj: object, extension: object, onlyOwn?: boolean, toLower?: boolean): void;
|
|
324
|
+
export function extendConstants(obj: object, constants: object, onlyOwn?: boolean, toUpper?: boolean): void;
|
|
288
325
|
export function filterElements<T>(list: T[], filter: object | Function): T[];
|
|
289
326
|
export function getBoardByContainerId(s: string): Board | null;
|
|
290
327
|
export function getCSSTrasform(cPos: number[], obj: Element): number[];
|
|
@@ -330,7 +367,12 @@ declare module JXG {
|
|
|
330
367
|
export function merge<U, V>(obj1: U, obj2: V): U | V;
|
|
331
368
|
export function normalizePointFace(s: string): 'x' | 'o' | '[]' | '+' | '<>' | '^' | 'v' | '<' | '>';
|
|
332
369
|
export function providePoints(board: Board, parents: unknown[], attrClass: string, attrArray: unknown[]): JXG.Point[] | false;
|
|
333
|
-
|
|
370
|
+
/**
|
|
371
|
+
* This registers a new construction element to JSXGraph for the construction via the JXG.Board.create interface.
|
|
372
|
+
* @param element The elements name. This is case-insensitive, existing elements with the same name will be overwritten.
|
|
373
|
+
* @param creator The factory function that creates the GeometryElement.
|
|
374
|
+
*/
|
|
375
|
+
export function registerElement(element: string, creator: ((board: Board, parents: unknown[], attributes: Record<string, unknown>) => GeometryElement | Composition | Array<GeometryElement>)): void;
|
|
334
376
|
export function registerReader(reader: Function, ext: unknown[]): void;
|
|
335
377
|
export function removeAllEvents(obj: unknown, type: string, owner: unknown): void;
|
|
336
378
|
export function removeElementFromArray<T>(ar: T[], el: T): T;
|
|
@@ -412,16 +454,34 @@ declare module JXG {
|
|
|
412
454
|
*/
|
|
413
455
|
name: string;
|
|
414
456
|
|
|
457
|
+
/**
|
|
458
|
+
* Controls if updates are necessary.
|
|
459
|
+
*/
|
|
415
460
|
needsUpdate: boolean;
|
|
416
461
|
|
|
462
|
+
/**
|
|
463
|
+
* Stores all Intersection Objects which in this moment are not real and so hide this element.
|
|
464
|
+
*/
|
|
417
465
|
notExistingParents: unknown;
|
|
418
466
|
|
|
467
|
+
/**
|
|
468
|
+
* Counts the number of objects drawn as part of the trace of the element.
|
|
469
|
+
*/
|
|
419
470
|
numTraces: number;
|
|
420
471
|
|
|
421
|
-
|
|
472
|
+
/**
|
|
473
|
+
* Ids of elements on which this element depends directly are stored here.
|
|
474
|
+
*/
|
|
475
|
+
parents: string[];
|
|
422
476
|
|
|
477
|
+
/**
|
|
478
|
+
* Quadratic form representation of circles (and conics)
|
|
479
|
+
*/
|
|
423
480
|
quadraticform: unknown[];
|
|
424
481
|
|
|
482
|
+
/**
|
|
483
|
+
* Stores the SVG (or VML) rendering node for the element.
|
|
484
|
+
*/
|
|
425
485
|
rendNode: HTMLElement;
|
|
426
486
|
|
|
427
487
|
/**
|
|
@@ -429,18 +489,41 @@ declare module JXG {
|
|
|
429
489
|
*/
|
|
430
490
|
stdform: [C: number, A: number, B: number];
|
|
431
491
|
|
|
492
|
+
/**
|
|
493
|
+
* Subs contains the subelements, created during the create method.
|
|
494
|
+
*/
|
|
432
495
|
subs: unknown;
|
|
433
496
|
|
|
497
|
+
/**
|
|
498
|
+
* Stores variables for symbolic computations.
|
|
499
|
+
*/
|
|
434
500
|
symbolic: unknown;
|
|
435
501
|
|
|
502
|
+
/**
|
|
503
|
+
* Keeps track of all objects drawn as part of the trace of the element.
|
|
504
|
+
*/
|
|
436
505
|
traces: unknown;
|
|
437
506
|
|
|
507
|
+
/**
|
|
508
|
+
* Stores the transformations which are applied during update in an array
|
|
509
|
+
*/
|
|
438
510
|
transformations: unknown[];
|
|
439
511
|
|
|
512
|
+
/**
|
|
513
|
+
* Type of the element.
|
|
514
|
+
*/
|
|
440
515
|
type: number;
|
|
441
516
|
|
|
517
|
+
/**
|
|
518
|
+
* An associative array containing all visual properties.
|
|
519
|
+
*/
|
|
442
520
|
visProp: { [name: string]: unknown };
|
|
443
521
|
|
|
522
|
+
/**
|
|
523
|
+
* An associative array containing visual properties which are calculated from the attribute values (i.e. visProp) and from other constraints.
|
|
524
|
+
* An example: if an intersection point does not have real coordinates, visPropCalc.visible is set to false.
|
|
525
|
+
* Additionally, the user can control visibility with the attribute "visible", even by supplying a functions as value.
|
|
526
|
+
*/
|
|
444
527
|
visPropCalc: { [name: string]: unknown };
|
|
445
528
|
|
|
446
529
|
/**
|
|
@@ -474,6 +557,12 @@ declare module JXG {
|
|
|
474
557
|
*/
|
|
475
558
|
addRotation(angle: number): void;
|
|
476
559
|
|
|
560
|
+
/**
|
|
561
|
+
* Get the value of the property key.
|
|
562
|
+
* @param key The name of the property you are looking for.
|
|
563
|
+
*/
|
|
564
|
+
getAttribute(key: string): any;
|
|
565
|
+
|
|
477
566
|
/**
|
|
478
567
|
* Returns the element name.
|
|
479
568
|
*/
|
|
@@ -493,14 +582,24 @@ declare module JXG {
|
|
|
493
582
|
*/
|
|
494
583
|
hideElement(): void;
|
|
495
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Unregister an event handler.
|
|
587
|
+
* For a list of possible events see documentation of the elements and objects implementing the EventEmitter interface.
|
|
588
|
+
* @param event
|
|
589
|
+
* @param handler
|
|
590
|
+
* @returns Reference to the object.
|
|
591
|
+
*/
|
|
592
|
+
off(event: string, handler?: (e: Event) => void): this;
|
|
593
|
+
|
|
496
594
|
/**
|
|
497
595
|
* Register a new event handler.
|
|
498
596
|
* For a list of possible events see documentation of the elements and objects implementing the EventEmitter interface.
|
|
499
597
|
* @param event
|
|
500
598
|
* @param handler
|
|
501
599
|
* @param context The context the handler will be called in, default is the element itself.
|
|
600
|
+
* @returns Reference to the object.
|
|
502
601
|
*/
|
|
503
|
-
on(event: string, handler: (e: Event) => void, context?: unknown):
|
|
602
|
+
on(event: string, handler: (e: Event) => void, context?: unknown): this;
|
|
504
603
|
|
|
505
604
|
/**
|
|
506
605
|
* Sets an arbitrary number of attributes.
|
|
@@ -1494,11 +1593,11 @@ declare module JXG {
|
|
|
1494
1593
|
}
|
|
1495
1594
|
|
|
1496
1595
|
/**
|
|
1497
|
-
*
|
|
1596
|
+
* In this class all group management is done.
|
|
1498
1597
|
*/
|
|
1499
1598
|
export class Group extends GeometryElement {
|
|
1500
1599
|
/**
|
|
1501
|
-
*
|
|
1600
|
+
* Creates a new instance of Group.
|
|
1502
1601
|
* @param board
|
|
1503
1602
|
* @param id Unique identifier for this object. If null or an empty string is given, an unique id will be generated by Board.
|
|
1504
1603
|
* @param name Not necessarily unique name, displayed on the board. If null or an empty string is given, an unique name will be generated.
|
|
@@ -1580,7 +1679,7 @@ declare module JXG {
|
|
|
1580
1679
|
* Sets the rotation points of the group. Dragging at one of these points results into a rotation of the whole group around the rotation center of the group {@see JXG.Group#setRotationCenter}.
|
|
1581
1680
|
* @param objects
|
|
1582
1681
|
*/
|
|
1583
|
-
setRotationPoints(objects: Point[]): this;
|
|
1682
|
+
setRotationPoints(objects: Point | Point[]): this;
|
|
1584
1683
|
/**
|
|
1585
1684
|
* Sets the center of scaling for the group. This is either a point or the centroid of the group.
|
|
1586
1685
|
* @param object
|
|
@@ -1591,12 +1690,12 @@ declare module JXG {
|
|
|
1591
1690
|
* @param objects Array of JXG.Point or arbitrary number of JXG.Point elements.
|
|
1592
1691
|
* @param direction Restricts the directions to be scaled. Possible values are 'x', 'y', 'xy'. Default value is 'xy'. By default, all points of the group are translation points.
|
|
1593
1692
|
*/
|
|
1594
|
-
setScalePoints(objects: Point[], direction?: 'x' | 'y' | 'xy'): this;
|
|
1693
|
+
setScalePoints(objects: Point | Point[], direction?: 'x' | 'y' | 'xy'): this;
|
|
1595
1694
|
/**
|
|
1596
1695
|
* Sets the translation points of the group. Dragging at one of these points results into a translation of the whole group.
|
|
1597
1696
|
* @param objects Array of JXG.Point or arbitrary number of JXG.Point elements. By default, all points of the group are translation points.
|
|
1598
1697
|
*/
|
|
1599
|
-
setTranslationPoints(objects: Point[]): this;
|
|
1698
|
+
setTranslationPoints(objects: Point | Point[]): this;
|
|
1600
1699
|
/**
|
|
1601
1700
|
* Releases all elements of this group.
|
|
1602
1701
|
*/
|
|
@@ -1762,6 +1861,11 @@ declare module JXG {
|
|
|
1762
1861
|
}
|
|
1763
1862
|
export interface HyperbolaAttributes extends ConicAttributes { }
|
|
1764
1863
|
|
|
1864
|
+
export interface Parabola extends Conic {
|
|
1865
|
+
setAttribute(attributes: ParabolaAttributes): this;
|
|
1866
|
+
}
|
|
1867
|
+
export interface ParabolaAttributes extends ConicAttributes { }
|
|
1868
|
+
|
|
1765
1869
|
/**
|
|
1766
1870
|
*
|
|
1767
1871
|
*/
|
|
@@ -2321,7 +2425,7 @@ declare module JXG {
|
|
|
2321
2425
|
*/
|
|
2322
2426
|
postLabel?: string | StringFunction | number | NumberFunction | null;
|
|
2323
2427
|
/**
|
|
2324
|
-
*
|
|
2428
|
+
*
|
|
2325
2429
|
*/
|
|
2326
2430
|
showInfobox?: boolean;
|
|
2327
2431
|
/**
|
|
@@ -2468,54 +2572,127 @@ declare module JXG {
|
|
|
2468
2572
|
L(): number;
|
|
2469
2573
|
setAttribute(attributes: LineAttributes): this;
|
|
2470
2574
|
}
|
|
2575
|
+
/**
|
|
2576
|
+
*
|
|
2577
|
+
*/
|
|
2471
2578
|
export interface LineAttributes extends GeometryElementAttributes {
|
|
2472
2579
|
/**
|
|
2473
2580
|
* Determines whether the line has an arrow at the first defining point.
|
|
2581
|
+
*
|
|
2582
|
+
* type=7 is the default for curves if firstArrow: true
|
|
2583
|
+
*
|
|
2584
|
+
* Default Value: false
|
|
2585
|
+
*/
|
|
2586
|
+
firstArrow?: boolean | { type?: 1 | 2 | 3 | 4 | 5 | 6 | 7; highlightSize?: number; size?: number };
|
|
2587
|
+
/**
|
|
2588
|
+
* Attributes for the line label.
|
|
2474
2589
|
*/
|
|
2475
|
-
|
|
2590
|
+
label?: LabelOptions;
|
|
2476
2591
|
/**
|
|
2477
2592
|
* Determines whether the line has an arrow at the second defining point.
|
|
2593
|
+
*
|
|
2594
|
+
* type=7 is the default for curves if lastArrow: true
|
|
2595
|
+
*
|
|
2596
|
+
* Default Value: false
|
|
2478
2597
|
*/
|
|
2479
|
-
lastArrow?: boolean | { type?:
|
|
2598
|
+
lastArrow?: boolean | { type?: 1 | 2 | 3 | 4 | 5 | 6 | 7; highlightSize?: number; size?: number };
|
|
2480
2599
|
/**
|
|
2600
|
+
* Line endings (linecap) of a straight line.
|
|
2481
2601
|
*
|
|
2602
|
+
* Not available for VML renderer.
|
|
2603
|
+
*
|
|
2604
|
+
* Default Value: 'butt'
|
|
2605
|
+
*/
|
|
2606
|
+
lineCap?: 'butt' | 'round' | 'square';
|
|
2607
|
+
/**
|
|
2608
|
+
* Attributes for first defining point of the line.
|
|
2482
2609
|
*/
|
|
2483
2610
|
point1?: PointAttributes;
|
|
2484
2611
|
/**
|
|
2485
|
-
*
|
|
2612
|
+
* Attributes for second defining point of the line.
|
|
2486
2613
|
*/
|
|
2487
2614
|
point2?: PointAttributes;
|
|
2615
|
+
/**
|
|
2616
|
+
* Defines together with Point#snapSizeY the grid the point snaps on to.
|
|
2617
|
+
* The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
|
|
2618
|
+
* If this value is equal to or less than 0, it will use the grid displayed by the major ticks of the default ticks of the default x axes of the board.
|
|
2619
|
+
*
|
|
2620
|
+
* Default Value: 1
|
|
2621
|
+
*/
|
|
2622
|
+
snapSizeX?: number;
|
|
2623
|
+
/**
|
|
2624
|
+
* Defines together with Point#snapSizeX the grid the point snaps on to.
|
|
2625
|
+
* The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction.
|
|
2626
|
+
* If this value is equal to or less than 0, it will use the grid displayed by the major ticks of the default ticks of the default y axes of the board.
|
|
2627
|
+
*
|
|
2628
|
+
* Default Value: 1
|
|
2629
|
+
*/
|
|
2630
|
+
snapSizeY?: number;
|
|
2631
|
+
/**
|
|
2632
|
+
* If set to true, the point will snap to a grid defined by Point#snapSizeX and Point#snapSizeY.
|
|
2633
|
+
*
|
|
2634
|
+
* Default Value: false
|
|
2635
|
+
*/
|
|
2636
|
+
snapToGrid?: boolean;
|
|
2488
2637
|
/**
|
|
2489
2638
|
* Determines whether the line is drawn beyond the first defining point.
|
|
2639
|
+
*
|
|
2640
|
+
* If true, line stretches infinitely in direction of its first point. Otherwise it ends at point1.
|
|
2641
|
+
*
|
|
2642
|
+
* Default Value: true
|
|
2490
2643
|
*/
|
|
2491
2644
|
straightFirst?: boolean;
|
|
2492
2645
|
/**
|
|
2493
2646
|
* Determines whether the line is drawn beyond the second defining point.
|
|
2647
|
+
*
|
|
2648
|
+
* If true, line stretches infinitely in direction of its second point. Otherwise it ends at point2.
|
|
2649
|
+
*
|
|
2650
|
+
* Default Value: true
|
|
2494
2651
|
*/
|
|
2495
2652
|
straightLast?: boolean;
|
|
2653
|
+
/**
|
|
2654
|
+
* Attributes for ticks of the line.
|
|
2655
|
+
*/
|
|
2656
|
+
ticks?: TicksOptions;
|
|
2657
|
+
/**
|
|
2658
|
+
* If set to true and Line#firstArrow is set to true, the arrow head will just touch the circle line of the start point of the line.
|
|
2659
|
+
*
|
|
2660
|
+
* Default Value: false
|
|
2661
|
+
*/
|
|
2662
|
+
touchFirstPoint?: boolean;
|
|
2663
|
+
/**
|
|
2664
|
+
* If set to true and Line#lastArrow is set to true, the arrow head will just touch the circle line of the start point of the line.
|
|
2665
|
+
*
|
|
2666
|
+
* Default Value: false
|
|
2667
|
+
*/
|
|
2668
|
+
touchLastPoint?: boolean;
|
|
2496
2669
|
}
|
|
2497
2670
|
|
|
2498
2671
|
export interface LineOptions extends GeometryElementAttributes {
|
|
2499
2672
|
/**
|
|
2500
2673
|
* Determines whether the line has an arrow at the first defining point.
|
|
2501
2674
|
*/
|
|
2502
|
-
firstArrow?: boolean | { type?:
|
|
2675
|
+
firstArrow?: boolean | { type?: 1 | 2 | 3 | 4 | 5 | 6 | 7; highlightSize?: number; size?: number };
|
|
2503
2676
|
/**
|
|
2504
2677
|
*
|
|
2505
2678
|
*/
|
|
2506
2679
|
fixed?: boolean;
|
|
2507
|
-
/**
|
|
2508
|
-
* Determines whether the line has an arrow at the second defining point.
|
|
2509
|
-
*/
|
|
2510
|
-
lastArrow?: boolean | { type?: number; highlightSize?: number; size?: number };
|
|
2511
2680
|
/**
|
|
2512
2681
|
*
|
|
2513
2682
|
*/
|
|
2514
2683
|
label?: LabelOptions;
|
|
2515
2684
|
/**
|
|
2685
|
+
* Determines whether the line has an arrow at the second defining point.
|
|
2686
|
+
*/
|
|
2687
|
+
lastArrow?: boolean | { type?: 1 | 2 | 3 | 4 | 5 | 6 | 7; highlightSize?: number; size?: number };
|
|
2688
|
+
/**
|
|
2689
|
+
* Line endings (linecap) of a straight line.
|
|
2690
|
+
*
|
|
2691
|
+
* Not available for VML renderer.
|
|
2516
2692
|
*
|
|
2693
|
+
* Default Value: 'butt'
|
|
2517
2694
|
*/
|
|
2518
|
-
lineCap?: 'butt';
|
|
2695
|
+
lineCap?: 'butt' | 'round' | 'square';
|
|
2519
2696
|
/**
|
|
2520
2697
|
*
|
|
2521
2698
|
*/
|
|
@@ -2658,7 +2835,7 @@ declare module JXG {
|
|
|
2658
2835
|
* Attributes for the axis label.
|
|
2659
2836
|
*/
|
|
2660
2837
|
label?: LabelOptions;
|
|
2661
|
-
lastArrow?: ArrowSpecification;
|
|
2838
|
+
lastArrow?: boolean | ArrowSpecification;
|
|
2662
2839
|
margin?: number;
|
|
2663
2840
|
/**
|
|
2664
2841
|
* Attributes for the first point on the axis.
|
|
@@ -2773,8 +2950,61 @@ declare module JXG {
|
|
|
2773
2950
|
*/
|
|
2774
2951
|
export class Ticks extends GeometryElement {
|
|
2775
2952
|
constructor(line: Line, ticks: number | unknown[], attributes: TicksAttributes);
|
|
2953
|
+
|
|
2954
|
+
/**
|
|
2955
|
+
* Equidistant ticks. Distance is defined by `ticksFunction`.
|
|
2956
|
+
*/
|
|
2957
|
+
equidistant: boolean;
|
|
2958
|
+
|
|
2959
|
+
/**
|
|
2960
|
+
* Array of fixed ticks.
|
|
2961
|
+
*/
|
|
2962
|
+
fixedTicks: number[] | null;
|
|
2963
|
+
|
|
2964
|
+
/**
|
|
2965
|
+
* To ensure the uniqueness of label ids this counter is used.
|
|
2966
|
+
*/
|
|
2967
|
+
labelCounter: number;
|
|
2968
|
+
|
|
2969
|
+
/**
|
|
2970
|
+
* Array where the labels are saved.
|
|
2971
|
+
*/
|
|
2972
|
+
labels: Label[];
|
|
2973
|
+
|
|
2974
|
+
/**
|
|
2975
|
+
* The line the ticks belong to.
|
|
2976
|
+
*/
|
|
2977
|
+
line: Line;
|
|
2978
|
+
|
|
2979
|
+
/**
|
|
2980
|
+
* Least distance between two ticks, measured in pixels.
|
|
2981
|
+
*/
|
|
2982
|
+
minTicksDistance: number;
|
|
2983
|
+
|
|
2984
|
+
/**
|
|
2985
|
+
* Stores the ticks coordinates as an array of length 3.
|
|
2986
|
+
*
|
|
2987
|
+
* The first two entries of the array are path coordinates in screen
|
|
2988
|
+
* coordinates of the tick (arrays of length 2). The 3rd entry is true if
|
|
2989
|
+
* the tick is a major tick, otherwise false.
|
|
2990
|
+
*
|
|
2991
|
+
* If the tick is outside of the canvas, the return array is empty.
|
|
2992
|
+
*/
|
|
2993
|
+
ticks: Array<[[x1: number, x2: number], [y1: number, y2: number], boolean]>;
|
|
2994
|
+
|
|
2995
|
+
/**
|
|
2996
|
+
* Distance between two major ticks in user coordinates
|
|
2997
|
+
*/
|
|
2998
|
+
ticksDelta: number;
|
|
2999
|
+
|
|
3000
|
+
/**
|
|
3001
|
+
* A function calculating ticks delta depending on the ticks number.
|
|
3002
|
+
*/
|
|
3003
|
+
ticksFunction: () => number;
|
|
3004
|
+
|
|
2776
3005
|
setAttribute(attributes: TicksAttributes): this;
|
|
2777
3006
|
}
|
|
3007
|
+
|
|
2778
3008
|
/**
|
|
2779
3009
|
*
|
|
2780
3010
|
*/
|
|
@@ -2803,7 +3033,7 @@ declare module JXG {
|
|
|
2803
3033
|
/**
|
|
2804
3034
|
*
|
|
2805
3035
|
*/
|
|
2806
|
-
generateLabelText?: ((labeled: Coords, center: Coords) => string) | null;
|
|
3036
|
+
generateLabelText?: ((labeled: Coords, center: Coords, value: null | Number | String) => string) | null;
|
|
2807
3037
|
/**
|
|
2808
3038
|
*
|
|
2809
3039
|
*/
|
|
@@ -2879,10 +3109,10 @@ declare module JXG {
|
|
|
2879
3109
|
defaultDistance?: number;
|
|
2880
3110
|
drawLabels?: boolean;
|
|
2881
3111
|
drawZero?: boolean;
|
|
2882
|
-
face?: '|';
|
|
3112
|
+
face?: '|' | '<' | '>';
|
|
2883
3113
|
fillColor?: string;
|
|
2884
|
-
generateLabelText?: ((one: Coords, two: Coords) => void) | null;
|
|
2885
|
-
generateLabelValue?: ((
|
|
3114
|
+
generateLabelText?: ((one: Coords, two: Coords, value: null|Number|String) => void) | null;
|
|
3115
|
+
generateLabelValue?: ((labeled: Coords, center: Coords) => string) | null;
|
|
2886
3116
|
highlightFillColor?: string;
|
|
2887
3117
|
highlightStrokeColor?: string;
|
|
2888
3118
|
includeBoundaries?: boolean | number;
|
|
@@ -2936,18 +3166,70 @@ declare module JXG {
|
|
|
2936
3166
|
numberPoints?: number;
|
|
2937
3167
|
}
|
|
2938
3168
|
|
|
3169
|
+
export type TransformationType = 'generic' | 'reflect' | 'rotate' | 'scale' | 'shear' | 'translate'
|
|
3170
|
+
|
|
3171
|
+
/**
|
|
3172
|
+
* A transformation consists of a 3x3 matrix, i.e. it is a projective transformation.
|
|
3173
|
+
*/
|
|
2939
3174
|
export class Transformation extends GeometryElement {
|
|
2940
|
-
|
|
2941
|
-
|
|
3175
|
+
/**
|
|
3176
|
+
* @param board The board the new circle is drawn on.
|
|
3177
|
+
* @param type Can be 'translate', 'scale', 'reflect', 'rotate', 'shear', 'generic'
|
|
3178
|
+
* @param params The parameters depend on the transformation type.
|
|
3179
|
+
*/
|
|
3180
|
+
constructor(board: Board, type: TransformationType, params: unknown);
|
|
3181
|
+
/**
|
|
3182
|
+
* Transform a GeometryElement: First, the transformation matrix is updated, then do the matrix-vector-multiplication.
|
|
3183
|
+
* @param p element which is transformed
|
|
3184
|
+
*/
|
|
3185
|
+
private apply(p: GeometryElement): unknown[];
|
|
3186
|
+
/**
|
|
3187
|
+
* Applies a transformation once to a GeometryElement or an array of elements.
|
|
3188
|
+
* If it is a free point, then it can be dragged around later and will overwrite the transformed coordinates.
|
|
3189
|
+
* @param p
|
|
3190
|
+
*/
|
|
2942
3191
|
applyOnce(p: GeometryElement | GeometryElement[]): void;
|
|
2943
|
-
|
|
3192
|
+
/**
|
|
3193
|
+
* Binds a transformation to a GeometryElement or an array of elements.
|
|
3194
|
+
* In every update of the GeometryElement(s), the transformation is executed.
|
|
3195
|
+
* That means, in order to immediately apply the transformation, a call of board.update() has to follow.
|
|
3196
|
+
* @param p JXG.Object or array of JXG.Object to which the transformation is bound to.
|
|
3197
|
+
*/
|
|
3198
|
+
bindTo(p: GeometryElement | Point[]): void;
|
|
3199
|
+
/**
|
|
3200
|
+
* Combine two transformations to one transformation.
|
|
3201
|
+
* This only works if both of transformation matrices consist solely of numbers, and do not contain functions.
|
|
3202
|
+
* Multiplies the transformation with a transformation t from the left. i.e. (this) = (t) join (this)
|
|
3203
|
+
* @param t Transformation which is the left multiplicand
|
|
3204
|
+
* @returns the transformation object.
|
|
3205
|
+
*/
|
|
2944
3206
|
melt(t: Transformation): Transformation;
|
|
2945
|
-
|
|
2946
|
-
|
|
3207
|
+
/**
|
|
3208
|
+
* Empty method. Unused.
|
|
3209
|
+
* @param term Key-value pairs of the attributes.
|
|
3210
|
+
*/
|
|
3211
|
+
setAttribute(term: TransformationAttributes): this;
|
|
3212
|
+
/**
|
|
3213
|
+
* Set the transformation matrix for different types of standard transforms.
|
|
3214
|
+
* @param board
|
|
3215
|
+
* @param type Transformation type, possible values are 'translate', 'scale', 'reflect', 'rotate', 'shear', 'generic'.
|
|
3216
|
+
* @param params Parameters for the various transformation types.
|
|
3217
|
+
* @param x Shift vector (number or function) in case of 'translate'.
|
|
3218
|
+
* @param y Shift vector (number or function) in case of 'translate'.
|
|
3219
|
+
* @param scale_x Scale vector (number or function) in case of 'scale'.
|
|
3220
|
+
* @param scale_y Scale vector (number or function) in case of 'scale'.
|
|
3221
|
+
*/
|
|
3222
|
+
setMatrix(board: Board, type: TransformationType, params: unknown[], x: NumberOrFunction, y: NumberOrFunction, scale_x: NumberOrFunction, scale_y: NumberOrFunction): void;
|
|
3223
|
+
/**
|
|
3224
|
+
* Updates the numerical data for the transformation, i.e. the entry of the subobject matrix.
|
|
3225
|
+
*/
|
|
2947
3226
|
update(): this;
|
|
2948
3227
|
}
|
|
3228
|
+
/**
|
|
3229
|
+
*
|
|
3230
|
+
*/
|
|
2949
3231
|
export interface TransformationAttributes {
|
|
2950
|
-
type:
|
|
3232
|
+
type: TransformationType;
|
|
2951
3233
|
}
|
|
2952
3234
|
|
|
2953
3235
|
/**
|
|
@@ -3615,6 +3897,13 @@ declare module JXG {
|
|
|
3615
3897
|
clickLeftArrow(): this;
|
|
3616
3898
|
clickRightArrow(): this;
|
|
3617
3899
|
clickUpArrow(): this;
|
|
3900
|
+
/**
|
|
3901
|
+
* Creates a new geometric element of type elementType.
|
|
3902
|
+
* @param elementType Type of the element to be constructed given as a string e.g. 'point' or 'circle'.
|
|
3903
|
+
* @param parents
|
|
3904
|
+
* @param attributes
|
|
3905
|
+
*/
|
|
3906
|
+
create<T extends GeometryElement | Composition | Array<GeometryElement>>(elementType: string, parents: unknown[], attributes?: Record<string, unknown>): T;
|
|
3618
3907
|
/**
|
|
3619
3908
|
*
|
|
3620
3909
|
* @param elementType 'angle'
|
|
@@ -3793,7 +4082,7 @@ declare module JXG {
|
|
|
3793
4082
|
* @param parents
|
|
3794
4083
|
* @param attributes
|
|
3795
4084
|
*/
|
|
3796
|
-
create(elementType: 'hyperbola', parents: unknown[], attributes?:
|
|
4085
|
+
create(elementType: 'hyperbola', parents: unknown[], attributes?: HyperbolaAttributes): Hyperbola;
|
|
3797
4086
|
/**
|
|
3798
4087
|
*
|
|
3799
4088
|
* @param elementType 'image'
|
|
@@ -3801,6 +4090,13 @@ declare module JXG {
|
|
|
3801
4090
|
* @param attributes
|
|
3802
4091
|
*/
|
|
3803
4092
|
create(elementType: 'image', parents: unknown[], attributes?: ImageAttributes): Image;
|
|
4093
|
+
/**
|
|
4094
|
+
*
|
|
4095
|
+
* @param elementType 'inequality'
|
|
4096
|
+
* @param parents
|
|
4097
|
+
* @param attributes
|
|
4098
|
+
*/
|
|
4099
|
+
create(elementType: 'inequality', parents: unknown[], attributes?: InequalityAttributes): Inequality;
|
|
3804
4100
|
/**
|
|
3805
4101
|
*
|
|
3806
4102
|
* @param elementType 'input'
|
|
@@ -3864,6 +4160,13 @@ declare module JXG {
|
|
|
3864
4160
|
* @param attributes
|
|
3865
4161
|
*/
|
|
3866
4162
|
create(elementType: 'normal', parents: unknown[], attributes?: NormalAttributes): Normal;
|
|
4163
|
+
/**
|
|
4164
|
+
*
|
|
4165
|
+
* @param elementType 'parabola'
|
|
4166
|
+
* @param parents
|
|
4167
|
+
* @param attributes
|
|
4168
|
+
*/
|
|
4169
|
+
create(elementType: 'parabola', parents: unknown[], attributes?: ParabolaAttributes): Parabola;
|
|
3867
4170
|
/**
|
|
3868
4171
|
*
|
|
3869
4172
|
* @param elementType 'perpendicular'
|
|
@@ -4034,7 +4337,7 @@ declare module JXG {
|
|
|
4034
4337
|
/**
|
|
4035
4338
|
*
|
|
4036
4339
|
*/
|
|
4037
|
-
|
|
4340
|
+
emulateColorblindness(deficiency: 'protanopia' | 'deuteranopia' | 'tritanopia'): this;
|
|
4038
4341
|
/**
|
|
4039
4342
|
* After construction of the object the visibility is set and the label is constructed if necessary.
|
|
4040
4343
|
* @param obj The object to add.
|
|
@@ -4052,10 +4355,10 @@ declare module JXG {
|
|
|
4052
4355
|
getCoordsTopLeftCorner(): [number, number];
|
|
4053
4356
|
getMousePosition(e: unknown, i?: number): [number, number];
|
|
4054
4357
|
getScrCoordsOfMouse(x: number, y: number): [number, number];
|
|
4055
|
-
|
|
4358
|
+
getUsrCoordsOfMouse(evt: unknown): [number, number];
|
|
4056
4359
|
hasPoint(x: number, y: number): boolean;
|
|
4057
4360
|
highlightCustomInfobox(text: string, element?: GeometryElement): this;
|
|
4058
|
-
|
|
4361
|
+
highlightInfobox(x: number, y: number, element?: GeometryElement): this;
|
|
4059
4362
|
initInfobox(): this;
|
|
4060
4363
|
initMoveObject(x: number, y: number, event: unknown, type: 'mouse' | 'pen' | 'touch'): GeometryElement[];
|
|
4061
4364
|
initMoveOrigin(x: number, y: number): unknown;
|
|
@@ -4121,11 +4424,13 @@ declare module JXG {
|
|
|
4121
4424
|
setZoom(fX: number, fY: number): Board;
|
|
4122
4425
|
showDependencies(): this;
|
|
4123
4426
|
showXML(): this;
|
|
4427
|
+
startResizeObserver(): unknown;
|
|
4124
4428
|
startSelectionMode(): unknown;
|
|
4125
4429
|
/**
|
|
4126
4430
|
* Cancels all running animations.
|
|
4127
4431
|
*/
|
|
4128
4432
|
stopAllAnimation(): Board;
|
|
4433
|
+
stopResizeObserver(): unknown;
|
|
4129
4434
|
stopSelectionMode(): [Coords, Coords];
|
|
4130
4435
|
/**
|
|
4131
4436
|
* Stop updates of the board.
|
|
@@ -5266,3 +5571,10 @@ declare module JXG {
|
|
|
5266
5571
|
rungeKutta(butcher: unknown, x0: number[], I: number[], N: number, f: unknown): number[][];
|
|
5267
5572
|
}
|
|
5268
5573
|
}
|
|
5574
|
+
|
|
5575
|
+
/**
|
|
5576
|
+
* JSXGraph in the module "jsxgraph".
|
|
5577
|
+
*/
|
|
5578
|
+
declare module "jsxgraph" {
|
|
5579
|
+
export = JXG;
|
|
5580
|
+
}
|
package/distrib/intergeo.min.js
CHANGED