This repository was archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsettings.js
250 lines (246 loc) · 6.92 KB
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
let stateIds =
[
{ value: 1, label: 'AK' },
{ value: 30, label: 'NY' },
{ value: 2, label: 'AZ' },
{ value: 31, label: 'NC' },
{ value: 3, label: 'AR' },
{ value: 32, label: 'ND' },
{ value: 4, label: 'CA' },
{ value: 33, label: 'OH' },
{ value: 5, label: 'CO' },
{ value: 34, label: 'OK' },
{ value: 6, label: 'CT' },
{ value: 35, label: 'OR' },
{ value: 7, label: 'DE' },
{ value: 36, label: 'PA' },
{ value: 8, label: 'FL' },
{ value: 7, label: 'RI' },
{ value: 9, label: 'GA' },
{ value: 38, label: 'SC' },
{ value: 10, label: 'ID' },
{ value: 39, label: 'SD' },
{ value: 11, label: 'IL' },
{ value: 40, label: 'TN' },
{ value: 12, label: 'IA' },
{ value: 41, label: 'TX' },
{ value: 13, label: 'IA' },
{ value: 42, label: 'UT' },
{ value: 14, label: 'KS' },
{ value: 43, label: 'VT' },
{ value: 15, label: 'KT' },
{ value: 44, label: 'VA' },
{ value: 16, label: 'LA' },
{ value: 45, label: 'WA' },
{ value: 17, label: 'ME' },
{ value: 46, label: 'WV' },
{ value: 18, label: 'MD' },
{ value: 47, label: 'WI' },
{ value: 19, label: 'MA' },
{ value: 48, label: 'WY' },
{ value: 20, label: 'MI' },
{ value: 21, label: 'MN' },
{ value: 22, label: 'MI' },
{ value: 103, label: 'Central Region' },
{ value: 23, label: 'MO' },
{ value: 24, label: 'MT' },
{ value: 25, label: 'NE' },
{ value: 106, label: 'South Region' },
{ value: 26, label: 'NV' },
{ value: 27, label: 'NH' },
{ value: 28, label: 'NJ' },
{ value: 29, label: 'NM' },
{ value: 50, label: 'USA?'}
];
export var settings = {
title: 'React-Dash v0.6.x -- Climate Indices by Year',
queries: {},
doFilterRouting: false,
// start dataResources example
dataResources: {
climateData: {
fetchData: {
type: 'backend',
backend: 'csv',
url: 'https://dl.dropboxusercontent.com/u/73703010/react_dash_data_0.4/climate_indices.csv'
},
}
// end dataResources example
},
regions: [
{
id: 'top-row filters-row',
className: 'row',
children: [
{
type: 'Autocomplete',
className: 'col-md-6',
name: 'specialty-autocomplete',
id: 'specialty-autocomplete',
className: 'specialty-autocomplete',
field: 'YearMonth',
action: 'filter', // sort / groupBy / etc
willFilter: ['climateData'], // array of dkanDataResources keys that filters affect
data: [
[
{ label: '2010', value: '2010' },
{ label: '2011', value: '2011' },
{ label: '2012', value: '2012' },
{ label: '2013', value: '2013' },
{ label: '2014', value: '2014' },
{ label: '2015', value: '2015' },
]
],
placeholder: 'Select year to filter dashboard...'
}
]
},
{
id: 'metrics-row',
className: 'row',
children: [
{
type: 'Metric',
cardStyle: 'metric',
iconClass: 'fa fa-level-up',
className: 'col-md-4',
background: "#00b3b3",
caption: 'Maximum Temp.',
dataHandlers: [
{
name: 'getClimateMetric',
field: 'TMAX'
},
],
// start stateHandler example
stateHandlers: [
{
name: 'getMaxTempMetricColor',
attr: 'bg'
}
]
// end stateHandler example
},
{
type: 'Metric',
cardStyle: 'metric',
iconClass: 'fa fa-level-down',
className: 'col-md-4',
background: '#009999',
caption: 'Minimum Temp.',
dataHandlers: [
{
name: 'getClimateMetric',
field: 'TMIN'
}
]
},
{
type: 'Metric',
cardStyle: 'metric',
iconClass: 'fa fa-fire',
className: 'col-md-4',
caption: 'Average Temp/',
background: '#004d4d',
dataHandlers: [
{
name: 'getClimateMetric',
field: 'TAVG'
}
]
}
]
},
{
id: 'map-row',
className: 'row',
children: [
// choropleth
{
type: 'Choropleth',
cardStyle: 'map',
iconClass: 'fa fa-balance-scale',
header: 'Palmer Hydrological Drought Index',
format: 'topojson',
dataHandlers: [
{
name: 'getMapData',
stateArray: stateIds
}
],
dataKeyField: 'name',
dataValueField: 'PHDI',
geometryKeyField: 'name',
geometry: 'https://dl.dropboxusercontent.com/u/73703010/react_dash_data_0.4/map/usa.json', // topojson or geojson
projection: 'albersUsa', // https://github.com/d3/d3/wiki/Geo-Projections
scaleDenominator: .75,
borderColor: 'yellow',
noDataColor: 'yellow',
topologyObject: 'usa',
startColor: '#e6ffff',
endColor: '#004d4d',
dataClassification: 'equidistant',
legend: {
classesCount: 5,
pallete:
[
"#e6ffff",
"#00ffff",
"#00cccc",
"#00b3b3",
"#009999",
"#008080",
"#004d4d"
]
},
},
]
},
{
id: 'chart-row',
className: 'row',
children: [
{
type: 'Chart',
cardStyle: 'chart',
header: 'Standard Precipitation Index',
iconClass: 'fa fa-cloud',
// start dataHandler example
dataHandlers: [
{
name: 'getBarChartData',
indicators: [ 'SP01', 'SP06', 'SP12', 'SP24' ],
colors: [ '#edf8fb', '#ccece6', '#99d8c9', '#66c2a4', '#2ca25f', '#006d2c']
}
],
// end dataHandler example
stateHandlers: [
{
name: 'isStatSignificant',
attr: 'footer'
}
],
settings: {
type: 'multiBarChart',
x: 'x',
y: 'y',
height: 800
}
}
]
}
]
}
let climateVars = {
PCP: 'Precipitation Index',
TAVG: 'Temperature Index',
TMIN: 'Minimum Temperature Index',
TMAX: 'Maximum Temperature Index',
PDSI: 'Palmer Drought Severity Index',
PHDI: 'Palmer Hydrological Drought Index',
ZNDX: 'Palmer Z-Index',
PMDI: 'Modified Palmer Drought Severity Index',
CDD: 'Cooling Degree Days',
HDD: 'Heating Degree Days',
SPnn: 'Standard Precipitation Index'
};