@malloydata/render 0.0.24-dev230224214106 → 0.0.24-dev230301165401

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 (58) hide show
  1. package/dist/data_styles.d.ts +27 -27
  2. package/dist/drill.d.ts +1 -1
  3. package/dist/drill.js +12 -12
  4. package/dist/html/bar_chart.d.ts +4 -4
  5. package/dist/html/bar_chart.js +5 -5
  6. package/dist/html/boolean.d.ts +2 -2
  7. package/dist/html/bytes.d.ts +2 -2
  8. package/dist/html/bytes.js +1 -1
  9. package/dist/html/cartesian_chart.d.ts +4 -4
  10. package/dist/html/cartesian_chart.js +30 -30
  11. package/dist/html/chart.d.ts +5 -5
  12. package/dist/html/chart.js +10 -10
  13. package/dist/html/container.d.ts +3 -3
  14. package/dist/html/currency.d.ts +2 -2
  15. package/dist/html/currency.js +4 -4
  16. package/dist/html/dashboard.d.ts +3 -3
  17. package/dist/html/dashboard.js +32 -31
  18. package/dist/html/date.d.ts +2 -2
  19. package/dist/html/date.js +2 -2
  20. package/dist/html/html_view.d.ts +3 -3
  21. package/dist/html/html_view.js +40 -40
  22. package/dist/html/image.d.ts +2 -2
  23. package/dist/html/image.js +2 -2
  24. package/dist/html/index.d.ts +1 -1
  25. package/dist/html/json.d.ts +2 -2
  26. package/dist/html/json.js +2 -2
  27. package/dist/html/line_chart.d.ts +4 -4
  28. package/dist/html/line_chart.js +6 -6
  29. package/dist/html/link.d.ts +2 -2
  30. package/dist/html/link.js +4 -4
  31. package/dist/html/list.d.ts +3 -3
  32. package/dist/html/list.js +7 -7
  33. package/dist/html/list_detail.d.ts +2 -2
  34. package/dist/html/number.d.ts +2 -2
  35. package/dist/html/percent.d.ts +2 -2
  36. package/dist/html/percent.js +1 -1
  37. package/dist/html/point_map.d.ts +4 -4
  38. package/dist/html/point_map.js +69 -69
  39. package/dist/html/scatter_chart.d.ts +4 -4
  40. package/dist/html/scatter_chart.js +6 -6
  41. package/dist/html/segment_map.d.ts +4 -4
  42. package/dist/html/segment_map.js +61 -61
  43. package/dist/html/shape_map.d.ts +4 -4
  44. package/dist/html/shape_map.js +73 -73
  45. package/dist/html/state_codes.js +108 -108
  46. package/dist/html/table.d.ts +3 -3
  47. package/dist/html/table.js +16 -16
  48. package/dist/html/text.d.ts +2 -2
  49. package/dist/html/text.js +1 -1
  50. package/dist/html/unsupported.d.ts +2 -2
  51. package/dist/html/unsupported.js +4 -4
  52. package/dist/html/utils.d.ts +4 -4
  53. package/dist/html/utils.js +51 -51
  54. package/dist/html/vega_spec.d.ts +6 -6
  55. package/dist/html/vega_spec.js +287 -287
  56. package/dist/index.d.ts +2 -2
  57. package/dist/renderer.d.ts +3 -3
  58. package/package.json +2 -2
@@ -30,69 +30,69 @@ const chart_1 = require("./chart");
30
30
  const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
31
31
  const utils_1 = require("./utils");
32
32
  exports.DEFAULT_SPEC = {
33
- "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
34
- "config": {
35
- "params": [
33
+ $schema: 'https://vega.github.io/schema/vega-lite/v5.json',
34
+ config: {
35
+ params: [
36
36
  {
37
- "name": "defaultFont",
38
- "value": "var(--malloy-font-family, 'Roboto')"
37
+ name: 'defaultFont',
38
+ value: "var(--malloy-font-family, 'Roboto')",
39
39
  },
40
- { "name": "titleColor", "value": "var(--malloy-title-color, #505050)" },
41
- { "name": "labelColor", "value": "var(--malloy-label-color, #505050)" }
40
+ { name: 'titleColor', value: 'var(--malloy-title-color, #505050)' },
41
+ { name: 'labelColor', value: 'var(--malloy-label-color, #505050)' },
42
42
  ],
43
- "background": undefined,
44
- "color": { "expr": "titleColor" },
45
- "header": {
46
- "labelFont": { "expr": "defaultFont" },
47
- "titleFont": { "expr": "defaultFont" },
48
- "titleFontWeight": 500
43
+ background: undefined,
44
+ color: { expr: 'titleColor' },
45
+ header: {
46
+ labelFont: { expr: 'defaultFont' },
47
+ titleFont: { expr: 'defaultFont' },
48
+ titleFontWeight: 500,
49
49
  },
50
- "text": {
51
- "font": { "expr": "defaultFont" },
52
- "color": { "expr": "labelColor" }
50
+ text: {
51
+ font: { expr: 'defaultFont' },
52
+ color: { expr: 'labelColor' },
53
53
  },
54
- "mark": {
55
- "font": { "expr": "defaultFont" },
56
- "color": { "expr": "labelColor" }
54
+ mark: {
55
+ font: { expr: 'defaultFont' },
56
+ color: { expr: 'labelColor' },
57
57
  },
58
- "title": {
59
- "font": { "expr": "defaultFont" },
60
- "subtitleFont": { "expr": "defaultFont" },
61
- "fontWeight": 500
58
+ title: {
59
+ font: { expr: 'defaultFont' },
60
+ subtitleFont: { expr: 'defaultFont' },
61
+ fontWeight: 500,
62
62
  },
63
- "axis": {
64
- "labelColor": { "expr": "labelColor" },
65
- "labelFont": { "expr": "defaultFont" },
66
- "titleFont": { "expr": "defaultFont" },
67
- "titleFontWeight": 500,
68
- "titleColor": { "expr": "titleColor" },
69
- "titleFontSize": 12
63
+ axis: {
64
+ labelColor: { expr: 'labelColor' },
65
+ labelFont: { expr: 'defaultFont' },
66
+ titleFont: { expr: 'defaultFont' },
67
+ titleFontWeight: 500,
68
+ titleColor: { expr: 'titleColor' },
69
+ titleFontSize: 12,
70
70
  },
71
- "legend": {
72
- "titleFontWeight": 500,
73
- "titleColor": { "expr": "titleColor" },
74
- "titleFontSize": 12,
75
- "labelColor": { "expr": "labelColor" },
76
- "labelFont": { "expr": "defaultFont" },
77
- "titleFont": { "expr": "defaultFont" }
78
- }
79
- }
71
+ legend: {
72
+ titleFontWeight: 500,
73
+ titleColor: { expr: 'titleColor' },
74
+ titleFontSize: 12,
75
+ labelColor: { expr: 'labelColor' },
76
+ labelFont: { expr: 'defaultFont' },
77
+ titleFont: { expr: 'defaultFont' },
78
+ },
79
+ },
80
80
  };
81
81
  const sizeSmall = {
82
- "height": 80,
83
- "width": 150
82
+ height: 80,
83
+ width: 150,
84
84
  };
85
85
  const sizeSmallWidth = {
86
- "width": 150
86
+ width: 150,
87
87
  };
88
88
  const sizeSmallHeightStep = {
89
- "height": { "step": 13 }
89
+ height: { step: 13 },
90
90
  };
91
91
  const sizeSmallStep = { ...sizeSmallWidth, ...sizeSmallHeightStep };
92
92
  const sizeMediumStep = { ...sizeSmallWidth };
93
93
  const sizeMedium = {
94
- "height": 150,
95
- "width": 200
94
+ height: 150,
95
+ width: 200,
96
96
  };
97
97
  const sizeLarge = {
98
98
  // height: 350,
@@ -101,324 +101,324 @@ const sizeLarge = {
101
101
  // bar with text in the bars.
102
102
  const bar_SM = {
103
103
  ...exports.DEFAULT_SPEC,
104
- "encoding": {
105
- "y": { "field": "#{1}", "type": "nominal", "axis": null, "sort": null }
104
+ encoding: {
105
+ y: { field: '#{1}', type: 'nominal', axis: null, sort: null },
106
106
  },
107
- "layer": [
107
+ layer: [
108
108
  {
109
- "mark": { "type": "bar", "color": "#aec7e8" },
110
- "encoding": {
111
- "x": {
112
- "field": "#{2}",
113
- "type": "quantitative",
114
- "sort": null
109
+ mark: { type: 'bar', color: '#aec7e8' },
110
+ encoding: {
111
+ x: {
112
+ field: '#{2}',
113
+ type: 'quantitative',
114
+ sort: null,
115
115
  },
116
- "color": { "value": "#4285F4" }
117
- }
116
+ color: { value: '#4285F4' },
117
+ },
118
118
  },
119
119
  {
120
- "mark": { "type": "text", "align": "left", "x": 5 },
121
- "encoding": {
122
- "text": { "field": "#{1}" }
123
- }
124
- }
125
- ]
120
+ mark: { type: 'text', align: 'left', x: 5 },
121
+ encoding: {
122
+ text: { field: '#{1}' },
123
+ },
124
+ },
125
+ ],
126
126
  };
127
127
  const bar_SM_large = {
128
128
  ...exports.DEFAULT_SPEC,
129
- "mark": "bar",
130
- "data": [],
131
- "encoding": {
132
- "x": { "field": "#{1}", "type": "nominal", "sort": null },
133
- "y": { "field": "#{2}", "type": "quantitative", "sort": null },
134
- "color": { "value": "#4285F4" }
135
- }
129
+ mark: 'bar',
130
+ data: [],
131
+ encoding: {
132
+ x: { field: '#{1}', type: 'nominal', sort: null },
133
+ y: { field: '#{2}', type: 'quantitative', sort: null },
134
+ color: { value: '#4285F4' },
135
+ },
136
136
  };
137
137
  const bar_SMM_large = {
138
138
  ...bar_SM_large,
139
- "encoding": {
139
+ encoding: {
140
140
  ...bar_SM_large.encoding,
141
- "color": {
142
- "field": "#{3}",
143
- "type": "quantitative",
144
- "scale": (0, utils_1.getColorScale)("quantitative", true, true)
145
- }
146
- }
141
+ color: {
142
+ field: '#{3}',
143
+ type: 'quantitative',
144
+ scale: (0, utils_1.getColorScale)('quantitative', true, true),
145
+ },
146
+ },
147
147
  };
148
148
  const bar_SMS_large = {
149
149
  ...bar_SM_large,
150
- "encoding": {
150
+ encoding: {
151
151
  ...bar_SM_large.encoding,
152
- "color": {
153
- "field": "#{3}",
154
- "scale": (0, utils_1.getColorScale)("nominal", true, true)
155
- }
156
- }
152
+ color: {
153
+ field: '#{3}',
154
+ scale: (0, utils_1.getColorScale)('nominal', true, true),
155
+ },
156
+ },
157
157
  };
158
158
  const bar_SMS = {
159
159
  ...bar_SM,
160
- "layer": [
160
+ layer: [
161
161
  {
162
162
  ...bar_SM.layer[0],
163
- "encoding": {
163
+ encoding: {
164
164
  ...bar_SM.layer[0].encoding,
165
- "color": {
166
- "field": "#{3}",
167
- "scale": (0, utils_1.getColorScale)("nominal", true, true)
168
- }
169
- }
165
+ color: {
166
+ field: '#{3}',
167
+ scale: (0, utils_1.getColorScale)('nominal', true, true),
168
+ },
169
+ },
170
170
  },
171
- bar_SM.layer[1]
172
- ]
171
+ bar_SM.layer[1],
172
+ ],
173
173
  };
174
174
  const bar_SMM = {
175
175
  ...bar_SM,
176
- "layer": [
176
+ layer: [
177
177
  {
178
178
  ...bar_SM.layer[0],
179
- "encoding": {
179
+ encoding: {
180
180
  ...bar_SM.layer[0].encoding,
181
- "color": {
182
- "field": "#{3}",
183
- "type": "quantitative",
184
- "scale": (0, utils_1.getColorScale)("quantitative", true, true)
185
- }
186
- }
181
+ color: {
182
+ field: '#{3}',
183
+ type: 'quantitative',
184
+ scale: (0, utils_1.getColorScale)('quantitative', true, true),
185
+ },
186
+ },
187
187
  },
188
- bar_SM.layer[1]
189
- ]
188
+ bar_SM.layer[1],
189
+ ],
190
190
  };
191
191
  // simple column chart
192
192
  const bar_NM = {
193
193
  ...exports.DEFAULT_SPEC,
194
- "mark": "bar",
195
- "data": [],
196
- "encoding": {
197
- "x": { "field": "#{1}", "type": "nominal", "sort": null },
198
- "y": { "field": "#{2}", "type": "quantitative", "sort": null },
199
- "color": { "value": "#4285F4" }
200
- }
194
+ mark: 'bar',
195
+ data: [],
196
+ encoding: {
197
+ x: { field: '#{1}', type: 'nominal', sort: null },
198
+ y: { field: '#{2}', type: 'quantitative', sort: null },
199
+ color: { value: '#4285F4' },
200
+ },
201
201
  };
202
202
  const bar_NMS = {
203
203
  ...bar_NM,
204
- "encoding": {
204
+ encoding: {
205
205
  ...bar_NM.encoding,
206
- "color": {
207
- "field": "#{3}",
208
- "type": "nominal",
209
- "scale": (0, utils_1.getColorScale)("nominal", true)
210
- }
211
- }
206
+ color: {
207
+ field: '#{3}',
208
+ type: 'nominal',
209
+ scale: (0, utils_1.getColorScale)('nominal', true),
210
+ },
211
+ },
212
212
  };
213
213
  const bar_NMM = {
214
214
  ...bar_NM,
215
- "encoding": {
215
+ encoding: {
216
216
  ...bar_NM.encoding,
217
- "color": {
218
- "field": "#{3}",
219
- "type": "quantitative",
220
- "scale": (0, utils_1.getColorScale)("quantitative", true)
221
- }
222
- }
217
+ color: {
218
+ field: '#{3}',
219
+ type: 'quantitative',
220
+ scale: (0, utils_1.getColorScale)('quantitative', true),
221
+ },
222
+ },
223
223
  };
224
224
  exports.vegaSpecs = {
225
225
  bar_SM,
226
- "bar_SM_small": { ...bar_SM, ...sizeSmallStep },
227
- "bar_SM_medium": { ...bar_SM, ...sizeMediumStep },
226
+ bar_SM_small: { ...bar_SM, ...sizeSmallStep },
227
+ bar_SM_medium: { ...bar_SM, ...sizeMediumStep },
228
228
  bar_SM_large,
229
229
  bar_SMS,
230
- "bar_SMS_small": { ...bar_SMS, ...sizeSmallStep },
231
- "bar_SMS_medium": { ...bar_SMS, ...sizeMediumStep },
230
+ bar_SMS_small: { ...bar_SMS, ...sizeSmallStep },
231
+ bar_SMS_medium: { ...bar_SMS, ...sizeMediumStep },
232
232
  bar_SMS_large,
233
233
  bar_SMM,
234
- "bar_SMM_small": { ...bar_SMM, ...sizeSmallStep },
235
- "bar_SMM_medium": { ...bar_SMM, ...sizeMediumStep },
234
+ bar_SMM_small: { ...bar_SMM, ...sizeSmallStep },
235
+ bar_SMM_medium: { ...bar_SMM, ...sizeMediumStep },
236
236
  bar_SMM_large,
237
237
  bar_NM,
238
- "bar_NM_small": { ...bar_NM, ...sizeSmall },
239
- "bar_NM_medium": { ...bar_NM, ...sizeMedium },
240
- "bar_NM_large": { ...bar_NM },
238
+ bar_NM_small: { ...bar_NM, ...sizeSmall },
239
+ bar_NM_medium: { ...bar_NM, ...sizeMedium },
240
+ bar_NM_large: { ...bar_NM },
241
241
  bar_NMS,
242
- "bar_NMS_small": { ...bar_NMS, ...sizeSmall },
243
- "bar_NMS_medium": { ...bar_NMS, ...sizeMedium },
244
- "bar_NMS_large": { ...bar_NMS, ...sizeLarge },
242
+ bar_NMS_small: { ...bar_NMS, ...sizeSmall },
243
+ bar_NMS_medium: { ...bar_NMS, ...sizeMedium },
244
+ bar_NMS_large: { ...bar_NMS, ...sizeLarge },
245
245
  bar_NMM,
246
- "bar_NMM_small": { ...bar_NMM, ...sizeSmall },
247
- "bar_NMM_medium": { ...bar_NMM, ...sizeMedium },
248
- "bar_NMM_large": { ...bar_NMM, ...sizeLarge },
249
- "bar_SSMMM": {
246
+ bar_NMM_small: { ...bar_NMM, ...sizeSmall },
247
+ bar_NMM_medium: { ...bar_NMM, ...sizeMedium },
248
+ bar_NMM_large: { ...bar_NMM, ...sizeLarge },
249
+ bar_SSMMM: {
250
250
  ...exports.DEFAULT_SPEC,
251
- "repeat": ["#{3}", "#{4}", "#{5}"],
252
- "spec": {
253
- "description": "A simple bar chart with embedded data.",
254
- "encoding": {
255
- "y": { "field": "#{1}", "type": "nominal", "axis": null, "sort": null }
251
+ repeat: ['#{3}', '#{4}', '#{5}'],
252
+ spec: {
253
+ description: 'A simple bar chart with embedded data.',
254
+ encoding: {
255
+ y: { field: '#{1}', type: 'nominal', axis: null, sort: null },
256
256
  },
257
- "layer": [
257
+ layer: [
258
258
  {
259
- "mark": {
260
- "type": "bar"
259
+ mark: {
260
+ type: 'bar',
261
261
  },
262
- "encoding": {
263
- "x": {
264
- "field": { "repeat": "repeat" },
265
- "type": "quantitative",
266
- "sort": null
262
+ encoding: {
263
+ x: {
264
+ field: { repeat: 'repeat' },
265
+ type: 'quantitative',
266
+ sort: null,
267
267
  },
268
- "color": {
269
- "field": "#{2}",
270
- "scale": (0, utils_1.getColorScale)("nominal", true, true)
271
- }
272
- }
268
+ color: {
269
+ field: '#{2}',
270
+ scale: (0, utils_1.getColorScale)('nominal', true, true),
271
+ },
272
+ },
273
273
  },
274
274
  {
275
- "mark": { "type": "text", "align": "left", "x": 5 },
276
- "encoding": {
277
- "text": { "field": "#{1}" },
278
- "detail": { "aggregate": "count" }
279
- }
280
- }
281
- ]
282
- }
275
+ mark: { type: 'text', align: 'left', x: 5 },
276
+ encoding: {
277
+ text: { field: '#{1}' },
278
+ detail: { aggregate: 'count' },
279
+ },
280
+ },
281
+ ],
282
+ },
283
283
  },
284
- "bubble_NNM": {
284
+ bubble_NNM: {
285
285
  ...exports.DEFAULT_SPEC,
286
- "data": [],
287
- "mark": "circle",
288
- "width": 400,
289
- "encoding": {
290
- "y": {
291
- "field": "#{1}",
292
- "type": "ordinal",
293
- "sort": null
286
+ data: [],
287
+ mark: 'circle',
288
+ width: 400,
289
+ encoding: {
290
+ y: {
291
+ field: '#{1}',
292
+ type: 'ordinal',
293
+ sort: null,
294
294
  },
295
- "x": {
296
- "field": "#{2}",
297
- "type": "ordinal",
298
- "sort": null
295
+ x: {
296
+ field: '#{2}',
297
+ type: 'ordinal',
298
+ sort: null,
299
299
  },
300
- "size": {
301
- "field": "#{3}",
302
- "type": "quantitative"
300
+ size: {
301
+ field: '#{3}',
302
+ type: 'quantitative',
303
303
  },
304
- "color": { "value": "#4285F4" }
305
- }
304
+ color: { value: '#4285F4' },
305
+ },
306
306
  },
307
- "heat_NNM": {
307
+ heat_NNM: {
308
308
  ...exports.DEFAULT_SPEC,
309
- "data": [],
310
- "mark": "bar",
311
- "width": 400,
312
- "encoding": {
313
- "y": {
314
- "field": "#{1}",
315
- "type": "ordinal",
316
- "sort": null
309
+ data: [],
310
+ mark: 'bar',
311
+ width: 400,
312
+ encoding: {
313
+ y: {
314
+ field: '#{1}',
315
+ type: 'ordinal',
316
+ sort: null,
317
317
  },
318
- "x": {
319
- "field": "#{2}",
320
- "type": "ordinal",
321
- "sort": null
318
+ x: {
319
+ field: '#{2}',
320
+ type: 'ordinal',
321
+ sort: null,
322
322
  },
323
- "color": {
324
- "field": "#{3}",
325
- "type": "quantitative",
326
- "scale": (0, utils_1.getColorScale)("quantitative", false)
327
- }
328
- }
323
+ color: {
324
+ field: '#{3}',
325
+ type: 'quantitative',
326
+ scale: (0, utils_1.getColorScale)('quantitative', false),
327
+ },
328
+ },
329
329
  },
330
- "heat_SNM": {
330
+ heat_SNM: {
331
331
  ...exports.DEFAULT_SPEC,
332
- "data": [],
333
- "mark": "bar",
334
- "width": 400,
335
- "encoding": {
336
- "y": {
337
- "field": "#{1}",
338
- "type": "nominal",
339
- "sort": null
332
+ data: [],
333
+ mark: 'bar',
334
+ width: 400,
335
+ encoding: {
336
+ y: {
337
+ field: '#{1}',
338
+ type: 'nominal',
339
+ sort: null,
340
340
  },
341
- "x": {
342
- "field": "#{2}",
343
- "type": "ordinal",
344
- "sort": null
341
+ x: {
342
+ field: '#{2}',
343
+ type: 'ordinal',
344
+ sort: null,
345
345
  },
346
- "color": {
347
- "field": "#{3}",
348
- "type": "quantitative",
349
- "scale": (0, utils_1.getColorScale)("quantitative", false)
350
- }
351
- }
346
+ color: {
347
+ field: '#{3}',
348
+ type: 'quantitative',
349
+ scale: (0, utils_1.getColorScale)('quantitative', false),
350
+ },
351
+ },
352
352
  },
353
- "stacked_line_STM": {
353
+ stacked_line_STM: {
354
354
  ...exports.DEFAULT_SPEC,
355
- "height": 50,
356
- "data": [],
357
- "mark": "area",
358
- "encoding": {
359
- "x": {
360
- "field": "#{2}",
361
- "type": "temporal",
362
- "axis": { "grid": false },
363
- "sort": null
355
+ height: 50,
356
+ data: [],
357
+ mark: 'area',
358
+ encoding: {
359
+ x: {
360
+ field: '#{2}',
361
+ type: 'temporal',
362
+ axis: { grid: false },
363
+ sort: null,
364
364
  },
365
- "y": {
366
- "field": "#{3}",
367
- "type": "quantitative",
368
- "axis": { "grid": false },
369
- "title": null,
370
- "sort": null
365
+ y: {
366
+ field: '#{3}',
367
+ type: 'quantitative',
368
+ axis: { grid: false },
369
+ title: null,
370
+ sort: null,
371
371
  },
372
- "color": {
373
- "field": "#{1}",
374
- "type": "nominal",
375
- "legend": null,
376
- "scale": (0, utils_1.getColorScale)("nominal", false)
372
+ color: {
373
+ field: '#{1}',
374
+ type: 'nominal',
375
+ legend: null,
376
+ scale: (0, utils_1.getColorScale)('nominal', false),
377
377
  },
378
- "row": {
379
- "field": "#{1}",
380
- "type": "nominal"
381
- }
382
- }
378
+ row: {
379
+ field: '#{1}',
380
+ type: 'nominal',
381
+ },
382
+ },
383
383
  },
384
- "grid_line_SSTM": {
384
+ grid_line_SSTM: {
385
385
  ...exports.DEFAULT_SPEC,
386
- "height": 50,
387
- "data": [],
388
- "mark": "area",
389
- "encoding": {
390
- "x": {
391
- "field": "#{3}",
392
- "type": "temporal",
393
- "axis": { "grid": false },
394
- "sort": null
386
+ height: 50,
387
+ data: [],
388
+ mark: 'area',
389
+ encoding: {
390
+ x: {
391
+ field: '#{3}',
392
+ type: 'temporal',
393
+ axis: { grid: false },
394
+ sort: null,
395
395
  },
396
- "y": {
397
- "field": "#{4}",
398
- "type": "quantitative",
399
- "axis": { "grid": false },
400
- "title": null,
401
- "sort": null
396
+ y: {
397
+ field: '#{4}',
398
+ type: 'quantitative',
399
+ axis: { grid: false },
400
+ title: null,
401
+ sort: null,
402
402
  },
403
- "color": {
404
- "field": "#{1}",
405
- "type": "nominal",
406
- "legend": null,
407
- "scale": (0, utils_1.getColorScale)("nominal", false)
403
+ color: {
404
+ field: '#{1}',
405
+ type: 'nominal',
406
+ legend: null,
407
+ scale: (0, utils_1.getColorScale)('nominal', false),
408
408
  },
409
- "row": {
410
- "field": "#{1}",
411
- "type": "nominal"
409
+ row: {
410
+ field: '#{1}',
411
+ type: 'nominal',
412
412
  },
413
- "column": {
414
- "field": "#{2}",
415
- "type": "nominal"
416
- }
417
- }
418
- }
413
+ column: {
414
+ field: '#{2}',
415
+ type: 'nominal',
416
+ },
417
+ },
418
+ },
419
419
  };
420
420
  function isDataContainer(a) {
421
- return Array.isArray(a) || (a !== null && typeof a === "object");
421
+ return Array.isArray(a) || (a !== null && typeof a === 'object');
422
422
  }
423
423
  exports.isDataContainer = isDataContainer;
424
424
  class HTMLVegaSpecRenderer extends chart_1.HTMLChartRenderer {
@@ -437,19 +437,19 @@ class HTMLVegaSpecRenderer extends chart_1.HTMLChartRenderer {
437
437
  return data.value;
438
438
  }
439
439
  else {
440
- throw new Error("Invalid field type for vega chart.");
440
+ throw new Error('Invalid field type for vega chart.');
441
441
  }
442
442
  }
443
443
  getDataType(field) {
444
444
  if (field.isAtomicField()) {
445
445
  if (field.isDate() || field.isTimestamp() || field.isString()) {
446
- return "nominal";
446
+ return 'nominal';
447
447
  }
448
448
  else if (field.isNumber()) {
449
- return "quantitative";
449
+ return 'quantitative';
450
450
  }
451
451
  }
452
- throw new Error("Invalid field type for vega chart.");
452
+ throw new Error('Invalid field type for vega chart.');
453
453
  }
454
454
  translateField(explore, fieldString) {
455
455
  const m = fieldString.match(/#\{(\d+)\}/);
@@ -466,15 +466,15 @@ class HTMLVegaSpecRenderer extends chart_1.HTMLChartRenderer {
466
466
  }
467
467
  }
468
468
  }
469
- else if (node && typeof node === "object") {
469
+ else if (node && typeof node === 'object') {
470
470
  for (const [key, value] of Object.entries(node)) {
471
- if (key === "field" && typeof value === "string") {
471
+ if (key === 'field' && typeof value === 'string') {
472
472
  node[key] = this.translateField(explore, value);
473
473
  }
474
- else if (key === "repeat" && Array.isArray(value)) {
474
+ else if (key === 'repeat' && Array.isArray(value)) {
475
475
  for (const k of value.keys()) {
476
476
  const fieldName = value[k];
477
- if (typeof fieldName === "string") {
477
+ if (typeof fieldName === 'string') {
478
478
  value[k] = this.translateField(explore, fieldName);
479
479
  }
480
480
  }
@@ -497,12 +497,12 @@ class HTMLVegaSpecRenderer extends chart_1.HTMLChartRenderer {
497
497
  // }
498
498
  getVegaLiteSpec(data) {
499
499
  if (data.isNull() || !data.isArray()) {
500
- throw new Error("Expected struct value not to be null.");
500
+ throw new Error('Expected struct value not to be null.');
501
501
  }
502
502
  const newSpec = (0, cloneDeep_1.default)(this.spec);
503
503
  this.translateFields(newSpec, data.field);
504
504
  const rdata = {
505
- "values": this.mapData(data)
505
+ values: this.mapData(data),
506
506
  };
507
507
  newSpec.data = rdata;
508
508
  return newSpec;