@pie-lib/graphing 2.46.0-mui-update.0 → 3.0.0-next.0

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 (118) hide show
  1. package/CHANGELOG.md +8 -97
  2. package/lib/axis/axes.js +7 -13
  3. package/lib/axis/axes.js.map +1 -1
  4. package/lib/coordinates-label.js +2 -0
  5. package/lib/coordinates-label.js.map +1 -1
  6. package/lib/grid-setup.js +30 -36
  7. package/lib/grid-setup.js.map +1 -1
  8. package/lib/grid.js +1 -1
  9. package/lib/grid.js.map +1 -1
  10. package/lib/key-legend.js +6 -7
  11. package/lib/key-legend.js.map +1 -1
  12. package/lib/labels.js +4 -2
  13. package/lib/labels.js.map +1 -1
  14. package/lib/mark-label.js +16 -9
  15. package/lib/mark-label.js.map +1 -1
  16. package/lib/toggle-bar.js +12 -16
  17. package/lib/toggle-bar.js.map +1 -1
  18. package/lib/tool-menu.js +1 -3
  19. package/lib/tool-menu.js.map +1 -1
  20. package/lib/tools/circle/component.js +1 -2
  21. package/lib/tools/circle/component.js.map +1 -1
  22. package/lib/tools/point/component.js +1 -1
  23. package/lib/tools/point/component.js.map +1 -1
  24. package/lib/tools/polygon/component.js +2 -2
  25. package/lib/tools/polygon/component.js.map +1 -1
  26. package/lib/tools/polygon/line.js +2 -2
  27. package/lib/tools/polygon/line.js.map +1 -1
  28. package/lib/tools/shared/icons/CorrectSVG.js +9 -0
  29. package/lib/tools/shared/icons/CorrectSVG.js.map +1 -1
  30. package/lib/tools/shared/icons/IncorrectSVG.js +9 -0
  31. package/lib/tools/shared/icons/IncorrectSVG.js.map +1 -1
  32. package/lib/tools/shared/icons/MissingSVG.js +9 -0
  33. package/lib/tools/shared/icons/MissingSVG.js.map +1 -1
  34. package/lib/tools/shared/line/index.js +14 -6
  35. package/lib/tools/shared/line/index.js.map +1 -1
  36. package/lib/tools/shared/line/line-path.js +2 -3
  37. package/lib/tools/shared/line/line-path.js.map +1 -1
  38. package/lib/tools/shared/line/with-root-edge.js +1 -1
  39. package/lib/tools/shared/line/with-root-edge.js.map +1 -1
  40. package/lib/tools/shared/point/arrow-point.js +1 -3
  41. package/lib/tools/shared/point/arrow-point.js.map +1 -1
  42. package/lib/tools/shared/point/arrow.js +1 -2
  43. package/lib/tools/shared/point/arrow.js.map +1 -1
  44. package/package.json +25 -16
  45. package/src/__tests__/graph-with-controls.test.jsx +28 -11
  46. package/src/__tests__/graph.test.jsx +104 -168
  47. package/src/__tests__/grid.test.jsx +8 -6
  48. package/src/__tests__/labels.test.jsx +25 -8
  49. package/src/__tests__/mark-label.test.jsx +12 -17
  50. package/src/__tests__/toggle-bar.test.jsx +92 -17
  51. package/src/__tests__/tool-menu.test.jsx +61 -12
  52. package/src/__tests__/undo-redo.test.jsx +7 -8
  53. package/src/__tests__/utils.js +3 -0
  54. package/src/axis/__tests__/arrow.test.jsx +16 -17
  55. package/src/axis/__tests__/axes.test.jsx +118 -122
  56. package/src/axis/axes.jsx +7 -12
  57. package/src/coordinates-label.jsx +1 -0
  58. package/src/grid-setup.jsx +6 -6
  59. package/src/grid.jsx +1 -1
  60. package/src/key-legend.jsx +1 -1
  61. package/src/labels.jsx +2 -0
  62. package/src/mark-label.jsx +10 -1
  63. package/src/toggle-bar.jsx +7 -25
  64. package/src/tool-menu.jsx +1 -1
  65. package/src/tools/circle/__tests__/bg-circle.test.jsx +7 -9
  66. package/src/tools/circle/__tests__/component.test.jsx +17 -189
  67. package/src/tools/circle/component.jsx +1 -1
  68. package/src/tools/line/__tests__/component.test.jsx +7 -7
  69. package/src/tools/point/__tests__/component.test.jsx +18 -43
  70. package/src/tools/point/component.jsx +1 -1
  71. package/src/tools/polygon/__tests__/component.test.jsx +18 -162
  72. package/src/tools/polygon/__tests__/line.test.jsx +7 -10
  73. package/src/tools/polygon/__tests__/polygon.test.jsx +7 -8
  74. package/src/tools/polygon/component.jsx +2 -2
  75. package/src/tools/polygon/line.jsx +3 -2
  76. package/src/tools/ray/__tests__/component.test.jsx +7 -8
  77. package/src/tools/segment/__tests__/component.test.jsx +7 -8
  78. package/src/tools/shared/__tests__/arrow-head.test.jsx +14 -17
  79. package/src/tools/shared/icons/CorrectSVG.jsx +10 -0
  80. package/src/tools/shared/icons/IncorrectSVG.jsx +10 -0
  81. package/src/tools/shared/icons/MissingSVG.jsx +10 -0
  82. package/src/tools/shared/line/__tests__/index.test.jsx +19 -165
  83. package/src/tools/shared/line/__tests__/line-path.test.jsx +8 -8
  84. package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +22 -22
  85. package/src/tools/shared/line/index.jsx +13 -5
  86. package/src/tools/shared/line/line-path.jsx +2 -2
  87. package/src/tools/shared/line/with-root-edge.jsx +1 -1
  88. package/src/tools/shared/point/__tests__/arrow-point.test.jsx +15 -11
  89. package/src/tools/shared/point/__tests__/base-point.test.jsx +14 -11
  90. package/src/tools/shared/point/arrow-point.jsx +1 -1
  91. package/src/tools/shared/point/arrow.jsx +1 -1
  92. package/src/tools/vector/__tests__/component.test.jsx +7 -8
  93. package/src/__tests__/__snapshots__/graph-with-controls.test.jsx.snap +0 -237
  94. package/src/__tests__/__snapshots__/graph.test.jsx.snap +0 -211
  95. package/src/__tests__/__snapshots__/grid.test.jsx.snap +0 -54
  96. package/src/__tests__/__snapshots__/labels.test.jsx.snap +0 -30
  97. package/src/__tests__/__snapshots__/mark-label.test.jsx.snap +0 -45
  98. package/src/__tests__/__snapshots__/toggle-bar.test.jsx.snap +0 -7
  99. package/src/__tests__/__snapshots__/tool-menu.test.jsx.snap +0 -13
  100. package/src/__tests__/__snapshots__/undo-redo.test.jsx.snap +0 -14
  101. package/src/axis/__tests__/__snapshots__/arrow.test.jsx.snap +0 -33
  102. package/src/axis/__tests__/__snapshots__/axes.test.jsx.snap +0 -122
  103. package/src/tools/circle/__tests__/__snapshots__/bg-circle.test.jsx.snap +0 -46
  104. package/src/tools/circle/__tests__/__snapshots__/component.test.jsx.snap +0 -293
  105. package/src/tools/line/__tests__/__snapshots__/component.test.jsx.snap +0 -20
  106. package/src/tools/point/__tests__/__snapshots__/component.test.jsx.snap +0 -40
  107. package/src/tools/polygon/__tests__/__snapshots__/component.test.jsx.snap +0 -415
  108. package/src/tools/polygon/__tests__/__snapshots__/line.test.jsx.snap +0 -45
  109. package/src/tools/polygon/__tests__/__snapshots__/polygon.test.jsx.snap +0 -52
  110. package/src/tools/ray/__tests__/__snapshots__/component.test.jsx.snap +0 -23
  111. package/src/tools/segment/__tests__/__snapshots__/component.test.jsx.snap +0 -14
  112. package/src/tools/shared/__tests__/__snapshots__/arrow-head.test.jsx.snap +0 -27
  113. package/src/tools/shared/line/__tests__/__snapshots__/index.test.jsx.snap +0 -360
  114. package/src/tools/shared/line/__tests__/__snapshots__/line-path.test.jsx.snap +0 -58
  115. package/src/tools/shared/line/__tests__/__snapshots__/with-root-edge.test.jsx.snap +0 -63
  116. package/src/tools/shared/point/__tests__/__snapshots__/arrow-point.test.jsx.snap +0 -56
  117. package/src/tools/shared/point/__tests__/__snapshots__/base-point.test.jsx.snap +0 -44
  118. package/src/tools/vector/__tests__/__snapshots__/component.test.jsx.snap +0 -12
@@ -1,360 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`lineBase render renders 1`] = `
4
- <g>
5
- <GridDraggable
6
- from={
7
- Object {
8
- "x": 0,
9
- "y": 0,
10
- }
11
- }
12
- graphProps={
13
- Object {
14
- "domain": Object {
15
- "max": 1,
16
- "min": 0,
17
- "step": 1,
18
- },
19
- "range": Object {
20
- "max": 1,
21
- "min": 0,
22
- "step": 1,
23
- },
24
- "scale": Object {
25
- "x": [MockFunction],
26
- "y": [MockFunction],
27
- },
28
- "size": Object {
29
- "height": 400,
30
- "width": 400,
31
- },
32
- "snap": Object {
33
- "x": [MockFunction],
34
- "y": [MockFunction],
35
- },
36
- }
37
- }
38
- onClick={[Function]}
39
- onDrag={[Function]}
40
- to={
41
- Object {
42
- "x": 1,
43
- "y": 1,
44
- }
45
- }
46
- />
47
- <WithStyles(GridDraggable)
48
- graphProps={
49
- Object {
50
- "domain": Object {
51
- "max": 1,
52
- "min": 0,
53
- "step": 1,
54
- },
55
- "range": Object {
56
- "max": 1,
57
- "min": 0,
58
- "step": 1,
59
- },
60
- "scale": Object {
61
- "x": [MockFunction],
62
- "y": [MockFunction],
63
- },
64
- "size": Object {
65
- "height": 400,
66
- "width": 400,
67
- },
68
- "snap": Object {
69
- "x": [MockFunction],
70
- "y": [MockFunction],
71
- },
72
- }
73
- }
74
- onClick={[Function]}
75
- onDrag={[Function]}
76
- x={0}
77
- y={0}
78
- />
79
- <WithStyles(GridDraggable)
80
- angle={45}
81
- graphProps={
82
- Object {
83
- "domain": Object {
84
- "max": 1,
85
- "min": 0,
86
- "step": 1,
87
- },
88
- "range": Object {
89
- "max": 1,
90
- "min": 0,
91
- "step": 1,
92
- },
93
- "scale": Object {
94
- "x": [MockFunction],
95
- "y": [MockFunction],
96
- },
97
- "size": Object {
98
- "height": 400,
99
- "width": 400,
100
- },
101
- "snap": Object {
102
- "x": [MockFunction],
103
- "y": [MockFunction],
104
- },
105
- }
106
- }
107
- onClick={[Function]}
108
- onDrag={[Function]}
109
- x={1}
110
- y={1}
111
- />
112
- </g>
113
- `;
114
-
115
- exports[`lineBase render renders with labels 1`] = `
116
- <g>
117
- <GridDraggable
118
- from={
119
- Object {
120
- "label": "A",
121
- "x": 0,
122
- "y": 0,
123
- }
124
- }
125
- graphProps={
126
- Object {
127
- "domain": Object {
128
- "max": 1,
129
- "min": 0,
130
- "step": 1,
131
- },
132
- "range": Object {
133
- "max": 1,
134
- "min": 0,
135
- "step": 1,
136
- },
137
- "scale": Object {
138
- "x": [MockFunction],
139
- "y": [MockFunction],
140
- },
141
- "size": Object {
142
- "height": 400,
143
- "width": 400,
144
- },
145
- "snap": Object {
146
- "x": [MockFunction],
147
- "y": [MockFunction],
148
- },
149
- }
150
- }
151
- onClick={[Function]}
152
- onDrag={[Function]}
153
- to={
154
- Object {
155
- "label": "B",
156
- "x": 1,
157
- "y": 1,
158
- }
159
- }
160
- />
161
- <WithStyles(GridDraggable)
162
- graphProps={
163
- Object {
164
- "domain": Object {
165
- "max": 1,
166
- "min": 0,
167
- "step": 1,
168
- },
169
- "range": Object {
170
- "max": 1,
171
- "min": 0,
172
- "step": 1,
173
- },
174
- "scale": Object {
175
- "x": [MockFunction],
176
- "y": [MockFunction],
177
- },
178
- "size": Object {
179
- "height": 400,
180
- "width": 400,
181
- },
182
- "snap": Object {
183
- "x": [MockFunction],
184
- "y": [MockFunction],
185
- },
186
- }
187
- }
188
- labelNode={<foreignobject />}
189
- onClick={[Function]}
190
- onDrag={[Function]}
191
- x={0}
192
- y={0}
193
- />
194
- <Portal
195
- containerInfo={<foreignobject />}
196
- >
197
- <WithStyles(MarkLabel)
198
- disabled={true}
199
- graphProps={
200
- Object {
201
- "domain": Object {
202
- "max": 1,
203
- "min": 0,
204
- "step": 1,
205
- },
206
- "range": Object {
207
- "max": 1,
208
- "min": 0,
209
- "step": 1,
210
- },
211
- "scale": Object {
212
- "x": [MockFunction],
213
- "y": [MockFunction],
214
- },
215
- "size": Object {
216
- "height": 400,
217
- "width": 400,
218
- },
219
- "snap": Object {
220
- "x": [MockFunction],
221
- "y": [MockFunction],
222
- },
223
- }
224
- }
225
- inputRef={[Function]}
226
- mark={
227
- Object {
228
- "label": "A",
229
- "x": 0,
230
- "y": 0,
231
- }
232
- }
233
- onChange={[Function]}
234
- />
235
- </Portal>
236
- <WithStyles(GridDraggable)
237
- angle={45}
238
- graphProps={
239
- Object {
240
- "domain": Object {
241
- "max": 1,
242
- "min": 0,
243
- "step": 1,
244
- },
245
- "range": Object {
246
- "max": 1,
247
- "min": 0,
248
- "step": 1,
249
- },
250
- "scale": Object {
251
- "x": [MockFunction],
252
- "y": [MockFunction],
253
- },
254
- "size": Object {
255
- "height": 400,
256
- "width": 400,
257
- },
258
- "snap": Object {
259
- "x": [MockFunction],
260
- "y": [MockFunction],
261
- },
262
- }
263
- }
264
- labelNode={<foreignobject />}
265
- onClick={[Function]}
266
- onDrag={[Function]}
267
- x={1}
268
- y={1}
269
- />
270
- <Portal
271
- containerInfo={<foreignobject />}
272
- >
273
- <WithStyles(MarkLabel)
274
- disabled={true}
275
- graphProps={
276
- Object {
277
- "domain": Object {
278
- "max": 1,
279
- "min": 0,
280
- "step": 1,
281
- },
282
- "range": Object {
283
- "max": 1,
284
- "min": 0,
285
- "step": 1,
286
- },
287
- "scale": Object {
288
- "x": [MockFunction],
289
- "y": [MockFunction],
290
- },
291
- "size": Object {
292
- "height": 400,
293
- "width": 400,
294
- },
295
- "snap": Object {
296
- "x": [MockFunction],
297
- "y": [MockFunction],
298
- },
299
- }
300
- }
301
- inputRef={[Function]}
302
- mark={
303
- Object {
304
- "label": "B",
305
- "x": 1,
306
- "y": 1,
307
- }
308
- }
309
- onChange={[Function]}
310
- />
311
- </Portal>
312
- </g>
313
- `;
314
-
315
- exports[`lineToolComponent snapshot renders 1`] = `
316
- <Component
317
- changeMarkProps={[Function]}
318
- from={
319
- Object {
320
- "x": 0,
321
- "y": 0,
322
- }
323
- }
324
- graphProps={
325
- Object {
326
- "domain": Object {
327
- "max": 1,
328
- "min": 0,
329
- "step": 1,
330
- },
331
- "range": Object {
332
- "max": 1,
333
- "min": 0,
334
- "step": 1,
335
- },
336
- "scale": Object {
337
- "x": [MockFunction],
338
- "y": [MockFunction],
339
- },
340
- "size": Object {
341
- "height": 400,
342
- "width": 400,
343
- },
344
- "snap": Object {
345
- "x": [MockFunction],
346
- "y": [MockFunction],
347
- },
348
- }
349
- }
350
- onChange={[Function]}
351
- onDragStart={[Function]}
352
- onDragStop={[Function]}
353
- to={
354
- Object {
355
- "x": 1,
356
- "y": 1,
357
- }
358
- }
359
- />
360
- `;
@@ -1,58 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`LinePath snapshot renders 1`] = `
4
- <RawLinePath
5
- className="className"
6
- classes={
7
- Object {
8
- "correct": "RawLinePath-correct-6",
9
- "disabled": "RawLinePath-disabled-4",
10
- "disabledSecondary": "RawLinePath-disabledSecondary-5",
11
- "dragging": "RawLinePath-dragging-3",
12
- "drawLine": "RawLinePath-drawLine-1",
13
- "incorrect": "RawLinePath-incorrect-7",
14
- "line": "RawLinePath-line-2",
15
- "missing": "RawLinePath-missing-8",
16
- }
17
- }
18
- from={
19
- Object {
20
- "x": 0,
21
- "y": 0,
22
- }
23
- }
24
- graphProps={
25
- Object {
26
- "domain": Object {
27
- "max": 1,
28
- "min": 0,
29
- "step": 1,
30
- },
31
- "range": Object {
32
- "max": 1,
33
- "min": 0,
34
- "step": 1,
35
- },
36
- "scale": Object {
37
- "x": [MockFunction],
38
- "y": [MockFunction],
39
- },
40
- "size": Object {
41
- "height": 400,
42
- "width": 400,
43
- },
44
- "snap": Object {
45
- "x": [MockFunction],
46
- "y": [MockFunction],
47
- },
48
- }
49
- }
50
- onChange={[MockFunction]}
51
- to={
52
- Object {
53
- "x": 1,
54
- "y": 1,
55
- }
56
- }
57
- />
58
- `;
@@ -1,63 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`rootEdgeComponent snapshot renders 1`] = `
4
- <Component
5
- graphProps={
6
- Object {
7
- "domain": Object {
8
- "max": 1,
9
- "min": 0,
10
- "step": 1,
11
- },
12
- "range": Object {
13
- "max": 1,
14
- "min": 0,
15
- "step": 1,
16
- },
17
- "scale": Object {
18
- "x": [MockFunction],
19
- "y": [MockFunction],
20
- },
21
- "size": Object {
22
- "height": 400,
23
- "width": 400,
24
- },
25
- "snap": Object {
26
- "x": [MockFunction],
27
- "y": [MockFunction],
28
- },
29
- }
30
- }
31
- mark={
32
- Object {
33
- "from": Object {
34
- "x": 0,
35
- "y": 0,
36
- },
37
- "to": Object {
38
- "x": 1,
39
- "y": 1,
40
- },
41
- }
42
- }
43
- onChange={[Function]}
44
- />
45
- `;
46
-
47
- exports[`rootEdgeToToFromWRapper renders 1`] = `
48
- <Component
49
- mark={
50
- Object {
51
- "from": Object {
52
- "x": 1,
53
- "y": 1,
54
- },
55
- "to": Object {
56
- "x": 2,
57
- "y": 2,
58
- },
59
- }
60
- }
61
- onChange={[Function]}
62
- />
63
- `;
@@ -1,56 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`ArrowPoint snapshot renders 1`] = `
4
- <RawArrow
5
- className="className"
6
- classes={
7
- Object {
8
- "correct": "RawArrow-correct-4",
9
- "disabled": "RawArrow-disabled-2",
10
- "disabledSecondary": "RawArrow-disabledSecondary-3",
11
- "incorrect": "RawArrow-incorrect-5",
12
- "missing": "RawArrow-missing-6",
13
- "point": "RawArrow-point-1",
14
- }
15
- }
16
- from={
17
- Object {
18
- "x": 0,
19
- "y": 0,
20
- }
21
- }
22
- graphProps={
23
- Object {
24
- "domain": Object {
25
- "max": 1,
26
- "min": 0,
27
- "step": 1,
28
- },
29
- "range": Object {
30
- "max": 1,
31
- "min": 0,
32
- "step": 1,
33
- },
34
- "scale": Object {
35
- "x": [MockFunction],
36
- "y": [MockFunction],
37
- },
38
- "size": Object {
39
- "height": 400,
40
- "width": 400,
41
- },
42
- "snap": Object {
43
- "x": [MockFunction],
44
- "y": [MockFunction],
45
- },
46
- }
47
- }
48
- onChange={[MockFunction]}
49
- to={
50
- Object {
51
- "x": 1,
52
- "y": 1,
53
- }
54
- }
55
- />
56
- `;
@@ -1,44 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`BasePoint snapshot renders 1`] = `
4
- <RawBp
5
- className="className"
6
- classes={
7
- Object {
8
- "correct": "RawBp-correct-4",
9
- "disabled": "RawBp-disabled-2",
10
- "disabledSecondary": "RawBp-disabledSecondary-3",
11
- "incorrect": "RawBp-incorrect-5",
12
- "missing": "RawBp-missing-6",
13
- "point": "RawBp-point-1",
14
- }
15
- }
16
- graphProps={
17
- Object {
18
- "domain": Object {
19
- "max": 1,
20
- "min": 0,
21
- "step": 1,
22
- },
23
- "range": Object {
24
- "max": 1,
25
- "min": 0,
26
- "step": 1,
27
- },
28
- "scale": Object {
29
- "x": [MockFunction],
30
- "y": [MockFunction],
31
- },
32
- "size": Object {
33
- "height": 400,
34
- "width": 400,
35
- },
36
- "snap": Object {
37
- "x": [MockFunction],
38
- "y": [MockFunction],
39
- },
40
- }
41
- }
42
- onChange={[MockFunction]}
43
- />
44
- `;
@@ -1,12 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Line snapshot renders 1`] = `
4
- <line
5
- className="className"
6
- strokeDasharray={-5.585786437626905}
7
- x1={0}
8
- x2={1}
9
- y1={0}
10
- y2={1}
11
- />
12
- `;