@pie-lib/charting 5.15.7-next.0 → 5.16.0-beta.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 (90) hide show
  1. package/CHANGELOG.md +35 -65
  2. package/NEXT.CHANGELOG.json +1 -0
  3. package/lib/axes.js +74 -29
  4. package/lib/axes.js.map +1 -1
  5. package/lib/bars/common/bars.js +35 -1
  6. package/lib/bars/common/bars.js.map +1 -1
  7. package/lib/chart-type.js +4 -4
  8. package/lib/chart-type.js.map +1 -1
  9. package/lib/chart-types.js +2 -2
  10. package/lib/chart-types.js.map +1 -1
  11. package/lib/chart.js +25 -10
  12. package/lib/chart.js.map +1 -1
  13. package/lib/common/drag-handle.js +11 -5
  14. package/lib/common/drag-handle.js.map +1 -1
  15. package/lib/common/drag-icon.js +7 -24
  16. package/lib/common/drag-icon.js.map +1 -1
  17. package/lib/line/common/drag-handle.js +9 -4
  18. package/lib/line/common/drag-handle.js.map +1 -1
  19. package/lib/line/line-cross.js +16 -5
  20. package/lib/line/line-cross.js.map +1 -1
  21. package/lib/line/line-dot.js +10 -2
  22. package/lib/line/line-dot.js.map +1 -1
  23. package/lib/mark-label.js +20 -11
  24. package/lib/mark-label.js.map +1 -1
  25. package/lib/plot/common/plot.js +3 -1
  26. package/lib/plot/common/plot.js.map +1 -1
  27. package/lib/plot/dot.js +1 -1
  28. package/lib/plot/dot.js.map +1 -1
  29. package/lib/plot/line.js +1 -1
  30. package/lib/plot/line.js.map +1 -1
  31. package/lib/tool-menu.js +0 -4
  32. package/lib/tool-menu.js.map +1 -1
  33. package/package.json +32 -5
  34. package/src/__tests__/__snapshots__/axes.test.jsx.snap +564 -0
  35. package/src/__tests__/__snapshots__/chart-type.test.jsx.snap +14 -0
  36. package/src/__tests__/__snapshots__/chart.test.jsx.snap +610 -0
  37. package/src/__tests__/__snapshots__/grid.test.jsx.snap +28 -0
  38. package/src/__tests__/__snapshots__/mark-label.test.jsx.snap +67 -0
  39. package/src/__tests__/axes.test.jsx +146 -0
  40. package/src/__tests__/chart-setup.test.jsx +47 -0
  41. package/src/__tests__/chart-type.test.jsx +29 -0
  42. package/src/__tests__/chart.test.jsx +87 -0
  43. package/src/__tests__/grid.test.jsx +25 -0
  44. package/src/__tests__/mark-label.test.jsx +31 -0
  45. package/src/__tests__/utils.js +30 -0
  46. package/src/__tests__/utils.test.js +100 -0
  47. package/src/axes.jsx +59 -23
  48. package/src/bars/__tests__/__snapshots__/bar.test.jsx.snap +43 -0
  49. package/src/bars/__tests__/__snapshots__/histogram.test.jsx.snap +45 -0
  50. package/src/bars/__tests__/bar.test.jsx +37 -0
  51. package/src/bars/__tests__/histogram.test.jsx +38 -0
  52. package/src/bars/__tests__/utils.js +30 -0
  53. package/src/bars/common/__tests__/__snapshots__/bars.test.jsx.snap +110 -0
  54. package/src/bars/common/__tests__/bars.test.jsx +69 -0
  55. package/src/bars/common/__tests__/utils.js +30 -0
  56. package/src/bars/common/bars.jsx +37 -1
  57. package/src/chart-type.js +7 -3
  58. package/src/chart-types.js +2 -2
  59. package/src/chart.jsx +15 -5
  60. package/src/common/__tests__/__snapshots__/drag-handle.test.jsx.snap +45 -0
  61. package/src/common/__tests__/drag-handle.test.jsx +88 -0
  62. package/src/common/__tests__/utils.js +30 -0
  63. package/src/common/drag-handle.jsx +18 -10
  64. package/src/common/drag-icon.jsx +6 -21
  65. package/src/line/__tests__/__snapshots__/line-cross.test.jsx.snap +45 -0
  66. package/src/line/__tests__/__snapshots__/line-dot.test.jsx.snap +45 -0
  67. package/src/line/__tests__/line-cross.test.jsx +38 -0
  68. package/src/line/__tests__/line-dot.test.jsx +38 -0
  69. package/src/line/__tests__/utils.js +30 -0
  70. package/src/line/common/__tests__/__snapshots__/drag-handle.test.jsx.snap +44 -0
  71. package/src/line/common/__tests__/__snapshots__/line.test.jsx.snap +141 -0
  72. package/src/line/common/__tests__/drag-handle.test.jsx +88 -0
  73. package/src/line/common/__tests__/line.test.jsx +82 -0
  74. package/src/line/common/__tests__/utils.js +30 -0
  75. package/src/line/common/drag-handle.jsx +9 -4
  76. package/src/line/line-cross.js +4 -1
  77. package/src/line/line-dot.js +17 -7
  78. package/src/mark-label.jsx +19 -7
  79. package/src/plot/__tests__/__snapshots__/dot.test.jsx.snap +45 -0
  80. package/src/plot/__tests__/__snapshots__/line.test.jsx.snap +45 -0
  81. package/src/plot/__tests__/dot.test.jsx +38 -0
  82. package/src/plot/__tests__/line.test.jsx +38 -0
  83. package/src/plot/__tests__/utils.js +30 -0
  84. package/src/plot/common/__tests__/__snapshots__/plot.test.jsx.snap +96 -0
  85. package/src/plot/common/__tests__/plot.test.jsx +70 -0
  86. package/src/plot/common/__tests__/utils.js +30 -0
  87. package/src/plot/common/plot.jsx +6 -1
  88. package/src/plot/dot.js +1 -1
  89. package/src/plot/line.js +1 -1
  90. package/src/tool-menu.jsx +0 -4
@@ -0,0 +1,610 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ChartAxes snapshot renders 1`] = `
4
+ <div
5
+ className="className"
6
+ >
7
+ <div>
8
+ <ToolMenu
9
+ addCategory={[Function]}
10
+ disabled={true}
11
+ />
12
+ </div>
13
+ <WithStyles(Root)
14
+ defineChart={false}
15
+ disabledLabels={true}
16
+ disabledTitle={true}
17
+ graphProps={
18
+ Object {
19
+ "domain": Object {
20
+ "labelStep": 1,
21
+ "max": 1,
22
+ "min": 0,
23
+ "step": 1,
24
+ },
25
+ "getRootNode": [Function],
26
+ "range": Object {
27
+ "labelStep": 1,
28
+ "max": 10,
29
+ "min": 0,
30
+ "step": 1,
31
+ },
32
+ "scale": Object {
33
+ "x": [Function],
34
+ "y": [Function],
35
+ },
36
+ "size": Object {
37
+ "height": 160,
38
+ "width": 100,
39
+ },
40
+ "snap": Object {
41
+ "x": [Function],
42
+ "y": [Function],
43
+ },
44
+ }
45
+ }
46
+ isChart={true}
47
+ labels={
48
+ Object {
49
+ "bottom": "",
50
+ "left": "",
51
+ }
52
+ }
53
+ mathMlOptions={Object {}}
54
+ rootRef={[Function]}
55
+ showLabels={true}
56
+ showTitle={true}
57
+ >
58
+ <WithStyles(Grid)
59
+ columnTickValues={Array []}
60
+ graphProps={
61
+ Object {
62
+ "domain": Object {
63
+ "labelStep": 1,
64
+ "max": 1,
65
+ "min": 0,
66
+ "step": 1,
67
+ },
68
+ "getRootNode": [Function],
69
+ "range": Object {
70
+ "labelStep": 1,
71
+ "max": 10,
72
+ "min": 0,
73
+ "step": 1,
74
+ },
75
+ "scale": Object {
76
+ "x": [Function],
77
+ "y": [Function],
78
+ },
79
+ "size": Object {
80
+ "height": 100,
81
+ "width": 100,
82
+ },
83
+ "snap": Object {
84
+ "x": [Function],
85
+ "y": [Function],
86
+ },
87
+ }
88
+ }
89
+ rowTickValues={
90
+ Array [
91
+ 0,
92
+ 1,
93
+ 2,
94
+ 3,
95
+ 4,
96
+ 5,
97
+ 6,
98
+ 7,
99
+ 8,
100
+ 9,
101
+ 10,
102
+ ]
103
+ }
104
+ xBand={[Function]}
105
+ />
106
+ <WithStyles(RawChartAxes)
107
+ categories={Array []}
108
+ defineChart={false}
109
+ graphProps={
110
+ Object {
111
+ "domain": Object {
112
+ "labelStep": 1,
113
+ "max": 1,
114
+ "min": 0,
115
+ "step": 1,
116
+ },
117
+ "getRootNode": [Function],
118
+ "range": Object {
119
+ "labelStep": 1,
120
+ "max": 10,
121
+ "min": 0,
122
+ "step": 1,
123
+ },
124
+ "scale": Object {
125
+ "x": [Function],
126
+ "y": [Function],
127
+ },
128
+ "size": Object {
129
+ "height": 100,
130
+ "width": 100,
131
+ },
132
+ "snap": Object {
133
+ "x": [Function],
134
+ "y": [Function],
135
+ },
136
+ }
137
+ }
138
+ leftAxis={true}
139
+ onAutoFocusUsed={[Function]}
140
+ onChange={[Function]}
141
+ onChangeCategory={[Function]}
142
+ top={0}
143
+ xBand={[Function]}
144
+ />
145
+ <mask
146
+ id="chart-2645"
147
+ >
148
+ <rect
149
+ fill="white"
150
+ height={180}
151
+ width={120}
152
+ x={-10}
153
+ y={-75}
154
+ />
155
+ </mask>
156
+ <g
157
+ id="marks"
158
+ mask="url('#chart-2645')"
159
+ >
160
+ <Component
161
+ data={Array []}
162
+ defineChart={false}
163
+ graphProps={
164
+ Object {
165
+ "domain": Object {
166
+ "labelStep": 1,
167
+ "max": 1,
168
+ "min": 0,
169
+ "step": 1,
170
+ },
171
+ "getRootNode": [Function],
172
+ "range": Object {
173
+ "labelStep": 1,
174
+ "max": 10,
175
+ "min": 0,
176
+ "step": 1,
177
+ },
178
+ "scale": Object {
179
+ "x": [Function],
180
+ "y": [Function],
181
+ },
182
+ "size": Object {
183
+ "height": 100,
184
+ "width": 100,
185
+ },
186
+ "snap": Object {
187
+ "x": [Function],
188
+ "y": [Function],
189
+ },
190
+ }
191
+ }
192
+ height={160}
193
+ onChange={[Function]}
194
+ onChangeCategory={[Function]}
195
+ />
196
+ </g>
197
+ </WithStyles(Root)>
198
+ <WithStyles(AlertDialog)
199
+ open={false}
200
+ />
201
+ </div>
202
+ `;
203
+
204
+ exports[`ChartAxes snapshot renders if size is not defined 1`] = `
205
+ <div
206
+ className="className"
207
+ >
208
+ <div>
209
+ <ToolMenu
210
+ addCategory={[Function]}
211
+ disabled={true}
212
+ />
213
+ </div>
214
+ <WithStyles(Root)
215
+ defineChart={false}
216
+ disabledLabels={true}
217
+ disabledTitle={true}
218
+ graphProps={
219
+ Object {
220
+ "domain": Object {
221
+ "labelStep": 1,
222
+ "max": 1,
223
+ "min": 0,
224
+ "step": 1,
225
+ },
226
+ "getRootNode": [Function],
227
+ "range": Object {
228
+ "labelStep": 1,
229
+ "max": 10,
230
+ "min": 0,
231
+ "step": 1,
232
+ },
233
+ "scale": Object {
234
+ "x": [Function],
235
+ "y": [Function],
236
+ },
237
+ "size": Object {
238
+ "height": 540,
239
+ "width": 480,
240
+ },
241
+ "snap": Object {
242
+ "x": [Function],
243
+ "y": [Function],
244
+ },
245
+ }
246
+ }
247
+ isChart={true}
248
+ labels={
249
+ Object {
250
+ "bottom": "",
251
+ "left": "",
252
+ }
253
+ }
254
+ mathMlOptions={Object {}}
255
+ rootRef={[Function]}
256
+ showLabels={true}
257
+ showTitle={true}
258
+ >
259
+ <WithStyles(Grid)
260
+ columnTickValues={Array []}
261
+ graphProps={
262
+ Object {
263
+ "domain": Object {
264
+ "labelStep": 1,
265
+ "max": 1,
266
+ "min": 0,
267
+ "step": 1,
268
+ },
269
+ "getRootNode": [Function],
270
+ "range": Object {
271
+ "labelStep": 1,
272
+ "max": 10,
273
+ "min": 0,
274
+ "step": 1,
275
+ },
276
+ "scale": Object {
277
+ "x": [Function],
278
+ "y": [Function],
279
+ },
280
+ "size": Object {
281
+ "height": 480,
282
+ "width": 480,
283
+ },
284
+ "snap": Object {
285
+ "x": [Function],
286
+ "y": [Function],
287
+ },
288
+ }
289
+ }
290
+ rowTickValues={
291
+ Array [
292
+ 0,
293
+ 1,
294
+ 2,
295
+ 3,
296
+ 4,
297
+ 5,
298
+ 6,
299
+ 7,
300
+ 8,
301
+ 9,
302
+ 10,
303
+ ]
304
+ }
305
+ xBand={[Function]}
306
+ />
307
+ <WithStyles(RawChartAxes)
308
+ categories={Array []}
309
+ defineChart={false}
310
+ graphProps={
311
+ Object {
312
+ "domain": Object {
313
+ "labelStep": 1,
314
+ "max": 1,
315
+ "min": 0,
316
+ "step": 1,
317
+ },
318
+ "getRootNode": [Function],
319
+ "range": Object {
320
+ "labelStep": 1,
321
+ "max": 10,
322
+ "min": 0,
323
+ "step": 1,
324
+ },
325
+ "scale": Object {
326
+ "x": [Function],
327
+ "y": [Function],
328
+ },
329
+ "size": Object {
330
+ "height": 480,
331
+ "width": 480,
332
+ },
333
+ "snap": Object {
334
+ "x": [Function],
335
+ "y": [Function],
336
+ },
337
+ }
338
+ }
339
+ leftAxis={true}
340
+ onAutoFocusUsed={[Function]}
341
+ onChange={[Function]}
342
+ onChangeCategory={[Function]}
343
+ top={0}
344
+ xBand={[Function]}
345
+ />
346
+ <mask
347
+ id="chart-1553"
348
+ >
349
+ <rect
350
+ fill="white"
351
+ height={560}
352
+ width={500}
353
+ x={-10}
354
+ y={-75}
355
+ />
356
+ </mask>
357
+ <g
358
+ id="marks"
359
+ mask="url('#chart-1553')"
360
+ >
361
+ <Component
362
+ data={Array []}
363
+ defineChart={false}
364
+ graphProps={
365
+ Object {
366
+ "domain": Object {
367
+ "labelStep": 1,
368
+ "max": 1,
369
+ "min": 0,
370
+ "step": 1,
371
+ },
372
+ "getRootNode": [Function],
373
+ "range": Object {
374
+ "labelStep": 1,
375
+ "max": 10,
376
+ "min": 0,
377
+ "step": 1,
378
+ },
379
+ "scale": Object {
380
+ "x": [Function],
381
+ "y": [Function],
382
+ },
383
+ "size": Object {
384
+ "height": 480,
385
+ "width": 480,
386
+ },
387
+ "snap": Object {
388
+ "x": [Function],
389
+ "y": [Function],
390
+ },
391
+ }
392
+ }
393
+ height={540}
394
+ onChange={[Function]}
395
+ onChangeCategory={[Function]}
396
+ />
397
+ </g>
398
+ </WithStyles(Root)>
399
+ <WithStyles(AlertDialog)
400
+ open={false}
401
+ />
402
+ </div>
403
+ `;
404
+
405
+ exports[`ChartAxes snapshot renders with chartType property and empty charts property 1`] = `""`;
406
+
407
+ exports[`ChartAxes snapshot renders without chartType and charts properties 1`] = `""`;
408
+
409
+ exports[`ChartAxes snapshot renders without chartType property 1`] = `
410
+ <div
411
+ className="className"
412
+ >
413
+ <div>
414
+ <ToolMenu
415
+ addCategory={[Function]}
416
+ disabled={true}
417
+ />
418
+ </div>
419
+ <WithStyles(Root)
420
+ defineChart={false}
421
+ disabledLabels={true}
422
+ disabledTitle={true}
423
+ graphProps={
424
+ Object {
425
+ "domain": Object {
426
+ "labelStep": 1,
427
+ "max": 1,
428
+ "min": 0,
429
+ "step": 1,
430
+ },
431
+ "getRootNode": [Function],
432
+ "range": Object {
433
+ "labelStep": 1,
434
+ "max": 10,
435
+ "min": 0,
436
+ "step": 1,
437
+ },
438
+ "scale": Object {
439
+ "x": [Function],
440
+ "y": [Function],
441
+ },
442
+ "size": Object {
443
+ "height": 160,
444
+ "width": 100,
445
+ },
446
+ "snap": Object {
447
+ "x": [Function],
448
+ "y": [Function],
449
+ },
450
+ }
451
+ }
452
+ isChart={true}
453
+ labels={
454
+ Object {
455
+ "bottom": "",
456
+ "left": "",
457
+ }
458
+ }
459
+ mathMlOptions={Object {}}
460
+ rootRef={[Function]}
461
+ showLabels={true}
462
+ showTitle={true}
463
+ >
464
+ <WithStyles(Grid)
465
+ columnTickValues={Array []}
466
+ graphProps={
467
+ Object {
468
+ "domain": Object {
469
+ "labelStep": 1,
470
+ "max": 1,
471
+ "min": 0,
472
+ "step": 1,
473
+ },
474
+ "getRootNode": [Function],
475
+ "range": Object {
476
+ "labelStep": 1,
477
+ "max": 10,
478
+ "min": 0,
479
+ "step": 1,
480
+ },
481
+ "scale": Object {
482
+ "x": [Function],
483
+ "y": [Function],
484
+ },
485
+ "size": Object {
486
+ "height": 100,
487
+ "width": 100,
488
+ },
489
+ "snap": Object {
490
+ "x": [Function],
491
+ "y": [Function],
492
+ },
493
+ }
494
+ }
495
+ rowTickValues={
496
+ Array [
497
+ 0,
498
+ 1,
499
+ 2,
500
+ 3,
501
+ 4,
502
+ 5,
503
+ 6,
504
+ 7,
505
+ 8,
506
+ 9,
507
+ 10,
508
+ ]
509
+ }
510
+ xBand={[Function]}
511
+ />
512
+ <WithStyles(RawChartAxes)
513
+ categories={Array []}
514
+ defineChart={false}
515
+ graphProps={
516
+ Object {
517
+ "domain": Object {
518
+ "labelStep": 1,
519
+ "max": 1,
520
+ "min": 0,
521
+ "step": 1,
522
+ },
523
+ "getRootNode": [Function],
524
+ "range": Object {
525
+ "labelStep": 1,
526
+ "max": 10,
527
+ "min": 0,
528
+ "step": 1,
529
+ },
530
+ "scale": Object {
531
+ "x": [Function],
532
+ "y": [Function],
533
+ },
534
+ "size": Object {
535
+ "height": 100,
536
+ "width": 100,
537
+ },
538
+ "snap": Object {
539
+ "x": [Function],
540
+ "y": [Function],
541
+ },
542
+ }
543
+ }
544
+ leftAxis={true}
545
+ onAutoFocusUsed={[Function]}
546
+ onChange={[Function]}
547
+ onChangeCategory={[Function]}
548
+ top={0}
549
+ xBand={[Function]}
550
+ />
551
+ <mask
552
+ id="chart-4286"
553
+ >
554
+ <rect
555
+ fill="white"
556
+ height={180}
557
+ width={120}
558
+ x={-10}
559
+ y={-75}
560
+ />
561
+ </mask>
562
+ <g
563
+ id="marks"
564
+ mask="url('#chart-4286')"
565
+ >
566
+ <Component
567
+ data={Array []}
568
+ defineChart={false}
569
+ graphProps={
570
+ Object {
571
+ "domain": Object {
572
+ "labelStep": 1,
573
+ "max": 1,
574
+ "min": 0,
575
+ "step": 1,
576
+ },
577
+ "getRootNode": [Function],
578
+ "range": Object {
579
+ "labelStep": 1,
580
+ "max": 10,
581
+ "min": 0,
582
+ "step": 1,
583
+ },
584
+ "scale": Object {
585
+ "x": [Function],
586
+ "y": [Function],
587
+ },
588
+ "size": Object {
589
+ "height": 100,
590
+ "width": 100,
591
+ },
592
+ "snap": Object {
593
+ "x": [Function],
594
+ "y": [Function],
595
+ },
596
+ }
597
+ }
598
+ height={160}
599
+ onChange={[Function]}
600
+ onChangeCategory={[Function]}
601
+ />
602
+ </g>
603
+ </WithStyles(Root)>
604
+ <WithStyles(AlertDialog)
605
+ open={false}
606
+ />
607
+ </div>
608
+ `;
609
+
610
+ exports[`ChartAxes snapshot renders without chartType property and empty charts property 1`] = `""`;
@@ -0,0 +1,28 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Grid snapshot renders 1`] = `
4
+ <r
5
+ className="className"
6
+ height={400}
7
+ width={400}
8
+ xOffset={NaN}
9
+ xScale={
10
+ Object {
11
+ "bandwidth": [Function],
12
+ }
13
+ }
14
+ yScale={[MockFunction]}
15
+ />
16
+ `;
17
+
18
+ exports[`Grid snapshot renders if graphProps is not defined 1`] = `
19
+ <r
20
+ className="className"
21
+ xOffset={NaN}
22
+ xScale={
23
+ Object {
24
+ "bandwidth": [Function],
25
+ }
26
+ }
27
+ />
28
+ `;
@@ -0,0 +1,67 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`MarkLabel snapshot renders 1`] = `
4
+ <AutosizeInput
5
+ injectStyles={true}
6
+ inputClassName=""
7
+ inputRef={[Function]}
8
+ inputStyle={
9
+ Object {
10
+ "background": "transparent",
11
+ "boxSizing": "border-box",
12
+ "minWidth": undefined,
13
+ "paddingLeft": 0,
14
+ "paddingRight": 0,
15
+ "textAlign": "center",
16
+ }
17
+ }
18
+ minWidth={1}
19
+ onBlur={[Function]}
20
+ onChange={[Function]}
21
+ style={
22
+ Object {
23
+ "left": 0,
24
+ "minWidth": undefined,
25
+ "pointerEvents": "auto",
26
+ "position": "fixed",
27
+ "top": 0,
28
+ "transform": "rotate(undefineddeg)",
29
+ "transformOrigin": "left",
30
+ "visibility": "unset",
31
+ }
32
+ }
33
+ />
34
+ `;
35
+
36
+ exports[`MarkLabel snapshot renders 2`] = `
37
+ <AutosizeInput
38
+ injectStyles={true}
39
+ inputClassName=""
40
+ inputRef={[Function]}
41
+ inputStyle={
42
+ Object {
43
+ "background": "transparent",
44
+ "boxSizing": "border-box",
45
+ "minWidth": undefined,
46
+ "paddingLeft": 0,
47
+ "paddingRight": 0,
48
+ "textAlign": "center",
49
+ }
50
+ }
51
+ minWidth={1}
52
+ onBlur={[Function]}
53
+ onChange={[Function]}
54
+ style={
55
+ Object {
56
+ "left": 0,
57
+ "minWidth": undefined,
58
+ "pointerEvents": "auto",
59
+ "position": "fixed",
60
+ "top": 0,
61
+ "transform": "rotate(undefineddeg)",
62
+ "transformOrigin": "left",
63
+ "visibility": "unset",
64
+ }
65
+ }
66
+ />
67
+ `;