@cdc/chart 4.22.10 → 4.23.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.
- package/README.md +5 -5
- package/dist/495.js +3 -0
- package/dist/703.js +1 -0
- package/dist/cdcchart.js +723 -6
- package/examples/age-adjusted-rates.json +1486 -1218
- package/examples/box-plot-data.json +71 -0
- package/examples/box-plot.csv +5 -0
- package/examples/{private/yaxis-test.json → box-plot.json} +46 -54
- package/examples/case-rate-example-config.json +1 -1
- package/examples/covid-confidence-example-config.json +33 -33
- package/examples/covid-example-config.json +34 -34
- package/examples/covid-example-data-confidence.json +30 -30
- package/examples/covid-example-data.json +20 -20
- package/examples/cutoff-example-config.json +36 -36
- package/examples/cutoff-example-data.json +36 -36
- package/examples/date-exclusions-config.json +1 -1
- package/examples/dynamic-legends.json +124 -124
- package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart-with-numbers-on-bar.json +191 -197
- package/examples/gallery/bar-chart-horizontal/horizontal-bar-chart.json +230 -240
- package/examples/gallery/bar-chart-horizontal/horizontal-stacked.json +239 -247
- package/examples/gallery/bar-chart-vertical/combo-line-chart.json +138 -136
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-categorical.json +79 -79
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-stacked.json +80 -80
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart-with-confidence.json +67 -67
- package/examples/gallery/bar-chart-vertical/vertical-bar-chart.json +179 -110
- package/examples/gallery/lollipop/lollipop-style-horizontal.json +215 -219
- package/examples/gallery/paired-bar/paired-bar-chart.json +195 -195
- package/examples/horizontal-chart.json +35 -35
- package/examples/horizontal-stacked-bar-chart.json +34 -34
- package/examples/line-chart.json +75 -75
- package/examples/new-data.csv +17 -0
- package/examples/newdata.json +90 -0
- package/examples/paired-bar-data.json +16 -14
- package/examples/paired-bar-example.json +48 -48
- package/examples/paired-bar-formatted.json +36 -36
- package/examples/planet-chart-horizontal-example-config.json +33 -33
- package/examples/planet-combo-example-config.json +34 -31
- package/examples/planet-example-config.json +35 -33
- package/examples/planet-example-data.json +56 -56
- package/examples/planet-pie-example-config.json +28 -28
- package/examples/stacked-vertical-bar-example.json +1 -1
- package/examples/temp-example-config.json +61 -54
- package/examples/temp-example-data.json +1 -1
- package/package.json +3 -2
- package/src/CdcChart.tsx +449 -434
- package/src/components/BarChart.tsx +383 -497
- package/src/components/BoxPlot.js +92 -0
- package/src/components/DataTable.tsx +182 -197
- package/src/components/EditorPanel.js +1068 -722
- package/src/components/Filters.js +131 -0
- package/src/components/Legend.js +286 -329
- package/src/components/LineChart.tsx +143 -81
- package/src/components/LinearChart.tsx +432 -451
- package/src/components/PairedBarChart.tsx +197 -213
- package/src/components/PieChart.tsx +105 -151
- package/src/components/SparkLine.js +179 -201
- package/src/components/useIntersectionObserver.tsx +19 -20
- package/src/context.tsx +3 -3
- package/src/data/initial-state.js +44 -17
- package/src/hooks/useActiveElement.js +13 -13
- package/src/hooks/useChartClasses.js +34 -28
- package/src/hooks/useColorPalette.ts +56 -63
- package/src/hooks/useLegendClasses.js +18 -10
- package/src/hooks/useReduceData.ts +64 -77
- package/src/hooks/useRightAxis.js +25 -0
- package/src/hooks/useTopAxis.js +6 -0
- package/src/index.html +19 -19
- package/src/index.tsx +13 -16
- package/src/scss/DataTable.scss +6 -5
- package/src/scss/editor-panel.scss +71 -69
- package/src/scss/main.scss +188 -114
- package/src/scss/variables.scss +1 -1
- package/examples/private/line-test-data.json +0 -22
- package/examples/private/line-test-two.json +0 -216
- package/examples/private/line-test.json +0 -102
- package/examples/private/newtest.csv +0 -101
- package/examples/private/shawn.json +0 -1296
- package/examples/private/test.json +0 -10124
- package/examples/private/yaxis-testing.csv +0 -27
- package/examples/private/yaxis.json +0 -28
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//TODO: Remove after COVE refactor
|
|
2
2
|
.cove {
|
|
3
|
-
@import
|
|
3
|
+
@import '@cdc/core/styles/v2/layout/tooltip.scss';
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.editor-panel {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
> label {
|
|
27
27
|
width: 48%;
|
|
28
|
-
margin-top: 0 !important
|
|
28
|
+
margin-top: 0 !important;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
|
|
37
37
|
.helper {
|
|
38
38
|
position: relative;
|
|
39
|
-
opacity: .7;
|
|
39
|
+
opacity: 0.7;
|
|
40
40
|
cursor: pointer;
|
|
41
41
|
width: 17px;
|
|
42
42
|
height: 17px;
|
|
43
43
|
align-self: center;
|
|
44
|
-
margin-left: .3rem;
|
|
44
|
+
margin-left: 0.3rem;
|
|
45
45
|
margin-top: -0.3rem;
|
|
46
46
|
border: none !important;
|
|
47
47
|
box-shadow: none !important;
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
border: $lightGray 1px solid;
|
|
67
67
|
|
|
68
68
|
&:empty {
|
|
69
|
-
border: none !important
|
|
69
|
+
border: none !important;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
li {
|
|
73
|
-
padding: .3em .5em;
|
|
73
|
+
padding: 0.3em 0.5em;
|
|
74
74
|
display: flex;
|
|
75
75
|
align-items: center;
|
|
76
76
|
justify-content: space-between;
|
|
77
|
-
font-size: .9em;
|
|
77
|
+
font-size: 0.9em;
|
|
78
78
|
|
|
79
79
|
&:hover {
|
|
80
80
|
background-color: $lightestGray;
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
.series-list__dropdown {
|
|
135
|
-
font-size: .8em;
|
|
135
|
+
font-size: 0.8em;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
.series-list__remove {
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
|
|
168
168
|
.number-narrow {
|
|
169
169
|
min-width: auto;
|
|
170
|
-
width: 75px
|
|
170
|
+
width: 75px;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
|
|
179
179
|
.guidance-link {
|
|
180
180
|
margin: 2em 1em 0;
|
|
181
|
-
padding: .75em 1em;
|
|
181
|
+
padding: 0.75em 1em;
|
|
182
182
|
|
|
183
183
|
svg {
|
|
184
184
|
width: 60px;
|
|
@@ -192,13 +192,13 @@
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
.warning {
|
|
195
|
-
color: #
|
|
196
|
-
background-color: #
|
|
197
|
-
padding: .75em 1em;
|
|
195
|
+
color: #d8000c;
|
|
196
|
+
background-color: #ffd2d2;
|
|
197
|
+
padding: 0.75em 1em;
|
|
198
198
|
margin: 1em 0;
|
|
199
|
-
font-size: .8em;
|
|
200
|
-
border: #
|
|
201
|
-
border-radius: .4em;
|
|
199
|
+
font-size: 0.8em;
|
|
200
|
+
border: #d8000c 1px solid;
|
|
201
|
+
border-radius: 0.4em;
|
|
202
202
|
|
|
203
203
|
strong {
|
|
204
204
|
font-weight: 600;
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
.accordion__button {
|
|
210
210
|
cursor: pointer;
|
|
211
211
|
font-size: 1em;
|
|
212
|
-
padding: .3em 1em;
|
|
212
|
+
padding: 0.3em 1em;
|
|
213
213
|
width: 100%;
|
|
214
214
|
text-align: left;
|
|
215
215
|
position: relative;
|
|
@@ -227,14 +227,14 @@
|
|
|
227
227
|
position: absolute;
|
|
228
228
|
top: 50%;
|
|
229
229
|
transform: rotate(-45deg) translateY(-50%);
|
|
230
|
-
transition: .1s all;
|
|
230
|
+
transition: 0.1s all;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
&[aria-expanded='true']::before {
|
|
234
234
|
transform: rotate(45deg) translateY(-50%);
|
|
235
235
|
transform-origin: right;
|
|
236
236
|
margin-right: 1.3em;
|
|
237
|
-
transition: .1s all;
|
|
237
|
+
transition: 0.1s all;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
h5 {
|
|
251
|
-
font-size: .8em;
|
|
251
|
+
font-size: 0.8em;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
text-align: left;
|
|
258
258
|
|
|
259
259
|
p {
|
|
260
|
-
font-size: .8rem;
|
|
260
|
+
font-size: 0.8rem;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
.advanced-toggle-link {
|
|
@@ -275,17 +275,17 @@
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
&:hover {
|
|
278
|
-
color: rgba(0, 0, 0, .7);
|
|
278
|
+
color: rgba(0, 0, 0, 0.7);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
textarea {
|
|
283
283
|
height: 400px;
|
|
284
284
|
width: 100%;
|
|
285
|
-
font-size: .9em;
|
|
286
|
-
padding: .5em;
|
|
285
|
+
font-size: 0.9em;
|
|
286
|
+
padding: 0.5em;
|
|
287
287
|
font-family: monospace;
|
|
288
|
-
box-sizing: border-box
|
|
288
|
+
box-sizing: border-box;
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
|
|
@@ -303,18 +303,17 @@
|
|
|
303
303
|
background: #565656;
|
|
304
304
|
color: #fff;
|
|
305
305
|
font-size: 1.1em;
|
|
306
|
-
padding: .6em 1em;
|
|
306
|
+
padding: 0.6em 1em;
|
|
307
307
|
position: relative;
|
|
308
308
|
border-bottom: #565656 3px solid;
|
|
309
309
|
z-index: 3;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
|
|
313
312
|
legend,
|
|
314
313
|
label {
|
|
315
314
|
text-transform: uppercase;
|
|
316
315
|
display: block;
|
|
317
|
-
font-size: .8em;
|
|
316
|
+
font-size: 0.8em;
|
|
318
317
|
font-weight: 600;
|
|
319
318
|
user-select: none;
|
|
320
319
|
|
|
@@ -323,7 +322,7 @@
|
|
|
323
322
|
}
|
|
324
323
|
|
|
325
324
|
span.edit-label {
|
|
326
|
-
margin-bottom: .3em;
|
|
325
|
+
margin-bottom: 0.3em;
|
|
327
326
|
display: block;
|
|
328
327
|
}
|
|
329
328
|
|
|
@@ -365,7 +364,10 @@
|
|
|
365
364
|
}
|
|
366
365
|
}
|
|
367
366
|
|
|
368
|
-
input[type=
|
|
367
|
+
input[type='text'],
|
|
368
|
+
input[role='combobox'],
|
|
369
|
+
input[type='number'],
|
|
370
|
+
textarea {
|
|
369
371
|
min-width: 100%;
|
|
370
372
|
max-width: 100%; // Doing this prevents width of textarea from being changed
|
|
371
373
|
}
|
|
@@ -385,7 +387,7 @@
|
|
|
385
387
|
display: flex;
|
|
386
388
|
max-width: 100%;
|
|
387
389
|
padding: 0;
|
|
388
|
-
margin: .5em 0 0 0;
|
|
390
|
+
margin: 0.5em 0 0 0;
|
|
389
391
|
list-style: none;
|
|
390
392
|
flex-wrap: wrap;
|
|
391
393
|
|
|
@@ -410,7 +412,7 @@
|
|
|
410
412
|
}
|
|
411
413
|
|
|
412
414
|
&.selected {
|
|
413
|
-
border: rgba(0, 0, 0, .8) 2px solid;
|
|
415
|
+
border: rgba(0, 0, 0, 0.8) 2px solid;
|
|
414
416
|
}
|
|
415
417
|
|
|
416
418
|
span {
|
|
@@ -450,7 +452,8 @@
|
|
|
450
452
|
width: 30%;
|
|
451
453
|
display: inline-block;
|
|
452
454
|
|
|
453
|
-
input[type=
|
|
455
|
+
input[type='text'],
|
|
456
|
+
input[type='number'] {
|
|
454
457
|
width: 50px;
|
|
455
458
|
}
|
|
456
459
|
}
|
|
@@ -460,12 +463,12 @@
|
|
|
460
463
|
.emove-column {
|
|
461
464
|
float: right;
|
|
462
465
|
text-transform: uppercase;
|
|
463
|
-
color: #
|
|
464
|
-
font-size: .7em;
|
|
466
|
+
color: #c32b2b;
|
|
467
|
+
font-size: 0.7em;
|
|
465
468
|
line-height: 1.6em;
|
|
466
469
|
border-radius: 5px;
|
|
467
470
|
margin: 0 auto;
|
|
468
|
-
transition: .1s all;
|
|
471
|
+
transition: 0.1s all;
|
|
469
472
|
border: 0;
|
|
470
473
|
text-decoration: underline;
|
|
471
474
|
outline: 0;
|
|
@@ -476,13 +479,14 @@
|
|
|
476
479
|
.edit-block {
|
|
477
480
|
padding-left: 1em;
|
|
478
481
|
border-left: rgba(0, 0, 0, 0.2) 4px solid;
|
|
479
|
-
transition: .2s all;
|
|
482
|
+
transition: 0.2s all;
|
|
480
483
|
|
|
481
484
|
&:not(:first-child) {
|
|
482
485
|
margin-top: 2em;
|
|
483
486
|
}
|
|
484
487
|
|
|
485
|
-
input[type=
|
|
488
|
+
input[type='text'],
|
|
489
|
+
input[type='number'] {
|
|
486
490
|
font-size: 1em;
|
|
487
491
|
}
|
|
488
492
|
|
|
@@ -496,13 +500,13 @@
|
|
|
496
500
|
|
|
497
501
|
&:hover {
|
|
498
502
|
border-left: rgba(0, 0, 0, 0.7) 4px solid;
|
|
499
|
-
transition: .2s all;
|
|
503
|
+
transition: 0.2s all;
|
|
500
504
|
}
|
|
501
505
|
}
|
|
502
506
|
|
|
503
507
|
span.subtext {
|
|
504
508
|
display: block;
|
|
505
|
-
color: rgba(0, 0, 0, .5);
|
|
509
|
+
color: rgba(0, 0, 0, 0.5);
|
|
506
510
|
text-transform: none;
|
|
507
511
|
font-weight: normal;
|
|
508
512
|
}
|
|
@@ -515,25 +519,25 @@
|
|
|
515
519
|
list-style: none;
|
|
516
520
|
|
|
517
521
|
> li {
|
|
518
|
-
margin-right: .3em;
|
|
519
|
-
margin-bottom: .3em;
|
|
522
|
+
margin-right: 0.3em;
|
|
523
|
+
margin-bottom: 0.3em;
|
|
520
524
|
}
|
|
521
525
|
}
|
|
522
526
|
|
|
523
527
|
.sort-list li > div {
|
|
524
528
|
display: block;
|
|
525
529
|
box-sizing: border-box;
|
|
526
|
-
border: 1px solid #
|
|
530
|
+
border: 1px solid #d1d1d1;
|
|
527
531
|
border-radius: 2px;
|
|
528
|
-
background: #
|
|
529
|
-
padding: .4em .6em;
|
|
530
|
-
font-size: .8em;
|
|
531
|
-
margin-bottom: .3em;
|
|
532
|
+
background: #f1f1f1;
|
|
533
|
+
padding: 0.4em 0.6em;
|
|
534
|
+
font-size: 0.8em;
|
|
535
|
+
margin-bottom: 0.3em;
|
|
532
536
|
cursor: move;
|
|
533
537
|
}
|
|
534
538
|
|
|
535
539
|
.info {
|
|
536
|
-
font-size: .8em;
|
|
540
|
+
font-size: 0.8em;
|
|
537
541
|
line-height: 1.4em;
|
|
538
542
|
font-style: italic;
|
|
539
543
|
padding-top: 10px;
|
|
@@ -547,14 +551,14 @@
|
|
|
547
551
|
position: relative;
|
|
548
552
|
|
|
549
553
|
input.react-tags__search-input {
|
|
550
|
-
font-size: .8rem;
|
|
554
|
+
font-size: 0.8rem;
|
|
551
555
|
}
|
|
552
556
|
|
|
553
557
|
/* clicking anywhere will focus the input */
|
|
554
558
|
cursor: text;
|
|
555
559
|
|
|
556
560
|
span {
|
|
557
|
-
display: inline
|
|
561
|
+
display: inline;
|
|
558
562
|
}
|
|
559
563
|
}
|
|
560
564
|
|
|
@@ -569,24 +573,24 @@
|
|
|
569
573
|
.react-tags__selected-tag {
|
|
570
574
|
display: inline-block;
|
|
571
575
|
box-sizing: border-box;
|
|
572
|
-
border: 1px solid #
|
|
576
|
+
border: 1px solid #d1d1d1;
|
|
573
577
|
border-radius: 2px;
|
|
574
|
-
background: #
|
|
575
|
-
padding: .4em .6em;
|
|
576
|
-
font-size: .8em;
|
|
577
|
-
margin-right: .3em;
|
|
578
|
-
margin-bottom: .3em;
|
|
578
|
+
background: #f1f1f1;
|
|
579
|
+
padding: 0.4em 0.6em;
|
|
580
|
+
font-size: 0.8em;
|
|
581
|
+
margin-right: 0.3em;
|
|
582
|
+
margin-bottom: 0.3em;
|
|
579
583
|
}
|
|
580
584
|
|
|
581
585
|
.react-tags__selected-tag:after {
|
|
582
586
|
content: '\2715';
|
|
583
|
-
color: #
|
|
587
|
+
color: #aaa;
|
|
584
588
|
margin-left: 8px;
|
|
585
589
|
}
|
|
586
590
|
|
|
587
591
|
.react-tags__selected-tag:hover,
|
|
588
592
|
.react-tags__selected-tag:focus {
|
|
589
|
-
border-color: #
|
|
593
|
+
border-color: #b1b1b1;
|
|
590
594
|
}
|
|
591
595
|
|
|
592
596
|
.react-tags__search {
|
|
@@ -597,12 +601,10 @@
|
|
|
597
601
|
}
|
|
598
602
|
|
|
599
603
|
@media screen and (min-width: 30em) {
|
|
600
|
-
|
|
601
604
|
.react-tags__search {
|
|
602
605
|
/* this will become the offsetParent for suggestions */
|
|
603
606
|
position: relative;
|
|
604
607
|
}
|
|
605
|
-
|
|
606
608
|
}
|
|
607
609
|
|
|
608
610
|
.react-tags__search input {
|
|
@@ -612,7 +614,7 @@
|
|
|
612
614
|
/* emove styles and layout from this element */
|
|
613
615
|
margin: 0;
|
|
614
616
|
outline: none;
|
|
615
|
-
padding: .5em .3em;
|
|
617
|
+
padding: 0.5em 0.3em;
|
|
616
618
|
|
|
617
619
|
/* match the font styles */
|
|
618
620
|
font-size: inherit;
|
|
@@ -641,7 +643,7 @@
|
|
|
641
643
|
padding: 0;
|
|
642
644
|
list-style: none;
|
|
643
645
|
background: white;
|
|
644
|
-
border: 1px solid #
|
|
646
|
+
border: 1px solid #d1d1d1;
|
|
645
647
|
border-radius: 2px;
|
|
646
648
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
|
647
649
|
}
|
|
@@ -671,7 +673,7 @@
|
|
|
671
673
|
cursor: auto;
|
|
672
674
|
}
|
|
673
675
|
|
|
674
|
-
input[type=
|
|
676
|
+
input[type='radio'] {
|
|
675
677
|
border: 1px solid #8c8f94;
|
|
676
678
|
border-radius: 50%;
|
|
677
679
|
margin-right: 5px;
|
|
@@ -679,27 +681,27 @@
|
|
|
679
681
|
}
|
|
680
682
|
|
|
681
683
|
.editor-toggle {
|
|
682
|
-
background: #
|
|
684
|
+
background: #f2f2f2;
|
|
683
685
|
border-radius: 60px;
|
|
684
686
|
color: #000;
|
|
685
687
|
font-size: 1em;
|
|
686
688
|
border: 0;
|
|
687
689
|
position: fixed;
|
|
688
690
|
z-index: 100;
|
|
689
|
-
transition: .1s background;
|
|
691
|
+
transition: 0.1s background;
|
|
690
692
|
cursor: pointer;
|
|
691
693
|
width: 25px;
|
|
692
694
|
height: 25px;
|
|
693
695
|
left: 307px;
|
|
694
696
|
top: 10px;
|
|
695
|
-
box-shadow: rgba(0, 0, 0, .5) 0 1px 2px;
|
|
697
|
+
box-shadow: rgba(0, 0, 0, 0.5) 0 1px 2px;
|
|
696
698
|
|
|
697
699
|
&:before {
|
|
698
700
|
top: 43%;
|
|
699
701
|
left: 50%;
|
|
700
702
|
transform: translate(-50%, -50%);
|
|
701
703
|
position: absolute;
|
|
702
|
-
content:
|
|
704
|
+
content: '\00ab';
|
|
703
705
|
}
|
|
704
706
|
|
|
705
707
|
&.collapsed {
|
|
@@ -707,12 +709,12 @@
|
|
|
707
709
|
margin-left: 0;
|
|
708
710
|
|
|
709
711
|
&:before {
|
|
710
|
-
content:
|
|
712
|
+
content: '\00bb';
|
|
711
713
|
}
|
|
712
714
|
}
|
|
713
715
|
|
|
714
716
|
&:hover {
|
|
715
|
-
background: rgba(255, 255, 255, 1)
|
|
717
|
+
background: rgba(255, 255, 255, 1);
|
|
716
718
|
}
|
|
717
719
|
}
|
|
718
720
|
|