jsxgraph 1.4.4 → 1.4.6

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.
Files changed (56) hide show
  1. package/README.md +24 -0
  2. package/build/Readme.md +17 -0
  3. package/build/bin/jsxcompressor.js +1 -0
  4. package/build/bin/jsxgraphcore-min.js +7 -0
  5. package/build/bin/jsxgraphcore.js +83017 -0
  6. package/build/bin/jsxgraphcore.min.js +67 -0
  7. package/build/compressor.build.json +14 -0
  8. package/build/compressor.deps.js +8 -0
  9. package/build/core-amd.build.json +14 -0
  10. package/build/core-amd.deps.js +81 -0
  11. package/build/core.build.json +14 -0
  12. package/build/core.deps.js +102 -0
  13. package/build/plot.build.json +15 -0
  14. package/distrib/README.md +24 -0
  15. package/distrib/geogebra.min.js +1 -1
  16. package/distrib/geonext.min.js +1 -1
  17. package/distrib/index.d.ts +28 -7
  18. package/distrib/intergeo.min.js +1 -1
  19. package/distrib/jsxgraph.css +6 -0
  20. package/distrib/jsxgraphcore.js +3 -3
  21. package/distrib/jsxgraphsrc.js +3558 -1857
  22. package/distrib/sketch.min.js +1 -1
  23. package/package.json +1 -1
  24. package/src/3d/box3d.js +43 -38
  25. package/src/3d/curve3d.js +157 -53
  26. package/src/3d/element3d.js +84 -0
  27. package/src/3d/linspace3d.js +427 -146
  28. package/src/3d/point3d.js +360 -123
  29. package/src/3d/surface3d.js +140 -42
  30. package/src/3d/view3d.js +319 -164
  31. package/src/base/board.js +163 -78
  32. package/src/base/constants.js +8 -1
  33. package/src/base/curve.js +51 -9
  34. package/src/base/polygon.js +111 -69
  35. package/src/base/text.js +122 -19
  36. package/src/base/ticks.js +12 -3
  37. package/src/element/button.js +7 -3
  38. package/src/element/checkbox.js +8 -4
  39. package/src/element/composition.js +7 -1
  40. package/src/element/conic.js +2 -2
  41. package/src/element/input.js +9 -5
  42. package/src/jsxgraph.js +4 -1
  43. package/src/loadjsxgraph.js +13 -8
  44. package/src/math/clip.js +34 -134
  45. package/src/math/geometry.js +204 -3
  46. package/src/math/math.js +1 -2
  47. package/src/math/nlp.js +865 -774
  48. package/src/options.js +185 -12
  49. package/src/options3d.js +24 -7
  50. package/src/parser/jessiecode.js +9 -3
  51. package/src/renderer/abstract.js +26 -15
  52. package/src/renderer/canvas.js +2 -2
  53. package/src/renderer/svg.js +15 -2
  54. package/src/utils/env.js +36 -53
  55. package/src/utils/type.js +75 -2
  56. package/src/3d/threed.js +0 -38
@@ -0,0 +1,14 @@
1
+ {
2
+ "baseUrl": "../src/",
3
+ "name": "../node_modules/almond/almond",
4
+ "include": [
5
+ "../build/compressor.deps.js"
6
+ ],
7
+ "wrap": {
8
+ "start": "(function () {",
9
+ "end": "window.JXG = require('../build/compressor.deps.js');}())"
10
+ },
11
+ "out": './bin/jsxcompressor.js',
12
+ "optimize": "uglify2",
13
+ "preserveLicenseComments": false
14
+ }
@@ -0,0 +1,8 @@
1
+ define(['jxg', 'utils/zip', 'utils/base64'], function (JXG, Zip, Base64) {
2
+ JXG.decompress = function (str) {
3
+ //return unescape((new Zip.Unzip(Base64.decodeAsArray(str))).unzip()[0][0]);
4
+ return decodeURIComponent((new Zip.Unzip(Base64.decodeAsArray(str))).unzip()[0][0]);
5
+ };
6
+
7
+ return JXG;
8
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "baseUrl": "../src/",
3
+ "name": "../node_modules/almond/almond",
4
+ "include": [
5
+ "../build/core-amd.deps.js"
6
+ ],
7
+ "wrap": {
8
+ "start": "define(function () {\n",
9
+ "end": "\n\nreturn require('../build/core-amd.deps.js');\n}());"
10
+ },
11
+ "out": './bin/jsxgraphcore-amd.js',
12
+ "optimize": "uglify2",
13
+ "preserveLicenseComments": false
14
+ }
@@ -0,0 +1,81 @@
1
+ /*global define: true*/
2
+ define([
3
+ 'jxg',
4
+ 'utils/env',
5
+ 'base/constants',
6
+ 'utils/type',
7
+ 'utils/xml',
8
+ 'utils/event',
9
+ 'utils/expect',
10
+ 'math/math',
11
+ 'math/extrapolate',
12
+ 'math/qdt',
13
+ 'math/numerics',
14
+ 'math/statistics',
15
+ 'math/symbolic',
16
+ 'math/geometry',
17
+ 'math/clip',
18
+ 'math/poly',
19
+ 'math/complex',
20
+ 'renderer/abstract',
21
+ 'renderer/no',
22
+ 'reader/file',
23
+ 'parser/geonext',
24
+ 'base/board',
25
+ 'options',
26
+ 'jsxgraph',
27
+ 'base/element',
28
+ 'base/coords',
29
+ 'base/point',
30
+ 'base/line',
31
+ 'base/group',
32
+ 'base/circle',
33
+ 'element/conic',
34
+ 'base/polygon',
35
+ 'base/curve',
36
+ 'element/arc',
37
+ 'element/sector',
38
+ 'base/composition',
39
+ 'element/composition',
40
+ 'element/locus',
41
+ 'base/text',
42
+ 'base/image',
43
+ 'element/slider',
44
+ 'element/measure',
45
+ 'base/chart',
46
+ 'base/transformation',
47
+ 'base/turtle',
48
+ 'utils/color',
49
+ 'base/ticks',
50
+ 'utils/zip',
51
+ 'utils/base64',
52
+ 'utils/uuid',
53
+ 'utils/encoding',
54
+ 'server/server',
55
+ 'element/locus',
56
+ 'parser/datasource',
57
+ 'parser/jessiecode',
58
+ 'utils/dump',
59
+ 'renderer/svg',
60
+ 'renderer/vml',
61
+ 'renderer/canvas',
62
+ 'renderer/no',
63
+ 'element/comb',
64
+ 'element/slopetriangle',
65
+ 'element/checkbox',
66
+ 'element/input',
67
+ 'element/button',
68
+ 'base/foreignobject',
69
+ 'options3d',
70
+ '3d/box3d',
71
+ '3d/curve3d',
72
+ '3d/linspace3d',
73
+ '3d/point3d',
74
+ '3d/surface3d',
75
+ '3d/threed',
76
+ '3d/view3d'
77
+ ], function (JXG) {
78
+ "use strict";
79
+
80
+ return JXG;
81
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "baseUrl": "../src/",
3
+ "name": "../node_modules/almond/almond",
4
+ "include": [
5
+ "../build/core.deps.js"
6
+ ],
7
+ "wrap": {
8
+ "start": "(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define('jsxgraphcore', [], factory);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = factory();\n } else {\n root.returnExports = factory();\n }\n}(typeof self !== 'undefined' ? self : this, function () {\n",
9
+ "end": " return require('../build/core.deps.js');\n}));"
10
+ },
11
+ "out": "./bin/jsxgraphcore.js",
12
+ "optimize": "none",
13
+ "preserveLicenseComments": false
14
+ }
@@ -0,0 +1,102 @@
1
+ /*global define: true*/
2
+ define([
3
+ 'jxg',
4
+ 'utils/env',
5
+ 'base/constants',
6
+ 'utils/type',
7
+ 'utils/xml',
8
+ 'utils/event',
9
+ 'utils/expect',
10
+ 'math/math',
11
+ 'math/probfuncs',
12
+ 'math/ia',
13
+ 'math/extrapolate',
14
+ 'math/qdt',
15
+ 'math/numerics',
16
+ 'math/nlp',
17
+ 'math/plot',
18
+ 'math/metapost',
19
+ 'math/statistics',
20
+ 'math/symbolic',
21
+ 'math/geometry',
22
+ 'math/clip',
23
+ 'math/poly',
24
+ 'math/complex',
25
+ 'renderer/abstract',
26
+ 'reader/file',
27
+ 'parser/geonext',
28
+ 'base/board',
29
+ 'options',
30
+ 'jsxgraph',
31
+ 'base/element',
32
+ 'base/coords',
33
+ 'base/coordselement',
34
+ 'base/point',
35
+ 'base/line',
36
+ 'base/group',
37
+ 'base/circle',
38
+ 'element/conic',
39
+ 'base/polygon',
40
+ 'base/curve',
41
+ 'element/arc',
42
+ 'element/sector',
43
+ 'base/composition',
44
+ 'element/composition',
45
+ 'element/locus',
46
+ 'base/text',
47
+ 'base/image',
48
+ 'element/slider',
49
+ 'element/measure',
50
+ 'base/chart',
51
+ 'base/transformation',
52
+ 'base/turtle',
53
+ 'utils/color',
54
+ 'base/ticks',
55
+ 'utils/zip',
56
+ 'utils/base64',
57
+ 'utils/uuid',
58
+ 'utils/encoding',
59
+ 'server/server',
60
+ 'parser/datasource',
61
+ 'parser/jessiecode',
62
+ 'parser/ca',
63
+ 'utils/dump',
64
+ 'renderer/svg',
65
+ 'renderer/vml',
66
+ 'renderer/canvas',
67
+ 'renderer/no',
68
+ 'element/comb',
69
+ 'element/slopetriangle',
70
+ 'element/checkbox',
71
+ 'element/input',
72
+ 'element/button',
73
+ 'base/foreignobject',
74
+ 'options3d',
75
+ '3d/view3d',
76
+ '3d/element3d',
77
+ '3d/box3d',
78
+ '3d/point3d',
79
+ '3d/curve3d',
80
+ '3d/linspace3d',
81
+ '3d/surface3d'
82
+ ], function (JXG, Env) {
83
+ "use strict";
84
+
85
+ // We're in the browser, export JXG to the global JXG symbol for backwards compatibility
86
+ if (Env.isBrowser) {
87
+ window.JXG = JXG;
88
+
89
+ // In node there are two cases:
90
+ // 1) jsxgraph is used without requirejs (e.g. as jsxgraphcore.js)
91
+ // 2) jsxgraph is loaded using requirejs (e.g. the dev version)
92
+ //
93
+ // in case 2) module is undefined, the export is set in src/jsxgraphnode.js using
94
+ // the return value of this factory function
95
+ } else if (Env.isNode() && typeof module === 'object') {
96
+ module.exports = JXG;
97
+ } else if (Env.isWebWorker()) {
98
+ self.JXG = JXG;
99
+ }
100
+
101
+ return JXG;
102
+ });
@@ -0,0 +1,15 @@
1
+ {
2
+ "baseUrl": "../src/",
3
+ "name": "../node_modules/almond/almond",
4
+ "include": [
5
+ "jsxgraph",
6
+ "base/curve"
7
+ ],
8
+ "wrap": {
9
+ "start": "(function () {",
10
+ "end": "window.JXG = require('jxg');}())"
11
+ },
12
+ "out": './bin/jxgplot.js',
13
+ "optimize": "uglify2",
14
+ "preserveLicenseComments": false
15
+ }
package/distrib/README.md CHANGED
@@ -19,6 +19,30 @@ to optimize the performance.
19
19
  Lehrstuhl für Mathematik und ihre Didaktik
20
20
  University of Bayreuth, Germany
21
21
 
22
+ Upcoming event: 3rd JSXGraph conference (online)
23
+ --------------
24
+
25
+ Date: October 4th - 6th, 2022
26
+
27
+ Conference homepage: <https://jsxgraph.org/conf2022/>
28
+
29
+ The conference will bring together developers and teachers, instructors and designers who are interested or already experienced in using JSXGraph (https://jsxgraph.org) to enhance digital learning of STEM topics.
30
+
31
+ The conference will be an entirely online conference. All participants are required to register (https://jsxgraph.org/conf2022/registration/), registration is free.
32
+
33
+ We invite all participants to contribute a talk or workshop and
34
+
35
+ - report about their concepts, experience, and workflow,
36
+ - present their applications and best practices,
37
+ - discuss pedagogical concepts involving JSXGraph.
38
+
39
+ Deadline for submission of talks / presentations: 31. August 2022
40
+
41
+ Details about the conference software will be announced at a later stage.
42
+
43
+ The 3nd International JSXGraph conference 2022 will be organized by the center of Mobile Learning with Digital Technology (https://mobiles-lernen.uni-bayreuth.de/) at the University of Bayreuth, Germany.
44
+
45
+
22
46
  Website
23
47
  -------
24
48
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- JSXGraph 1.4.4
2
+ JSXGraph 1.4.6
3
3
 
4
4
  Copyright 2008-2022
5
5
  Matthias Ehmann,
@@ -1,5 +1,5 @@
1
1
  /*
2
- JSXGraph 1.4.4
2
+ JSXGraph 1.4.6
3
3
 
4
4
  Copyright 2008-2022
5
5
  Matthias Ehmann,
@@ -557,6 +557,12 @@ declare namespace JXG {
557
557
  */
558
558
  addRotation(angle: number): void;
559
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
+
560
566
  /**
561
567
  * Returns the element name.
562
568
  */
@@ -583,7 +589,7 @@ declare namespace JXG {
583
589
  * @param handler
584
590
  * @returns Reference to the object.
585
591
  */
586
- off(event: string, handler: (e: Event) => void): this;
592
+ off(event: string, handler?: (e: Event) => void): this;
587
593
 
588
594
  /**
589
595
  * Register a new event handler.
@@ -1855,6 +1861,11 @@ declare namespace JXG {
1855
1861
  }
1856
1862
  export interface HyperbolaAttributes extends ConicAttributes { }
1857
1863
 
1864
+ export interface Parabola extends Conic {
1865
+ setAttribute(attributes: ParabolaAttributes): this;
1866
+ }
1867
+ export interface ParabolaAttributes extends ConicAttributes { }
1868
+
1858
1869
  /**
1859
1870
  *
1860
1871
  */
@@ -2824,7 +2835,7 @@ declare namespace JXG {
2824
2835
  * Attributes for the axis label.
2825
2836
  */
2826
2837
  label?: LabelOptions;
2827
- lastArrow?: ArrowSpecification;
2838
+ lastArrow?: boolean | ArrowSpecification;
2828
2839
  margin?: number;
2829
2840
  /**
2830
2841
  * Attributes for the first point on the axis.
@@ -3022,7 +3033,7 @@ declare namespace JXG {
3022
3033
  /**
3023
3034
  *
3024
3035
  */
3025
- generateLabelText?: ((labeled: Coords, center: Coords) => string) | null;
3036
+ generateLabelText?: ((labeled: Coords, center: Coords, value: null | Number | String) => string) | null;
3026
3037
  /**
3027
3038
  *
3028
3039
  */
@@ -3098,10 +3109,10 @@ declare namespace JXG {
3098
3109
  defaultDistance?: number;
3099
3110
  drawLabels?: boolean;
3100
3111
  drawZero?: boolean;
3101
- face?: '|';
3112
+ face?: '|' | '<' | '>';
3102
3113
  fillColor?: string;
3103
- generateLabelText?: ((one: Coords, two: Coords) => void) | null;
3104
- generateLabelValue?: ((one: Coords, two: Coords) => void) | null;
3114
+ generateLabelText?: ((one: Coords, two: Coords, value: null|Number|String) => void) | null;
3115
+ generateLabelValue?: ((labeled: Coords, center: Coords) => string) | null;
3105
3116
  highlightFillColor?: string;
3106
3117
  highlightStrokeColor?: string;
3107
3118
  includeBoundaries?: boolean | number;
@@ -4071,7 +4082,7 @@ declare namespace JXG {
4071
4082
  * @param parents
4072
4083
  * @param attributes
4073
4084
  */
4074
- create(elementType: 'hyperbola', parents: unknown[], attributes?: {}): Hyperbola;
4085
+ create(elementType: 'hyperbola', parents: unknown[], attributes?: HyperbolaAttributes): Hyperbola;
4075
4086
  /**
4076
4087
  *
4077
4088
  * @param elementType 'image'
@@ -4149,6 +4160,13 @@ declare namespace JXG {
4149
4160
  * @param attributes
4150
4161
  */
4151
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;
4152
4170
  /**
4153
4171
  *
4154
4172
  * @param elementType 'perpendicular'
@@ -4406,11 +4424,13 @@ declare namespace JXG {
4406
4424
  setZoom(fX: number, fY: number): Board;
4407
4425
  showDependencies(): this;
4408
4426
  showXML(): this;
4427
+ startResizeObserver(): unknown;
4409
4428
  startSelectionMode(): unknown;
4410
4429
  /**
4411
4430
  * Cancels all running animations.
4412
4431
  */
4413
4432
  stopAllAnimation(): Board;
4433
+ stopResizeObserver(): unknown;
4414
4434
  stopSelectionMode(): [Coords, Coords];
4415
4435
  /**
4416
4436
  * Stop updates of the board.
@@ -4936,6 +4956,7 @@ declare namespace JXG {
4936
4956
  display?: 'html' | 'internal';
4937
4957
  dragArea?: 'all' | 'small';
4938
4958
  fontSize?: number;
4959
+ fontUnit?: 'px' | 'vw' | 'vh' | 'vmax' | 'vmin' | 'rem';
4939
4960
  highlight?: boolean;
4940
4961
  highlightCssClass?: string;
4941
4962
  highlightCssDefaultStyle?: string;
@@ -1,5 +1,5 @@
1
1
  /*
2
- JSXGraph 1.4.4
2
+ JSXGraph 1.4.6
3
3
 
4
4
  Copyright 2008-2022
5
5
  Matthias Ehmann,
@@ -108,6 +108,12 @@
108
108
  background: rgba(184, 184, 184, 0.5);
109
109
  }
110
110
 
111
+ .JXG_navigation_button svg {
112
+ top: 0.2em;
113
+ position: relative;
114
+ padding: 0;
115
+ }
116
+
111
117
  /* CSS rules for the wrapping div in fullscreen mode */
112
118
 
113
119
  .JXG_wrap_private:-moz-full-screen {