jsxgraph 1.4.2 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/distrib/README.md +24 -0
- package/distrib/geogebra.min.js +1 -1
- package/distrib/geonext.min.js +1 -1
- package/distrib/index.d.ts +351 -39
- package/distrib/intergeo.min.js +1 -1
- package/distrib/jsxgraphcore.js +4 -4
- package/distrib/jsxgraphsrc.js +2909 -389
- package/distrib/sketch.min.js +2 -2
- package/package.json +1 -1
- package/src/3d/box3d.js +268 -0
- package/src/3d/curve3d.js +97 -0
- package/src/3d/linspace3d.js +375 -0
- package/src/3d/point3d.js +238 -0
- package/src/3d/surface3d.js +220 -0
- package/src/3d/threed.js +38 -0
- package/src/3d/view3d.js +529 -0
- package/src/base/board.js +160 -84
- package/src/base/constants.js +1 -1
- package/src/base/coordselement.js +1 -4
- package/src/base/element.js +22 -13
- package/src/base/foreignobject.js +7 -1
- package/src/base/line.js +1 -1
- package/src/base/polygon.js +88 -33
- package/src/base/text.js +42 -13
- package/src/base/ticks.js +3 -1
- package/src/element/composition.js +62 -23
- package/src/element/slider.js +12 -0
- package/src/jsxgraph.js +8 -5
- package/src/loadjsxgraph.js +17 -11
- package/src/math/clip.js +0 -1
- package/src/math/geometry.js +187 -2
- package/src/math/math.js +9 -0
- package/src/math/nlp.js +205 -173
- package/src/options.js +35 -13
- package/src/options3d.js +265 -0
- package/src/parser/jessiecode.js +1 -1
- package/src/reader/sketch.js +2 -2
- package/src/renderer/svg.js +7 -4
- package/src/utils/env.js +10 -10
- package/src/utils/type.js +2 -2
package/src/options.js
CHANGED
|
@@ -783,6 +783,10 @@ define([
|
|
|
783
783
|
* visible: false // Initial visibility. Should be set to false always
|
|
784
784
|
* }
|
|
785
785
|
* </pre>
|
|
786
|
+
* <p>
|
|
787
|
+
* Board events triggered by selection manipulation:
|
|
788
|
+
* 'startselecting', 'stopselecting', 'mousestartselecting', 'mousestopselecting',
|
|
789
|
+
* 'pointerstartselecting', 'pointerstopselecting', 'touchstartselecting', 'touchstopselecting'.
|
|
786
790
|
*
|
|
787
791
|
* @example
|
|
788
792
|
* board.on('stopselecting', function(){
|
|
@@ -796,14 +800,10 @@ define([
|
|
|
796
800
|
* });
|
|
797
801
|
*
|
|
798
802
|
* @name JXG.Board#selection
|
|
799
|
-
*
|
|
800
|
-
* @see JXG.Board#
|
|
801
|
-
* @see JXG.Board#
|
|
802
|
-
*
|
|
803
|
-
* @see JXG.Board#touchstartselecting
|
|
804
|
-
* @see JXG.Board#mousestopselecting
|
|
805
|
-
* @see JXG.Board#pointerstopselecting
|
|
806
|
-
* @see JXG.Board#touchstopselecting
|
|
803
|
+
*
|
|
804
|
+
* @see JXG.Board#startSelectionMode
|
|
805
|
+
* @see JXG.Board#stopSelectionMode
|
|
806
|
+
*
|
|
807
807
|
* @type Object
|
|
808
808
|
* @default
|
|
809
809
|
*/
|
|
@@ -1411,14 +1411,33 @@ define([
|
|
|
1411
1411
|
* <p>
|
|
1412
1412
|
* In case the element is a polygon or line and it has the attribute "scalable:false",
|
|
1413
1413
|
* moving the element with two fingers results in a rotation or translation.
|
|
1414
|
+
* <p>
|
|
1415
|
+
* If an element is set to be neither scalable nor rotatable, it can only be translated.
|
|
1414
1416
|
*
|
|
1415
1417
|
* @type Boolean
|
|
1416
1418
|
* @default true
|
|
1417
1419
|
* @name JXG.GeometryElement#scalable
|
|
1418
1420
|
* @see JXG.Ticks#fixed
|
|
1421
|
+
* @see JXG.GeometryElement#rotatable
|
|
1419
1422
|
*/
|
|
1420
1423
|
scalable: true,
|
|
1421
1424
|
|
|
1425
|
+
/**
|
|
1426
|
+
* Determines whether two-finger manipulation may rotate this object.
|
|
1427
|
+
* If set to false, the object can only be scaled and translated.
|
|
1428
|
+
* <p>
|
|
1429
|
+
* In case the element is a polygon or line and it has the attribute "rotatable:false",
|
|
1430
|
+
* moving the element with two fingers results in a rotation or translation.
|
|
1431
|
+
* <p>
|
|
1432
|
+
* If an element is set to be neither scalable nor rotatable, it can only be translated.
|
|
1433
|
+
*
|
|
1434
|
+
* @type Boolean
|
|
1435
|
+
* @default true
|
|
1436
|
+
* @name JXG.GeometryElement#rotatable
|
|
1437
|
+
* @see JXG.GeometryElement#scalable
|
|
1438
|
+
*/
|
|
1439
|
+
rotatable: true,
|
|
1440
|
+
|
|
1422
1441
|
/**
|
|
1423
1442
|
* If the element is dragged it will be moved on mousedown or touchstart to the
|
|
1424
1443
|
* top of its layer. Works only for SVG renderer and for simple elements
|
|
@@ -1490,6 +1509,7 @@ define([
|
|
|
1490
1509
|
|
|
1491
1510
|
/**
|
|
1492
1511
|
* Controls if an element can get the focus with the tab key.
|
|
1512
|
+
* tabindex corresponds to the HTML attribute of the same name.
|
|
1493
1513
|
* See <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex">descriptiona at MDN</a>.
|
|
1494
1514
|
* The additional value null completely disables focus of an element.
|
|
1495
1515
|
* The value will be ignored if keyboard control of the board is not enabled or
|
|
@@ -1519,6 +1539,8 @@ define([
|
|
|
1519
1539
|
/**
|
|
1520
1540
|
* A function that expects two {@link JXG.Coords}, the first one representing the coordinates of the
|
|
1521
1541
|
* tick that is to be labeled, the second one the coordinates of the center (the tick with position 0).
|
|
1542
|
+
* The tird parameter is a null, number or a string. In the latter two cases, this value is taken.
|
|
1543
|
+
* Returns a string.
|
|
1522
1544
|
*
|
|
1523
1545
|
* @type function
|
|
1524
1546
|
* @name Ticks#generateLabelText
|
|
@@ -1529,7 +1551,7 @@ define([
|
|
|
1529
1551
|
* A function that expects two {@link JXG.Coords}, the first one representing the coordinates of the
|
|
1530
1552
|
* tick that is to be labeled, the second one the coordinates of the center (the tick with position 0).
|
|
1531
1553
|
*
|
|
1532
|
-
* @deprecated Use {@link JGX.Options@
|
|
1554
|
+
* @deprecated Use {@link JGX.Options@generateLabelText}
|
|
1533
1555
|
* @type function
|
|
1534
1556
|
* @name Ticks#generateLabelValue
|
|
1535
1557
|
*/
|
|
@@ -3505,7 +3527,6 @@ define([
|
|
|
3505
3527
|
*/
|
|
3506
3528
|
lastArrow: false,
|
|
3507
3529
|
|
|
3508
|
-
|
|
3509
3530
|
/**
|
|
3510
3531
|
* This number (pixel value) controls where infinite lines end at the canvas border. If zero, the line
|
|
3511
3532
|
* ends exactly at the border, if negative there is a margin to the inside, if positive the line
|
|
@@ -3682,7 +3703,6 @@ define([
|
|
|
3682
3703
|
*/
|
|
3683
3704
|
lineCap: 'butt'
|
|
3684
3705
|
|
|
3685
|
-
|
|
3686
3706
|
/**#@-*/
|
|
3687
3707
|
},
|
|
3688
3708
|
|
|
@@ -5623,8 +5643,10 @@ define([
|
|
|
5623
5643
|
display: 'html',
|
|
5624
5644
|
|
|
5625
5645
|
/**
|
|
5626
|
-
* Anchor element {@link Point}, {@link Text} or {@link Image} of the text.
|
|
5627
|
-
*
|
|
5646
|
+
* Anchor element {@link Point}, {@link Text} or {@link Image} of the text.
|
|
5647
|
+
* If it exists, the coordinates of the text are relative
|
|
5648
|
+
* to this anchor element. In this case, only numbers are possible coordinates,
|
|
5649
|
+
* functions are not supported.
|
|
5628
5650
|
*
|
|
5629
5651
|
* @name anchor
|
|
5630
5652
|
* @memberOf Text.prototype
|
package/src/options3d.js
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/*global JXG:true, define: true*/
|
|
2
|
+
|
|
3
|
+
define([
|
|
4
|
+
'jxg', 'options'
|
|
5
|
+
], function (JXG, Options) {
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
JXG.extend(Options, {
|
|
10
|
+
|
|
11
|
+
infobox: {
|
|
12
|
+
strokeColor: 'black'
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
axes3d: {
|
|
16
|
+
/**#@+
|
|
17
|
+
* @visprop
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Position of the main axes in a View3D element. Possible values are
|
|
22
|
+
* 'center' and 'border'.
|
|
23
|
+
*
|
|
24
|
+
* @type String
|
|
25
|
+
* @name View3D#axesPosition
|
|
26
|
+
* @default 'center'
|
|
27
|
+
*/
|
|
28
|
+
axesPosition: 'center', // Possible values: 'center', otherwise: border
|
|
29
|
+
|
|
30
|
+
// Main axes
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Attributes of the 3D x-axis.
|
|
34
|
+
*
|
|
35
|
+
* @type Line3D
|
|
36
|
+
* @name View3D#xAxis
|
|
37
|
+
*/
|
|
38
|
+
xAxis: { visible: true, point2: {name: 'x'}},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Attributes of the 3D y-axis.
|
|
42
|
+
*
|
|
43
|
+
* @type Line3D
|
|
44
|
+
* @name View3D#yAxis
|
|
45
|
+
*/
|
|
46
|
+
yAxis: { visible: true, point2: {name: 'y'}},
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Attributes of the 3D z-axis.
|
|
50
|
+
*
|
|
51
|
+
* @type Line3D
|
|
52
|
+
* @name View3D#zAxis
|
|
53
|
+
*/
|
|
54
|
+
zAxis: { visible: true, point2: {name: 'z'}},
|
|
55
|
+
|
|
56
|
+
// Planes
|
|
57
|
+
/**
|
|
58
|
+
* Attributes of the 3D plane orthogonal to the x-axis at the "rear" of the cube.
|
|
59
|
+
* @type Plane3D
|
|
60
|
+
* @name View3D#xPlaneRear
|
|
61
|
+
*/
|
|
62
|
+
xPlaneRear: { visible: true, layer: 0, mesh3d: { layer: 1 } },
|
|
63
|
+
/**
|
|
64
|
+
* Attributes of the 3D plane orthogonal to the y-axis at the "rear" of the cube.
|
|
65
|
+
* @type Plane3D
|
|
66
|
+
* @name View3D#yPlaneRear
|
|
67
|
+
*/
|
|
68
|
+
yPlaneRear: { visible: true, layer: 0, mesh3d: { layer: 1 } },
|
|
69
|
+
/**
|
|
70
|
+
* Attributes of the 3D plane orthogonal to the z-axis at the "rear" of the cube.
|
|
71
|
+
* @type Plane3D
|
|
72
|
+
* @name View3D#zPlaneRear
|
|
73
|
+
*/
|
|
74
|
+
zPlaneRear: { visible: true, layer: 0, mesh3d: { layer: 1 } },
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Attributes of the 3D plane orthogonal to the x-axis at the "front" of the cube.
|
|
78
|
+
* @type Plane3D
|
|
79
|
+
* @name View3D#xPlaneFront
|
|
80
|
+
*/
|
|
81
|
+
xPlaneFront: { visible: false, layer: 0, mesh3d: { layer: 1 } },
|
|
82
|
+
/**
|
|
83
|
+
* Attributes of the 3D plane orthogonal to the y-axis at the "front" of the cube.
|
|
84
|
+
* @type Plane3D
|
|
85
|
+
* @name View3D#yPlaneFront
|
|
86
|
+
*/
|
|
87
|
+
yPlaneFront: { visible: false, layer: 0, mesh3d: { layer: 1 } },
|
|
88
|
+
/**
|
|
89
|
+
* Attributes of the 3D plane orthogonal to the z-axis at the "front" of the cube.
|
|
90
|
+
* @type Plane3D
|
|
91
|
+
* @name View3D#zPlaneFront
|
|
92
|
+
*/
|
|
93
|
+
zPlaneFront: { visible: false, layer: 0, mesh3d: { layer: 1 } },
|
|
94
|
+
|
|
95
|
+
// Axes on the planes
|
|
96
|
+
/**
|
|
97
|
+
* Attributes of the 3D y-axis on the 3D plane orthogonal to the x-axis at the "rear" of the cube.
|
|
98
|
+
* @type Plane3D
|
|
99
|
+
* @name View3D#xPlaneRearYAxis
|
|
100
|
+
*/
|
|
101
|
+
xPlaneRearYAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
102
|
+
/**
|
|
103
|
+
* Attributes of the 3D z-axis on the 3D plane orthogonal to the x-axis at the "rear" of the cube.
|
|
104
|
+
* @type Plane3D
|
|
105
|
+
* @name View3D#xPlaneRearZAxis
|
|
106
|
+
*/
|
|
107
|
+
xPlaneRearZAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
108
|
+
/**
|
|
109
|
+
* Attributes of the 3D y-axis on the 3D plane orthogonal to the x-axis at the "front" of the cube.
|
|
110
|
+
* @type Plane3D
|
|
111
|
+
* @name View3D#xPlaneFrontYAxis
|
|
112
|
+
*/
|
|
113
|
+
xPlaneFrontYAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
114
|
+
/**
|
|
115
|
+
* Attributes of the 3D z-axis on the 3D plane orthogonal to the x-axis at the "front" of the cube.
|
|
116
|
+
* @type Plane3D
|
|
117
|
+
* @name View3D#xPlaneFrontZAxis
|
|
118
|
+
*/
|
|
119
|
+
xPlaneFrontZAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Attributes of the 3D x-axis on the 3D plane orthogonal to the y-axis at the "rear" of the cube.
|
|
123
|
+
* @type Plane3D
|
|
124
|
+
* @name View3D#yPlaneRearXAxis
|
|
125
|
+
*/
|
|
126
|
+
yPlaneRearXAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
127
|
+
/**
|
|
128
|
+
* Attributes of the 3D z-axis on the 3D plane orthogonal to the y-axis at the "rear" of the cube.
|
|
129
|
+
* @type Plane3D
|
|
130
|
+
* @name View3D#yPlaneRearZAxis
|
|
131
|
+
*/
|
|
132
|
+
yPlaneRearZAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
133
|
+
/**
|
|
134
|
+
* Attributes of the 3D x-axis on the 3D plane orthogonal to the y-axis at the "front" of the cube.
|
|
135
|
+
* @type Plane3D
|
|
136
|
+
* @name View3D#yPlaneFrontXAxis
|
|
137
|
+
*/
|
|
138
|
+
yPlaneFrontXAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
139
|
+
/**
|
|
140
|
+
* Attributes of the 3D z-axis on the 3D plane orthogonal to the y-axis at the "front" of the cube.
|
|
141
|
+
* @type Plane3D
|
|
142
|
+
* @name View3D#yPlaneFrontZAxis
|
|
143
|
+
*/
|
|
144
|
+
yPlaneFrontZAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Attributes of the 3D x-axis on the 3D plane orthogonal to the z-axis at the "rear" of the cube.
|
|
148
|
+
* @type Plane3D
|
|
149
|
+
* @name View3D#zPlaneRearXAxis
|
|
150
|
+
*/
|
|
151
|
+
zPlaneRearXAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
152
|
+
/**
|
|
153
|
+
* Attributes of the 3D y-axis on the 3D plane orthogonal to the z-axis at the "rear" of the cube.
|
|
154
|
+
* @type Plane3D
|
|
155
|
+
* @name View3D#zPlaneRearYAxis
|
|
156
|
+
*/
|
|
157
|
+
zPlaneRearYAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
158
|
+
/**
|
|
159
|
+
* Attributes of the 3D x-axis on the 3D plane orthogonal to the z-axis at the "front" of the cube.
|
|
160
|
+
* @type Plane3D
|
|
161
|
+
* @name View3D#zPlaneFrontXAxis
|
|
162
|
+
*/
|
|
163
|
+
zPlaneFrontXAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1},
|
|
164
|
+
/**
|
|
165
|
+
* Attributes of the 3D y-axis on the 3D plane orthogonal to the z-axis at the "front" of the cube.
|
|
166
|
+
* @type Plane3D
|
|
167
|
+
* @name View3D#zPlaneFrontYAxis
|
|
168
|
+
*/
|
|
169
|
+
zPlaneFrontYAxis: {visible: 'inherit', strokeColor: '#888888', strokeWidth: 1}
|
|
170
|
+
|
|
171
|
+
/**#@-*/
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
axis3d: {
|
|
175
|
+
highlight: false,
|
|
176
|
+
strokecolor: 'black',
|
|
177
|
+
strokeWidth: 1,
|
|
178
|
+
tabindex: null,
|
|
179
|
+
|
|
180
|
+
point1: { visible: false, name: '' },
|
|
181
|
+
point2: { visible: false, name: '', label: { visible: true } }
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
mesh3d: {
|
|
185
|
+
strokeWidth: 1,
|
|
186
|
+
strokeColor: '#9a9a9a',
|
|
187
|
+
strokeOpacity: 0.6,
|
|
188
|
+
highlight: false,
|
|
189
|
+
fillColor: '#9a9a9a',
|
|
190
|
+
fillOpacity: 0.1,
|
|
191
|
+
tabindex: null,
|
|
192
|
+
|
|
193
|
+
visible: 'inherit'
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
line3d: {
|
|
197
|
+
strokeWidth: 1,
|
|
198
|
+
strokeColor: 'black',
|
|
199
|
+
fixed: true,
|
|
200
|
+
tabindex: null,
|
|
201
|
+
|
|
202
|
+
gradient: 'linear',
|
|
203
|
+
gradientSecondColor: '#ffffff',
|
|
204
|
+
|
|
205
|
+
point1: {visible: false, name: ''},
|
|
206
|
+
point2: {visible: false, name: ''}
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
plane3d: {
|
|
210
|
+
strokeWidth: 0,
|
|
211
|
+
strokeColor: 'black',
|
|
212
|
+
strokeOpacity: 1,
|
|
213
|
+
highlight: false,
|
|
214
|
+
tabindex: null,
|
|
215
|
+
|
|
216
|
+
gradient: 'linear',
|
|
217
|
+
gradientSecondColor: '#ffffff',
|
|
218
|
+
gradientAngle: Math.PI,
|
|
219
|
+
fillColor: '#a7a7a7',
|
|
220
|
+
fillOpacity: 0.6
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
point3d: {
|
|
224
|
+
strokeWidth: 0,
|
|
225
|
+
gradient: 'radial',
|
|
226
|
+
gradientSecondColor: '#555555',
|
|
227
|
+
fillColor: 'yellow',
|
|
228
|
+
highlightStrokeColor: '#555555'
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
surface3d: {
|
|
232
|
+
/**#@+
|
|
233
|
+
* @visprop
|
|
234
|
+
*/
|
|
235
|
+
|
|
236
|
+
highlight: false,
|
|
237
|
+
tabindex: -1,
|
|
238
|
+
strokeWidth: 1,
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Number of intervals the mesh is divided into in direction of parameter u.
|
|
242
|
+
* @type Number
|
|
243
|
+
* @name Surface3D#stepsU
|
|
244
|
+
*/
|
|
245
|
+
stepsU: 30,
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Number of intervals the mesh is divided into in direction of parameter v.
|
|
249
|
+
* @type Number
|
|
250
|
+
* @name Surface3D#stepsV
|
|
251
|
+
*/
|
|
252
|
+
stepsV: 30
|
|
253
|
+
|
|
254
|
+
/**#@-*/
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
view3d: {
|
|
258
|
+
needsRegularUpdate: true
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
return JXG.Options;
|
|
264
|
+
});
|
|
265
|
+
|
package/src/parser/jessiecode.js
CHANGED
|
@@ -1585,7 +1585,7 @@ define([
|
|
|
1585
1585
|
case 'node_str':
|
|
1586
1586
|
//ret = node.value.replace(/\\'/, "'").replace(/\\"/, '"').replace(/\\\\/, '\\');
|
|
1587
1587
|
/*jslint regexp:true*/
|
|
1588
|
-
ret = node.value.replace(/\\(.)
|
|
1588
|
+
ret = node.value.replace(/\\(.)/g, '$1'); // Remove backslash, important in JessieCode tags
|
|
1589
1589
|
/*jslint regexp:false*/
|
|
1590
1590
|
break;
|
|
1591
1591
|
}
|
package/src/reader/sketch.js
CHANGED
|
@@ -886,7 +886,7 @@ Copyright 2008-2022
|
|
|
886
886
|
str1[i] = pn(step.args.p1[i]);
|
|
887
887
|
}
|
|
888
888
|
|
|
889
|
-
set_str = 'point(' + str1.join(', ') + ') <<id: \'' + pid1 + '\', name: \'\', visible: false, ';
|
|
889
|
+
set_str = 'point(' + str1.join(', ') + ') <<id: \'' + pid1 + '\', name: \'\', visible: false, isinfinit: true, ';
|
|
890
890
|
set_str += 'snaptogrid: false, snaptopoints: false, priv: true>>; ';
|
|
891
891
|
reset_str = 'remove(' + pid1 + '); ';
|
|
892
892
|
} else {
|
|
@@ -901,7 +901,7 @@ Copyright 2008-2022
|
|
|
901
901
|
str1[i] = pn(step.args.p2[i]);
|
|
902
902
|
}
|
|
903
903
|
|
|
904
|
-
set_str += 'point(' + str1.join(', ') + ') <<id: \'' + pid2 + '\', name: \'\', visible: false, ';
|
|
904
|
+
set_str += 'point(' + str1.join(', ') + ') <<id: \'' + pid2 + '\', name: \'\', visible: false, isinfinit: true, ';
|
|
905
905
|
set_str += 'snaptogrid: false, snaptopoints: false, priv: true>>; ';
|
|
906
906
|
reset_str = 'remove(' + pid2 + '); ' + reset_str;
|
|
907
907
|
} else {
|
package/src/renderer/svg.js
CHANGED
|
@@ -1694,10 +1694,11 @@ define([
|
|
|
1694
1694
|
* setTimeout(function() { console.log('done'); }, 400);
|
|
1695
1695
|
*/
|
|
1696
1696
|
dumpToCanvas: function (canvasId, w, h, ignoreTexts) {
|
|
1697
|
-
var svg, tmpImg, cv, ctx
|
|
1697
|
+
var svg, tmpImg, cv, ctx,
|
|
1698
|
+
doc = this.container.ownerDocument;
|
|
1698
1699
|
|
|
1699
1700
|
// Prepare the canvas element
|
|
1700
|
-
cv =
|
|
1701
|
+
cv = doc.getElementById(canvasId);
|
|
1701
1702
|
|
|
1702
1703
|
// Clear the canvas
|
|
1703
1704
|
/* eslint-disable no-self-assign */
|
|
@@ -1833,7 +1834,8 @@ define([
|
|
|
1833
1834
|
} else {
|
|
1834
1835
|
// Debug: use canvas element 'jxgbox_canvas' from jsxdev/dump.html
|
|
1835
1836
|
id = 'jxgbox_canvas';
|
|
1836
|
-
canvas = document.getElementById(id);
|
|
1837
|
+
// canvas = document.getElementById(id);
|
|
1838
|
+
canvas = doc.getElementById(id);
|
|
1837
1839
|
}
|
|
1838
1840
|
|
|
1839
1841
|
if (newImg) {
|
|
@@ -1853,7 +1855,8 @@ define([
|
|
|
1853
1855
|
}
|
|
1854
1856
|
|
|
1855
1857
|
// Hide navigation bar in board
|
|
1856
|
-
zbar = document.getElementById(this.container.id + '_navigationbar');
|
|
1858
|
+
// zbar = document.getElementById(this.container.id + '_navigationbar');
|
|
1859
|
+
zbar = doc.getElementById(this.container.id + '_navigationbar');
|
|
1857
1860
|
if (Type.exists(zbar)) {
|
|
1858
1861
|
zbarDisplay = zbar.style.display;
|
|
1859
1862
|
zbar.style.display = 'none';
|
package/src/utils/env.js
CHANGED
|
@@ -840,14 +840,15 @@ define(['jxg', 'utils/type'], function (JXG, Type) {
|
|
|
840
840
|
* @param {String} inner_id id of the DOM element which is scaled and shifted
|
|
841
841
|
* @param {Number} scale Scaling factor
|
|
842
842
|
* @param {Number} vshift Vertical shift (in pixel)
|
|
843
|
+
* @param {Object} doc document object or shadow root
|
|
843
844
|
*
|
|
844
845
|
* @private
|
|
845
846
|
* @see JXG.Board#toFullscreen
|
|
846
847
|
* @see JXG.Board#fullscreenListener
|
|
847
848
|
*
|
|
848
849
|
*/
|
|
849
|
-
scaleJSXGraphDiv: function (wrap_id, inner_id, scale, vshift) {
|
|
850
|
-
var len =
|
|
850
|
+
scaleJSXGraphDiv: function (wrap_id, inner_id, scale, vshift, doc) {
|
|
851
|
+
var len = doc.styleSheets.length, style,
|
|
851
852
|
|
|
852
853
|
pseudo_keys = [':fullscreen', ':-webkit-full-screen', ':-moz-full-screen', ':-ms-fullscreen'],
|
|
853
854
|
len_pseudo = pseudo_keys.length, i,
|
|
@@ -865,22 +866,21 @@ define(['jxg', 'utils/type'], function (JXG, Type) {
|
|
|
865
866
|
// WebKit hack :(
|
|
866
867
|
style.appendChild(document.createTextNode(''));
|
|
867
868
|
// Add the <style> element to the page
|
|
868
|
-
|
|
869
|
-
len =
|
|
869
|
+
doc.appendChild(style);
|
|
870
|
+
len = doc.styleSheets.length;
|
|
870
871
|
}
|
|
871
872
|
|
|
872
873
|
// Remove a previously installed CSS rule.
|
|
873
|
-
if (
|
|
874
|
-
regex.test(
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
document.styleSheets[len - 1].deleteRule(0);
|
|
874
|
+
if (doc.styleSheets[len - 1].cssRules.length > 0 &&
|
|
875
|
+
regex.test(doc.styleSheets[len - 1].cssRules[0].cssText) &&
|
|
876
|
+
doc.styleSheets[len - 1].deleteRule) {
|
|
877
|
+
doc.styleSheets[len - 1].deleteRule(0);
|
|
878
878
|
}
|
|
879
879
|
|
|
880
880
|
// Install a CSS rule to center the JSXGraph div at the first position of the list.
|
|
881
881
|
for (i = 0; i < len_pseudo; i++) {
|
|
882
882
|
try {
|
|
883
|
-
|
|
883
|
+
doc.styleSheets[len - 1].insertRule('#' + wrap_id + pseudo_keys[i] + ' #' + inner_id + rule_inner, 0);
|
|
884
884
|
break;
|
|
885
885
|
} catch (err) {
|
|
886
886
|
// console.log('JXG.scaleJSXGraphDiv: Could not add CSS rule "' + pseudo_keys[i] + '".');
|
package/src/utils/type.js
CHANGED
|
@@ -977,7 +977,7 @@ define([
|
|
|
977
977
|
}
|
|
978
978
|
|
|
979
979
|
// options from attributes
|
|
980
|
-
o = attributes;
|
|
980
|
+
o = (typeof attributes === 'object') ? attributes : {};
|
|
981
981
|
isAvail = true;
|
|
982
982
|
for (i = 3; i < len; i++) {
|
|
983
983
|
if (this.exists(o[arguments[i]])) {
|
|
@@ -1283,7 +1283,7 @@ define([
|
|
|
1283
1283
|
return html_sanitize(str, function () { return undefined; }, function (id) { return id; });
|
|
1284
1284
|
}
|
|
1285
1285
|
|
|
1286
|
-
if (str) {
|
|
1286
|
+
if (str && typeof str === 'string') {
|
|
1287
1287
|
str = str.replace(/</g, '<').replace(/>/g, '>');
|
|
1288
1288
|
}
|
|
1289
1289
|
|