-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
77 lines (68 loc) · 2.94 KB
/
config.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
var config = {
/* name of the data file; use key `csv` if data file is CSV format */
json: 'coal.json',
/* define the column and associated values for color application */
color: {
field: 'status',
values: {
'operating': 'red',
'construction': 'blue',
'announced': 'green',
'permitted': 'green',
'pre-permit': 'green',
'retired': 'grey',
'cancelled': 'grey',
'mothballed': 'grey',
'shelved': 'grey'
}
},
/* define the column and values used for the filter UI. There can be multiple filters listed.
Additionally a custom `label` can be defined (default is the field),
and `values_label` (an array matching elements in `values`)
*/
filters: [
{
field: 'status',
values: ['operating','construction','announced','permitted','pre-permit','retired','cancelled','mothballed','shelved'],
}
],
/* define the field for calculating and showing capacity along with label.
this is defined per tracker since it varies widely */
capacityField: 'capacity',
capacityLabel: 'Capacity (MW)',
/* Labels for describing the assets */
assetFullLabel: "Coal-fired Units",
assetLabel: 'units',
/* the column that contains the asset name. this varies between trackers */
nameField: 'plant',
/* configure the table view, selecting which columns to show, how to label them,
and designated which column has the link */
tableHeaders: {
values: ['plant','unit','chinese_name','owner', 'parent', 'capacity', 'status', 'region', 'country', 'subnational', 'year'],
labels: ['Plant','Unit','Chinese Name','Owner','Parent','Capacity (MW)','Status','Region','Country','Subnational unit (province/state)','Start year'],
clickColumns: ['plant'],
rightAlign: ['unit','capacity','year']
},
/* configure the search box;
each label has a value with the list of fields to search. Multiple fields might be searched */
searchFields: { 'Plant': ['plant'],
'Companies': ['owner', 'parent'],
'Start Year': ['start_year']
},
/* define fields and how they are displayed.
`'display': 'heading'` displays the field in large type
`'display': 'range'` will show the minimum and maximum values.
`'display': 'join'` will join together values with a comma separator
`'display': 'location'` will show the fields over the detail image
`'label': '...'` prepends a label. If a range, two values for singular and plural.
*/
detailView: {
'plant': {'display': 'heading'},
'chinese_name': {},
'owner': {'label': 'Owner'},
'parent': {'label': 'Parent'},
'year': {'display': 'range', 'label': ['Start Year', 'Start Year Range']},
'subnational': {'display': 'location'},
'country': {'display': 'location'}
}
}