jsxgraph 1.14.0 → 1.14.1

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 (99) hide show
  1. package/CHANGELOG.md +33 -3
  2. package/distrib/docs/3d_linspace3d.js.html +16 -10
  3. package/distrib/docs/3d_point3d.js.html +0 -5
  4. package/distrib/docs/3d_sphere3d.js.html +92 -69
  5. package/distrib/docs/3d_view3d.js.html +24 -16
  6. package/distrib/docs/Angle.html +7 -7
  7. package/distrib/docs/CircumcircleSector.html +2 -2
  8. package/distrib/docs/Conic.html +1 -1
  9. package/distrib/docs/Ellipse.html +23 -1
  10. package/distrib/docs/Hyperbola.html +24 -1
  11. package/distrib/docs/JXG.Board.infobox.html +1 -1
  12. package/distrib/docs/JXG.Board_.html +130 -130
  13. package/distrib/docs/JXG.CanvasRenderer.html +10 -10
  14. package/distrib/docs/JXG.Composition.html +3 -3
  15. package/distrib/docs/JXG.GeometryElement.html +26 -26
  16. package/distrib/docs/JXG.Math.Numerics.html +45 -47
  17. package/distrib/docs/JXG.Math.Statistics.html +14 -15
  18. package/distrib/docs/JXG.Math.Tiling.html +3 -7
  19. package/distrib/docs/JXG.Math.html +101 -83
  20. package/distrib/docs/JXG.Point3D.html +2 -2
  21. package/distrib/docs/JXG.SVGRenderer.html +12 -12
  22. package/distrib/docs/JXG.Sphere3D.html +1255 -2
  23. package/distrib/docs/JXG.View3D.html +29 -29
  24. package/distrib/docs/JXG.html +20 -20
  25. package/distrib/docs/MajorSector.html +1 -1
  26. package/distrib/docs/MinorSector.html +1 -1
  27. package/distrib/docs/NonReflexAngle.html +1 -1
  28. package/distrib/docs/Parabola.html +1 -1
  29. package/distrib/docs/Point3D.html +1 -1
  30. package/distrib/docs/ReflexAngle.html +1 -1
  31. package/distrib/docs/Sector.html +12 -12
  32. package/distrib/docs/Sphere3D.html +17 -1
  33. package/distrib/docs/View3D.html +1 -1
  34. package/distrib/docs/base_board.js.html +63 -13
  35. package/distrib/docs/base_composition.js.html +3 -3
  36. package/distrib/docs/base_constants.js.html +1 -1
  37. package/distrib/docs/base_element.js.html +2 -1
  38. package/distrib/docs/base_text.js.html +2 -2
  39. package/distrib/docs/element_conic.js.html +35 -1
  40. package/distrib/docs/element_sector.js.html +6 -3
  41. package/distrib/docs/index.html +1 -1
  42. package/distrib/docs/math_math.js.html +64 -35
  43. package/distrib/docs/math_numerics.js.html +13 -12
  44. package/distrib/docs/math_statistics.js.html +19 -19
  45. package/distrib/docs/math_tiling.js.html +6 -288
  46. package/distrib/docs/parser_jessiecode.js.html +1 -1
  47. package/distrib/docs/renderer_canvas.js.html +7 -6
  48. package/distrib/docs/renderer_svg.js.html +15 -7
  49. package/distrib/docs/scripts/jsxgraphcore.js +2 -2
  50. package/distrib/docs/styles/jsxgraph.css +1 -1
  51. package/distrib/docs/utils_type.js.html +11 -4
  52. package/distrib/geogebra.min.js +1 -1
  53. package/distrib/geonext.min.js +1 -1
  54. package/distrib/index.d.ts +11 -0
  55. package/distrib/intergeo.min.js +1 -1
  56. package/distrib/jsxgraph.css +1 -1
  57. package/distrib/jsxgraphcore.js +2 -2
  58. package/distrib/jsxgraphcore.mjs +2 -2
  59. package/distrib/jsxgraphcore.mjs.map +1 -1
  60. package/distrib/jsxgraphsrc.js +380 -496
  61. package/distrib/jsxgraphsrc.mjs +380 -496
  62. package/distrib/jsxgraphsrc.mjs.map +1 -1
  63. package/package.json +10 -12
  64. package/src/3d/linspace3d.js +16 -10
  65. package/src/3d/point3d.js +0 -5
  66. package/src/3d/sphere3d.js +92 -69
  67. package/src/3d/view3d.js +24 -16
  68. package/src/base/board.js +63 -13
  69. package/src/base/composition.js +3 -3
  70. package/src/base/constants.js +1 -1
  71. package/src/base/element.js +2 -1
  72. package/src/base/text.js +2 -2
  73. package/src/element/conic.js +35 -1
  74. package/src/element/sector.js +6 -3
  75. package/src/index.d.ts +11 -0
  76. package/src/math/math.js +64 -35
  77. package/src/math/numerics.js +13 -12
  78. package/src/math/statistics.js +19 -19
  79. package/src/math/tiling.js +6 -288
  80. package/src/parser/jessiecode.js +1 -1
  81. package/src/renderer/canvas.js +7 -6
  82. package/src/renderer/svg.js +15 -7
  83. package/src/utils/type.js +11 -4
  84. package/src/unused/bst.js +0 -475
  85. package/src/unused/heap.js +0 -135
  86. package/src/unused/locus.js +0 -162
  87. package/src/unused/server/JXG.py +0 -74
  88. package/src/unused/server/JXGServer.py +0 -94
  89. package/src/unused/server/JXGServerModule.py +0 -9
  90. package/src/unused/server/README.md +0 -63
  91. package/src/unused/server/RStats.py +0 -45
  92. package/src/unused/server/YahooFinance.py +0 -81
  93. package/src/unused/server/fft.py +0 -136
  94. package/src/unused/server/geoloci.py +0 -210
  95. package/src/unused/server/jxggroebner.py +0 -219
  96. package/src/unused/server/jxgtestplugin.py +0 -19
  97. package/src/unused/server/server.js +0 -280
  98. package/src/unused/sketch.js +0 -2895
  99. package/src/unused/symbolic.js +0 -416
@@ -1,280 +0,0 @@
1
- /*
2
- Copyright 2008-2026
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 <https://www.gnu.org/licenses/>
29
- and <https://opensource.org/licenses/MIT/>.
30
- */
31
-
32
- /*global JXG: true, define: true, escape:true, window:true, ActiveXObject:true, XMLHttpRequest:true*/
33
- /*jslint nomen: true, plusplus: true*/
34
-
35
- /**
36
- * @fileoverview The JXG.Server is a wrapper for a smoother integration of server side calculations. on the
37
- * server side a python plugin system is used.
38
- */
39
-
40
- import JXG from "../jxg.js";
41
- import Zip from "../utils/zip.js";
42
- import Base64 from "../utils/base64.js";
43
- import Type from "../utils/type.js";
44
-
45
- /**
46
- * @namespace
47
- * JXG.Server namespace holding functions to load JXG server modules.
48
- */
49
- JXG.Server = {
50
- /**
51
- * This is where all of a module's handlers are accessed from. If you're loading a module named JXGModule which
52
- * provides a handler called ImaHandler, then this handler can be called by invoking JXG.Server.modules.JXGModule.ImaHandler().
53
- * @namespace
54
- */
55
- modules: {},
56
-
57
- /**
58
- * Stores all asynchronous calls to server which aren't finished yet.
59
- * @private
60
- */
61
- runningCalls: {},
62
-
63
- /**
64
- * Handles errors, just a default implementation, can be overwritten by you, if you want to handle errors by yourself.
65
- * @param {object} data An object holding a field of type string named message handling the error described in the message string.
66
- */
67
- handleError: function (data) {
68
- JXG.debug("error occured, server says: " + data.message);
69
- },
70
-
71
- /**
72
- * The main method of JXG.Server. Actually makes the calls to the server and parses the feedback.
73
- * @param {String} action Can be 'load' or 'exec'.
74
- * @param {function} callback Function pointer or anonymous function which takes as it's only argument an
75
- * object containing the data from the server. The fields of this object depend on the reply of the server
76
- * module. See the correspondings server module readme.
77
- * @param {Object} data What is to be sent to the server.
78
- * @param {Boolean} sync If the call should be synchronous or not.
79
- */
80
- callServer: function (action, callback, data, sync) {
81
- var fileurl, passdata, AJAX,// params, k,
82
- id, dataJSONStr;
83
-
84
- sync = sync || false;
85
-
86
- // params = "";
87
- // for (k in data) {
88
- // if (data.hasOwnProperty(k)) {
89
- // params += "&" + escape(k) + "=" + escape(data[k]);
90
- // }
91
- // }
92
-
93
- dataJSONStr = Type.toJSON(data);
94
-
95
- // generate id
96
- do {
97
- id = action + Math.floor(Math.random() * 4096);
98
- } while (Type.exists(this.runningCalls[id]));
99
-
100
- // store information about the calls
101
- this.runningCalls[id] = { action: action };
102
- if (Type.exists(data.module)) {
103
- this.runningCalls[id].module = data.module;
104
- }
105
-
106
- fileurl = JXG.serverBase + 'JXGServer.py'
107
- passdata =
108
- "action=" +
109
- escape(action) +
110
- "&id=" +
111
- id +
112
- "&dataJSON=" +
113
- escape(Base64.encode(dataJSONStr));
114
-
115
- this.cbp = function (d) {
116
- /*jslint evil:true*/
117
- var str, data, tmp, inject, paramlist, id, i, j;
118
-
119
- str = new Zip.Unzip(Base64.decodeAsArray(d)).unzip();
120
- if (Type.isArray(str) && str.length > 0) {
121
- str = str[0][0];
122
- }
123
-
124
- if (!Type.exists(str)) {
125
- return;
126
- }
127
-
128
- data =
129
- window.JSON && window.JSON.parse
130
- ? window.JSON.parse(str)
131
- : new Function("return " + str)();
132
-
133
- if (data.type === 'error') {
134
- this.handleError(data);
135
- } else if (data.type === 'response') {
136
- id = data.id;
137
-
138
- // inject fields
139
- for (i = 0; i < data.fields.length; i++) {
140
- tmp = data.fields[i];
141
- inject =
142
- tmp.namespace +
143
- (typeof new Function("return " + tmp.namespace)() === "object"
144
- ? "."
145
- : '.prototype.') +
146
- tmp.name +
147
- " = " +
148
- tmp.value;
149
- new Function(inject)();
150
- }
151
-
152
- // inject handlers
153
- for (i = 0; i < data.handler.length; i++) {
154
- tmp = data.handler[i];
155
- paramlist = [];
156
-
157
- for (j = 0; j < tmp.parameters.length; j++) {
158
- paramlist[j] = '"' + tmp.parameters[j] + '": ' + tmp.parameters[j];
159
- }
160
- // insert subnamespace named after module.
161
- inject =
162
- "if(typeof JXG.Server.modules." +
163
- this.runningCalls[id].module +
164
- " == 'undefined')" +
165
- "JXG.Server.modules." +
166
- this.runningCalls[id].module +
167
- " = {};";
168
-
169
- // insert callback method which fetches and uses the server's data for calculation in JavaScript
170
- inject +=
171
- "JXG.Server.modules." +
172
- this.runningCalls[id].module +
173
- "." +
174
- tmp.name +
175
- "_cb = " +
176
- tmp.callback +
177
- ";";
178
-
179
- // insert handler as JXG.Server.modules.<module name>.<handler name>
180
- inject +=
181
- "JXG.Server.modules." +
182
- this.runningCalls[id].module +
183
- "." +
184
- tmp.name +
185
- " = function (" +
186
- tmp.parameters.join(",") +
187
- ", __JXGSERVER_CB__, __JXGSERVER_SYNC) {" +
188
- "if(typeof __JXGSERVER_CB__ == 'undefined') __JXGSERVER_CB__ = JXG.Server.modules." +
189
- this.runningCalls[id].module +
190
- "." +
191
- tmp.name +
192
- "_cb;" +
193
- "var __JXGSERVER_PAR__ = {" +
194
- paramlist.join(",") +
195
- ', "module": "' +
196
- this.runningCalls[id].module +
197
- '", "handler": "' +
198
- tmp.name +
199
- '" };' +
200
- 'JXG.Server.callServer("exec", __JXGSERVER_CB__, __JXGSERVER_PAR__, __JXGSERVER_SYNC);' +
201
- "};";
202
- new Function(inject)();
203
- }
204
-
205
- delete this.runningCalls[id];
206
-
207
- // handle data
208
- callback(data.data);
209
- }
210
- };
211
-
212
- // bind cbp callback method to JXG.Server to get access to JXG.Server fields from within cpb
213
- this.cb = JXG.bind(this.cbp, this);
214
-
215
- // We are using our own XMLHttpRequest object in here because of a/sync and POST
216
- if (window.XMLHttpRequest) {
217
- AJAX = new XMLHttpRequest();
218
- AJAX.overrideMimeType("text/plain; charset=iso-8859-1");
219
- } else {
220
- AJAX = new ActiveXObject('Microsoft.XMLHTTP');
221
- }
222
- if (AJAX) {
223
- // POST is required if data sent to server is too long for a url.
224
- // some browsers/http servers don't accept long urls.
225
- AJAX.open("POST", fileurl, !sync);
226
- AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
227
-
228
- if (!sync) {
229
- // Define function to fetch data received from server
230
- // that function returning a function is required to make this.cb known to the function.
231
- AJAX.onreadystatechange = (function (cb) {
232
- return function () {
233
- if (AJAX.readyState === 4 && AJAX.status === 200) {
234
- cb(AJAX.responseText);
235
- return true;
236
- }
237
- return false;
238
- };
239
- })(this.cb);
240
- }
241
-
242
- // send the data
243
- AJAX.send(passdata);
244
- if (sync) {
245
- this.cb(AJAX.responseText);
246
- return true;
247
- }
248
- }
249
-
250
- return false;
251
- },
252
-
253
- /**
254
- * Callback for the default action 'load'.
255
- */
256
- loadModule_cb: function (data) {
257
- var i;
258
- for (i = 0; i < data.length; i++) {
259
- JXG.debug(data[i].name + ": " + data[i].value);
260
- }
261
- },
262
-
263
- /**
264
- * Loads a module from the server.
265
- * @param {string} module A string containing the module. Has to match the filename of the Python module on the server exactly including
266
- * lower and upper case letters without the file ending .py.
267
- */
268
- loadModule: function (module) {
269
- return JXG.Server.callServer(
270
- "load",
271
- JXG.Server.loadModule_cb,
272
- { module: module },
273
- true
274
- );
275
- }
276
- };
277
-
278
- JXG.Server.load = JXG.Server.loadModule;
279
-
280
- export default JXG.Server;