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
@@ -1,5 +1,5 @@
1
1
  /*
2
- JSXGraph 1.9.1
2
+ JSXGraph 1.10.0
3
3
 
4
4
  Copyright 2008-2024
5
5
  Matthias Ehmann,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "jsxgraph",
3
3
  "description": "Interactive geometry, plotting, visualization",
4
4
  "homepage": "https://jsxgraph.org",
5
- "version": "1.10.0",
5
+ "version": "1.10.1",
6
6
  "exports": {
7
7
  "types": "./src/index.d.ts",
8
8
  "default": "./src/index.js"
package/src/3d/box3d.js CHANGED
@@ -113,6 +113,7 @@ JXG.createAxes3D = function (board, parents, attributes) {
113
113
  to[i] = front[i];
114
114
  // attr[na.toLowerCase()].lastArrow = false;
115
115
  axes[na] = view.create("axis3d", [from, to], attr[na.toLowerCase()]);
116
+ axes[na].view = view;
116
117
 
117
118
  ticks_attr = attr[na.toLowerCase()].ticks3d;
118
119
  len = front[i] - rear[i];
@@ -123,6 +124,7 @@ JXG.createAxes3D = function (board, parents, attributes) {
123
124
  } else {
124
125
  axes[na + "Ticks"] = view.create("ticks3d", [from, [0, 0, 1], len, [0, 1, 0]], ticks_attr);
125
126
  }
127
+ axes[na + "Ticks"].view = view;
126
128
  }
127
129
  }
128
130
 
package/src/3d/curve3d.js CHANGED
@@ -297,23 +297,72 @@ JXG.registerElement("curve3d", JXG.createCurve3D);
297
297
  * end value of y. The vector field will contain (number of steps) + 1 vectors in direction of y.
298
298
  * @param {Array} zData Array of length 3 containing start value for z, number of steps,
299
299
  * end value of z. The vector field will contain (number of steps) + 1 vectors in direction of z.
300
+ *
301
+ * @example
302
+ * const view = board.create('view3d',
303
+ * [
304
+ * [-6, -3],
305
+ * [8, 8],
306
+ * [[-3, 3], [-3, 3], [-3, 3]]
307
+ * ], {});
308
+ *
309
+ * var vf = view.create('vectorfield3d', [
310
+ * [(x, y, z) => Math.cos(y), (x, y, z) => Math.sin(x), (x, y, z) => z],
311
+ * [-2, 5, 2], // x from -2 to 2 in 5 steps
312
+ * [-2, 5, 2], // y
313
+ * [-2, 5, 2] // z
314
+ * ], {
315
+ * strokeColor: 'red',
316
+ * scale: 0.5
317
+ * });
318
+ *
319
+ * </pre><div id="JXG8e41c67b-3338-4428-bd0f-c69d8f6fb348" class="jxgbox" style="width: 300px; height: 300px;"></div>
320
+ * <script type="text/javascript">
321
+ * (function() {
322
+ * var board = JXG.JSXGraph.initBoard('JXG8e41c67b-3338-4428-bd0f-c69d8f6fb348',
323
+ * {boundingbox: [-8, 8, 8,-8], axis: false, showcopyright: false, shownavigation: false,
324
+ * pan: {
325
+ * needTwoFingers: true
326
+ * }
327
+ * });
328
+ * const view = board.create('view3d',
329
+ * [
330
+ * [-6, -3],
331
+ * [8, 8],
332
+ * [[-3, 3], [-3, 3], [-3, 3]]
333
+ * ], {});
334
+ * var vf = view.create('vectorfield3d', [
335
+ * [(x, y, z) => Math.cos(y), (x, y, z) => Math.sin(x), (x, y, z) => z],
336
+ * [-2, 5, 2], // x from -2 to 2 in 5 steps
337
+ * [-2, 5, 2], // y
338
+ * [-2, 5, 2] // z
339
+ * ], {
340
+ * strokeColor: 'red',
341
+ * scale: 0.5
342
+ * });
343
+ *
344
+ *
345
+ * })();
346
+ *
347
+ * </script><pre>
348
+ *
300
349
  */
301
350
  JXG.createVectorfield3D = function (board, parents, attributes) {
302
351
  var view = parents[0],
303
352
  el, attr;
304
353
 
305
354
  if (!(parents.length >= 5 &&
306
- (Type.isArray(parents[1]) || Type.isFunction(parents[0]) || Type.isString(parents[0])) &&
355
+ (Type.isArray(parents[1]) || Type.isFunction(parents[1]) || Type.isString(parents[1])) &&
307
356
  (Type.isArray(parents[2]) && parents[1].length === 3) &&
308
357
  (Type.isArray(parents[3]) && parents[2].length === 3) &&
309
358
  (Type.isArray(parents[4]) && parents[3].length === 3)
310
359
  )) {
311
360
  throw new Error(
312
361
  "JSXGraph: Can't create vector field 3D with parent types " +
313
- "'" + typeof parents[0] + "', " +
314
362
  "'" + typeof parents[1] + "', " +
315
- "'" + typeof parents[2] + "'." +
316
- "'" + typeof parents[1] + "', "
363
+ "'" + typeof parents[2] + "', " +
364
+ "'" + typeof parents[3] + "'." +
365
+ "'" + typeof parents[4] + "', "
317
366
  );
318
367
  }
319
368
 
@@ -602,7 +602,7 @@ JXG.extend(
602
602
 
603
603
  updateDataArray: function () {
604
604
  var s1, e1, s2, e2, c2d, l1, l2,
605
- planes = ['xPlaneRear', 'yPlaneRear', 'zPlaneRear'],
605
+ planes = ['xPlaneRear', 'yPlaneRear', 'zPlaneRear'], // Must be ordered x, y, z
606
606
  points = [],
607
607
  v1 = [0, 0, 0],
608
608
  v2 = [0, 0, 0],
@@ -625,17 +625,20 @@ JXG.extend(
625
625
  Type.evaluate(this.range2[0]) === -Infinity &&
626
626
  Type.evaluate(this.range2[1]) === Infinity
627
627
  ) {
628
+ // Determine the intersections of the new plane with
629
+ // the view bbox3d.
630
+ //
628
631
  // Start with the rear plane.
629
- // Determine the intersections with the view bbox3d
630
632
  // For each face of the bbox3d we determine two points
631
- // which are the ends of the intersection line.
632
- // We start with the three rear planes.
633
+ // which are the end points of the intersecting line
634
+ // between the plane and a face of bbox3d.
635
+ // We start with the three rear planes (set in planes[] above)
633
636
  for (j = 0; j < planes.length; j++) {
634
637
  p = view.intersectionPlanePlane(this, view.defaultAxes[planes[j]]);
635
-
636
638
  if (p[0].length === 3 && p[1].length === 3) {
637
639
  // This test is necessary to filter out intersection lines which are
638
- // identical to intersections of axis planes (they would occur twice).
640
+ // identical to intersections of axis planes (they would occur twice),
641
+ // i.e. edges of bbox3d.
639
642
  for (i = 0; i < points.length; i++) {
640
643
  if (
641
644
  (Geometry.distance(p[0], points[i][0], 3) < Mat.eps &&
@@ -651,10 +654,11 @@ JXG.extend(
651
654
  }
652
655
  }
653
656
 
654
- // Point on the front plane of the bbox3d
657
+ // Take a point on the corresponding front plane of bbox3d.
655
658
  p = [0, 0, 0];
656
659
  p[j] = view.bbox3D[j][1];
657
660
 
661
+ // Use the Hesse normal form of front plane to intersect it with the plane
658
662
  // d is the rhs of the Hesse normal form of the front plane.
659
663
  d = Mat.innerProduct(p, view.defaultAxes[planes[j]].normal, 3);
660
664
  p = view.intersectionPlanePlane(this, view.defaultAxes[planes[j]], d);
@@ -662,6 +666,7 @@ JXG.extend(
662
666
  if (p[0].length === 3 && p[1].length === 3) {
663
667
  // Do the same test as above
664
668
  for (i = 0; i < points.length; i++) {
669
+ // Same test for edges of bbox3d as above
665
670
  if (
666
671
  (Geometry.distance(p[0], points[i][0], 3) < Mat.eps &&
667
672
  Geometry.distance(p[1], points[i][1], 3) < Mat.eps) ||
@@ -677,6 +682,11 @@ JXG.extend(
677
682
  }
678
683
  }
679
684
 
685
+ // Handle the case that the plane does not intersect bbox3d at all.
686
+ if (points.length === 0) {
687
+ return { X: this.dataX, Y: this.dataY };
688
+ }
689
+
680
690
  // Concatenate the intersection points to a polygon.
681
691
  // If all went well, each intersection should appear
682
692
  // twice in the list.
package/src/3d/point3d.js CHANGED
@@ -278,13 +278,15 @@ JXG.extend(
278
278
  },
279
279
 
280
280
  update: function (drag) {
281
- var c3d, foot;
281
+ var c3d, foot, res;
282
282
 
283
283
  // Update is called from board.updateElements
284
284
  if (
285
285
  this.element2D.draggable() &&
286
286
  Geometry.distance(this._c2d, this.element2D.coords.usrCoords) !== 0
287
287
  ) {
288
+
289
+ //
288
290
  if (this.slide) {
289
291
  this.coords = this.slide.projectScreenCoords(
290
292
  [this.element2D.X(), this.element2D.Y()],
@@ -297,17 +299,33 @@ JXG.extend(
297
299
  } else {
298
300
  if (this.view.isVerticalDrag()) {
299
301
  // Drag the point in its vertical to the xy plane
302
+ // If the point is outside of bbox3d,
303
+ // c3d is already corrected.
300
304
  c3d = this.view.project2DTo3DVertical(this.element2D, this.coords);
301
305
  } else {
302
306
  // Drag the point in its xy plane
303
307
  foot = [1, 0, 0, this.coords[3]];
304
308
  c3d = this.view.project2DTo3DPlane(this.element2D, [1, 0, 0, 1], foot);
305
309
  }
310
+
306
311
  if (c3d[0] !== 0) {
307
- this.coords = this.view.project3DToCube(c3d);
312
+ // Check if c3d is inside of view.bbox3d
313
+ // Otherwise, the coords have to be corrected below.
314
+ res = this.view.project3DToCube(c3d);
315
+ this.coords = res[0];
316
+
317
+ if (res[1]) {
318
+ // The 3D coordinates have been corrected, now
319
+ // also correct the 2D element.
320
+ this.element2D.coords.setCoordinates(
321
+ Const.COORDS_BY_USER,
322
+ this.view.project3DTo2D(this.coords)
323
+ );
324
+ }
308
325
  }
309
326
  }
310
327
  } else {
328
+ // Update 2D point from its 3D view
311
329
  this.updateCoords();
312
330
  if (this.slide) {
313
331
  this.coords = this.slide.projectCoords(
@@ -315,7 +333,6 @@ JXG.extend(
315
333
  this._params
316
334
  );
317
335
  }
318
- // Update 2D point from its 3D view
319
336
  this.element2D.coords.setCoordinates(
320
337
  Const.COORDS_BY_USER,
321
338
  this.view.project3DTo2D([1, this.X(), this.Y(), this.Z()])
package/src/3d/text3d.js CHANGED
@@ -278,9 +278,10 @@ JXG.extend(
278
278
  },
279
279
 
280
280
  update: function (drag) {
281
- var c3d, foot;
281
+ var c3d, foot, res;
282
282
 
283
- // Update is called from board.updateElements
283
+ // Update is called from board.updateElements.
284
+ // See Point3D.update() for the logic.
284
285
  if (
285
286
  this.element2D.draggable() &&
286
287
  Geometry.distance(this._c2d, this.element2D.coords.usrCoords) !== 0
@@ -296,15 +297,27 @@ JXG.extend(
296
297
  );
297
298
  } else {
298
299
  if (this.view.isVerticalDrag()) {
299
- // Drag the point in its vertical to the xy plane
300
+ // Drag the text in its vertical to the xy plane
300
301
  c3d = this.view.project2DTo3DVertical(this.element2D, this.coords);
301
302
  } else {
302
- // Drag the point in its xy plane
303
+ // Drag the text in its xy plane
303
304
  foot = [1, 0, 0, this.coords[3]];
304
305
  c3d = this.view.project2DTo3DPlane(this.element2D, [1, 0, 0, 1], foot);
305
306
  }
306
307
  if (c3d[0] !== 0) {
307
- this.coords = this.view.project3DToCube(c3d);
308
+ // Check if c3d is inside of view.bbox3d
309
+ // Otherwise, the coords have to be corrected below.
310
+ res = this.view.project3DToCube(c3d);
311
+ this.coords = res[0];
312
+
313
+ if (res[1]) {
314
+ // The 3D coordinates have been corrected, now
315
+ // also correct the 2D element.
316
+ this.element2D.coords.setCoordinates(
317
+ Const.COORDS_BY_USER,
318
+ this.view.project3DTo2D(this.coords)
319
+ );
320
+ }
308
321
  }
309
322
  }
310
323
  } else {
@@ -315,7 +328,7 @@ JXG.extend(
315
328
  this._params
316
329
  );
317
330
  }
318
- // Update 2D point from its 3D view
331
+ // Update 2D text from its 3D view
319
332
  this.element2D.coords.setCoordinates(
320
333
  Const.COORDS_BY_USER,
321
334
  this.view.project3DTo2D([1, this.X(), this.Y(), this.Z()].slice(1))
@@ -447,8 +460,7 @@ JXG.createText3D = function (board, parents, attributes) {
447
460
  el.inherits.push(el.element2D);
448
461
  el.element2D.setParents(el);
449
462
 
450
-
451
- // if this point is a glider, record that in the update tree
463
+ // If this point is a glider, record that in the update tree
452
464
  if (el.slide) {
453
465
  el.slide.addChild(el);
454
466
  el.setParents(el.slide);
package/src/3d/view3d.js CHANGED
@@ -1160,30 +1160,39 @@ JXG.extend(
1160
1160
  * Limit 3D coordinates to the bounding cube.
1161
1161
  *
1162
1162
  * @param {Array} c3d 3D coordinates [x,y,z]
1163
- * @returns Array with updated 3D coordinates.
1163
+ * @returns Array [Array, Boolean] containing [coords, corrected]. coords contains the updated 3D coordinates,
1164
+ * correct is true if the coords have been changed.
1164
1165
  */
1165
1166
  project3DToCube: function (c3d) {
1166
- var cube = this.bbox3D;
1167
+ var cube = this.bbox3D,
1168
+ isOut = false;
1169
+
1167
1170
  if (c3d[1] < cube[0][0]) {
1168
1171
  c3d[1] = cube[0][0];
1172
+ isOut = true;
1169
1173
  }
1170
1174
  if (c3d[1] > cube[0][1]) {
1171
1175
  c3d[1] = cube[0][1];
1176
+ isOut = true;
1172
1177
  }
1173
1178
  if (c3d[2] < cube[1][0]) {
1174
1179
  c3d[2] = cube[1][0];
1180
+ isOut = true;
1175
1181
  }
1176
1182
  if (c3d[2] > cube[1][1]) {
1177
1183
  c3d[2] = cube[1][1];
1184
+ isOut = true;
1178
1185
  }
1179
- if (c3d[3] < cube[2][0]) {
1186
+ if (c3d[3] <= cube[2][0]) {
1180
1187
  c3d[3] = cube[2][0];
1188
+ isOut = true;
1181
1189
  }
1182
- if (c3d[3] > cube[2][1]) {
1190
+ if (c3d[3] >= cube[2][1]) {
1183
1191
  c3d[3] = cube[2][1];
1192
+ isOut = true;
1184
1193
  }
1185
1194
 
1186
- return c3d;
1195
+ return [c3d, isOut];
1187
1196
  },
1188
1197
 
1189
1198
  /**
@@ -2295,7 +2304,9 @@ JXG.createView3D = function (board, parents, attributes) {
2295
2304
  view.inherits.push(view.bank_slide);
2296
2305
 
2297
2306
  // Set special infobox attributes of view3d.infobox
2298
- view.board.infobox.setAttribute(attr.infobox);
2307
+ // Using setAttribute() is not possible here, since we have to
2308
+ // avoid a call of board.update().
2309
+ view.board.infobox.visProp = Type.merge(view.board.infobox.visProp, attr.infobox);
2299
2310
 
2300
2311
  // 3d infobox: drag direction and coordinates
2301
2312
  view.board.highlightInfobox = function (x, y, el) {
@@ -2352,7 +2363,6 @@ JXG.createView3D = function (board, parents, attributes) {
2352
2363
  }
2353
2364
  };
2354
2365
 
2355
-
2356
2366
  // Hack needed to enable addEvent for view3D:
2357
2367
  view.BOARD_MODE_NONE = 0x0000;
2358
2368
 
package/src/base/board.js CHANGED
@@ -6064,6 +6064,7 @@ JXG.extend(
6064
6064
  Type.isString(parents[i]) &&
6065
6065
  !(elementType === 'text' && i === 2) &&
6066
6066
  !(elementType === 'solidofrevolution3d' && i === 2) &&
6067
+ !(elementType === 'text3d' && (i === 2 || i === 4)) &&
6067
6068
  !(
6068
6069
  (elementType === 'input' ||
6069
6070
  elementType === 'checkbox' ||
@@ -37,7 +37,7 @@ import JXG from "../jxg.js";
37
37
 
38
38
  var major = 1,
39
39
  minor = 10,
40
- patch = 0,
40
+ patch = 1,
41
41
  add = '', // 'dev' 'beta'
42
42
  version = major + '.' + minor + '.' + patch + (add ? '-' + add : ''),
43
43
  constants;
@@ -1903,13 +1903,58 @@ JXG.extend(
1903
1903
  * @param {Number} [time] Number of milliseconds the animation should last.
1904
1904
  * @param {Object} [options] Optional settings for the animation
1905
1905
  * @param {function} [options.callback] A function that is called as soon as the animation is finished.
1906
- * @param {String} [options.effect='<>'] animation effects like speed fade in and out. possible values are
1907
- * '<>' for speed increase on start and slow down at the end (default) and '--' for constant speed during
1906
+ * @param {String} [options.effect='<>'|'>'|'<'] animation effects like speed fade in and out. possible values are
1907
+ * '<>' for speed increase on start and slow down at the end (default), '<' for speed up, '>' for slow down, and '--' for constant speed during
1908
1908
  * the whole animation.
1909
1909
  * @returns {JXG.CoordsElement} Reference to itself.
1910
1910
  * @see JXG.CoordsElement#moveAlong
1911
1911
  * @see JXG.CoordsElement#visit
1912
1912
  * @see JXG.GeometryElement#animate
1913
+ * @example
1914
+ * // moveTo() with different easing options and callback options
1915
+ * let yInit = 3
1916
+ * let [A, B, C, D] = ['==', '<>', '<', '>'].map((s) => board.create('point', [4, yInit--], { name: s, label: { fontSize: 24 } }))
1917
+ * let seg = board.create('segment', [A, [() => A.X(), 0]]) // shows linear
1918
+ *
1919
+ *let isLeftRight = true;
1920
+ *let buttonMove = board.create('button', [-2, 4, 'left',
1921
+ *() => {
1922
+ * isLeftRight = !isLeftRight;
1923
+ * buttonMove.rendNodeButton.innerHTML = isLeftRight ? 'left' : 'right'
1924
+ * let x = isLeftRight ? 4 : -4
1925
+ * let sym = isLeftRight ? 'triangleleft' : 'triangleright'
1926
+ *
1927
+ * A.moveTo([x, 3], 1000, { callback: () => A.setAttribute({ face: sym, size: 5 }) })
1928
+ * B.moveTo([x, 2], 1000, { callback: () => B.setAttribute({ face: sym, size: 5 }), effect: "<>" })
1929
+ * C.moveTo([x, 1], 1000, { callback: () => C.setAttribute({ face: sym, size: 5 }), effect: "<" })
1930
+ * D.moveTo([x, 0], 1000, { callback: () => D.setAttribute({ face: sym, size: 5 }), effect: ">" })
1931
+ *
1932
+ *}])
1933
+ *
1934
+ </pre><div id="JXG0f35a50e-e99d-11e8-a1ca-04d3b0c2aad4" class="jxgbox" style="width: 300px; height: 300px;"></div>
1935
+ <script type="text/javascript">
1936
+ {
1937
+ * let board = JXG.JSXGraph.initBoard('JXG0f35a50e-e99d-11e8-a1ca-04d3b0c2aad4')
1938
+ let yInit = 3
1939
+ let [A, B, C, D] = ['==', '<>', '<', '>'].map((s) => board.create('point', [4, yInit--], { name: s, label: { fontSize: 24 } }))
1940
+ let seg = board.create('segment', [A, [() => A.X(), 0]]) // shows linear
1941
+
1942
+ let isLeftRight = true;
1943
+ let buttonMove = board.create('button', [-2, 4, 'left',
1944
+ () => {
1945
+ isLeftRight = !isLeftRight;
1946
+ buttonMove.rendNodeButton.innerHTML = isLeftRight ? 'left' : 'right'
1947
+ let x = isLeftRight ? 4 : -4
1948
+ let sym = isLeftRight ? 'triangleleft' : 'triangleright'
1949
+
1950
+ A.moveTo([x, 3], 1000, { callback: () => A.setAttribute({ face: sym, size: 5 }) })
1951
+ B.moveTo([x, 2], 1000, { callback: () => B.setAttribute({ face: sym, size: 5 }), effect: "<>" })
1952
+ C.moveTo([x, 1], 1000, { callback: () => C.setAttribute({ face: sym, size: 5 }), effect: "<" })
1953
+ D.moveTo([x, 0], 1000, { callback: () => D.setAttribute({ face: sym, size: 5 }), effect: ">" })
1954
+
1955
+ }])
1956
+ }
1957
+ </script><pre>
1913
1958
  */
1914
1959
  moveTo: function (where, time, options) {
1915
1960
  options = options || {};
@@ -1925,10 +1970,24 @@ JXG.extend(
1925
1970
  dY = where.usrCoords[2] - Y,
1926
1971
  /** @ignore */
1927
1972
  stepFun = function (i) {
1928
- if (options.effect && options.effect === "<>") {
1929
- return Math.pow(Math.sin(((i / steps) * Math.PI) / 2), 2);
1973
+ let x = i / steps; // absolute progress of the animatin
1974
+
1975
+ if (options.effect) {
1976
+ if (options.effect === "<>") {
1977
+ return Math.pow(Math.sin((x * Math.PI) / 2), 2);
1978
+ }
1979
+ if (options.effect === "<") { // cubic ease in
1980
+ return x * x * x;
1981
+ }
1982
+ if (options.effect === ">") { // cubic ease out
1983
+ return 1 - Math.pow(1 - x, 3);
1984
+ }
1985
+ if (options.effect === "==") {
1986
+ return i / steps; // linear
1987
+ }
1988
+ throw new Error("valid effects are '==', '<>', '>', and '<'.");
1930
1989
  }
1931
- return i / steps;
1990
+ return i / steps; // default
1932
1991
  };
1933
1992
 
1934
1993
  if (
@@ -1972,14 +2031,52 @@ JXG.extend(
1972
2031
  * @param {Number} time Number of milliseconds the animation should last.
1973
2032
  * @param {Object} [options] Optional settings for the animation
1974
2033
  * @param {function} [options.callback] A function that is called as soon as the animation is finished.
1975
- * @param {String} [options.effect='<>'] animation effects like speed fade in and out. possible values are
1976
- * '<>' for speed increase on start and slow down at the end (default) and '--' for constant speed during
2034
+ * @param {String} [options.effect='<>'|'>'|'<'] animation effects like speed fade in and out. possible values are
2035
+ * '<>' for speed increase on start and slow down at the end (default), '<' for speed up, '>' for slow down, and '--' for constant speed during
1977
2036
  * the whole animation.
1978
2037
  * @param {Number} [options.repeat=1] How often this animation should be repeated.
1979
2038
  * @returns {JXG.CoordsElement} Reference to itself.
1980
2039
  * @see JXG.CoordsElement#moveAlong
1981
2040
  * @see JXG.CoordsElement#moveTo
1982
2041
  * @see JXG.GeometryElement#animate
2042
+ * @example
2043
+ * // visit() with different easing options
2044
+ * let yInit = 3
2045
+ * let [A, B, C, D] = ['==', '<>', '<', '>'].map((s) => board.create('point', [4, yInit--], { name: s, label: { fontSize: 24 } }))
2046
+ * let seg = board.create('segment', [A, [() => A.X(), 0]]) // shows linear
2047
+ *
2048
+ *let isLeftRight = true;
2049
+ *let buttonVisit = board.create('button', [0, 4, 'visit',
2050
+ * () => {
2051
+ * let x = isLeftRight ? 4 : -4
2052
+ *
2053
+ * A.visit([-x, 3], 4000, { effect: "==", repeat: 2 }) // linear
2054
+ * B.visit([-x, 2], 4000, { effect: "<>", repeat: 2 })
2055
+ * C.visit([-x, 1], 4000, { effect: "<", repeat: 2 })
2056
+ * D.visit([-x, 0], 4000, { effect: ">", repeat: 2 })
2057
+ * }])
2058
+ *
2059
+ </pre><div id="JXG0f35a50e-e99d-11e8-a1ca-04d3b0c2aad5" class="jxgbox" style="width: 300px; height: 300px;"></div>
2060
+ <script type="text/javascript">
2061
+ {
2062
+ * let board = JXG.JSXGraph.initBoard('JXG0f35a50e-e99d-11e8-a1ca-04d3b0c2aad5')
2063
+ let yInit = 3
2064
+ let [A, B, C, D] = ['==', '<>', '<', '>'].map((s) => board.create('point', [4, yInit--], { name: s, label: { fontSize: 24 } }))
2065
+ let seg = board.create('segment', [A, [() => A.X(), 0]]) // shows linear
2066
+
2067
+ let isLeftRight = true;
2068
+ let buttonVisit = board.create('button', [0, 4, 'visit',
2069
+ () => {
2070
+ let x = isLeftRight ? 4 : -4
2071
+
2072
+ A.visit([-x, 3], 4000, { effect: "==", repeat: 2 }) // linear
2073
+ B.visit([-x, 2], 4000, { effect: "<>", repeat: 2 })
2074
+ C.visit([-x, 1], 4000, { effect: "<", repeat: 2 })
2075
+ D.visit([-x, 0], 4000, { effect: ">", repeat: 2 })
2076
+ }])
2077
+ }
2078
+ </script><pre>
2079
+
1983
2080
  */
1984
2081
  visit: function (where, time, options) {
1985
2082
  where = new Coords(Const.COORDS_BY_USER, where, this.board);
@@ -1997,10 +2094,22 @@ JXG.extend(
1997
2094
  stepFun = function (i) {
1998
2095
  var x = i < steps / 2 ? (2 * i) / steps : (2 * (steps - i)) / steps;
1999
2096
 
2000
- if (options.effect && options.effect === "<>") {
2001
- return Math.pow(Math.sin((x * Math.PI) / 2), 2);
2002
- }
2097
+ if (options.effect) {
2098
+ if (options.effect === "<>") { // slow at beginning and end
2099
+ return Math.pow(Math.sin((x * Math.PI) / 2), 2);
2100
+ }
2101
+ if (options.effect === "<") { // cubic ease in
2102
+ return x * x * x;
2103
+ }
2104
+ if (options.effect === ">") { // cubic ease out
2105
+ return 1 - Math.pow(1 - x, 3);
2106
+ }
2107
+ if (options.effect === "==") {
2108
+ return x; // linear
2109
+ }
2110
+ throw new Error("valid effects are '==', '<>', '>', and '<'.");
2003
2111
 
2112
+ }
2004
2113
  return x;
2005
2114
  };
2006
2115
 
@@ -1233,7 +1233,7 @@ JXG.createAngle = function (board, parents, attributes) {
1233
1233
  attr = Type.copyAttributes(attributes, board.options, "angle");
1234
1234
 
1235
1235
  // If empty, create a new name
1236
- if (!Type.exists(attr.name) || attr.name === "") {
1236
+ if (!Type.exists(attr.name) /*|| attr.name === ""*/) {
1237
1237
  attr.name = board.generateName({ type: Const.OBJECT_TYPE_ANGLE });
1238
1238
  }
1239
1239
 
package/src/index.js CHANGED
@@ -18,7 +18,6 @@ import './math/plot.js';
18
18
  import './math/implicitplot.js';
19
19
  import './math/metapost.js';
20
20
  import './math/statistics.js';
21
- import './math/symbolic.js';
22
21
  import './math/geometry.js';
23
22
  import './math/clip.js';
24
23
  import './math/poly.js';
@@ -44,7 +43,6 @@ import './element/sector.js';
44
43
  import './base/composition.js';
45
44
  import './element/composition.js';
46
45
  import './element/grid.js';
47
- import './element/locus.js';
48
46
  import './base/text.js';
49
47
  import './base/image.js';
50
48
  import './element/slider.js';
@@ -58,7 +56,6 @@ import './utils/zip.js';
58
56
  import './utils/base64.js';
59
57
  import './utils/uuid.js';
60
58
  import './utils/encoding.js';
61
- import './server/server.js';
62
59
  import './parser/datasource.js';
63
60
  import './parser/jessiecode.js';
64
61
  import './parser/prefix.js';