@cdc/chart 4.23.3 → 4.23.5

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 (98) hide show
  1. package/dist/cdcchart.js +52543 -50830
  2. package/examples/feature/__data__/area-chart.json +56 -0
  3. package/examples/{planet-example-data.json → feature/__data__/planet-example-data.json} +3 -8
  4. package/examples/feature/__data__/planet-logaritmic-data.json +56 -0
  5. package/examples/feature/area/area-chart-category.json +240 -0
  6. package/examples/{area-chart.json → feature/area/area-chart-date.json} +70 -13
  7. package/examples/feature/bar/example-bar-chart.json +558 -0
  8. package/examples/{horizontal-chart-max-increase.json → feature/bar/horizontal-chart-max-increase.json} +10 -4
  9. package/examples/{horizontal-chart.json → feature/bar/horizontal-chart.json} +10 -4
  10. package/examples/{horizontal-stacked-bar-chart.json → feature/bar/horizontal-stacked-bar-chart.json} +7 -3
  11. package/examples/{planet-chart-horizontal-example-config.json → feature/bar/planet-chart-horizontal-example-config.json} +8 -3
  12. package/examples/feature/bar/planet-chart-logaritmic-config.json +170 -0
  13. package/examples/{planet-example-config.json → feature/bar/planet-example-config.json} +2 -2
  14. package/examples/{box-plot.json → feature/boxplot/boxplot.json} +7 -7
  15. package/examples/feature/boxplot/testing.csv +38 -0
  16. package/examples/feature/boxplot/valid-boxplot.csv +17 -0
  17. package/examples/feature/combo/combochart-categories_are_numbers .json +18 -0
  18. package/examples/{planet-combo-example-config.json → feature/combo/planet-combo-example-config.json} +1 -1
  19. package/examples/{planet-deviation-config.json → feature/deviation/planet-deviation-config.json} +2 -2
  20. package/examples/{planet-deviation-data.json → feature/deviation/planet-deviation-data.json} +9 -9
  21. package/examples/feature/filters/filter-testing.json +212 -0
  22. package/examples/feature/forecasting/case_date_example.csv +130 -0
  23. package/examples/feature/forecasting/effective_reproduction.json +202 -0
  24. package/examples/feature/forecasting/r_data.csv +130 -0
  25. package/examples/feature/forecasting/random_data.csv +366 -0
  26. package/examples/feature/line/line-chart.json +124 -0
  27. package/examples/{paired-bar-example.json → feature/paired-bar/paired-bar-example.json} +10 -4
  28. package/examples/{planet-pie-example-config.json → feature/pie/planet-pie-example-config.json} +2 -2
  29. package/examples/{scatterplot.json → feature/scatterplot/scatterplot.json} +1 -1
  30. package/examples/feature/test-highlight/test-highlight-2.json +789 -0
  31. package/examples/feature/test-highlight/test-highlight-vertical.json +561 -0
  32. package/examples/feature/test-highlight/test-highlight.json +100 -0
  33. package/examples/{case-rate-example-config.json → feature/tests-case-rate/case-rate-example-config.json} +2 -2
  34. package/examples/{covid-confidence-example-config.json → feature/tests-covid/covid-confidence-example-config.json} +8 -3
  35. package/examples/{covid-example-config.json → feature/tests-covid/covid-example-config.json} +7 -3
  36. package/examples/{cutoff-example-config.json → feature/tests-cutoff/cutoff-example-config.json} +7 -3
  37. package/examples/{date-exclusions-config.json → feature/tests-date-exclusions/date-exclusions-config.json} +2 -2
  38. package/examples/{example-bar-chart-nonnumeric.json → feature/tests-non-numerics/example-bar-chart-nonnumeric.json} +1 -1
  39. package/examples/{planet-pie-example-config-nonnumeric.json → feature/tests-non-numerics/planet-pie-example-config-nonnumeric.json} +2 -2
  40. package/examples/{sparkline-chart-nonnumeric.json → feature/tests-non-numerics/sparkline-chart-nonnumeric.json} +1 -1
  41. package/examples/{stacked-vertical-bar-example-nonnumerics.json → feature/tests-non-numerics/stacked-vertical-bar-example-nonnumerics.json} +1 -2
  42. package/examples/gallery/bar-chart-horizontal/horizontal-highlight.json +345 -0
  43. package/examples/gallery/bar-chart-vertical/combo-line-chart.json +145 -7
  44. package/examples/gallery/paired-bar/paired-bar-chart.json +1 -0
  45. package/index.html +73 -49
  46. package/package.json +2 -2
  47. package/src/CdcChart.jsx +405 -40
  48. package/src/components/AreaChart.jsx +122 -80
  49. package/src/components/BarChart.jsx +126 -49
  50. package/src/components/BoxPlot.jsx +28 -20
  51. package/src/components/DataTable.jsx +7 -6
  52. package/src/components/DeviationBar.jsx +34 -34
  53. package/src/components/EditorPanel.jsx +1332 -352
  54. package/src/components/Legend.jsx +40 -4
  55. package/src/components/LineChart.jsx +10 -23
  56. package/src/components/LinearChart.jsx +133 -286
  57. package/src/components/PairedBarChart.jsx +6 -6
  58. package/src/components/PieChart.jsx +2 -4
  59. package/src/components/SparkLine.jsx +6 -42
  60. package/src/data/initial-state.js +23 -4
  61. package/src/hooks/useHighlightedBars.js +154 -0
  62. package/src/hooks/useMinMax.js +92 -0
  63. package/src/hooks/useReduceData.js +31 -57
  64. package/src/hooks/useScales.js +202 -0
  65. package/src/index.jsx +2 -1
  66. package/src/scss/editor-panel.scss +15 -0
  67. package/src/scss/main.scss +8 -6
  68. package/examples/box-plot.csv +0 -5
  69. package/examples/dynamic-legends.json +0 -125
  70. package/examples/example-bar-chart.json +0 -36
  71. package/examples/line-chart.json +0 -34
  72. package/examples/temp-example-config.json +0 -64
  73. package/examples/temp-example-data.json +0 -130
  74. package/src/components/Filters.jsx +0 -126
  75. /package/examples/{age-adjusted-rates.json → feature/__data__/age-adjusted-rates.json} +0 -0
  76. /package/examples/{new-data.csv → feature/__data__/new-data.csv} +0 -0
  77. /package/examples/{planet-example-data-max-increase.json → feature/__data__/planet-example-data-max-increase.json} +0 -0
  78. /package/examples/{Barchart_with_negative.json → feature/bar/Barchart_with_negative.json} +0 -0
  79. /package/examples/{stacked-vertical-bar-example-negative.json → feature/bar/stacked-vertical-bar-example-negative.json} +0 -0
  80. /package/examples/{stacked-vertical-bar-example.json → feature/bar/stacked-vertical-bar-example.json} +0 -0
  81. /package/examples/{box-plot-data.json → feature/boxplot/box-plot-data.json} +0 -0
  82. /package/examples/{newdata.json → feature/boxplot/boxplot-data.json} +0 -0
  83. /package/examples/{line-chart-max-increase.json → feature/line/line-chart-max-increase.json} +0 -0
  84. /package/examples/{paired-bar-data.json → feature/paired-bar/paired-bar-data.json} +0 -0
  85. /package/examples/{paired-bar-formatted.json → feature/paired-bar/paired-bar-formatted.json} +0 -0
  86. /package/examples/{scatterplot-continuous.csv → feature/scatterplot/scatterplot-continuous.csv} +0 -0
  87. /package/examples/{example-sparkline.json → feature/sparkline/example-sparkline.json} +0 -0
  88. /package/examples/{big-small-test-bar.json → feature/tests-big-small/big-small-test-bar.json} +0 -0
  89. /package/examples/{big-small-test-line.json → feature/tests-big-small/big-small-test-line.json} +0 -0
  90. /package/examples/{big-small-test-negative.json → feature/tests-big-small/big-small-test-negative.json} +0 -0
  91. /package/examples/{case-rate-example-data.json → feature/tests-case-rate/case-rate-example-data.json} +0 -0
  92. /package/examples/{covid-example-data-confidence.json → feature/tests-covid/covid-example-data-confidence.json} +0 -0
  93. /package/examples/{covid-example-data.json → feature/tests-covid/covid-example-data.json} +0 -0
  94. /package/examples/{cutoff-example-data.json → feature/tests-cutoff/cutoff-example-data.json} +0 -0
  95. /package/examples/{date-exclusions-data.json → feature/tests-date-exclusions/date-exclusions-data.json} +0 -0
  96. /package/examples/{example-combo-bar-nonnumeric.json → feature/tests-non-numerics/example-combo-bar-nonnumeric.json} +0 -0
  97. /package/examples/{line-chart-nonnumeric.json → feature/tests-non-numerics/line-chart-nonnumeric.json} +0 -0
  98. /package/examples/{planet-example-data-nonnumeric.json → feature/tests-non-numerics/planet-example-data-nonnumeric.json} +0 -0
@@ -0,0 +1,202 @@
1
+ import { scaleBand, scaleLinear, scaleLog, scalePoint, scaleTime } from '@visx/scale'
2
+
3
+ const useScales = properties => {
4
+ let { xAxisDataMapped, xMax, yMax, min, max, config, data } = properties
5
+ const seriesDomain = config.runtime.barSeriesKeys || config.runtime.seriesKeys
6
+ const xAxisType = config.runtime.xAxis.type
7
+ const isHorizontal = config.orientation === 'horizontal'
8
+
9
+ // define scxales
10
+ let xScale = null
11
+ let yScale = null
12
+ let g2xScale = null
13
+ let g1xScale = null
14
+ let seriesScale = null
15
+
16
+ const scaleTypes = {
17
+ TIME: 'time',
18
+ LOG: 'log',
19
+ POINT: 'point',
20
+ LINEAR: 'linear',
21
+ BAND: 'band'
22
+ }
23
+
24
+ // handle Horizontal bars
25
+ if (isHorizontal) {
26
+ xScale = composeXScale({ min: min * 1.03, ...properties })
27
+ xScale.type = config.useLogScale ? scaleTypes.LOG : scaleTypes.LINEAR
28
+ yScale = getYScaleFunction(xAxisType, xAxisDataMapped)
29
+ yScale.rangeRound([0, yMax])
30
+ seriesScale = composeScalePoint(seriesDomain, [0, yMax])
31
+ }
32
+
33
+ // handle Vertical bars
34
+ if (!isHorizontal) {
35
+ xScale = composeScalePoint(xAxisDataMapped, [0, xMax], 0.5)
36
+ xScale.type = scaleTypes.POINT
37
+
38
+ // if (config.visualizationType === 'Bar') {
39
+ // xScale = scaleBand({
40
+ // domain: xAxisDataMapped,
41
+ // range: [0, xMax],
42
+ // padding: 0.4
43
+ // })
44
+ // xScale.type = scaleTypes.BAND
45
+ // }
46
+ yScale = composeYScale(properties)
47
+ seriesScale = composeScalePoint(seriesDomain, [0, xMax])
48
+ }
49
+
50
+ // handle Area chart
51
+ if (config.visualizationType === 'Area Chart' && config.xAxis.type === 'date') {
52
+ xScale = scaleTime({
53
+ domain: [Math.min(...xAxisDataMapped), Math.max(...xAxisDataMapped)],
54
+ range: [0, xMax]
55
+ })
56
+ xScale.type = scaleTypes.TIME
57
+ }
58
+
59
+ // handle Deviation bar
60
+ if (config.visualizationType === 'Deviation Bar') {
61
+ const leftOffset = config.isLollipopChart ? 1.05 : 1.03
62
+ yScale = scaleBand({
63
+ domain: xAxisDataMapped,
64
+ range: [0, yMax]
65
+ })
66
+ xScale = scaleLinear({
67
+ domain: [min * leftOffset, Math.max(Number(config.xAxis.target), max)],
68
+ range: [0, xMax],
69
+ round: true,
70
+ nice: true
71
+ })
72
+ xScale.type = scaleTypes.LINEAR
73
+ }
74
+
75
+ // handle Scatter plot
76
+ if (config.visualizationType === 'Scatter Plot') {
77
+ if (config.xAxis.type === 'continuous') {
78
+ xScale = scaleLinear({
79
+ domain: [0, Math.max.apply(null, xScale.domain())],
80
+ range: [0, xMax]
81
+ })
82
+ xScale.type = scaleTypes.LINEAR
83
+ }
84
+ }
85
+
86
+ // handle Box plot
87
+ if (config.visualizationType === 'Box Plot') {
88
+ const allOutliers = []
89
+ const hasOutliers = config.boxplot.plots.map(b => b.columnOutliers.map(outlier => allOutliers.push(outlier))) && !config.boxplot.hideOutliers
90
+
91
+ // check if outliers are lower
92
+ if (hasOutliers) {
93
+ let outlierMin = Math.min(...allOutliers)
94
+ let outlierMax = Math.max(...allOutliers)
95
+
96
+ // check if outliers exceed standard bounds
97
+ if (outlierMin < min) min = outlierMin
98
+ if (outlierMax > max) max = outlierMax
99
+ }
100
+
101
+ // check fences for max/min
102
+ let lowestFence = Math.min(...config.boxplot.plots.map(item => item.columnLowerBounds))
103
+ let highestFence = Math.max(...config.boxplot.plots.map(item => item.columnUpperBounds))
104
+
105
+ if (lowestFence < min) min = lowestFence
106
+ if (highestFence > max) max = highestFence
107
+
108
+ // Set Scales
109
+ yScale = scaleLinear({
110
+ range: [yMax, 0],
111
+ round: true,
112
+ domain: [min, max]
113
+ })
114
+
115
+ xScale = scaleBand({
116
+ range: [0, xMax],
117
+ round: true,
118
+ domain: config.boxplot.categories,
119
+ padding: 0.4
120
+ })
121
+ xScale.type = scaleTypes.BAND
122
+ }
123
+
124
+ // handle Paired bar
125
+ if (config.visualizationType === 'Paired Bar') {
126
+ const offset = 1.02 // Offset of the ticks/values from the Axis
127
+ let groupOneMax = Math.max.apply(
128
+ Math,
129
+ data.map(d => d[config.series[0].dataKey])
130
+ )
131
+ let groupTwoMax = Math.max.apply(
132
+ Math,
133
+ data.map(d => d[config.series[1].dataKey])
134
+ )
135
+
136
+ // group one
137
+ g1xScale = scaleLinear({
138
+ domain: [0, Math.max(groupOneMax, groupTwoMax) * offset],
139
+ range: [xMax / 2, 0]
140
+ })
141
+
142
+ // group 2
143
+ g2xScale = scaleLinear({
144
+ domain: g1xScale.domain(),
145
+ range: [xMax / 2, xMax],
146
+ nice: true
147
+ })
148
+ }
149
+
150
+ return { xScale, yScale, seriesScale, g1xScale, g2xScale }
151
+ }
152
+
153
+ export default useScales
154
+
155
+ /// helper functions
156
+ const composeXScale = ({ min, max, xMax, config }) => {
157
+ // Adjust min value if using logarithmic scale
158
+ min = config.useLogScale && min >= 0 && min < 1 ? min + 0.1 : min
159
+ // Select the appropriate scale function
160
+ const scaleFunc = config.useLogScale ? scaleLog : scaleLinear
161
+ // Return the configured scale function
162
+ return scaleFunc({
163
+ domain: [min, max],
164
+ range: [0, xMax],
165
+ nice: config.useLogScale,
166
+ zero: config.useLogScale,
167
+ type: config.useLogScale ? 'log' : 'linear'
168
+ })
169
+ }
170
+
171
+ const composeYScale = ({ min, max, yMax, config }) => {
172
+ // Adjust min value if using logarithmic scale
173
+ min = config.useLogScale && min >= 0 && min < 1 ? min + 0.1 : min
174
+ // Select the appropriate scale function
175
+ const scaleFunc = config.useLogScale ? scaleLog : scaleLinear
176
+ // Return the configured scale function
177
+ return scaleFunc({
178
+ domain: [min, max],
179
+ range: [yMax, 0],
180
+ nice: config.useLogScale,
181
+ zero: config.useLogScale
182
+ })
183
+ }
184
+
185
+ const getYScaleFunction = (xAxisType, xAxisDataMapped) => {
186
+ if (xAxisType === 'date') {
187
+ return scaleLinear({
188
+ domain: [Math.min(...xAxisDataMapped), Math.max(...xAxisDataMapped)]
189
+ })
190
+ } else {
191
+ return scalePoint({ domain: xAxisDataMapped, padding: 0.5 })
192
+ }
193
+ }
194
+
195
+ const composeScalePoint = (domain, range, padding = 0) => {
196
+ return scalePoint({
197
+ domain: domain,
198
+ range: range,
199
+ padding: padding,
200
+ type: 'point'
201
+ })
202
+ }
package/src/index.jsx CHANGED
@@ -6,11 +6,12 @@ import CdcChart from './CdcChart'
6
6
  import 'react-tooltip/dist/react-tooltip.css'
7
7
 
8
8
  let isEditor = window.location.href.includes('editor=true')
9
+ let isDebug = window.location.href.includes('debug=true')
9
10
 
10
11
  let domContainer = document.getElementsByClassName('react-container')[0]
11
12
 
12
13
  ReactDOM.createRoot(domContainer).render(
13
14
  <React.StrictMode>
14
- <CdcChart configUrl={domContainer.attributes['data-config'].value} isEditor={isEditor} />
15
+ <CdcChart configUrl={domContainer.attributes['data-config'].value} isEditor={isEditor} isDebug={isDebug} />
15
16
  </React.StrictMode>
16
17
  )
@@ -75,11 +75,16 @@
75
75
  align-items: center;
76
76
  justify-content: space-between;
77
77
  font-size: 0.9em;
78
+ position: relative;
78
79
 
79
80
  &:hover {
80
81
  background-color: $lightestGray;
81
82
  }
82
83
 
84
+ div {
85
+ width: 100%;
86
+ }
87
+
83
88
  .series-list__name {
84
89
  position: relative;
85
90
  user-select: none;
@@ -132,7 +137,13 @@
132
137
  }
133
138
 
134
139
  .series-list__dropdown {
140
+ width: 100%;
141
+ display: block;
135
142
  font-size: 0.8em;
143
+ margin-bottom: 10px;
144
+ select {
145
+ width: 100%;
146
+ }
136
147
  }
137
148
 
138
149
  .series-list__remove {
@@ -140,6 +151,9 @@
140
151
  font-size: 1.125rem;
141
152
  color: #f00;
142
153
  cursor: pointer;
154
+ position: absolute;
155
+ top: 5px;
156
+ right: 5px;
143
157
  }
144
158
 
145
159
  + li {
@@ -150,6 +164,7 @@
150
164
 
151
165
  .series-list__name-text {
152
166
  max-width: 150px;
167
+ margin-bottom: 10px;
153
168
  white-space: nowrap;
154
169
  text-overflow: ellipsis;
155
170
  overflow: hidden;
@@ -231,9 +231,13 @@
231
231
  }
232
232
  }
233
233
 
234
+ .visx-tooltip {
235
+ z-index: 100000;
236
+ }
237
+
234
238
  .tooltip {
235
- border: rgba(0,0,0,.3) 1px solid;
236
- box-shadow: rgba(0,0,0,.1) 3px 3px 7px;
239
+ border: rgba(0, 0, 0, 0.3) 1px solid;
240
+ box-shadow: rgba(0, 0, 0, 0.1) 3px 3px 7px;
237
241
  opacity: 1;
238
242
  line-height: 1.4em;
239
243
  font-size: 1em;
@@ -242,8 +246,8 @@
242
246
  z-index: 1;
243
247
 
244
248
  .react-tooltip-arrow {
245
- border-bottom: rgba(0,0,0,.3) 1px solid;
246
- border-right: rgba(0,0,0,.3) 1px solid;
249
+ border-bottom: rgba(0, 0, 0, 0.3) 1px solid;
250
+ border-right: rgba(0, 0, 0, 0.3) 1px solid;
247
251
  backface-visibility: hidden;
248
252
  }
249
253
  }
@@ -337,8 +341,6 @@
337
341
  }
338
342
 
339
343
  &__wrapper {
340
- margin-bottom: 40px;
341
-
342
344
  hr {
343
345
  margin-bottom: 20px;
344
346
  }
@@ -1,5 +0,0 @@
1
- x,min,firstQuartile,median,thirdQuartile,max,outliers
2
- Group 1,-3.529439249291613,2.498913996933074,6,6.517816161082865,12.546169407307552,-4.222649440089676,-3.7995254226812145,12.669680018702707,,,,,,,,,,,,
3
- Group 2,-2.961278855962981,3.1553763355078277,5.31642875968012,7.233146463155033,13.349801654625843,-4.5962772985737645,14.42798091207488,14.832072412460995,,,,,,,,,,,,
4
- Group 3,-0.784362943544294,5.600233888319485,7.606034555385235,9.85663177622867,16.24122860809245,-2.0568265981730285,-2.036299998010181,-1.634595257757523,-0.9751707921193091,-0.9256799494292718,-0.813852054679872,16.255225428689318,19.221712546396496,,,,,,,
5
- Group 4,-3.4976011611041598,2.362493132101971,4.364242960871863,6.269222660906058,12.129316954112188,-5.912277243480174,-4.535668956980487,-4.255719319016919,-4.175200716132927,-4.1021204775116455,-3.7913796362224352,-3.6909919981778567,-3.6261129831962697,12.169135739844744,12.1724073804239,12.191268834215071,12.236896118210165,12.34513716605812,12.826785108558722,13.048968511771164
@@ -1,125 +0,0 @@
1
- {
2
- "type": "chart",
3
- "title": "Example Line Chart",
4
- "theme": "theme-green",
5
- "fontSize": "medium",
6
- "height": "375",
7
- "padding": {
8
- "left": 5,
9
- "right": 5
10
- },
11
- "yAxis": {
12
- "size": "75",
13
- "gridLines": false,
14
- "label": "Y-Axis Example Label",
15
- "numTicks": "9"
16
- },
17
- "barThickness": 0.35,
18
- "xAxis": {
19
- "size": "77",
20
- "tickRotation": "25",
21
- "dataKey": "Date",
22
- "label": "X-Axis Example Label",
23
- "type": "date",
24
- "dateParseFormat": "%d/%m/%Y",
25
- "dateDisplayFormat": "%d/%m/%Y"
26
- },
27
- "table": {
28
- "label": "Data Table",
29
- "expanded": true,
30
- "download": true
31
- },
32
- "legend": {
33
- "behavior": "isolate",
34
- "position": "right",
35
- "label": "Type of Data",
36
- "dynamicLegend": false
37
- },
38
- "palette": "qualitative-bold",
39
- "labels": false,
40
- "dataFormat": {},
41
- "confidenceKeys": {},
42
- "data": [
43
- {
44
- "Date": "1/15/2016",
45
- "Alabama": "90",
46
- "Alaska": "135",
47
- "Arizona": "300",
48
- "Arkansas": "95",
49
- "California": "120",
50
- "Colorado": "310"
51
- },
52
- {
53
- "Date": "2/15/2016",
54
- "Alabama": "40",
55
- "Alaska": "90",
56
- "Arizona": "240",
57
- "Arkansas": "60",
58
- "California": "160",
59
- "Colorado": "200"
60
- },
61
- {
62
- "Date": "3/15/2016",
63
- "Alabama": "50",
64
- "Alaska": "300",
65
- "Arizona": "290",
66
- "Arkansas": "100",
67
- "California": "200",
68
- "Colorado": "250"
69
- },
70
- {
71
- "Date": "4/15/2016",
72
- "Alabama": "120",
73
- "Alaska": "160",
74
- "Arizona": "230",
75
- "Arkansas": "180",
76
- "California": "160",
77
- "Colorado": "220"
78
- },
79
- {
80
- "Date": "5/15/2016",
81
- "Alabama": "80",
82
- "Alaska": "350",
83
- "Arizona": "300",
84
- "Arkansas": "150",
85
- "California": "130",
86
- "Colorado": "100"
87
- },
88
- {
89
- "Date": "6/15/2016",
90
- "Alabama": "90",
91
- "Alaska": "220",
92
- "Arizona": "320",
93
- "Arkansas": "100",
94
- "California": "220",
95
- "Colorado": "300"
96
- }
97
- ],
98
- "visualizationType": "Line",
99
- "series": [
100
- {
101
- "dataKey": "Alabama",
102
- "type": "Bar"
103
- },
104
- {
105
- "dataKey": "Alaska",
106
- "type": "Bar"
107
- },
108
- {
109
- "dataKey": "Arizona",
110
- "type": "Bar"
111
- },
112
- {
113
- "dataKey": "Arkansas",
114
- "type": "Bar"
115
- },
116
- {
117
- "dataKey": "California",
118
- "type": "Bar"
119
- },
120
- {
121
- "dataKey": "Colorado",
122
- "type": "Bar"
123
- }
124
- ]
125
- }
@@ -1,36 +0,0 @@
1
- {
2
- "type": "chart",
3
- "title": "Example Bar Chart",
4
- "theme": "theme-blue",
5
- "fontSize": "medium",
6
- "height": 300,
7
- "padding": { "left": 5, "right": 5 },
8
- "yAxis": { "size": "76", "gridLines": false, "label": "Y Axis Example Label" },
9
- "barThickness": "0.6",
10
- "xAxis": { "size": "59", "tickRotation": 0, "dataKey": "Date", "label": "X Axis Example Label" },
11
- "table": { "label": "Data Type by Date", "expanded": true },
12
- "legend": { "behavior": "isolate", "position": "right", "label": "Type of Data" },
13
- "palette": "qualitative-bold",
14
- "labels": false,
15
- "dataFormat": { "suffix": " units" },
16
- "confidenceKeys": {},
17
- "data": [
18
- { "Date": "1/15/2016", "Data 1": "90", "Data 2": "135", "Data 3": "300", "Data 4": "95", "Data 5": "120", "Data 6": "310" },
19
- { "Date": "2/15/2016", "Data 1": "40", "Data 2": "90", "Data 3": "240", "Data 4": "60", "Data 5": "160", "Data 6": "200" },
20
- { "Date": "3/15/2016", "Data 1": "50", "Data 2": "300", "Data 3": "290", "Data 4": "100", "Data 5": "200", "Data 6": "250" },
21
- { "Date": "4/15/2016", "Data 1": "120", "Data 2": "160", "Data 3": "230", "Data 4": "180", "Data 5": "160", "Data 6": "220" },
22
- { "Date": "5/15/2016", "Data 1": "80", "Data 2": "350", "Data 3": "300", "Data 4": "150", "Data 5": "130", "Data 6": "100" },
23
- { "Date": "6/15/2016", "Data 1": "90", "Data 2": "220", "Data 3": "320", "Data 4": "100", "Data 5": "220", "Data 6": "300" }
24
- ],
25
- "visualizationType": "Bar",
26
- "series": [
27
- { "dataKey": "Data 1", "type": "Bar" },
28
- { "dataKey": "Data 2", "type": "Bar" },
29
- { "dataKey": "Data 3", "type": "Bar" },
30
- { "dataKey": "Data 4", "type": "Bar" },
31
- { "dataKey": "Data 5", "type": "Bar" },
32
- { "dataKey": "Data 6", "type": "Bar" }
33
- ],
34
- "description": "This example shows a bar chart created in the visualization editor in WCMS",
35
- "dataCutoff": "0"
36
- }
@@ -1,34 +0,0 @@
1
- {
2
- "type": "chart",
3
- "title": "Example Line Chart",
4
- "theme": "theme-green",
5
- "fontSize": "medium",
6
- "height": "375",
7
- "padding": { "left": 5, "right": 5 },
8
- "yAxis": { "size": "75", "gridLines": false, "label": "Y-Axis Example Label", "numTicks": "9" },
9
- "barThickness": 0.35,
10
- "xAxis": { "size": "77", "tickRotation": "25", "dataKey": "Date", "label": "X-Axis Example Label", "type": "date", "dateParseFormat": "%d/%m/%Y", "dateDisplayFormat": "%d/%m/%Y" },
11
- "table": { "label": "Data Table", "expanded": true, "download": true },
12
- "legend": { "behavior": "isolate", "position": "right", "label": "Type of Data" },
13
- "palette": "qualitative-bold",
14
- "labels": false,
15
- "dataFormat": {},
16
- "confidenceKeys": {},
17
- "data": [
18
- { "Date": "1/15/2016", "Data 1": "90", "Data 2": "135", "Data 3": "300", "Data 4": "95", "Data 5": "120", "Data 6": "310" },
19
- { "Date": "2/15/2016", "Data 1": "40", "Data 2": "90", "Data 3": "240", "Data 4": "60", "Data 5": "160", "Data 6": "200" },
20
- { "Date": "3/15/2016", "Data 1": "50", "Data 2": "300", "Data 3": "290", "Data 4": "100", "Data 5": "200", "Data 6": "250" },
21
- { "Date": "4/15/2016", "Data 1": "120", "Data 2": "160", "Data 3": "230", "Data 4": "180", "Data 5": "160", "Data 6": "220" },
22
- { "Date": "5/15/2016", "Data 1": "80", "Data 2": "350", "Data 3": "300", "Data 4": "150", "Data 5": "130", "Data 6": "100" },
23
- { "Date": "6/15/2016", "Data 1": "90", "Data 2": "220", "Data 3": "320", "Data 4": "100", "Data 5": "220", "Data 6": "300" }
24
- ],
25
- "visualizationType": "Line",
26
- "series": [
27
- { "dataKey": "Data 1", "type": "Line" },
28
- { "dataKey": "Data 2", "type": "Line" },
29
- { "dataKey": "Data 3", "type": "Line" },
30
- { "dataKey": "Data 4", "type": "Line" },
31
- { "dataKey": "Data 5", "type": "Line" },
32
- { "dataKey": "Data 6", "type": "Line" }
33
- ]
34
- }
@@ -1,64 +0,0 @@
1
- {
2
- "title": "Average Temperature By City (Line Example)",
3
- "description": "<p>Average temperature from October 1st through August 29th in:</p><ul><li>New York</li><li>San Francisco</li><li>Austin</li></ul>",
4
- "dataUrl": "/examples/temp-example-data.json",
5
- "visualizationType": "Line",
6
- "series": [
7
- { "dataKey": "New York", "label": "NY" },
8
- { "dataKey": "San Francisco", "label": "SF" },
9
- { "dataKey": "Austin", "label": "AU" }
10
- ],
11
- "filters": [
12
- {
13
- "label": "Wind",
14
- "columnName": "wind"
15
- },
16
- {
17
- "label": "Humidity",
18
- "columnName": "humidity"
19
- }
20
- ],
21
- "seriesLabel": "City",
22
- "fontSize": "large",
23
- "dataFormat": {
24
- "commas": false,
25
- "prefix": "",
26
- "suffix": "°"
27
- },
28
- "padding": {
29
- "left": 15,
30
- "right": 15
31
- },
32
- "yAxis": {
33
- "label": "Temperature",
34
- "paddingPercent": 0.15
35
- },
36
- "xAxis": {
37
- "label": "Date",
38
- "dataKey": "date",
39
- "type": "date",
40
- "dateParseFormat": "%Y-%m-%d",
41
- "dateDisplayFormat": "%b %d",
42
- "numTicks": 8,
43
- "tickRotation": 50
44
- },
45
- "legend": {
46
- "label": "Legend",
47
- "above": true,
48
- "left": true
49
- },
50
- "table": {
51
- "label": "Data Table",
52
- "expanded": false,
53
- "download": true
54
- },
55
- "regions": [
56
- {
57
- "label": "Region",
58
- "color": "black",
59
- "background": "green",
60
- "from": "2011-10-02",
61
- "to": "2011-10-03"
62
- }
63
- ]
64
- }