@cdc/core 4.26.1 → 4.26.3
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/.claude/agents/qa-test-developer.md +126 -0
- package/CLAUDE.local.md +67 -0
- package/LICENSE +201 -0
- package/_stories/Gallery.Charts.stories.tsx +35 -42
- package/_stories/Gallery.DataBite.stories.tsx +15 -8
- package/_stories/Gallery.Maps.stories.tsx +37 -28
- package/_stories/Gallery.WaffleChart.stories.tsx +1 -1
- package/_stories/PageART.stories.tsx +5 -4
- package/_stories/PageBRFSS.stories.tsx +21 -16
- package/_stories/PageCancerRegistries.stories.tsx +15 -15
- package/_stories/PageEasternEquineEncephalitis.stories.tsx +33 -19
- package/_stories/PageExcessiveAlcoholUse.stories.tsx +148 -143
- package/_stories/PageMaternalMortality.stories.tsx +5 -4
- package/_stories/PageOralHealth.stories.tsx +15 -10
- package/_stories/PageRespiratory.stories.tsx +4 -4
- package/_stories/PageSmokingTobacco.stories.tsx +15 -10
- package/_stories/PageStateDiabetesProfiles.stories.tsx +15 -10
- package/_stories/PageWastewater.stories.tsx +44 -30
- package/_stories/VegaImport.stories.tsx +401 -0
- package/_stories/vega-fixtures/bars-with-line.json +444 -0
- package/_stories/vega-fixtures/bars.json +58 -0
- package/_stories/vega-fixtures/combo-bar-rolling-mean.json +88 -0
- package/_stories/vega-fixtures/combo.json +68 -0
- package/_stories/vega-fixtures/grouped-horizontal-bars.json +83 -0
- package/_stories/vega-fixtures/grouped-horizontal-bars2.json +231 -0
- package/_stories/vega-fixtures/horizontal-bar.json +427 -0
- package/_stories/vega-fixtures/horizontal-bars-with-bad-colors.json +197 -0
- package/_stories/vega-fixtures/horizontal-bars2.json +58 -0
- package/_stories/vega-fixtures/lines.json +227 -0
- package/_stories/vega-fixtures/measles-bars.json +348 -0
- package/_stories/vega-fixtures/measles-map.json +11101 -0
- package/_stories/vega-fixtures/measles-stacked-bars.json +2147 -0
- package/_stories/vega-fixtures/multi-dataset.json +255 -0
- package/_stories/vega-fixtures/no-data.json +14 -0
- package/_stories/vega-fixtures/pie-chart.json +94 -0
- package/_stories/vega-fixtures/repeat-spec.json +47 -0
- package/_stories/vega-fixtures/stacked-area.json +222 -0
- package/_stories/vega-fixtures/stacked-bar-with-rect.json +3412 -0
- package/_stories/vega-fixtures/stacked-bars-with-line.json +364 -0
- package/_stories/vega-fixtures/stacked-bars.json +212 -0
- package/_stories/vega-fixtures/stacked-horizontal-bars.json +140 -0
- package/_stories/vega-fixtures/warning-combo.json +59 -0
- package/_stories/vega-fixtures/warning-scatter-and-line.json +1182 -0
- package/assets/callout-flag.svg +7 -0
- package/assets/icon-chart-area.svg +1 -0
- package/assets/icon-chart-radar.svg +23 -0
- package/assets/logo2.svg +31 -0
- package/components/AdvancedEditor/EmbedEditor.tsx +270 -38
- package/components/Alert/components/Alert.styles.css +2 -2
- package/components/ComboBox/combobox.styles.css +48 -48
- package/components/CustomColorsEditor/CustomColorsEditor.css +53 -53
- package/components/CustomColorsEditor/CustomColorsEditor.tsx +3 -10
- package/components/DataTable/DataTable.tsx +46 -18
- package/components/DataTable/DataTableStandAlone.tsx +1 -0
- package/components/DataTable/components/ChartHeader.tsx +21 -12
- package/components/DataTable/components/MapHeader.tsx +34 -28
- package/components/DataTable/components/SortIcon/sort-icon.css +5 -5
- package/components/DataTable/data-table.css +50 -52
- package/components/DataTable/helpers/applyCustomOrder.ts +17 -0
- package/components/DataTable/helpers/getChartCellValue.ts +10 -7
- package/components/DataTable/helpers/getMapDataTableColumnKeys.ts +22 -0
- package/components/DataTable/helpers/getSeriesName.ts +6 -0
- package/components/DataTable/helpers/mapCellMatrix.tsx +33 -23
- package/components/DataTable/helpers/tests/mapCellMatrix.test.ts +33 -0
- package/components/DownloadButton.tsx +14 -6
- package/components/EditorPanel/ColumnsEditor.tsx +38 -31
- package/components/EditorPanel/CustomSortOrder.tsx +94 -0
- package/components/EditorPanel/DataTableEditor.tsx +139 -23
- package/components/EditorPanel/EditorPanel.styles.css +71 -71
- package/components/EditorPanel/EditorPanel.tsx +3 -8
- package/components/EditorPanel/EditorPanelDispatch.tsx +4 -4
- package/components/EditorPanel/FootnotesEditor.tsx +2 -2
- package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +21 -12
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +16 -10
- package/components/EditorPanel/VizFilterEditor/components/FilterOrder.tsx +33 -29
- package/components/EditorPanel/components/MarkupVariablesEditor.tsx +160 -106
- package/components/EditorPanel/components/PanelMarkup.tsx +5 -1
- package/{styles/v2/components → components/EditorPanel}/editor.scss +76 -22
- package/components/EditorPanel/sections/StyleTreatmentSection.tsx +99 -0
- package/components/EditorPanel/sections/VisualSection.tsx +11 -0
- package/components/EditorWrapper/editor-wrapper.style.css +1 -1
- package/components/Filters/Filters.tsx +3 -5
- package/components/Filters/components/Tabs.tsx +19 -7
- package/{styles → components/Filters}/filters.scss +3 -3
- package/components/Footnotes/FootnotesStandAlone.tsx +4 -2
- package/components/HeaderThemeSelector/HeaderThemeSelector.css +61 -5
- package/components/Layout/components/Responsive.tsx +14 -6
- package/components/Layout/components/Sidebar/components/Sidebar.tsx +1 -1
- package/components/Layout/components/Sidebar/components/sidebar.styles.scss +14 -20
- package/components/Layout/components/Visualization/index.tsx +50 -38
- package/components/Layout/components/Visualization/visualizations.scss +232 -15
- package/components/Layout/components/VisualizationContainer.test.tsx +67 -0
- package/components/Layout/components/VisualizationContainer.tsx +37 -0
- package/components/Layout/components/VisualizationContent.test.tsx +182 -0
- package/components/Layout/components/VisualizationContent.tsx +75 -0
- package/components/Layout/index.tsx +5 -5
- package/components/Layout/styles/editor-utils.scss +3 -3
- package/components/Layout/styles/editor.scss +4 -4
- package/components/Legend/Legend.Gradient.tsx +7 -1
- package/components/Loader/loader.styles.css +2 -2
- package/components/Loading.jsx +1 -1
- package/components/MediaControls.tsx +10 -3
- package/components/MultiSelect/multiselect.styles.css +19 -19
- package/components/NestedDropdown/nesteddropdown.styles.css +15 -15
- package/components/PaletteSelector/PaletteSelector.css +15 -15
- package/components/RichTooltip/richTooltip.css +6 -6
- package/components/Table/table.styles.css +2 -2
- package/components/Waiting.tsx +1 -1
- package/components/_stories/CustomColorsEditor.stories.tsx +37 -0
- package/components/_stories/DataTable.stories.tsx +1 -0
- package/components/_stories/Filters.stories.tsx +1 -1
- package/components/_stories/styles.scss +0 -1
- package/components/elements/Button.jsx +1 -1
- package/components/elements/Card.jsx +1 -1
- package/{styles/v2/components → components/elements}/button.scss +9 -8
- package/components/inputs/InputCheckbox.jsx +1 -1
- package/components/inputs/InputSelect.tsx +1 -1
- package/components/inputs/InputText.jsx +1 -1
- package/components/inputs/InputToggle.tsx +1 -1
- package/{styles/v2/components/input → components/inputs}/_input-check-radio.scss +2 -2
- package/{styles/v2/components/input → components/inputs}/_input-group.scss +3 -3
- package/{styles/v2/components/input → components/inputs}/_input-slider.scss +2 -2
- package/{styles/v2/components/input → components/inputs}/_input.scss +5 -5
- package/{styles/v2/components/input → components/inputs}/index.scss +2 -2
- package/{styles → components}/loading.scss +1 -1
- package/components/managers/DataDesigner.tsx +1 -1
- package/{styles/v2/components → components/managers}/data-designer.scss +6 -7
- package/components/ui/Accordion.jsx +1 -1
- package/components/ui/Icon.tsx +1 -1
- package/components/ui/LoadSpin.jsx +1 -1
- package/components/ui/Modal.jsx +1 -1
- package/components/ui/Overlay.jsx +1 -1
- package/components/ui/Title/index.test.tsx +34 -0
- package/components/ui/Title/index.tsx +24 -7
- package/components/ui/Title/title.styles.css +119 -25
- package/components/ui/Tooltip.tsx +1 -1
- package/components/ui/_stories/Title.stories.tsx +1 -1
- package/{styles/v2/components → components/ui}/accordion.scss +3 -3
- package/components/ui/accordion.styles.css +11 -11
- package/{styles/v2/components → components/ui}/modal.scss +2 -2
- package/{styles/v2/components → components/ui}/overlay.scss +6 -6
- package/{styles/v2/components → components}/ui/tooltip.scss +1 -1
- package/{styles → components}/waiting.scss +9 -3
- package/data/colorPalettes.ts +18 -5
- package/data/mapColorPalettes.ts +10 -0
- package/devTemplate/dev.js +285 -0
- package/devTemplate/index.html +30 -0
- package/devTemplate/preview.html +1503 -0
- package/devTemplate/sidebar.css +151 -0
- package/dist/cove-main.css +2530 -3901
- package/dist/cove-main.css.map +1 -1
- package/generateViteConfig.js +111 -2
- package/helpers/DataTransform.ts +1 -5
- package/helpers/backfillDefaults.ts +35 -0
- package/helpers/constants.ts +12 -0
- package/helpers/cove/date.ts +64 -3
- package/helpers/cove/number.ts +29 -15
- package/helpers/cove/string.ts +29 -0
- package/helpers/coveUpdateWorker.ts +14 -8
- package/helpers/displayDataAsText.ts +1 -1
- package/helpers/embed/embedCodeGenerator.ts +80 -0
- package/helpers/embed/embedHelper.js +169 -0
- package/helpers/embed/filterUtils.ts +121 -0
- package/helpers/embed/index.ts +17 -0
- package/helpers/embed/urlValidation.ts +119 -0
- package/helpers/extractDataAndMetadata.ts +20 -0
- package/helpers/fetchRemoteData.ts +14 -8
- package/helpers/filterVizData.ts +6 -1
- package/helpers/getFileExtension.ts +0 -6
- package/helpers/labelHash.ts +9 -0
- package/helpers/markupProcessor.ts +56 -38
- package/helpers/metrics/types.ts +3 -0
- package/helpers/palettes/colorDistributions.ts +1 -1
- package/helpers/palettes/utils.ts +12 -12
- package/helpers/parseCsvWithQuotes.ts +15 -14
- package/helpers/prepareScreenshot.ts +33 -10
- package/helpers/testing.ts +44 -0
- package/helpers/tests/DataTransform.test.ts +125 -0
- package/helpers/tests/abbreviateNumber.test.ts +59 -0
- package/helpers/tests/backfillDefaults.test.ts +253 -0
- package/helpers/tests/date.test.ts +110 -0
- package/helpers/tests/extractDataAndMetadata.test.ts +93 -0
- package/helpers/tests/markupProcessor.test.ts +315 -124
- package/helpers/tests/number.test.ts +42 -0
- package/helpers/tests/prepareScreenshot.test.ts +28 -28
- package/helpers/tests/testStandaloneBuild.ts +36 -26
- package/helpers/tests/useDataVizClasses.test.ts +66 -0
- package/helpers/tests/visualizationWrapperUsage.test.ts +57 -0
- package/helpers/useDataVizClasses.ts +13 -7
- package/helpers/vegaConfig.ts +1 -1
- package/helpers/vegaConfigImport.ts +160 -0
- package/helpers/ver/4.24.4.ts +24 -0
- package/helpers/ver/4.26.1.ts +1 -1
- package/helpers/ver/4.26.2.ts +84 -0
- package/helpers/ver/4.26.3.ts +44 -0
- package/helpers/ver/4.26.4.ts +31 -0
- package/helpers/ver/tests/4.26.1.test.ts +105 -0
- package/helpers/ver/tests/4.26.2.test.ts +298 -0
- package/helpers/ver/tests/4.26.3.test.ts +168 -0
- package/helpers/ver/tests/4.26.4.test.ts +88 -0
- package/helpers/ver/tests/coveUpdateWorker.test.ts +57 -0
- package/helpers/viewports.ts +2 -0
- package/package.json +27 -32
- package/styles/_global.scss +7 -7
- package/styles/_reset.scss +2 -2
- package/styles/{v2/base → base}/_file-selector.scss +4 -4
- package/styles/{v2/base → base}/_general.scss +2 -4
- package/styles/{v2/base → base}/index.scss +1 -1
- package/styles/base.scss +107 -165
- package/styles/cove-main.scss +3 -6
- package/styles/layout/_component.scss +110 -0
- package/styles/{v2/layout → layout}/_data-table.scss +7 -7
- package/styles/layout/_wrapper-padding.scss +27 -0
- package/styles/{v2/main.scss → main.scss} +3 -1
- package/styles/{v2/themes → themes}/_color-definitions.scss +46 -41
- package/styles/{_accessibility.scss → utils/_accessibility.scss} +1 -1
- package/styles/{v2/utils → utils}/_grid.scss +8 -3
- package/styles/{_global-variables.scss → utils/_properties.scss} +133 -112
- package/styles/{v2/utils → utils}/index.scss +2 -1
- package/types/Annotation.ts +10 -11
- package/types/Axis.ts +2 -0
- package/types/ComponentStyles.ts +1 -0
- package/types/ConfigureData.ts +1 -0
- package/types/General.ts +2 -0
- package/types/MarkupInclude.ts +1 -0
- package/types/MarkupVariable.ts +2 -1
- package/types/Palette.ts +22 -0
- package/types/Table.ts +9 -0
- package/types/Visualization.ts +7 -0
- package/_stories/StoryRenderingTests.stories.tsx +0 -164
- package/helpers/embedCodeGenerator.ts +0 -109
- package/styles/_common-components.css +0 -73
- package/styles/_variables.scss +0 -63
- package/styles/v2/layout/_component.scss +0 -21
- package/styles/v2/utils/_variables.scss +0 -9
- package/{styles/v2/components/card.scss → components/elements/card.css} +2 -2
- /package/{styles/v2/components → components/ui}/icon.scss +0 -0
- /package/{styles/v2/components → components/ui}/loadspin.scss +0 -0
- /package/styles/{v2/base → base}/_heading.scss +0 -0
- /package/styles/{v2/base → base}/_reset.scss +0 -0
- /package/styles/{v2/layout → layout}/_alert.scss +0 -0
- /package/styles/{v2/layout → layout}/_progression.scss +0 -0
- /package/styles/{v2/layout → layout}/_tooltip.scss +0 -0
- /package/styles/{v2/layout → layout}/index.scss +0 -0
- /package/styles/{v2/themes → themes}/index.scss +0 -0
- /package/styles/{v2/utils → utils}/_align.scss +0 -0
- /package/styles/{v2/utils → utils}/_animations.scss +0 -0
- /package/styles/{v2/utils → utils}/_breakpoints.scss +0 -0
- /package/styles/{v2/utils → utils}/_mixins.scss +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
|
|
3
|
+
"data": {
|
|
4
|
+
"name": "Weekly Incident Case Counts"
|
|
5
|
+
},
|
|
6
|
+
"layer": [
|
|
7
|
+
{
|
|
8
|
+
"mark": {
|
|
9
|
+
"type": "bar",
|
|
10
|
+
"color": "#3f82e0"
|
|
11
|
+
},
|
|
12
|
+
"encoding": {
|
|
13
|
+
"x": {
|
|
14
|
+
"field": "date",
|
|
15
|
+
"type": "temporal",
|
|
16
|
+
"title": "Date (CCCD)",
|
|
17
|
+
"axis": {
|
|
18
|
+
"labelExpr": "[utcFormat(datum.value, '%b'), utcFormat(datum.value, '%m') == '01' ? utcFormat(datum.value, '%Y') : '']"
|
|
19
|
+
},
|
|
20
|
+
"scale": {
|
|
21
|
+
"nice": "month"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"y": {
|
|
25
|
+
"field": "sum of cases",
|
|
26
|
+
"type": "quantitative",
|
|
27
|
+
"title": "Total Number of Cases",
|
|
28
|
+
"scale": {
|
|
29
|
+
"domain": {
|
|
30
|
+
"unionWith": [
|
|
31
|
+
0,
|
|
32
|
+
1
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"color": {
|
|
38
|
+
"value": "#578edb",
|
|
39
|
+
"legend": {
|
|
40
|
+
"title": "Legend"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"data": {
|
|
47
|
+
"name": "3 week moving average"
|
|
48
|
+
},
|
|
49
|
+
"mark": {
|
|
50
|
+
"type": "line",
|
|
51
|
+
"color": "black",
|
|
52
|
+
"strokeDash": [
|
|
53
|
+
4,
|
|
54
|
+
4
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"encoding": {
|
|
58
|
+
"x": {
|
|
59
|
+
"field": "test",
|
|
60
|
+
"type": "temporal",
|
|
61
|
+
"title": "Date (CCCD)",
|
|
62
|
+
"scale": {
|
|
63
|
+
"nice": "month"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"y": {
|
|
67
|
+
"field": "rate",
|
|
68
|
+
"type": "quantitative",
|
|
69
|
+
"title": "Total Number of Cases",
|
|
70
|
+
"scale": {
|
|
71
|
+
"domain": {
|
|
72
|
+
"unionWith": [
|
|
73
|
+
0,
|
|
74
|
+
1
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"color": {
|
|
80
|
+
"value": "black",
|
|
81
|
+
"legend": {
|
|
82
|
+
"title": "Legend"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"height": "container",
|
|
89
|
+
"width": "container",
|
|
90
|
+
"datasets": {
|
|
91
|
+
"Weekly Incident Case Counts": [
|
|
92
|
+
{
|
|
93
|
+
"date": "2022-05-09T00:00:00.000Z",
|
|
94
|
+
"sum of cases": 6
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"date": "2022-05-16T00:00:00.000Z",
|
|
98
|
+
"sum of cases": 18
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"date": "2022-05-23T00:00:00.000Z",
|
|
102
|
+
"sum of cases": 15
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"date": "2022-05-30T00:00:00.000Z",
|
|
106
|
+
"sum of cases": 52
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"date": "2022-06-06T00:00:00.000Z",
|
|
110
|
+
"sum of cases": 98
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"date": "2022-06-13T00:00:00.000Z",
|
|
114
|
+
"sum of cases": 194
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"date": "2022-06-20T00:00:00.000Z",
|
|
118
|
+
"sum of cases": 341
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"date": "2022-06-27T00:00:00.000Z",
|
|
122
|
+
"sum of cases": 715
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"date": "2022-07-04T00:00:00.000Z",
|
|
126
|
+
"sum of cases": 1277
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"date": "2022-07-11T00:00:00.000Z",
|
|
130
|
+
"sum of cases": 2001
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"3 week moving average": [
|
|
134
|
+
{
|
|
135
|
+
"test": "2022-05-09T00:00:00.000Z"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"test": "2022-05-16T00:00:00.000Z"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"test": "2022-05-23T00:00:00.000Z",
|
|
142
|
+
"rate": 13
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"test": "2022-05-30T00:00:00.000Z",
|
|
146
|
+
"rate": 28.333333333333332
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"test": "2022-06-06T00:00:00.000Z",
|
|
150
|
+
"rate": 55
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"test": "2022-06-13T00:00:00.000Z",
|
|
154
|
+
"rate": 114.66666666666667
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"test": "2022-06-20T00:00:00.000Z",
|
|
158
|
+
"rate": 211
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"test": "2022-06-27T00:00:00.000Z",
|
|
162
|
+
"rate": 416.6666666666667
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"test": "2022-07-04T00:00:00.000Z",
|
|
166
|
+
"rate": 777.6666666666666
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"test": "2022-07-11T00:00:00.000Z",
|
|
170
|
+
"rate": 1331
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"config": {
|
|
175
|
+
"background": "#FFFFFF",
|
|
176
|
+
"bar": {
|
|
177
|
+
"fill": "#2D72D2"
|
|
178
|
+
},
|
|
179
|
+
"arc": {
|
|
180
|
+
"fill": "#2D72D2"
|
|
181
|
+
},
|
|
182
|
+
"area": {
|
|
183
|
+
"fill": "#2D72D2"
|
|
184
|
+
},
|
|
185
|
+
"rect": {
|
|
186
|
+
"fill": "#2D72D2"
|
|
187
|
+
},
|
|
188
|
+
"circle": {
|
|
189
|
+
"fill": "#2D72D2"
|
|
190
|
+
},
|
|
191
|
+
"point": {
|
|
192
|
+
"stroke": "#2D72D2"
|
|
193
|
+
},
|
|
194
|
+
"line": {
|
|
195
|
+
"stroke": "#2D72D2"
|
|
196
|
+
},
|
|
197
|
+
"font": "Source-Sans-Pro",
|
|
198
|
+
"padding": 20,
|
|
199
|
+
"mark": {
|
|
200
|
+
"opacity": 0.75,
|
|
201
|
+
"tooltip": true
|
|
202
|
+
},
|
|
203
|
+
"title": {
|
|
204
|
+
"color": "#111418",
|
|
205
|
+
"fontSize": 14,
|
|
206
|
+
"fontWeight": 600,
|
|
207
|
+
"anchor": "start",
|
|
208
|
+
"subtitleColor": "#5F6B7C",
|
|
209
|
+
"subtitleFontSize": 12,
|
|
210
|
+
"subtitlePadding": 7
|
|
211
|
+
},
|
|
212
|
+
"axis": {
|
|
213
|
+
"labelFontSize": 12,
|
|
214
|
+
"titleFontSize": 14,
|
|
215
|
+
"titleFontWeight": 400,
|
|
216
|
+
"titlePadding": 10,
|
|
217
|
+
"titleColor": "#111418",
|
|
218
|
+
"labelColor": "#738091",
|
|
219
|
+
"gridColor": "#DCE0E5",
|
|
220
|
+
"gridOpacity": 1,
|
|
221
|
+
"domainColor": "#5F6B7C",
|
|
222
|
+
"tickColor": "#5F6B7C"
|
|
223
|
+
},
|
|
224
|
+
"legend": {
|
|
225
|
+
"titleColor": "#111418",
|
|
226
|
+
"labelColor": "#111418",
|
|
227
|
+
"titleFontSize": 12,
|
|
228
|
+
"labelFontSize": 12,
|
|
229
|
+
"titleFontWeight": 600
|
|
230
|
+
},
|
|
231
|
+
"view": {
|
|
232
|
+
"stroke": "transparent"
|
|
233
|
+
},
|
|
234
|
+
"text": {
|
|
235
|
+
"color": "#111418",
|
|
236
|
+
"fontSize": 12,
|
|
237
|
+
"fontWeight": 400
|
|
238
|
+
},
|
|
239
|
+
"range": {
|
|
240
|
+
"category": [
|
|
241
|
+
"#2D72D2",
|
|
242
|
+
"#DB2C6F",
|
|
243
|
+
"#8EB125",
|
|
244
|
+
"#9D3F9D",
|
|
245
|
+
"#00A396",
|
|
246
|
+
"#D1980B",
|
|
247
|
+
"#D33D17",
|
|
248
|
+
"#7961DB",
|
|
249
|
+
"#29A634",
|
|
250
|
+
"#946638",
|
|
251
|
+
"#147EB3"
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
|
|
3
|
+
"description": "Stock prices of 5 Tech Companies over Time.",
|
|
4
|
+
"data": { "url": "data/stocks.csv" },
|
|
5
|
+
"mark": {
|
|
6
|
+
"type": "line",
|
|
7
|
+
"point": true
|
|
8
|
+
},
|
|
9
|
+
"encoding": {
|
|
10
|
+
"x": { "timeUnit": "year", "field": "date" },
|
|
11
|
+
"y": { "aggregate": "mean", "field": "price", "type": "quantitative" },
|
|
12
|
+
"color": { "field": "symbol", "type": "nominal" }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://vega.github.io/schema/vega/v5.json",
|
|
3
|
+
"description": "A basic pie chart example.",
|
|
4
|
+
"width": 200,
|
|
5
|
+
"height": 200,
|
|
6
|
+
"autosize": "none",
|
|
7
|
+
|
|
8
|
+
"signals": [
|
|
9
|
+
{
|
|
10
|
+
"name": "startAngle",
|
|
11
|
+
"value": 0,
|
|
12
|
+
"bind": { "input": "range", "min": 0, "max": 6.29, "step": 0.01 }
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "endAngle",
|
|
16
|
+
"value": 6.29,
|
|
17
|
+
"bind": { "input": "range", "min": 0, "max": 6.29, "step": 0.01 }
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "padAngle",
|
|
21
|
+
"value": 0,
|
|
22
|
+
"bind": { "input": "range", "min": 0, "max": 0.1 }
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "innerRadius",
|
|
26
|
+
"value": 0,
|
|
27
|
+
"bind": { "input": "range", "min": 0, "max": 90, "step": 1 }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "cornerRadius",
|
|
31
|
+
"value": 0,
|
|
32
|
+
"bind": { "input": "range", "min": 0, "max": 10, "step": 0.5 }
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "sort",
|
|
36
|
+
"value": false,
|
|
37
|
+
"bind": { "input": "checkbox" }
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
|
|
41
|
+
"data": [
|
|
42
|
+
{
|
|
43
|
+
"name": "table",
|
|
44
|
+
"values": [
|
|
45
|
+
{ "id": 1, "field": 4 },
|
|
46
|
+
{ "id": 2, "field": 6 },
|
|
47
|
+
{ "id": 3, "field": 10 },
|
|
48
|
+
{ "id": 4, "field": 3 },
|
|
49
|
+
{ "id": 5, "field": 7 },
|
|
50
|
+
{ "id": 6, "field": 8 }
|
|
51
|
+
],
|
|
52
|
+
"transform": [
|
|
53
|
+
{
|
|
54
|
+
"type": "pie",
|
|
55
|
+
"field": "field",
|
|
56
|
+
"startAngle": { "signal": "startAngle" },
|
|
57
|
+
"endAngle": { "signal": "endAngle" },
|
|
58
|
+
"sort": { "signal": "sort" }
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
|
|
64
|
+
"scales": [
|
|
65
|
+
{
|
|
66
|
+
"name": "color",
|
|
67
|
+
"type": "ordinal",
|
|
68
|
+
"domain": { "data": "table", "field": "id" },
|
|
69
|
+
"range": { "scheme": "category20" }
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
|
|
73
|
+
"marks": [
|
|
74
|
+
{
|
|
75
|
+
"type": "arc",
|
|
76
|
+
"from": { "data": "table" },
|
|
77
|
+
"encode": {
|
|
78
|
+
"enter": {
|
|
79
|
+
"fill": { "scale": "color", "field": "id" },
|
|
80
|
+
"x": { "signal": "width / 2" },
|
|
81
|
+
"y": { "signal": "height / 2" }
|
|
82
|
+
},
|
|
83
|
+
"update": {
|
|
84
|
+
"startAngle": { "field": "startAngle" },
|
|
85
|
+
"endAngle": { "field": "endAngle" },
|
|
86
|
+
"padAngle": { "signal": "padAngle" },
|
|
87
|
+
"innerRadius": { "signal": "innerRadius" },
|
|
88
|
+
"outerRadius": { "signal": "width / 2" },
|
|
89
|
+
"cornerRadius": { "signal": "cornerRadius" }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"values": [
|
|
4
|
+
{
|
|
5
|
+
"Title": "Movie 1",
|
|
6
|
+
"US Gross": 146083,
|
|
7
|
+
"Worldwide Gross": 146083,
|
|
8
|
+
"IMDB Rating": 6.1
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"Title": "Movie 2",
|
|
12
|
+
"US Gross": 10876,
|
|
13
|
+
"Worldwide Gross": 10876,
|
|
14
|
+
"IMDB Rating": 6.9
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"Title": "Movie 3",
|
|
18
|
+
"US Gross": 203134,
|
|
19
|
+
"Worldwide Gross": 203134,
|
|
20
|
+
"IMDB Rating": 6.8
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"repeat": {
|
|
25
|
+
"layer": ["US Gross", "Worldwide Gross"]
|
|
26
|
+
},
|
|
27
|
+
"spec": {
|
|
28
|
+
"mark": "line",
|
|
29
|
+
"encoding": {
|
|
30
|
+
"x": {
|
|
31
|
+
"bin": true,
|
|
32
|
+
"field": "IMDB Rating",
|
|
33
|
+
"type": "quantitative"
|
|
34
|
+
},
|
|
35
|
+
"y": {
|
|
36
|
+
"aggregate": "mean",
|
|
37
|
+
"field": { "repeat": "layer" },
|
|
38
|
+
"type": "quantitative",
|
|
39
|
+
"title": "Mean of US and Worldwide Gross"
|
|
40
|
+
},
|
|
41
|
+
"color": {
|
|
42
|
+
"datum": { "repeat": "layer" },
|
|
43
|
+
"type": "nominal"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://vega.github.io/schema/vega/v5.json",
|
|
3
|
+
"description": "A basic stacked area chart example.",
|
|
4
|
+
"width": 500,
|
|
5
|
+
"height": 200,
|
|
6
|
+
"padding": 5,
|
|
7
|
+
"data": [
|
|
8
|
+
{
|
|
9
|
+
"name": "table",
|
|
10
|
+
"values": [
|
|
11
|
+
{
|
|
12
|
+
"x": 0,
|
|
13
|
+
"y": 28,
|
|
14
|
+
"c": 0
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"x": 0,
|
|
18
|
+
"y": 55,
|
|
19
|
+
"c": 1
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"x": 1,
|
|
23
|
+
"y": 43,
|
|
24
|
+
"c": 0
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"x": 1,
|
|
28
|
+
"y": 91,
|
|
29
|
+
"c": 1
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"x": 2,
|
|
33
|
+
"y": 81,
|
|
34
|
+
"c": 0
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"x": 2,
|
|
38
|
+
"y": 53,
|
|
39
|
+
"c": 1
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"x": 3,
|
|
43
|
+
"y": 19,
|
|
44
|
+
"c": 0
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"x": 3,
|
|
48
|
+
"y": 87,
|
|
49
|
+
"c": 1
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"x": 4,
|
|
53
|
+
"y": 52,
|
|
54
|
+
"c": 0
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"x": 4,
|
|
58
|
+
"y": 48,
|
|
59
|
+
"c": 1
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"x": 5,
|
|
63
|
+
"y": 24,
|
|
64
|
+
"c": 0
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"x": 5,
|
|
68
|
+
"y": 49,
|
|
69
|
+
"c": 1
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"x": 6,
|
|
73
|
+
"y": 87,
|
|
74
|
+
"c": 0
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"x": 6,
|
|
78
|
+
"y": 66,
|
|
79
|
+
"c": 1
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"x": 7,
|
|
83
|
+
"y": 17,
|
|
84
|
+
"c": 0
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"x": 7,
|
|
88
|
+
"y": 27,
|
|
89
|
+
"c": 1
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"x": 8,
|
|
93
|
+
"y": 68,
|
|
94
|
+
"c": 0
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"x": 8,
|
|
98
|
+
"y": 16,
|
|
99
|
+
"c": 1
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"x": 9,
|
|
103
|
+
"y": 49,
|
|
104
|
+
"c": 0
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"x": 9,
|
|
108
|
+
"y": 15,
|
|
109
|
+
"c": 1
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"transform": [
|
|
113
|
+
{
|
|
114
|
+
"type": "stack",
|
|
115
|
+
"groupby": [
|
|
116
|
+
"x"
|
|
117
|
+
],
|
|
118
|
+
"sort": {
|
|
119
|
+
"field": "c"
|
|
120
|
+
},
|
|
121
|
+
"field": "y"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"scales": [
|
|
127
|
+
{
|
|
128
|
+
"name": "x",
|
|
129
|
+
"type": "point",
|
|
130
|
+
"range": "width",
|
|
131
|
+
"domain": {
|
|
132
|
+
"data": "table",
|
|
133
|
+
"field": "x"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "y",
|
|
138
|
+
"type": "linear",
|
|
139
|
+
"range": "height",
|
|
140
|
+
"nice": true,
|
|
141
|
+
"zero": true,
|
|
142
|
+
"domain": {
|
|
143
|
+
"data": "table",
|
|
144
|
+
"field": "y1"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "color",
|
|
149
|
+
"type": "ordinal",
|
|
150
|
+
"range": "category",
|
|
151
|
+
"domain": {
|
|
152
|
+
"data": "table",
|
|
153
|
+
"field": "c"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"axes": [
|
|
158
|
+
{
|
|
159
|
+
"orient": "bottom",
|
|
160
|
+
"scale": "x",
|
|
161
|
+
"zindex": 1
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"orient": "left",
|
|
165
|
+
"scale": "y",
|
|
166
|
+
"zindex": 1
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"marks": [
|
|
170
|
+
{
|
|
171
|
+
"type": "group",
|
|
172
|
+
"from": {
|
|
173
|
+
"facet": {
|
|
174
|
+
"name": "series",
|
|
175
|
+
"data": "table",
|
|
176
|
+
"groupby": "c"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"marks": [
|
|
180
|
+
{
|
|
181
|
+
"type": "area",
|
|
182
|
+
"from": {
|
|
183
|
+
"data": "series"
|
|
184
|
+
},
|
|
185
|
+
"encode": {
|
|
186
|
+
"enter": {
|
|
187
|
+
"interpolate": {
|
|
188
|
+
"value": "monotone"
|
|
189
|
+
},
|
|
190
|
+
"x": {
|
|
191
|
+
"scale": "x",
|
|
192
|
+
"field": "x"
|
|
193
|
+
},
|
|
194
|
+
"y": {
|
|
195
|
+
"scale": "y",
|
|
196
|
+
"field": "y0"
|
|
197
|
+
},
|
|
198
|
+
"y2": {
|
|
199
|
+
"scale": "y",
|
|
200
|
+
"field": "y1"
|
|
201
|
+
},
|
|
202
|
+
"fill": {
|
|
203
|
+
"scale": "color",
|
|
204
|
+
"field": "c"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"update": {
|
|
208
|
+
"fillOpacity": {
|
|
209
|
+
"value": 1
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"hover": {
|
|
213
|
+
"fillOpacity": {
|
|
214
|
+
"value": 0.5
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|