-
Notifications
You must be signed in to change notification settings - Fork 0
/
baseEsriChartSpec.js
199 lines (158 loc) · 5.13 KB
/
baseEsriChartSpec.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
// Feature layer
const featureLayer = {
"url": "<fs-url>",
"title": "blahblah",
"id": "123455",
"layerType": "ArcGISFeatureLayer",
"visibility": true,
"opacity": 1,
"layerDefinition": {
"charts": [{chartSpec}] // Not sure if charts lives in layerDefinition or at the top level
}
};
// Chart
const chartSpec = {
type: 'chart',
name: 'blah', // point of the difference between name and title?
title: 'blah',
subTitle: 'blah blah blah',
footer: 'string',
theme: 'string' // What goes here?
series: [chartSeriesSpec], // Types: scatter, bar, line, histogram, etc
legend: [chartLegendSpec], // chart legend object
axes: [chartAxesSpec], // chart axes object
metadata: 'string' // what would be contained here
};
// legend spec
const chartLegendSpec = {
type: 'chartLegend',
// chart legend
visible: true, // boolean default is true
title: 'string',
alignment: 'left|right|top|bottom',
valueFormat: 'string' // What is?
};
// axis
const chartAxisSpec = {
type: 'chartAxis',
// chart axis
id: 'unique-axis-id' // not needed, I don't think
visible: true, // boolean default true
isLogarithmic: false, // boolean default false - how would this play in for us
title: 'string',
valueFormat: 'string', // ??
dateTimeFormat: 'string',
calculateAutomaticMinimum: true, //boolean default true
calculateAutomaticMaximum: true, // boolean default true
minimum: 'number',
maximum: 'number'
};
// chart series
// scatter series
const scatterChartSeriesSpec = {
type: 'scatterSeries',
// chartSeries
title: 'string',
query: {
where: 'where-clause',
outStatistics: [{
onStatisticField: 'fs_field_name', // actual field name from the data
statisticType: '<count | sum | min | max | avg | stddev | var>', // what is var?
outStatisticFieldName: 'uniqueFieldName'
}], // other outstatistics here
groupByFieldsForStatistics: 'field1,field2',
orderByFields: 'field1,field2'
},
x: 'field-name',
y: 'field-name',
showLabels: false, // boolean default false
horizontalAxisId: 'axis-id',
verticalAxisId: 'axis-id',
colorType: 'singleColor|colorMatch', // default singleColor could inherit site colors here
// scatterSeries
markerSymbol: {esriSMS}, // would have to toss and bring in our own
// future concepts.....
visualVariables: [{}] // specifics to chart
};
// bar series
const barSeriesSpec = {
type: 'barSeries',
// chartSeries
title: 'string',
query: {
where: 'where-clause',
outStatistics: [{
onStatisticField: 'fs_field_name', // actual field name from the data
statisticType: '<count | sum | min | max | avg | stddev | var>', // what is var?
outStatisticFieldName: 'uniqueFieldName'
}], // other outstatistics here
groupByFieldsForStatistics: 'field1,field2',
orderByFields: 'field1,field2'
},
x: 'field-name',
y: 'field-name',
showLabels: false, // boolean default false
horizontalAxisId: 'axis-id',
verticalAxisId: 'axis-id',
colorType: 'singleColor|colorMatch', // default singleColor could inherit site colors here
// barSeries
multipleBarType: 'none|sideBySide|stacked|stacked100', // what is stacked100?
barSize: 'long', //default: 90 ??????
fillSymbol: {esriSFS} // Pull in our own stuff
};
// line series
const lineSeriesSpec = {
type: 'lineSeries',
// chartSeries
title: 'string',
query: {
where: 'where-clause',
outStatistics: [{
onStatisticField: 'fs_field_name', // actual field name from the data
statisticType: '<count | sum | min | max | avg | stddev | var>', // what is var?
outStatisticFieldName: 'uniqueFieldName'
}], // other outstatistics here
groupByFieldsForStatistics: 'field1,field2',
orderByFields: 'field1,field2'
},
x: 'field-name',
y: 'field-name',
showLabels: false, // boolean default false
horizontalAxisId: 'axis-id',
verticalAxisId: 'axis-id',
colorType: 'singleColor|colorMatch', // default singleColor could inherit site colors here
// lineSeries
lineSymbol: {esriSLS},
markerSymbol: {esriSMS} // need to figure out how to translate into our own
};
// histogram series
const histogramSeriesSpec = {
type: 'histogramSeries',
// chartSeries
title: 'string',
query: {
where: 'where-clause',
outStatistics: [{
onStatisticField: 'fs_field_name', // actual field name from the data
statisticType: '<count | sum | min | max | avg | stddev | var>', // what is var?
outStatisticFieldName: 'uniqueFieldName'
}], // other outstatistics here
groupByFieldsForStatistics: 'field1,field2',
orderByFields: 'field1,field2'
},
x: 'field-name',
y: 'field-name',
showLabels: false, // boolean default false
horizontalAxisId: 'axis-id',
verticalAxisId: 'axis-id',
colorType: 'singleColor|colorMatch', // default singleColor could inherit site colors here
//histogramSeries
binCount: 'long', // default 8
showMean: false, // boolean default false
showMediam: false, // boolean default false
showStandardDeviation: false, // boolean default false
fillSymbol: {esriSFS},
meanLineSymbol: {esriSLS},
medianLineSymbol: {esriSLS},
standardDeviationSymbol: {esriSFS}
};