@pie-lib/charting 5.15.6 → 5.15.7-next.1618

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