jsxgraph 1.10.0 → 1.10.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 (239) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/distrib/docs/files.html +2 -61
  3. package/distrib/docs/index.html +2 -58
  4. package/distrib/docs/static/jsxgraphcore.js +2 -2
  5. package/distrib/docs/symbols/Angle.html +2 -18
  6. package/distrib/docs/symbols/Arc.html +2 -18
  7. package/distrib/docs/symbols/Arrow.html +2 -18
  8. package/distrib/docs/symbols/Arrowparallel.html +2 -18
  9. package/distrib/docs/symbols/Axes3D.html +2 -18
  10. package/distrib/docs/symbols/Axis.html +2 -18
  11. package/distrib/docs/symbols/Axis3D.html +2 -18
  12. package/distrib/docs/symbols/Bisector.html +2 -18
  13. package/distrib/docs/symbols/Bisectorlines.html +2 -18
  14. package/distrib/docs/symbols/Boxplot.html +2 -18
  15. package/distrib/docs/symbols/Button.html +2 -18
  16. package/distrib/docs/symbols/Cardinalspline.html +2 -18
  17. package/distrib/docs/symbols/Chart.html +2 -18
  18. package/distrib/docs/symbols/Checkbox.html +2 -18
  19. package/distrib/docs/symbols/Circle.html +2 -18
  20. package/distrib/docs/symbols/Circle3D.html +2 -18
  21. package/distrib/docs/symbols/Circumcenter.html +2 -18
  22. package/distrib/docs/symbols/Circumcircle.html +2 -18
  23. package/distrib/docs/symbols/CircumcircleArc.html +2 -18
  24. package/distrib/docs/symbols/CircumcircleSector.html +2 -18
  25. package/distrib/docs/symbols/Comb.html +2 -18
  26. package/distrib/docs/symbols/Conic.html +2 -18
  27. package/distrib/docs/symbols/Curve.html +2 -18
  28. package/distrib/docs/symbols/Curve3D.html +2 -18
  29. package/distrib/docs/symbols/CurveDifference.html +2 -18
  30. package/distrib/docs/symbols/CurveIntersection.html +2 -18
  31. package/distrib/docs/symbols/CurveUnion.html +2 -18
  32. package/distrib/docs/symbols/Derivative.html +2 -18
  33. package/distrib/docs/symbols/Ellipse.html +2 -18
  34. package/distrib/docs/symbols/ForeignObject.html +2 -18
  35. package/distrib/docs/symbols/Functiongraph.html +2 -18
  36. package/distrib/docs/symbols/Functiongraph3D.html +2 -18
  37. package/distrib/docs/symbols/Glider.html +2 -18
  38. package/distrib/docs/symbols/Grid.html +2 -18
  39. package/distrib/docs/symbols/Group.html +2 -18
  40. package/distrib/docs/symbols/Hatch.html +2 -18
  41. package/distrib/docs/symbols/Hyperbola.html +2 -18
  42. package/distrib/docs/symbols/Image.html +2 -18
  43. package/distrib/docs/symbols/ImplicitCurve.html +2 -18
  44. package/distrib/docs/symbols/Incenter.html +2 -18
  45. package/distrib/docs/symbols/Incircle.html +2 -18
  46. package/distrib/docs/symbols/Inequality.html +2 -18
  47. package/distrib/docs/symbols/Input.html +2 -18
  48. package/distrib/docs/symbols/Integral.html +2 -18
  49. package/distrib/docs/symbols/Intersection.html +2 -18
  50. package/distrib/docs/symbols/IntersectionCircle3D.html +2 -18
  51. package/distrib/docs/symbols/IntersectionLine3D.html +2 -18
  52. package/distrib/docs/symbols/JXG.AbstractRenderer.html +2 -18
  53. package/distrib/docs/symbols/JXG.Board.html +4 -20
  54. package/distrib/docs/symbols/JXG.Board.infobox.html +2 -18
  55. package/distrib/docs/symbols/JXG.C.html +2 -18
  56. package/distrib/docs/symbols/JXG.CA.html +2 -18
  57. package/distrib/docs/symbols/JXG.CanvasRenderer.html +2 -18
  58. package/distrib/docs/symbols/JXG.Chart.html +2 -18
  59. package/distrib/docs/symbols/JXG.Circle.html +2 -18
  60. package/distrib/docs/symbols/JXG.Circle3D.html +2 -18
  61. package/distrib/docs/symbols/JXG.Complex.html +2 -18
  62. package/distrib/docs/symbols/JXG.Composition.html +2 -18
  63. package/distrib/docs/symbols/JXG.Coords.html +2 -18
  64. package/distrib/docs/symbols/JXG.CoordsElement.html +98 -22
  65. package/distrib/docs/symbols/JXG.Curve.html +2 -18
  66. package/distrib/docs/symbols/JXG.Curve3D.html +2 -18
  67. package/distrib/docs/symbols/JXG.Dump.html +2 -18
  68. package/distrib/docs/symbols/JXG.EventEmitter.html +2 -18
  69. package/distrib/docs/symbols/JXG.Expect.html +2 -18
  70. package/distrib/docs/symbols/JXG.ForeignObject.html +2 -18
  71. package/distrib/docs/symbols/JXG.GeometryElement.html +2 -18
  72. package/distrib/docs/symbols/JXG.GeometryElement3D.html +2 -18
  73. package/distrib/docs/symbols/JXG.GeonextParser.html +2 -18
  74. package/distrib/docs/symbols/JXG.Group.html +2 -18
  75. package/distrib/docs/symbols/JXG.Image.html +2 -18
  76. package/distrib/docs/symbols/JXG.JSXGraph.html +2 -18
  77. package/distrib/docs/symbols/JXG.JessieCode.html +2 -18
  78. package/distrib/docs/symbols/JXG.Legend.html +2 -18
  79. package/distrib/docs/symbols/JXG.Line.html +2 -18
  80. package/distrib/docs/symbols/JXG.Line3D.html +2 -18
  81. package/distrib/docs/symbols/JXG.Math.BoxQuadtree.html +2 -18
  82. package/distrib/docs/symbols/JXG.Math.Clip.html +2 -18
  83. package/distrib/docs/symbols/JXG.Math.Extrapolate.html +2 -18
  84. package/distrib/docs/symbols/JXG.Math.Geometry.html +2 -18
  85. package/distrib/docs/symbols/JXG.Math.ImplicitPlot.html +2 -18
  86. package/distrib/docs/symbols/JXG.Math.IntervalArithmetic.html +2 -18
  87. package/distrib/docs/symbols/JXG.Math.Metapost.html +2 -18
  88. package/distrib/docs/symbols/JXG.Math.Nlp.html +2 -18
  89. package/distrib/docs/symbols/JXG.Math.Numerics.html +2 -18
  90. package/distrib/docs/symbols/JXG.Math.Plot.html +2 -18
  91. package/distrib/docs/symbols/JXG.Math.Poly.Monomial.html +2 -18
  92. package/distrib/docs/symbols/JXG.Math.Poly.Polynomial.html +2 -18
  93. package/distrib/docs/symbols/JXG.Math.Poly.Ring.html +2 -18
  94. package/distrib/docs/symbols/JXG.Math.Poly.html +2 -18
  95. package/distrib/docs/symbols/JXG.Math.ProbFuncs.html +2 -18
  96. package/distrib/docs/symbols/JXG.Math.Quadtree.html +2 -18
  97. package/distrib/docs/symbols/JXG.Math.Statistics.html +22 -34
  98. package/distrib/docs/symbols/JXG.Math.html +2 -18
  99. package/distrib/docs/symbols/JXG.NoRenderer.html +2 -18
  100. package/distrib/docs/symbols/JXG.Options.html +2 -18
  101. package/distrib/docs/symbols/JXG.Plane3D.html +2 -18
  102. package/distrib/docs/symbols/JXG.Point.html +2 -18
  103. package/distrib/docs/symbols/JXG.Point3D.html +2 -18
  104. package/distrib/docs/symbols/JXG.Polygon.html +2 -18
  105. package/distrib/docs/symbols/JXG.Polygon3D.html +2 -18
  106. package/distrib/docs/symbols/JXG.PrefixParser.html +2 -18
  107. package/distrib/docs/symbols/JXG.SVGRenderer.html +2 -18
  108. package/distrib/docs/symbols/JXG.Sphere3D.html +2 -18
  109. package/distrib/docs/symbols/JXG.Surface3D.html +2 -18
  110. package/distrib/docs/symbols/JXG.Text.html +2 -18
  111. package/distrib/docs/symbols/JXG.Text3D.html +2 -18
  112. package/distrib/docs/symbols/JXG.Ticks.html +2 -18
  113. package/distrib/docs/symbols/JXG.Transformation.html +2 -18
  114. package/distrib/docs/symbols/JXG.Turtle.html +2 -18
  115. package/distrib/docs/symbols/JXG.Util.Base64.html +2 -18
  116. package/distrib/docs/symbols/JXG.Util.UTF8.html +2 -18
  117. package/distrib/docs/symbols/JXG.Util.Unzip.html +2 -18
  118. package/distrib/docs/symbols/JXG.Util.html +2 -18
  119. package/distrib/docs/symbols/JXG.VMLRenderer.html +2 -18
  120. package/distrib/docs/symbols/JXG.View3D.html +4 -19
  121. package/distrib/docs/symbols/JXG.XML.html +2 -18
  122. package/distrib/docs/symbols/JXG.html +2 -18
  123. package/distrib/docs/symbols/Label.html +2 -18
  124. package/distrib/docs/symbols/Legend.html +2 -18
  125. package/distrib/docs/symbols/Line.html +2 -18
  126. package/distrib/docs/symbols/Line3D.html +2 -18
  127. package/distrib/docs/symbols/MajorArc.html +2 -18
  128. package/distrib/docs/symbols/MajorSector.html +2 -18
  129. package/distrib/docs/symbols/Measurement.html +2 -18
  130. package/distrib/docs/symbols/Mesh3D.html +2 -18
  131. package/distrib/docs/symbols/Metapostspline.html +2 -18
  132. package/distrib/docs/symbols/Midpoint.html +2 -18
  133. package/distrib/docs/symbols/MinorArc.html +2 -18
  134. package/distrib/docs/symbols/MinorSector.html +2 -18
  135. package/distrib/docs/symbols/Mirrorpoint.html +2 -18
  136. package/distrib/docs/symbols/NonReflexAngle.html +2 -18
  137. package/distrib/docs/symbols/Normal.html +2 -18
  138. package/distrib/docs/symbols/Orthogonalprojection.html +2 -18
  139. package/distrib/docs/symbols/OtherIntersection.html +2 -18
  140. package/distrib/docs/symbols/Parabola.html +2 -18
  141. package/distrib/docs/symbols/Parallel.html +2 -18
  142. package/distrib/docs/symbols/Parallelogram.html +2 -18
  143. package/distrib/docs/symbols/Parallelpoint.html +2 -18
  144. package/distrib/docs/symbols/ParametricSurface3D.html +2 -18
  145. package/distrib/docs/symbols/Perpendicular.html +2 -18
  146. package/distrib/docs/symbols/PerpendicularPoint.html +2 -18
  147. package/distrib/docs/symbols/PerpendicularSegment.html +2 -18
  148. package/distrib/docs/symbols/Point.html +2 -18
  149. package/distrib/docs/symbols/Point3D.html +2 -18
  150. package/distrib/docs/symbols/PolarLine.html +2 -18
  151. package/distrib/docs/symbols/PolePoint.html +2 -18
  152. package/distrib/docs/symbols/Polygon.html +2 -18
  153. package/distrib/docs/symbols/PolygonalChain.html +2 -18
  154. package/distrib/docs/symbols/RadicalAxis.html +2 -18
  155. package/distrib/docs/symbols/Reflection.html +2 -18
  156. package/distrib/docs/symbols/ReflexAngle.html +2 -18
  157. package/distrib/docs/symbols/RegularPolygon.html +2 -18
  158. package/distrib/docs/symbols/Riemannsum.html +2 -18
  159. package/distrib/docs/symbols/Sector.html +2 -18
  160. package/distrib/docs/symbols/Segment.html +2 -18
  161. package/distrib/docs/symbols/Semicircle.html +2 -18
  162. package/distrib/docs/symbols/Slider.html +2 -18
  163. package/distrib/docs/symbols/Slopefield.html +2 -18
  164. package/distrib/docs/symbols/Slopetriangle.html +2 -18
  165. package/distrib/docs/symbols/Smartlabel.html +2 -18
  166. package/distrib/docs/symbols/Sphere3D.html +2 -18
  167. package/distrib/docs/symbols/Spline.html +2 -18
  168. package/distrib/docs/symbols/Stepfunction.html +2 -18
  169. package/distrib/docs/symbols/Tangent.html +2 -18
  170. package/distrib/docs/symbols/TangentTo.html +2 -18
  171. package/distrib/docs/symbols/Tapemeasure.html +2 -18
  172. package/distrib/docs/symbols/Text.html +12 -26
  173. package/distrib/docs/symbols/Text3D.html +2 -18
  174. package/distrib/docs/symbols/Ticks.html +2 -18
  175. package/distrib/docs/symbols/Ticks3D.html +2 -18
  176. package/distrib/docs/symbols/Tracecurve.html +2 -18
  177. package/distrib/docs/symbols/Transformation.html +2 -18
  178. package/distrib/docs/symbols/Turtle.html +2 -18
  179. package/distrib/docs/symbols/Vectorfield.html +2 -18
  180. package/distrib/docs/symbols/Vectorfield3D.html +53 -18
  181. package/distrib/docs/symbols/View3D.html +2 -18
  182. package/distrib/docs/symbols/_global_.html +2 -18
  183. package/distrib/docs/symbols/mirrorelement.html +2 -18
  184. package/distrib/docs/symbols/src/src_3d_box3d.js.html +261 -259
  185. package/distrib/docs/symbols/src/src_3d_curve3d.js.html +205 -156
  186. package/distrib/docs/symbols/src/src_3d_linspace3d.js.html +337 -327
  187. package/distrib/docs/symbols/src/src_3d_point3d.js.html +204 -187
  188. package/distrib/docs/symbols/src/src_3d_text3d.js.html +189 -177
  189. package/distrib/docs/symbols/src/src_3d_view3d.js.html +1246 -1236
  190. package/distrib/docs/symbols/src/src_base_board.js.html +2058 -2057
  191. package/distrib/docs/symbols/src/src_base_constants.js.html +1 -1
  192. package/distrib/docs/symbols/src/src_base_coordselement.js.html +383 -274
  193. package/distrib/docs/symbols/src/src_element_sector.js.html +1 -1
  194. package/distrib/docs/symbols/src/src_math_geometry.js.html +609 -604
  195. package/distrib/docs/symbols/src/src_math_statistics.js.html +418 -411
  196. package/distrib/docs/symbols/src/src_options.js.html +504 -502
  197. package/distrib/docs/symbols/src/src_options3d.js.html +952 -944
  198. package/distrib/docs.zip +0 -0
  199. package/distrib/geogebra.min.js +1 -1
  200. package/distrib/geonext.min.js +1 -1
  201. package/distrib/intergeo.min.js +1 -1
  202. package/distrib/jsxgraph.zip +0 -0
  203. package/distrib/jsxgraphcore.js +2 -2
  204. package/distrib/jsxgraphcore.mjs +2 -2
  205. package/distrib/jsxgraphcore.mjs.map +1 -1
  206. package/distrib/jsxgraphsrc.js +15405 -16038
  207. package/distrib/jsxgraphsrc.mjs +15405 -16038
  208. package/distrib/jsxgraphsrc.mjs.map +1 -1
  209. package/distrib/sketch.min.js +1 -1
  210. package/package.json +1 -1
  211. package/src/3d/box3d.js +2 -0
  212. package/src/3d/curve3d.js +53 -4
  213. package/src/3d/linspace3d.js +17 -7
  214. package/src/3d/point3d.js +20 -3
  215. package/src/3d/text3d.js +20 -8
  216. package/src/3d/view3d.js +17 -7
  217. package/src/base/board.js +1 -0
  218. package/src/base/constants.js +1 -1
  219. package/src/base/coordselement.js +119 -10
  220. package/src/element/sector.js +1 -1
  221. package/src/index.js +0 -3
  222. package/src/math/geometry.js +27 -22
  223. package/src/math/statistics.js +29 -22
  224. package/src/options.js +8 -6
  225. package/src/options3d.js +10 -2
  226. package/src/{server → unused/server}/JXGServer.py +4 -9
  227. package/src/{server → unused/server}/JXGServerModule.py +2 -2
  228. package/src/{server → unused/server}/README.md +25 -14
  229. package/src/{server → unused/server}/RStats.py +1 -1
  230. package/src/{server → unused/server}/YahooFinance.py +4 -4
  231. package/src/{server → unused/server}/fft.py +6 -6
  232. package/src/{server → unused/server}/geoloci.py +17 -17
  233. package/src/{server → unused/server}/jxggroebner.py +22 -22
  234. package/src/index2.js +0 -105
  235. /package/src/{element → unused}/locus.js +0 -0
  236. /package/src/{server → unused/server}/JXG.py +0 -0
  237. /package/src/{server → unused/server}/jxgtestplugin.py +0 -0
  238. /package/src/{server → unused/server}/server.js +0 -0
  239. /package/src/{math → unused}/symbolic.js +0 -0
@@ -3143,7 +3143,6 @@ JXG.extend(
3143
3143
  t = Type.evaluate(curve.visProp.curvetype) === 'functiongraph' ? x : 0.0;
3144
3144
  }
3145
3145
  result = this.projectCoordsToCurve(x, y, t, curve, board);
3146
-
3147
3146
  // point.position = result[1];
3148
3147
 
3149
3148
  return result;
@@ -3167,7 +3166,8 @@ JXG.extend(
3167
3166
  i, j, mindist, dist, lbda,
3168
3167
  v, coords, d, p1, p2, res, minfunc,
3169
3168
  t_new, f_new, f_old, dy,
3170
- delta, delta1, delta2, steps, minX, maxX,
3169
+ delta, delta1, delta2, steps,
3170
+ minX, maxX, minX_glob, maxX_glob,
3171
3171
  infty = Number.POSITIVE_INFINITY;
3172
3172
 
3173
3173
  if (!Type.exists(board)) {
@@ -3232,24 +3232,31 @@ JXG.extend(
3232
3232
  } else {
3233
3233
  // 'parameter', 'polar', 'functiongraph'
3234
3234
 
3235
+ minX_glob = curve.minX();
3236
+ maxX_glob = curve.maxX();
3237
+ minX = minX_glob;
3238
+ maxX = maxX_glob;
3239
+
3235
3240
  if (Type.evaluate(curve.visProp.curvetype) === 'functiongraph') {
3241
+ // Restrict the possible position of t
3242
+ // to the projection of a circle to the x-axis (= t-axis)
3236
3243
  dy = Math.abs(y - curve.Y(x));
3237
3244
  if (!isNaN(dy)) {
3238
3245
  minX = x - dy;
3239
3246
  maxX = x + dy;
3240
- } else {
3241
- minX = curve.minX();
3242
- maxX = curve.maxX();
3243
3247
  }
3244
- } else {
3245
- minX = curve.minX();
3246
- maxX = curve.maxX();
3247
3248
  }
3248
3249
 
3249
- /** @ignore */
3250
+ /**
3251
+ * @ignore
3252
+ * Find t such that the Euclidean distance between
3253
+ * [x, y] and [curve.X(t), curve.Y(t)]
3254
+ * is minimized.
3255
+ */
3250
3256
  minfunc = function (t) {
3251
3257
  var dx, dy;
3252
- if (t < curve.minX() || t > curve.maxX()) {
3258
+
3259
+ if (t < minX_glob || t > curve.maxX_glob) {
3253
3260
  return Infinity;
3254
3261
  }
3255
3262
  dx = x - curve.X(t);
@@ -3257,12 +3264,12 @@ JXG.extend(
3257
3264
  return dx * dx + dy * dy;
3258
3265
  };
3259
3266
 
3267
+ // Search t which minimizes minfunc(t)
3268
+ // in discrete steps
3260
3269
  f_old = minfunc(t);
3261
3270
  steps = 50;
3262
-
3263
3271
  delta = (maxX - minX) / steps;
3264
3272
  t_new = minX;
3265
-
3266
3273
  for (i = 0; i < steps; i++) {
3267
3274
  f_new = minfunc(t_new);
3268
3275
 
@@ -3275,24 +3282,21 @@ JXG.extend(
3275
3282
  }
3276
3283
 
3277
3284
  // t = Numerics.root(Numerics.D(minfunc), t);
3285
+
3278
3286
  // Ensure that minfunc is defined on the
3279
- // enclsoing interval [t-delta1, t+delta2]
3287
+ // enclosing interval [t-delta1, t+delta2]
3280
3288
  delta1 = delta;
3281
- for (i = 0;
3282
- i < 20 && isNaN(minfunc(t - delta1));
3283
- i++, delta1 *= 0.5);
3284
-
3289
+ for (i = 0; i < 20 && isNaN(minfunc(t - delta1)); i++, delta1 *= 0.5);
3285
3290
  if (isNaN(minfunc(t - delta1))) {
3286
3291
  delta1 = 0.0;
3287
3292
  }
3288
3293
  delta2 = delta;
3289
- for (i = 0;
3290
- i < 20 && isNaN(minfunc(t + delta2));
3291
- i++, delta2 *= 0.5);
3294
+ for (i = 0; i < 20 && isNaN(minfunc(t + delta2)); i++, delta2 *= 0.5);
3292
3295
  if (isNaN(minfunc(t + delta2))) {
3293
3296
  delta2 = 0.0;
3294
3297
  }
3295
3298
 
3299
+ // Finally, apply mathemetical optimization in the determined interval
3296
3300
  t = Numerics.fminbr(minfunc, [
3297
3301
  Math.max(t - delta1, minX),
3298
3302
  Math.min(t + delta2, maxX)
@@ -3310,8 +3314,9 @@ JXG.extend(
3310
3314
  // t = minX + t - maxX;
3311
3315
  // }
3312
3316
  // } else {
3313
- t = t < minX ? minX : t;
3314
- t = t > maxX ? maxX : t;
3317
+
3318
+ t = t < minX_glob ? minX_glob : t;
3319
+ t = t > maxX_glob ? maxX_glob : t;
3315
3320
  // }
3316
3321
 
3317
3322
  newCoordsObj = new Coords(
@@ -988,25 +988,29 @@ Mat.Statistics = {
988
988
  * @memberof JXG.Math.Statistics
989
989
  *
990
990
  * @example
991
- * let board = JXG.JSXGraph.initBoard('JXGbox',
992
- * { boundingbox: [-1.7, .5, 30, -.03], axis: true});
993
- *
994
- * let runs = [
995
- * [0.5, 20, 'blue'],
996
- * [0.7, 20, 'green'],
997
- * [0.5, 40, 'red'],
998
- * ]
999
- *
1000
- * let labelY = .4
1001
- * runs.forEach((run,i) => {
1002
- * board.create('segment',[[7,labelY-(i/50)],[9,labelY-(i/50)]],{strokeColor:run[2]})
1003
- * board.create('text',[10,labelY-(i/50),`p=${run[0]}, n=${run[1]}`])
1004
- *
1005
- * let x = Array(50000).fill(0).map(() => JXG.Math.Statistics.randomBinomial(run[1],run[0]))
1006
- * let res = JXG.Math.Statistics.histogram(x, { bins: 40, density: true, cumulative: false, range: [0, 40] });
1007
- * board.create('curve', [res[1], res[0]], { strokeColor: run[2]});
1008
- * })
1009
- * }
991
+ * let board = JXG.JSXGraph.initBoard('jxgbox',
992
+ * { boundingbox: [-1.7, .5, 30, -.03], axis: true });
993
+ *
994
+ * let runs = [
995
+ * [0.5, 20, 'blue'],
996
+ * [0.7, 20, 'green'],
997
+ * [0.5, 40, 'red'],
998
+ * ];
999
+ *
1000
+ * let labelY = .4;
1001
+ * runs.forEach((run, i) => {
1002
+ * board.create('segment', [[7, labelY - (i / 50)], [9, labelY - (i / 50)]], { strokeColor: run[2] });
1003
+ * board.create('text', [10, labelY - (i / 50), `p=${run[0]}, n=${run[1]}`]);
1004
+ *
1005
+ * let x = Array(50000).fill(0).map(() => JXG.Math.Statistics.randomBinomial(run[1], run[0]));
1006
+ * let res = JXG.Math.Statistics.histogram(x, {
1007
+ * bins: 40,
1008
+ * density: true,
1009
+ * cumulative: false,
1010
+ * range: [0, 40]
1011
+ * });
1012
+ * board.create('curve', [res[1], res[0]], { strokeColor: run[2] });
1013
+ * });
1010
1014
  *
1011
1015
  *
1012
1016
  * </pre><div id="JXGda56df4d-a5a5-4c87-9ffc-9bbc1b512302-3" class="jxgbox" style="width: 300px; height: 300px;"></div>
@@ -1342,7 +1346,8 @@ Mat.Statistics = {
1342
1346
  range,
1343
1347
  s,
1344
1348
  counts = [],
1345
- bins = [];
1349
+ bins = [],
1350
+ no_bin = 0; // Count of long tail elements not in histogram range
1346
1351
 
1347
1352
  // Evaluate number of bins
1348
1353
  num_bins = opt.bins || 10;
@@ -1377,12 +1382,14 @@ Mat.Statistics = {
1377
1382
  k = Math.floor((x[i] - mi) / delta);
1378
1383
  if (k >= 0 && k < num_bins) {
1379
1384
  counts[k] += 1;
1385
+ } else {
1386
+ no_bin += 1;
1380
1387
  }
1381
1388
  }
1382
1389
 
1383
1390
  // Normalize if density===true
1384
1391
  if (opt.density) {
1385
- s = JXG.Math.Statistics.sum(counts);
1392
+ s = JXG.Math.Statistics.sum(counts) + no_bin; // Normalize including long tail
1386
1393
  for (i = 0; i < num_bins; i++) {
1387
1394
  counts[i] /= (s * delta);
1388
1395
  // counts[i] /= s;
@@ -1393,7 +1400,7 @@ Mat.Statistics = {
1393
1400
  if (opt.cumulative) {
1394
1401
  if (opt.density) {
1395
1402
  for (i = 0; i < num_bins; i++) {
1396
- counts[i] *= delta; // normalize
1403
+ counts[i] *= delta; // Normalize
1397
1404
  }
1398
1405
  } for (i = 1; i < num_bins; i++) {
1399
1406
  counts[i] += counts[i - 1];
package/src/options.js CHANGED
@@ -1081,8 +1081,8 @@ JXG.Options = {
1081
1081
  * resize calls.
1082
1082
  * <p>
1083
1083
  * <b>Attention:</b> if the JSXGraph container has no CSS property like width or height and max-width or max-height set, but
1084
- * has a property like boxsizing:box-content, then the interplay between CSS and the resize attribute may result in an
1085
- * infinite loop with ever increasing JSXgraph container.
1084
+ * has a property like box-sizing:content-box, then the interplay between CSS and the resize attribute may result in an
1085
+ * infinite loop with ever increasing JSXGraph container.
1086
1086
  *
1087
1087
  * @see JXG.Board#startResizeObserver
1088
1088
  * @see JXG.Board#resizeListener
@@ -8609,9 +8609,9 @@ JXG.Options = {
8609
8609
 
8610
8610
  /**
8611
8611
  * If the text content is solely a number and
8612
- * this attribute is true (default) then the number is formatted
8612
+ * this attribute is true (default) then the number is either formatted
8613
8613
  * according to the number of digits
8614
- * given by the attribute 'digits' and convert into a fraction if 'toFraction'
8614
+ * given by the attribute 'digits' or converted into a fraction if 'toFraction'
8615
8615
  * is true.
8616
8616
  * <p>
8617
8617
  * Otherwise, display the raw number.
@@ -9334,7 +9334,8 @@ JXG.Options = {
9334
9334
  anchorY: 'middle',
9335
9335
 
9336
9336
  /**
9337
- * CSS class of the text in non-highlighted view.
9337
+ * Apply CSS classes to the text in non-highlighted view. It is possible to supply one or more
9338
+ * CSS classes separated by blanks.
9338
9339
  *
9339
9340
  * @name cssClass
9340
9341
  * @memberOf Text.prototype
@@ -9344,7 +9345,8 @@ JXG.Options = {
9344
9345
  cssClass: 'JXGtext',
9345
9346
 
9346
9347
  /**
9347
- * CSS class of the text in highlighted view.
9348
+ * Apply CSS classes to the text in highlighted view. It is possible to supply one or more
9349
+ * CSS classes separated by blanks.
9348
9350
  *
9349
9351
  * @name highlightCssClass
9350
9352
  * @memberOf Text.prototype
package/src/options3d.js CHANGED
@@ -80,6 +80,7 @@ JXG.extend(Options, {
80
80
  */
81
81
  xAxisBorder: {
82
82
  name: 'x',
83
+ visible: 'ìnherit',
83
84
  withLabel: false,
84
85
  label: {
85
86
  position: '50% left',
@@ -89,6 +90,7 @@ JXG.extend(Options, {
89
90
  strokeWidth: 1,
90
91
  lastArrow: false,
91
92
  ticks3d: {
93
+ visible: 'ìnherit',
92
94
  label: {
93
95
  anchorX: 'middle',
94
96
  anchorY: 'middle'
@@ -123,6 +125,7 @@ JXG.extend(Options, {
123
125
  */
124
126
  yAxisBorder: {
125
127
  name: 'y',
128
+ visible: 'ìnherit',
126
129
  withLabel: false,
127
130
  label: {
128
131
  position: '50% right',
@@ -132,6 +135,7 @@ JXG.extend(Options, {
132
135
  strokeWidth: 1,
133
136
  lastArrow: false,
134
137
  ticks3d: {
138
+ visible: 'ìnherit',
135
139
  label: {
136
140
  anchorX: 'middle'
137
141
  }
@@ -165,6 +169,7 @@ JXG.extend(Options, {
165
169
  */
166
170
  zAxisBorder: {
167
171
  name: 'z',
172
+ visible: 'ìnherit',
168
173
  withLabel: false,
169
174
  label: {
170
175
  position: '50% right',
@@ -174,6 +179,7 @@ JXG.extend(Options, {
174
179
  strokeWidth: 1,
175
180
  lastArrow: false,
176
181
  ticks3d: {
182
+ visible: 'ìnherit',
177
183
  label: {
178
184
  anchorX: 'middle',
179
185
  anchorY: 'middle'
@@ -394,7 +400,7 @@ JXG.extend(Options, {
394
400
  axis3d: {
395
401
  highlight: false,
396
402
  fixed: true,
397
- strokecolor: "black",
403
+ strokeColor: "black",
398
404
  strokeWidth: 1,
399
405
  tabindex: null,
400
406
 
@@ -1018,7 +1024,9 @@ JXG.extend(Options, {
1018
1024
  ],
1019
1025
 
1020
1026
  infobox: {
1021
- strokeColor: '#888888',
1027
+ // strokeColor: '#888888',
1028
+ strokeColor: '#000000',
1029
+ fontSize: 24,
1022
1030
  useKatex: false,
1023
1031
  useMathjax: false
1024
1032
  },
@@ -6,8 +6,6 @@ import zlib
6
6
  import base64
7
7
  # CGI variables handling
8
8
  import cgi
9
- #import cgitb
10
- #cgitb.enable()
11
9
 
12
10
  import JXG
13
11
  import inspect
@@ -17,9 +15,9 @@ import inspect
17
15
  from JXGServerModule import JXGServerModule
18
16
 
19
17
  def print_httpheader():
20
- print """\
18
+ print("""\
21
19
  Content-Type: text/plain\n
22
- """
20
+ """)
23
21
 
24
22
 
25
23
  def default_action(req, resp):
@@ -27,7 +25,6 @@ def default_action(req, resp):
27
25
  resp.error("action \"" + action + "\" is undefined")
28
26
  return resp.dump()
29
27
 
30
-
31
28
  def import_module(plugin, resp):
32
29
  try:
33
30
  __import__(plugin, None, None, [''])
@@ -55,7 +52,6 @@ def load_module(req, resp):
55
52
  tp.init(resp)
56
53
  return resp.dump()
57
54
 
58
-
59
55
  def exec_module(req, resp):
60
56
  handler = req.getValue('handler', 'none')
61
57
  module = req.getValue('module', 'none')
@@ -75,11 +71,10 @@ def exec_module(req, resp):
75
71
  else:
76
72
  params += (req.getValue(args.args[i]), )
77
73
 
78
- apply(method, params)
74
+ method(*params)
79
75
 
80
76
  return resp.dump()
81
77
 
82
-
83
78
  # Get Data from post/get parameters
84
79
  form = cgi.FieldStorage();
85
80
 
@@ -95,5 +90,5 @@ ret = actions_map.get(action, default_action)(JXG.Request(action, id, data), JXG
95
90
 
96
91
  print_httpheader()
97
92
 
98
- print base64.b64encode(zlib.compress(ret, 9))
93
+ print(base64.b64encode(zlib.compress(ret, 9)))
99
94
 
@@ -5,5 +5,5 @@ class JXGServerModule(object):
5
5
  def __init__(self):
6
6
  self.isJXGServerModule = True
7
7
 
8
- def init(self, resp):
9
- return
8
+ def init(self, resp):
9
+ return
@@ -1,5 +1,16 @@
1
1
  # JSXGraph server scripts
2
2
 
3
+ __Update 18.10.2024__
4
+
5
+ Since v1.10.1 this module is retired !
6
+
7
+ The server module needs a complete rewrite. The installation is error prone,
8
+ since python 3.13 the module `cgi` is not longer supported.
9
+ A modern implementation would use a different approach with nodejs or
10
+ a comparable system for python.
11
+
12
+ ## Description
13
+
3
14
  JSXGraph is a cross-browser library for interactive geometry, function plotting,
4
15
  graphs, and data visualization in a web browser. It is implemented completely in
5
16
  JavaScript and uses SVG and VML.
@@ -11,35 +22,35 @@ plot that points in JSXGraph.
11
22
 
12
23
  Scripts available:
13
24
 
14
- - jxggroebner.py
25
+ - `jxggroebner.py`
15
26
 
16
27
  ## General configuration
17
28
 
18
- By default server scripts are stored in the server subdirectory of the JavaScript
29
+ By default server scripts are stored in the subdirectory `server` of the JavaScript
19
30
  files. If you want the scripts in another place you'll have to adjust
20
- JXG.serverBase
21
- either directly in JSX source (loadjsxgraph[InOneFile].js) or by setting it in a
22
- javascript in your page after loading jsxgraph.
31
+ `JXG.serverBase`
32
+ either directly in JSX source (loadjsxgraph[InOneFile].js) or by setting it with
33
+ javascript in your page after loading JSXGraph.
23
34
 
24
35
  ## jxggroebner.py
25
36
 
26
- - **Required software**
37
+ - __Required software__
27
38
 
28
- - CoCoA (https://cocoa.dima.unige.it/)
29
- - Python (https://python.org/)
30
- - numpy (https://numpy.scipy.org/)
31
- - matplotlib (https://matplotlib.sourceforge.net/)
39
+ - CoCoA (https://cocoa.dima.unige.it/)
40
+ - Python (https://python.org/)
41
+ - numpy (https://numpy.scipy.org/)
42
+ - matplotlib (https://matplotlib.sourceforge.net/)
32
43
 
33
- - **Setup**
44
+ - __Setup__
34
45
 
35
46
  Install CoCoA so it can be started by just typing cocoa in a terminal or adjust
36
- the configuration in jsxgroebner.py. Install all of the python packages.
47
+ the configuration in `jsxgroebner.py`. Install all of the python packages.
37
48
 
38
49
  Your webserver has to be configured to execute python .py scripts as cgi, e.g.
39
50
  for Apache you have to configure
40
51
 
41
- Options +ExecCGI
42
- AddHandler cgi-script .py
52
+ Options +ExecCGI
53
+ AddHandler cgi-script .py
43
54
 
44
55
  for the directory JSXGraph server scripts are in.
45
56
 
@@ -1,7 +1,7 @@
1
1
  from JXGServerModule import JXGServerModule
2
2
  from rpy import r
3
3
  import JXG
4
- import StringIO, gzip
4
+ import io, gzip
5
5
  import datetime, math, random
6
6
 
7
7
  class RStats(JXGServerModule):
@@ -1,6 +1,6 @@
1
1
  from JXGServerModule import JXGServerModule
2
2
  import JXG
3
- import urllib2, httplib, StringIO, gzip
3
+ import urllib.request, urllib.error, urllib.parse, http.client, io, gzip
4
4
  import datetime, math, random
5
5
 
6
6
  class YahooFinance(JXGServerModule):
@@ -22,14 +22,14 @@ class YahooFinance(JXGServerModule):
22
22
  def _getData(self, share):
23
23
  #httplib.HTTPConnection.debuglevel = 1
24
24
  # todo: adjust the s parameter to input the share given with parameter share
25
- request = urllib2.Request('http://finance.yahoo.com/d/quotes.csv?s=' + share.lower() + '&f=sl1d1t1c1ohgv&e=.csv')
25
+ request = urllib.request.Request('http://finance.yahoo.com/d/quotes.csv?s=' + share.lower() + '&f=sl1d1t1c1ohgv&e=.csv')
26
26
  # accept compressed data
27
27
  request.add_header('Accept-encoding', 'gzip')
28
- opener = urllib2.build_opener()
28
+ opener = urllib.request.build_opener()
29
29
  f = opener.open(request)
30
30
 
31
31
  compresseddata = f.read()
32
- compressedstream = StringIO.StringIO(compresseddata)
32
+ compressedstream = io.StringIO(compresseddata)
33
33
  gzipper = gzip.GzipFile(fileobj=compressedstream)
34
34
  try:
35
35
  data = gzipper.read()
@@ -3,7 +3,7 @@ import numpy
3
3
  import numpy.fft
4
4
  import wave, struct, uuid
5
5
  import os, subprocess
6
- import StringIO, gzip, base64
6
+ import io, gzip, base64
7
7
  import datetime, math, random
8
8
 
9
9
  # Should be changed to something more persistent but must be writable by
@@ -31,7 +31,7 @@ class FFT(JXGServerModule):
31
31
 
32
32
  def fft(self, resp, x):
33
33
  y = numpy.fft.rfft(x)
34
- y = map(abs, y);
34
+ y = list(map(abs, y));
35
35
  resp.addData('y', y)
36
36
  return
37
37
 
@@ -40,7 +40,7 @@ class FFT(JXGServerModule):
40
40
 
41
41
  def ifft(self, resp, x):
42
42
  y = numpy.fft.irfft(x)
43
- y = map(self._real, y);
43
+ y = list(map(self._real, y));
44
44
  resp.addData('y', y)
45
45
  return
46
46
 
@@ -54,7 +54,7 @@ class FFT(JXGServerModule):
54
54
  w = wave.open(fname, 'r')
55
55
  (nchannels, sampwidth, framerate, nframes, comptype, compname) = w.getparams()
56
56
  frames = w.readframes(nframes*nchannels)
57
- out = map(lambda value: value/8192., struct.unpack_from("%dh" % nframes * nchannels, frames))
57
+ out = [value/8192. for value in struct.unpack_from("%dh" % nframes * nchannels, frames)]
58
58
  w.close()
59
59
  # apply fft
60
60
  x = numpy.fft.rfft(out)
@@ -66,7 +66,7 @@ class FFT(JXGServerModule):
66
66
  x[i] = x[i] * factor
67
67
  #ifft
68
68
  y = numpy.fft.irfft(x)
69
- y = map(self._real, y);
69
+ y = list(map(self._real, y));
70
70
  resp.addData('y', y)
71
71
  self.makeAudio(resp, 'ogg', framerate, y)
72
72
  return
@@ -95,7 +95,7 @@ class FFT(JXGServerModule):
95
95
  w = wave.open(fname, 'r')
96
96
  (nchannels, sampwidth, framerate, nframes, comptype, compname) = w.getparams()
97
97
  frames = w.readframes(nframes*nchannels)
98
- out = map(lambda value: value/8192., struct.unpack_from("%dh" % nframes * nchannels, frames))
98
+ out = [value/8192. for value in struct.unpack_from("%dh" % nframes * nchannels, frames)]
99
99
  w.close()
100
100
  step = math.floor(len(out)/7500);
101
101
  #resp.addData('audioData', [out[i] for i in range(len(out)) if i % step == 0]);
@@ -21,7 +21,7 @@ import time
21
21
  import re
22
22
  import zlib
23
23
  import base64
24
- import cStringIO
24
+ import io
25
25
  import cgi
26
26
  import math
27
27
 
@@ -45,7 +45,7 @@ class JXGGeoLociModule(JXGServerModule):
45
45
 
46
46
  ############################
47
47
 
48
- self.debugOutput = cStringIO.StringIO()
48
+ self.debugOutput = io.StringIO()
49
49
 
50
50
  JXGServerModule.__init__(self)
51
51
  return
@@ -96,8 +96,8 @@ class JXGGeoLociModule(JXGServerModule):
96
96
  #cinput = "Ciao;"
97
97
 
98
98
  if self.debug:
99
- print >>self.debugOutput, "Starting CoCoA with input<br />"
100
- print >>self.debugOutput, cinput + '<br />'
99
+ print("Starting CoCoA with input<br />", file=self.debugOutput)
100
+ print(cinput + '<br />', file=self.debugOutput)
101
101
 
102
102
  # The suicide pill for the CoCoA process:
103
103
  # If not done within the following amount
@@ -109,7 +109,7 @@ class JXGGeoLociModule(JXGServerModule):
109
109
 
110
110
  def time_limit(seconds):
111
111
  def signal_handler(signum, frame):
112
- raise TimeoutException, "Timed out!"
112
+ raise TimeoutException("Timed out!")
113
113
  signal.signal(signal.SIGALRM, signal_handler)
114
114
  signal.alarm(seconds)
115
115
 
@@ -126,7 +126,7 @@ class JXGGeoLociModule(JXGServerModule):
126
126
  try:
127
127
  time_limit(time_left)
128
128
  callCoCoA()
129
- except TimeoutException, msg:
129
+ except TimeoutException as msg:
130
130
  # This is only tested with linux/unix
131
131
  # and works ONLY if the cocoa script cd-ing
132
132
  # to the cocoa dir and starting cocoa executes
@@ -136,7 +136,7 @@ class JXGGeoLociModule(JXGServerModule):
136
136
  # sharing tests would be nice).
137
137
  self.cocoa_process.kill()
138
138
  if self.debug:
139
- print >>self.debugOutput, "Timed out!"
139
+ print("Timed out!", file=self.debugOutput)
140
140
  resp.error("Timeout, maybe the system of polynomial is too big or there's an error in it.")
141
141
  return
142
142
 
@@ -144,8 +144,8 @@ class JXGGeoLociModule(JXGServerModule):
144
144
  resp.addData('exectime', calc_time)
145
145
 
146
146
  if self.debug:
147
- print >>self.debugOutput, "Reading and Parsing CoCoA output" + '<br />'
148
- print >>self.debugOutput, self.output + '<br />'
147
+ print("Reading and Parsing CoCoA output" + '<br />', file=self.debugOutput)
148
+ print(self.output + '<br />', file=self.debugOutput)
149
149
 
150
150
  # Extract results
151
151
  if re.search('resultsbegin', self.output) is None:
@@ -157,9 +157,9 @@ class JXGGeoLociModule(JXGServerModule):
157
157
  polynomials = re.split('\n', result)
158
158
 
159
159
  if self.debug:
160
- print >>self.debugOutput, "Found the following polynomials:" + '<br />'
160
+ print("Found the following polynomials:" + '<br />', file=self.debugOutput)
161
161
  for i in range(0,len(polynomials)):
162
- print >>self.debugOutput, "Polynomial ", i+1, ": " + polynomials[i] + '<br />'
162
+ print("Polynomial ", i+1, ": " + polynomials[i] + '<br />', file=self.debugOutput)
163
163
 
164
164
  datax = []
165
165
  datay = []
@@ -198,12 +198,12 @@ class JXGGeoLociModule(JXGServerModule):
198
198
  resp.addData('polynomial', polynomialsReturn)
199
199
 
200
200
  if self.debug:
201
- print >>self.debugOutput, ", ".join(map(str, datax)) + '<br />'
202
- print >>self.debugOutput, ", ".join(map(str, datay)) + '<br />'
203
- print "Content-Type: text/plain\n\n"
204
- print
205
- print
206
- print self.debugOutput.getvalue()
201
+ print(", ".join(map(str, datax)) + '<br />', file=self.debugOutput)
202
+ print(", ".join(map(str, datay)) + '<br />', file=self.debugOutput)
203
+ print("Content-Type: text/plain\n\n")
204
+ print()
205
+ print()
206
+ print(self.debugOutput.getvalue())
207
207
 
208
208
  self.debugOutput.close()
209
209