@splunk/visualization-migrations 23.0.0 → 23.4.0
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.
- package/index.js +461 -126
- package/index.js.map +1 -1
- package/package.json +5 -4
- package/types/visualizations/area.d.ts +3 -0
- package/types/visualizations/bubble.d.ts +3 -0
- package/types/visualizations/index.d.ts +6 -1
- package/types/visualizations/line.d.ts +3 -0
- package/types/visualizations/pie.d.ts +3 -0
- package/types/visualizations/scatter.d.ts +3 -0
- package/types/visualizations/splunk-charting.d.ts +32 -1
package/index.js
CHANGED
|
@@ -97,55 +97,33 @@ module.exports =
|
|
|
97
97
|
"use strict";
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
var
|
|
101
|
-
if (k2 === undefined) k2 = k;
|
|
102
|
-
Object.defineProperty(o, k2, {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function get() {
|
|
105
|
-
return m[k];
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
} : function (o, m, k, k2) {
|
|
109
|
-
if (k2 === undefined) k2 = k;
|
|
110
|
-
o[k2] = m[k];
|
|
111
|
-
});
|
|
100
|
+
var _typeof = __webpack_require__(1);
|
|
112
101
|
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
103
|
+
var t = {};
|
|
104
|
+
|
|
105
|
+
for (var p in s) {
|
|
106
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
116
107
|
}
|
|
108
|
+
|
|
109
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
110
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
111
|
+
}
|
|
112
|
+
return t;
|
|
117
113
|
};
|
|
118
114
|
|
|
119
115
|
Object.defineProperty(exports, "__esModule", {
|
|
120
116
|
value: true
|
|
121
117
|
});
|
|
118
|
+
exports.otherValueReplacements = exports.migrateChartingOptions = exports.migrateBaseChartingVizDefinition = void 0;
|
|
122
119
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/***/ }),
|
|
126
|
-
/* 1 */
|
|
127
|
-
/***/ (function(module, exports) {
|
|
128
|
-
|
|
129
|
-
module.exports = require("@babel/runtime/helpers/typeof");
|
|
130
|
-
|
|
131
|
-
/***/ }),
|
|
132
|
-
/* 2 */
|
|
133
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
134
|
-
|
|
135
|
-
"use strict";
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var _typeof = __webpack_require__(1);
|
|
139
|
-
|
|
140
|
-
Object.defineProperty(exports, "__esModule", {
|
|
141
|
-
value: true
|
|
142
|
-
});
|
|
143
|
-
exports.migrateChartingOptions = void 0;
|
|
120
|
+
var encoding_1 = __webpack_require__(2);
|
|
144
121
|
/**
|
|
145
122
|
* map of splunk charting based @splunk/dashboard-visualization option names
|
|
146
123
|
* to updated @splunk/visualization option names
|
|
147
124
|
*/
|
|
148
125
|
|
|
126
|
+
|
|
149
127
|
var optionRenames = {
|
|
150
128
|
'axisTitleX.text': 'xAxisTitleText',
|
|
151
129
|
'axisTitleY.text': 'yAxisTitleText',
|
|
@@ -160,17 +138,22 @@ var optionRenames = {
|
|
|
160
138
|
'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',
|
|
161
139
|
'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',
|
|
162
140
|
'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',
|
|
141
|
+
'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',
|
|
163
142
|
'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',
|
|
164
143
|
'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',
|
|
165
144
|
'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',
|
|
166
145
|
'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',
|
|
167
146
|
'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',
|
|
147
|
+
'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',
|
|
168
148
|
'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',
|
|
169
149
|
'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',
|
|
150
|
+
'axisLabelsX.majorUnit': 'xAxisMajorTickInterval',
|
|
170
151
|
'axisLabelsY.majorUnit': 'yAxisMajorTickInterval',
|
|
171
152
|
'axisLabelsY2.majorUnit': 'y2AxisMajorTickInterval',
|
|
153
|
+
'axisX.abbreviation': 'xAxisAbbreviation',
|
|
172
154
|
'axisY.abbreviation': 'yAxisAbbreviation',
|
|
173
155
|
'axisY2.abbreviation': 'y2AxisAbbreviation',
|
|
156
|
+
'axisLabelsX.integerUnits': 'showRoundedXAxisLabels',
|
|
174
157
|
'axisLabelsY2.integerUnits': 'showRoundedY2AxisLabels',
|
|
175
158
|
'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',
|
|
176
159
|
'axisLabelsX.axisVisibility': 'xAxisLineVisibility',
|
|
@@ -178,17 +161,23 @@ var optionRenames = {
|
|
|
178
161
|
'axisLabelsY2.axisVisibility': 'y2AxisLineVisibility',
|
|
179
162
|
'gridLinesX.showMajorLines': 'showXMajorGridLines',
|
|
180
163
|
'gridLinesY.showMajorLines': 'showYMajorGridLines',
|
|
164
|
+
'gridLinesX.showMinorLines': 'showXMinorGridLines',
|
|
181
165
|
'gridLinesY.showMinorLines': 'showYMinorGridLines',
|
|
182
166
|
'gridLinesY2.showMajorLines': 'showY2MajorGridLines',
|
|
183
167
|
'gridLinesY2.showMinorLines': 'showY2MinorGridLines',
|
|
168
|
+
'axisX.scale': 'xAxisScale',
|
|
184
169
|
'axisY.scale': 'yAxisScale',
|
|
185
170
|
'axisY2.scale': 'y2AxisScale',
|
|
171
|
+
'axisX.maximumNumber': 'xAxisMax',
|
|
186
172
|
'axisY.maximumNumber': 'yAxisMax',
|
|
187
173
|
'axisY2.maximumNumber': 'y2AxisMax',
|
|
174
|
+
'axisX.minimumNumber': 'xAxisMin',
|
|
188
175
|
'axisY.minimumNumber': 'yAxisMin',
|
|
189
176
|
'axisY2.minimumNumber': 'y2AxisMin',
|
|
177
|
+
'axisX.includeZero': 'showXAxisWithZero',
|
|
190
178
|
'axisY.includeZero': 'showYAxisWithZero',
|
|
191
179
|
'axisY2.includeZero': 'showY2AxisWithZero',
|
|
180
|
+
'axisLabelsX.extendsAxisRange': 'showXAxisExtendedRange',
|
|
192
181
|
'axisLabelsY.extendsAxisRange': 'showYAxisExtendedRange',
|
|
193
182
|
'layout.splitSeries': 'showSplitSeries',
|
|
194
183
|
'layout.splitSeries.allowIndependentYRanges': 'showIndependentYRanges',
|
|
@@ -206,7 +195,22 @@ var optionRenames = {
|
|
|
206
195
|
'chart.stackMode': 'stackMode',
|
|
207
196
|
'chart.barSpacing': 'barSpacing',
|
|
208
197
|
'chart.columnSpacing': 'columnSpacing',
|
|
209
|
-
'chart.seriesSpacing': 'seriesSpacing'
|
|
198
|
+
'chart.seriesSpacing': 'seriesSpacing',
|
|
199
|
+
'chart.sliceCollapsingLabel': 'collapseLabel',
|
|
200
|
+
'chart.sliceCollapsingThreshold': 'collapseThreshold',
|
|
201
|
+
hasDonutHole: 'showDonutHole',
|
|
202
|
+
// area specific mapped options
|
|
203
|
+
areaFillOpacity: 'areaOpacity',
|
|
204
|
+
'chart.showLines': 'showLines',
|
|
205
|
+
// bubble specific mapped options
|
|
206
|
+
'chart.bubbleMinimumSize': 'bubbleSizeMin',
|
|
207
|
+
'chart.bubbleMaximumSize': 'bubbleSizeMax',
|
|
208
|
+
'chart.bubbleSizeBy': 'bubbleSizeMethod',
|
|
209
|
+
// line specific mapped options
|
|
210
|
+
fieldDashStyles: 'lineDashStylesByField',
|
|
211
|
+
'chart.showMarkers': 'markerDisplay',
|
|
212
|
+
// scatter-specific options
|
|
213
|
+
'chart.markerSize': 'markerSize'
|
|
210
214
|
};
|
|
211
215
|
var visibilityEnumReplacements = {
|
|
212
216
|
visible: 'show',
|
|
@@ -224,6 +228,7 @@ var enumReplacements = {
|
|
|
224
228
|
xAxisTitleVisibility: visibilityEnumReplacements,
|
|
225
229
|
yAxisTitleVisibility: visibilityEnumReplacements,
|
|
226
230
|
y2AxisTitleVisibility: visibilityEnumReplacements,
|
|
231
|
+
xAxisAbbreviation: modeEnumReplacements,
|
|
227
232
|
yAxisAbbreviation: modeEnumReplacements,
|
|
228
233
|
y2AxisAbbreviation: modeEnumReplacements,
|
|
229
234
|
dataValuesDisplay: modeEnumReplacements,
|
|
@@ -240,6 +245,29 @@ var enumReplacements = {
|
|
|
240
245
|
var splitValue = function splitValue(oldValue) {
|
|
241
246
|
return Array.isArray(oldValue) ? oldValue : oldValue.split(',');
|
|
242
247
|
};
|
|
248
|
+
/**
|
|
249
|
+
* converts stringified objects into plain objects
|
|
250
|
+
*
|
|
251
|
+
* @param {string | Object} oldValue stringified object to parse
|
|
252
|
+
* @returns {Object}
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
var parseObjects = function parseObjects(oldValue) {
|
|
257
|
+
if (_typeof(oldValue) === 'object' && !Array.isArray(oldValue)) {
|
|
258
|
+
return oldValue;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
var nuValue = {};
|
|
262
|
+
|
|
263
|
+
try {
|
|
264
|
+
nuValue = JSON.parse(oldValue);
|
|
265
|
+
} catch (e) {
|
|
266
|
+
/* noop */
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return nuValue;
|
|
270
|
+
};
|
|
243
271
|
/**
|
|
244
272
|
* some option values require special processing
|
|
245
273
|
* (e.g. if the type of the updated option changed)
|
|
@@ -251,22 +279,19 @@ var otherValueReplacements = {
|
|
|
251
279
|
y2Fields: splitValue,
|
|
252
280
|
overlayFields: splitValue,
|
|
253
281
|
legendLabels: splitValue,
|
|
254
|
-
seriesColorsByField:
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
/* noop */
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
return nuValue;
|
|
282
|
+
seriesColorsByField: parseObjects,
|
|
283
|
+
lineDashStylesByField: parseObjects,
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* the original markerDisplay was only exposed as `chart.showMarkers`
|
|
287
|
+
* setting chart.showMarkers to true is the equivalent of `markerDisplay: 'outlined'`
|
|
288
|
+
*/
|
|
289
|
+
markerDisplay: function markerDisplay(oldValue) {
|
|
290
|
+
if (oldValue === false) return 'off';else if (oldValue === true) return 'outlined';
|
|
291
|
+
return oldValue;
|
|
268
292
|
}
|
|
269
293
|
};
|
|
294
|
+
exports.otherValueReplacements = otherValueReplacements;
|
|
270
295
|
/**
|
|
271
296
|
* migrateChartingOptions
|
|
272
297
|
* - renames option keys
|
|
@@ -295,6 +320,87 @@ var migrateChartingOptions = function migrateChartingOptions(options) {
|
|
|
295
320
|
};
|
|
296
321
|
|
|
297
322
|
exports.migrateChartingOptions = migrateChartingOptions;
|
|
323
|
+
/**
|
|
324
|
+
* helper that encapsulates shared migration logic across most charting-based viz
|
|
325
|
+
* @param {Object} defaultChanges - map consistsing of default value changes from viz.* to splunk.*
|
|
326
|
+
* @param {Object} validOptions - the list of options that the new splunk.* viz supports
|
|
327
|
+
* @param {VisualizationDefinition} vizDefinition - the viz definition to migrate
|
|
328
|
+
* @param {String} vizType - the value of splunk.*
|
|
329
|
+
*/
|
|
330
|
+
|
|
331
|
+
var migrateBaseChartingVizDefinition = function migrateBaseChartingVizDefinition(_ref) {
|
|
332
|
+
var defaultChanges = _ref.defaultChanges,
|
|
333
|
+
validOptions = _ref.validOptions,
|
|
334
|
+
vizDefinition = _ref.vizDefinition,
|
|
335
|
+
vizType = _ref.vizType;
|
|
336
|
+
|
|
337
|
+
var _vizDefinition$encodi = vizDefinition.encoding,
|
|
338
|
+
encoding = _vizDefinition$encodi === void 0 ? {} : _vizDefinition$encodi,
|
|
339
|
+
_vizDefinition$option = vizDefinition.options,
|
|
340
|
+
options = _vizDefinition$option === void 0 ? {} : _vizDefinition$option,
|
|
341
|
+
otherDefinitionParts = __rest(vizDefinition, ["encoding", "options"]);
|
|
342
|
+
|
|
343
|
+
var migratedDefinition = Object.assign(Object.assign({}, otherDefinitionParts), {
|
|
344
|
+
type: vizType,
|
|
345
|
+
options: {},
|
|
346
|
+
context: {}
|
|
347
|
+
}); // translate encoding to dynamic options equivalent
|
|
348
|
+
|
|
349
|
+
var _encoding_1$encodingT = encoding_1.encodingToDynamicOptionsDSL(encoding),
|
|
350
|
+
dataOptions = _encoding_1$encodingT.options,
|
|
351
|
+
dataContext = _encoding_1$encodingT.context;
|
|
352
|
+
|
|
353
|
+
var migratedOptions = Object.assign(Object.assign(Object.assign({}, defaultChanges), migrateChartingOptions(options)), dataOptions); // remove invalid options
|
|
354
|
+
|
|
355
|
+
Object.keys(migratedOptions).forEach(function (key) {
|
|
356
|
+
if (!validOptions[key]) {
|
|
357
|
+
delete migratedOptions[key];
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
migratedDefinition.options = migratedOptions;
|
|
361
|
+
migratedDefinition.context = dataContext;
|
|
362
|
+
return migratedDefinition;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
exports.migrateBaseChartingVizDefinition = migrateBaseChartingVizDefinition;
|
|
366
|
+
|
|
367
|
+
/***/ }),
|
|
368
|
+
/* 1 */
|
|
369
|
+
/***/ (function(module, exports) {
|
|
370
|
+
|
|
371
|
+
module.exports = require("@babel/runtime/helpers/typeof");
|
|
372
|
+
|
|
373
|
+
/***/ }),
|
|
374
|
+
/* 2 */
|
|
375
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
376
|
+
|
|
377
|
+
"use strict";
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
381
|
+
if (k2 === undefined) k2 = k;
|
|
382
|
+
Object.defineProperty(o, k2, {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
get: function get() {
|
|
385
|
+
return m[k];
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
} : function (o, m, k, k2) {
|
|
389
|
+
if (k2 === undefined) k2 = k;
|
|
390
|
+
o[k2] = m[k];
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
394
|
+
for (var p in m) {
|
|
395
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
Object.defineProperty(exports, "__esModule", {
|
|
400
|
+
value: true
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
__exportStar(__webpack_require__(7), exports);
|
|
298
404
|
|
|
299
405
|
/***/ }),
|
|
300
406
|
/* 3 */
|
|
@@ -343,11 +449,26 @@ exports.canMigrate = exports.migrate = void 0;
|
|
|
343
449
|
var visualizations_1 = __webpack_require__(5);
|
|
344
450
|
|
|
345
451
|
var supportedMigrations = {
|
|
346
|
-
'viz.
|
|
347
|
-
'splunk.
|
|
452
|
+
'viz.area': {
|
|
453
|
+
'splunk.area': visualizations_1.migrateVizToSplunkArea
|
|
348
454
|
},
|
|
349
455
|
'viz.bar': {
|
|
350
456
|
'splunk.bar': visualizations_1.migrateVizToSplunkBar
|
|
457
|
+
},
|
|
458
|
+
'viz.bubble': {
|
|
459
|
+
'splunk.bubble': visualizations_1.migrateVizToSplunkBubble
|
|
460
|
+
},
|
|
461
|
+
'viz.column': {
|
|
462
|
+
'splunk.column': visualizations_1.migrateVizToSplunkColumn
|
|
463
|
+
},
|
|
464
|
+
'viz.line': {
|
|
465
|
+
'splunk.line': visualizations_1.migrateVizToSplunkLine
|
|
466
|
+
},
|
|
467
|
+
'viz.pie': {
|
|
468
|
+
'splunk.pie': visualizations_1.migrateVizToSplunkPie
|
|
469
|
+
},
|
|
470
|
+
'viz.scatter': {
|
|
471
|
+
'splunk.scatter': visualizations_1.migrateVizToSplunkScatter
|
|
351
472
|
}
|
|
352
473
|
};
|
|
353
474
|
|
|
@@ -421,6 +542,16 @@ __exportStar(__webpack_require__(6), exports);
|
|
|
421
542
|
|
|
422
543
|
__exportStar(__webpack_require__(10), exports);
|
|
423
544
|
|
|
545
|
+
__exportStar(__webpack_require__(12), exports);
|
|
546
|
+
|
|
547
|
+
__exportStar(__webpack_require__(14), exports);
|
|
548
|
+
|
|
549
|
+
__exportStar(__webpack_require__(16), exports);
|
|
550
|
+
|
|
551
|
+
__exportStar(__webpack_require__(18), exports);
|
|
552
|
+
|
|
553
|
+
__exportStar(__webpack_require__(20), exports);
|
|
554
|
+
|
|
424
555
|
/***/ }),
|
|
425
556
|
/* 6 */
|
|
426
557
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -428,36 +559,16 @@ __exportStar(__webpack_require__(10), exports);
|
|
|
428
559
|
"use strict";
|
|
429
560
|
|
|
430
561
|
|
|
431
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
432
|
-
var t = {};
|
|
433
|
-
|
|
434
|
-
for (var p in s) {
|
|
435
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
439
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
440
|
-
}
|
|
441
|
-
return t;
|
|
442
|
-
};
|
|
443
|
-
|
|
444
562
|
Object.defineProperty(exports, "__esModule", {
|
|
445
563
|
value: true
|
|
446
564
|
});
|
|
447
|
-
exports.
|
|
448
|
-
|
|
449
|
-
var encoding_1 = __webpack_require__(0);
|
|
565
|
+
exports.migrateVizToSplunkArea = void 0;
|
|
450
566
|
|
|
451
|
-
var splunk_charting_1 = __webpack_require__(
|
|
567
|
+
var splunk_charting_1 = __webpack_require__(0);
|
|
452
568
|
|
|
453
|
-
var
|
|
569
|
+
var Area_1 = __webpack_require__(9);
|
|
454
570
|
|
|
455
|
-
|
|
456
|
-
var validOptions = Object.assign(Object.assign({}, Column_1.config.optionsSchema), {
|
|
457
|
-
x: 1,
|
|
458
|
-
y: 1,
|
|
459
|
-
y2: 1
|
|
460
|
-
}); // old default configurations should be retained in migrated configuration
|
|
571
|
+
var validOptions = Object.assign({}, Area_1.config.optionsSchema); // old default configurations should be retained in migrated configuration
|
|
461
572
|
|
|
462
573
|
var defaultChanges = {
|
|
463
574
|
yAxisAbbreviation: 'off',
|
|
@@ -467,36 +578,16 @@ var defaultChanges = {
|
|
|
467
578
|
showY2MajorGridLines: true
|
|
468
579
|
};
|
|
469
580
|
|
|
470
|
-
var
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
var migratedDefinition = Object.assign(Object.assign({}, otherDefinitionParts), {
|
|
478
|
-
type: 'splunk.column',
|
|
479
|
-
options: {},
|
|
480
|
-
context: {}
|
|
481
|
-
}); // translate encoding to dynamic options equivalent
|
|
482
|
-
|
|
483
|
-
var _encoding_1$encodingT = encoding_1.encodingToDynamicOptionsDSL(encoding),
|
|
484
|
-
dataOptions = _encoding_1$encodingT.options,
|
|
485
|
-
dataContext = _encoding_1$encodingT.context;
|
|
486
|
-
|
|
487
|
-
var migratedOptions = Object.assign(Object.assign(Object.assign({}, defaultChanges), splunk_charting_1.migrateChartingOptions(options)), dataOptions); // remove invalid options
|
|
488
|
-
|
|
489
|
-
Object.keys(migratedOptions).forEach(function (key) {
|
|
490
|
-
if (!validOptions[key]) {
|
|
491
|
-
delete migratedOptions[key];
|
|
492
|
-
}
|
|
581
|
+
var migrateVizToSplunkArea = function migrateVizToSplunkArea(vizDefinition) {
|
|
582
|
+
return splunk_charting_1.migrateBaseChartingVizDefinition({
|
|
583
|
+
defaultChanges: defaultChanges,
|
|
584
|
+
validOptions: validOptions,
|
|
585
|
+
vizDefinition: vizDefinition,
|
|
586
|
+
vizType: 'splunk.area'
|
|
493
587
|
});
|
|
494
|
-
migratedDefinition.options = migratedOptions;
|
|
495
|
-
migratedDefinition.context = dataContext;
|
|
496
|
-
return migratedDefinition;
|
|
497
588
|
};
|
|
498
589
|
|
|
499
|
-
exports.
|
|
590
|
+
exports.migrateVizToSplunkArea = migrateVizToSplunkArea;
|
|
500
591
|
|
|
501
592
|
/***/ }),
|
|
502
593
|
/* 7 */
|
|
@@ -730,7 +821,7 @@ module.exports = require("@splunk/visualization-encoding-parsers/Base");
|
|
|
730
821
|
/* 9 */
|
|
731
822
|
/***/ (function(module, exports) {
|
|
732
823
|
|
|
733
|
-
module.exports = require("@splunk/visualizations/
|
|
824
|
+
module.exports = require("@splunk/visualizations/Area");
|
|
734
825
|
|
|
735
826
|
/***/ }),
|
|
736
827
|
/* 10 */
|
|
@@ -739,6 +830,176 @@ module.exports = require("@splunk/visualizations/Column");
|
|
|
739
830
|
"use strict";
|
|
740
831
|
|
|
741
832
|
|
|
833
|
+
Object.defineProperty(exports, "__esModule", {
|
|
834
|
+
value: true
|
|
835
|
+
});
|
|
836
|
+
exports.migrateVizToSplunkBar = void 0;
|
|
837
|
+
|
|
838
|
+
var splunk_charting_1 = __webpack_require__(0);
|
|
839
|
+
|
|
840
|
+
var Bar_1 = __webpack_require__(11);
|
|
841
|
+
|
|
842
|
+
var validOptions = Object.assign({}, Bar_1.config.optionsSchema); // old default configurations should be retained in migrated configuration
|
|
843
|
+
|
|
844
|
+
var defaultChanges = {
|
|
845
|
+
yAxisAbbreviation: 'off',
|
|
846
|
+
y2AxisAbbreviation: 'off',
|
|
847
|
+
showRoundedY2AxisLabels: false,
|
|
848
|
+
legendTruncation: 'ellipsisMiddle',
|
|
849
|
+
showY2MajorGridLines: true
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
var migrateVizToSplunkBar = function migrateVizToSplunkBar(vizDefinition) {
|
|
853
|
+
return splunk_charting_1.migrateBaseChartingVizDefinition({
|
|
854
|
+
defaultChanges: defaultChanges,
|
|
855
|
+
validOptions: validOptions,
|
|
856
|
+
vizDefinition: vizDefinition,
|
|
857
|
+
vizType: 'splunk.bar'
|
|
858
|
+
});
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
exports.migrateVizToSplunkBar = migrateVizToSplunkBar;
|
|
862
|
+
|
|
863
|
+
/***/ }),
|
|
864
|
+
/* 11 */
|
|
865
|
+
/***/ (function(module, exports) {
|
|
866
|
+
|
|
867
|
+
module.exports = require("@splunk/visualizations/Bar");
|
|
868
|
+
|
|
869
|
+
/***/ }),
|
|
870
|
+
/* 12 */
|
|
871
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
872
|
+
|
|
873
|
+
"use strict";
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
Object.defineProperty(exports, "__esModule", {
|
|
877
|
+
value: true
|
|
878
|
+
});
|
|
879
|
+
exports.migrateVizToSplunkBubble = void 0;
|
|
880
|
+
|
|
881
|
+
var splunk_charting_1 = __webpack_require__(0);
|
|
882
|
+
|
|
883
|
+
var Bubble_1 = __webpack_require__(13);
|
|
884
|
+
|
|
885
|
+
var validOptions = Object.assign({}, Bubble_1.config.optionsSchema); // old default configurations should be retained in migrated configuration
|
|
886
|
+
|
|
887
|
+
var defaultChanges = {
|
|
888
|
+
yAxisAbbreviation: 'off',
|
|
889
|
+
legendTruncation: 'ellipsisMiddle'
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
var migrateVizToSplunkBubble = function migrateVizToSplunkBubble(vizDefinition) {
|
|
893
|
+
return splunk_charting_1.migrateBaseChartingVizDefinition({
|
|
894
|
+
defaultChanges: defaultChanges,
|
|
895
|
+
validOptions: validOptions,
|
|
896
|
+
vizDefinition: vizDefinition,
|
|
897
|
+
vizType: 'splunk.bubble'
|
|
898
|
+
});
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
exports.migrateVizToSplunkBubble = migrateVizToSplunkBubble;
|
|
902
|
+
|
|
903
|
+
/***/ }),
|
|
904
|
+
/* 13 */
|
|
905
|
+
/***/ (function(module, exports) {
|
|
906
|
+
|
|
907
|
+
module.exports = require("@splunk/visualizations/Bubble");
|
|
908
|
+
|
|
909
|
+
/***/ }),
|
|
910
|
+
/* 14 */
|
|
911
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
912
|
+
|
|
913
|
+
"use strict";
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
Object.defineProperty(exports, "__esModule", {
|
|
917
|
+
value: true
|
|
918
|
+
});
|
|
919
|
+
exports.migrateVizToSplunkColumn = void 0;
|
|
920
|
+
|
|
921
|
+
var splunk_charting_1 = __webpack_require__(0);
|
|
922
|
+
|
|
923
|
+
var Column_1 = __webpack_require__(15);
|
|
924
|
+
|
|
925
|
+
var validOptions = Object.assign({}, Column_1.config.optionsSchema); // old default configurations should be retained in migrated configuration
|
|
926
|
+
|
|
927
|
+
var defaultChanges = {
|
|
928
|
+
yAxisAbbreviation: 'off',
|
|
929
|
+
y2AxisAbbreviation: 'off',
|
|
930
|
+
showRoundedY2AxisLabels: false,
|
|
931
|
+
legendTruncation: 'ellipsisMiddle',
|
|
932
|
+
showY2MajorGridLines: true
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
var migrateVizToSplunkColumn = function migrateVizToSplunkColumn(vizDefinition) {
|
|
936
|
+
return splunk_charting_1.migrateBaseChartingVizDefinition({
|
|
937
|
+
defaultChanges: defaultChanges,
|
|
938
|
+
validOptions: validOptions,
|
|
939
|
+
vizDefinition: vizDefinition,
|
|
940
|
+
vizType: 'splunk.column'
|
|
941
|
+
});
|
|
942
|
+
};
|
|
943
|
+
|
|
944
|
+
exports.migrateVizToSplunkColumn = migrateVizToSplunkColumn;
|
|
945
|
+
|
|
946
|
+
/***/ }),
|
|
947
|
+
/* 15 */
|
|
948
|
+
/***/ (function(module, exports) {
|
|
949
|
+
|
|
950
|
+
module.exports = require("@splunk/visualizations/Column");
|
|
951
|
+
|
|
952
|
+
/***/ }),
|
|
953
|
+
/* 16 */
|
|
954
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
955
|
+
|
|
956
|
+
"use strict";
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
Object.defineProperty(exports, "__esModule", {
|
|
960
|
+
value: true
|
|
961
|
+
});
|
|
962
|
+
exports.migrateVizToSplunkLine = void 0;
|
|
963
|
+
|
|
964
|
+
var splunk_charting_1 = __webpack_require__(0);
|
|
965
|
+
|
|
966
|
+
var Line_1 = __webpack_require__(17);
|
|
967
|
+
|
|
968
|
+
var validOptions = Object.assign({}, Line_1.config.optionsSchema); // old default configurations should be retained in migrated configuration
|
|
969
|
+
|
|
970
|
+
var defaultChanges = {
|
|
971
|
+
yAxisAbbreviation: 'off',
|
|
972
|
+
y2AxisAbbreviation: 'off',
|
|
973
|
+
showRoundedY2AxisLabels: false,
|
|
974
|
+
legendTruncation: 'ellipsisMiddle',
|
|
975
|
+
showY2MajorGridLines: true,
|
|
976
|
+
markerDisplay: 'outlined'
|
|
977
|
+
};
|
|
978
|
+
|
|
979
|
+
var migrateVizToSplunkLine = function migrateVizToSplunkLine(vizDefinition) {
|
|
980
|
+
return splunk_charting_1.migrateBaseChartingVizDefinition({
|
|
981
|
+
defaultChanges: defaultChanges,
|
|
982
|
+
validOptions: validOptions,
|
|
983
|
+
vizDefinition: vizDefinition,
|
|
984
|
+
vizType: 'splunk.line'
|
|
985
|
+
});
|
|
986
|
+
};
|
|
987
|
+
|
|
988
|
+
exports.migrateVizToSplunkLine = migrateVizToSplunkLine;
|
|
989
|
+
|
|
990
|
+
/***/ }),
|
|
991
|
+
/* 17 */
|
|
992
|
+
/***/ (function(module, exports) {
|
|
993
|
+
|
|
994
|
+
module.exports = require("@splunk/visualizations/Line");
|
|
995
|
+
|
|
996
|
+
/***/ }),
|
|
997
|
+
/* 18 */
|
|
998
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
999
|
+
|
|
1000
|
+
"use strict";
|
|
1001
|
+
|
|
1002
|
+
|
|
742
1003
|
var __rest = this && this.__rest || function (s, e) {
|
|
743
1004
|
var t = {};
|
|
744
1005
|
|
|
@@ -755,30 +1016,64 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
755
1016
|
Object.defineProperty(exports, "__esModule", {
|
|
756
1017
|
value: true
|
|
757
1018
|
});
|
|
758
|
-
exports.
|
|
1019
|
+
exports.migrateVizToSplunkPie = void 0;
|
|
759
1020
|
|
|
760
|
-
var encoding_1 = __webpack_require__(
|
|
1021
|
+
var encoding_1 = __webpack_require__(2);
|
|
761
1022
|
|
|
762
|
-
var splunk_charting_1 = __webpack_require__(
|
|
1023
|
+
var splunk_charting_1 = __webpack_require__(0);
|
|
763
1024
|
|
|
764
|
-
var
|
|
1025
|
+
var Pie_1 = __webpack_require__(19);
|
|
765
1026
|
|
|
1027
|
+
var validOptions = Object.assign({}, Pie_1.config.optionsSchema);
|
|
766
1028
|
|
|
767
|
-
var
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}
|
|
1029
|
+
var migratePieChartLabelAndPercent = function migratePieChartLabelAndPercent(options) {
|
|
1030
|
+
// if neither chart.showLabels or chart.showPercent is specified in viz.pie,
|
|
1031
|
+
// splunk.pie use the default labelDisplay value
|
|
1032
|
+
if (!('chart.showLabels' in options) && !('chart.showPercent' in options)) {
|
|
1033
|
+
return {};
|
|
1034
|
+
} // if only chart.showPercent is specified in viz.pie
|
|
772
1035
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
1036
|
+
|
|
1037
|
+
if (!('chart.showLabels' in options) && 'chart.showPercent' in options) {
|
|
1038
|
+
return {
|
|
1039
|
+
labelDisplay: options['chart.showPercent'] ? 'valuesAndPercentage' : 'values'
|
|
1040
|
+
};
|
|
1041
|
+
} // if only chart.showLabels is specified in viz.pie
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
if ('chart.showLabels' in options && !('chart.showPercent' in options)) {
|
|
1045
|
+
return {
|
|
1046
|
+
labelDisplay: options['chart.showLabels'] ? 'values' : 'off'
|
|
1047
|
+
};
|
|
1048
|
+
} // if both chart.showLabels and chart.showPercent are specified in viz.pie
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
var labelOption = {
|
|
1052
|
+
labelDisplay: 'values'
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
if (options['chart.showLabels'] && options['chart.showPercent']) {
|
|
1056
|
+
labelOption.labelDisplay = 'valuesAndPercentage';
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
if (!options['chart.showLabels']) {
|
|
1060
|
+
labelOption.labelDisplay = 'off';
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
return labelOption;
|
|
779
1064
|
};
|
|
780
1065
|
|
|
781
|
-
var
|
|
1066
|
+
var migrateFieldColors = function migrateFieldColors(options) {
|
|
1067
|
+
if ('fieldColors' in options) {
|
|
1068
|
+
return {
|
|
1069
|
+
seriesColorsByValue: splunk_charting_1.otherValueReplacements.seriesColorsByField(options.fieldColors)
|
|
1070
|
+
};
|
|
1071
|
+
} else {
|
|
1072
|
+
return {};
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
var migrateVizToSplunkPie = function migrateVizToSplunkPie(vizDefinition) {
|
|
782
1077
|
var _vizDefinition$encodi = vizDefinition.encoding,
|
|
783
1078
|
encoding = _vizDefinition$encodi === void 0 ? {} : _vizDefinition$encodi,
|
|
784
1079
|
_vizDefinition$option = vizDefinition.options,
|
|
@@ -786,7 +1081,7 @@ var migrateVizToSplunkBar = function migrateVizToSplunkBar(vizDefinition) {
|
|
|
786
1081
|
otherDefinitionParts = __rest(vizDefinition, ["encoding", "options"]);
|
|
787
1082
|
|
|
788
1083
|
var migratedDefinition = Object.assign(Object.assign({}, otherDefinitionParts), {
|
|
789
|
-
type: 'splunk.
|
|
1084
|
+
type: 'splunk.pie',
|
|
790
1085
|
options: {},
|
|
791
1086
|
context: {}
|
|
792
1087
|
}); // translate encoding to dynamic options equivalent
|
|
@@ -795,7 +1090,7 @@ var migrateVizToSplunkBar = function migrateVizToSplunkBar(vizDefinition) {
|
|
|
795
1090
|
dataOptions = _encoding_1$encodingT.options,
|
|
796
1091
|
dataContext = _encoding_1$encodingT.context;
|
|
797
1092
|
|
|
798
|
-
var migratedOptions = Object.assign(Object.assign(Object.assign({},
|
|
1093
|
+
var migratedOptions = Object.assign(Object.assign(Object.assign(Object.assign({}, migratePieChartLabelAndPercent(options)), splunk_charting_1.migrateChartingOptions(options)), migrateFieldColors(options)), dataOptions); // remove invalid options
|
|
799
1094
|
|
|
800
1095
|
Object.keys(migratedOptions).forEach(function (key) {
|
|
801
1096
|
if (!validOptions[key]) {
|
|
@@ -807,13 +1102,53 @@ var migrateVizToSplunkBar = function migrateVizToSplunkBar(vizDefinition) {
|
|
|
807
1102
|
return migratedDefinition;
|
|
808
1103
|
};
|
|
809
1104
|
|
|
810
|
-
exports.
|
|
1105
|
+
exports.migrateVizToSplunkPie = migrateVizToSplunkPie;
|
|
811
1106
|
|
|
812
1107
|
/***/ }),
|
|
813
|
-
/*
|
|
1108
|
+
/* 19 */
|
|
814
1109
|
/***/ (function(module, exports) {
|
|
815
1110
|
|
|
816
|
-
module.exports = require("@splunk/visualizations/
|
|
1111
|
+
module.exports = require("@splunk/visualizations/Pie");
|
|
1112
|
+
|
|
1113
|
+
/***/ }),
|
|
1114
|
+
/* 20 */
|
|
1115
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1116
|
+
|
|
1117
|
+
"use strict";
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1121
|
+
value: true
|
|
1122
|
+
});
|
|
1123
|
+
exports.migrateVizToSplunkScatter = void 0;
|
|
1124
|
+
|
|
1125
|
+
var splunk_charting_1 = __webpack_require__(0);
|
|
1126
|
+
|
|
1127
|
+
var Scatter_1 = __webpack_require__(21);
|
|
1128
|
+
|
|
1129
|
+
var validOptions = Object.assign({}, Scatter_1.config.optionsSchema); // old default configurations should be retained in migrated configuration
|
|
1130
|
+
|
|
1131
|
+
var defaultChanges = {
|
|
1132
|
+
yAxisAbbreviation: 'off',
|
|
1133
|
+
legendTruncation: 'ellipsisMiddle'
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
var migrateVizToSplunkScatter = function migrateVizToSplunkScatter(vizDefinition) {
|
|
1137
|
+
return splunk_charting_1.migrateBaseChartingVizDefinition({
|
|
1138
|
+
defaultChanges: defaultChanges,
|
|
1139
|
+
validOptions: validOptions,
|
|
1140
|
+
vizDefinition: vizDefinition,
|
|
1141
|
+
vizType: 'splunk.scatter'
|
|
1142
|
+
});
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
exports.migrateVizToSplunkScatter = migrateVizToSplunkScatter;
|
|
1146
|
+
|
|
1147
|
+
/***/ }),
|
|
1148
|
+
/* 21 */
|
|
1149
|
+
/***/ (function(module, exports) {
|
|
1150
|
+
|
|
1151
|
+
module.exports = require("@splunk/visualizations/Scatter");
|
|
817
1152
|
|
|
818
1153
|
/***/ })
|
|
819
1154
|
/******/ ]);
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/encoding/index.ts","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///./src/visualizations/splunk-charting.ts","webpack:///./src/index.ts","webpack:///./src/migrate.ts","webpack:///./src/visualizations/index.ts","webpack:///./src/visualizations/column.ts","webpack:///./src/encoding/encoding.ts","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///external \"@splunk/visualizations/Column\"","webpack:///./src/visualizations/bar.ts","webpack:///external \"@splunk/visualizations/Bar\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA,8C;;;;;;ACAA,0D;;;;;;;;;;;;;;;ACAA;;;AAGG;;AACH,IAAM,aAAa,GAAG;AAClB,qBAAmB,gBADD;AAElB,qBAAmB,gBAFD;AAGlB,sBAAoB,iBAHF;AAIlB,2BAAyB,sBAJP;AAKlB,2BAAyB,sBALP;AAMlB,4BAA0B,uBANR;AAOlB,0CAAwC,oBAPtB;AAQlB,sCAAoC,sBARlB;AASlB,sCAAoC,sBATlB;AAUlB,uCAAqC,uBAVnB;AAWlB,qCAAmC,0BAXjB;AAYlB,qCAAmC,0BAZjB;AAalB,sCAAoC,2BAblB;AAclB,qCAAmC,0BAdjB;AAelB,sCAAoC,2BAflB;AAgBlB,+BAA6B,oBAhBX;AAiBlB,+BAA6B,oBAjBX;AAkBlB,gCAA8B,qBAlBZ;AAmBlB,+BAA6B,oBAnBX;AAoBlB,gCAA8B,qBApBZ;A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EAAE,KAFD;AAGnB,yBAAuB,EAAE,KAHN;AAInB,kBAAgB,EAAE,gBAJC;AAKnB,sBAAoB,EAAE;AALH,CAAvB;;AAQA,IAAM,qBAAqB,GAAG,SAAxB,qBAAwB,CAAC,aAAD,EAAoE;AAAA,8BAC7B,aAD6B,CACtF,QADsF;AAAA,MACtF,QADsF,sCAC3E,EAD2E;AAAA,8BAC7B,aAD6B,CACvE,OADuE;AAAA,MACvE,OADuE,sCAC7D,EAD6D;AAAA,MACtD,oBADsD,GAClC,OAAK,aAAL,EAAtD,uBAAsD,CADkC;;AAE9F,MAAM,kBAAkB,mCACjB,oBADiB,GACG;AACvB,QAAI,EAAE,YADiB;AAEvB,WAAO,EAAE,EAFc;AAGvB,WAAO,EAAE;AAHc,GADH,CAAxB,CAF8F,CAQ9F;;AAR8F,8BASvC,uCACnD,QADmD,CATuC;AAAA,MAS7E,WAT6E,yBAStF,OATsF;AAAA,MASvD,WATuD,yBAShE,OATgE;;AAa9F,MAAM,eAAe,iDACd,cADc,GAEd,yCAAuB,OAAvB,CAFc,GAGd,WAHc,CAArB,CAb8F,CAkB9F;;AACA,QAAM,CAAC,IAAP,CAAY,eAAZ,EAA6B,OAA7B,CAAqC,aAAG,EAAG;AACvC,QAAI,CAAC,YAAY,CAAC,GAAD,CAAjB,EAAwB;AACpB,aAAO,eAAe,CAAC,GAAD,CAAtB;AACH;AACJ,GAJD;AAKA,oBAAkB,CAAC,OAAnB,GAA6B,eAA7B;AACA,oBAAkB,CAAC,OAAnB,GAA6B,WAA7B;AAEA,SAAO,kBAAP;AACH,CA5BD;;AA8BS,sD;;;;;;ACpDT,uD","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n","export * from './encoding';\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","/**\n * map of splunk charting based @splunk/dashboard-visualization option names\n * to updated @splunk/visualization option names\n */\nconst optionRenames = {\n 'axisTitleX.text': 'xAxisTitleText',\n 'axisTitleY.text': 'yAxisTitleText',\n 'axisTitleY2.text': 'y2AxisTitleText',\n 'axisTitleX.visibility': 'xAxisTitleVisibility',\n 'axisTitleY.visibility': 'yAxisTitleVisibility',\n 'axisTitleY2.visibility': 'y2AxisTitleVisibility',\n 'axisLabelsX.majorLabelStyle.rotation': 'xAxisLabelRotation',\n 'axisLabelsX.majorLabelVisibility': 'xAxisLabelVisibility',\n 'axisLabelsY.majorLabelVisibility': 'yAxisLabelVisibility',\n 'axisLabelsY2.majorLabelVisibility': 'y2AxisLabelVisibility',\n 'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',\n 'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',\n 'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',\n 'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',\n 'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',\n 'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',\n 'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',\n 'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',\n 'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',\n 'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',\n 'axisLabelsY.majorUnit': 'yAxisMajorTickInterval',\n 'axisLabelsY2.majorUnit': 'y2AxisMajorTickInterval',\n 'axisY.abbreviation': 'yAxisAbbreviation',\n 'axisY2.abbreviation': 'y2AxisAbbreviation',\n 'axisLabelsY2.integerUnits': 'showRoundedY2AxisLabels',\n 'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',\n 'axisLabelsX.axisVisibility': 'xAxisLineVisibility',\n 'axisLabelsY.axisVisibility': 'yAxisLineVisibility',\n 'axisLabelsY2.axisVisibility': 'y2AxisLineVisibility',\n 'gridLinesX.showMajorLines': 'showXMajorGridLines',\n 'gridLinesY.showMajorLines': 'showYMajorGridLines',\n 'gridLinesY.showMinorLines': 'showYMinorGridLines',\n 'gridLinesY2.showMajorLines': 'showY2MajorGridLines',\n 'gridLinesY2.showMinorLines': 'showY2MinorGridLines',\n 'axisY.scale': 'yAxisScale',\n 'axisY2.scale': 'y2AxisScale',\n 'axisY.maximumNumber': 'yAxisMax',\n 'axisY2.maximumNumber': 'y2AxisMax',\n 'axisY.minimumNumber': 'yAxisMin',\n 'axisY2.minimumNumber': 'y2AxisMin',\n 'axisY.includeZero': 'showYAxisWithZero',\n 'axisY2.includeZero': 'showY2AxisWithZero',\n 'axisLabelsY.extendsAxisRange': 'showYAxisExtendedRange',\n 'layout.splitSeries': 'showSplitSeries',\n 'layout.splitSeries.allowIndependentYRanges': 'showIndependentYRanges',\n 'axisY2.enabled': 'showOverlayY2Axis',\n 'axisY2.fields': 'y2Fields',\n 'chart.overlayFields': 'overlayFields',\n 'legend.labels': 'legendLabels',\n 'legend.labelStyle.overflowMode': 'legendTruncation',\n 'legend.mode': 'legendMode',\n 'legend.placement': 'legendDisplay',\n 'chart.nullValueMode': 'nullValueDisplay',\n 'chart.showDataLabels': 'dataValuesDisplay',\n fieldColors: 'seriesColorsByField',\n 'chart.resultTruncationLimit': 'resultLimit',\n 'chart.stackMode': 'stackMode',\n 'chart.barSpacing': 'barSpacing',\n 'chart.columnSpacing': 'columnSpacing',\n 'chart.seriesSpacing': 'seriesSpacing',\n};\n\nconst visibilityEnumReplacements = {\n visible: 'show',\n collapsed: 'hide',\n};\nconst modeEnumReplacements = {\n none: 'off',\n};\n/**\n * for some options the valid values changed.\n * this maps enum values that need to be changed\n */\nconst enumReplacements = {\n xAxisTitleVisibility: visibilityEnumReplacements,\n yAxisTitleVisibility: visibilityEnumReplacements,\n y2AxisTitleVisibility: visibilityEnumReplacements,\n yAxisAbbreviation: modeEnumReplacements,\n y2AxisAbbreviation: modeEnumReplacements,\n dataValuesDisplay: modeEnumReplacements,\n legendDisplay: modeEnumReplacements,\n legendTruncation: {\n ellipsisNone: 'ellipsisOff',\n },\n stackMode: {\n default: 'auto',\n },\n};\n\n// splits a string with multiple fields separated by comma\n// returns the same value if it's already an array\nconst splitValue = (oldValue: string | string[]) =>\n Array.isArray(oldValue) ? oldValue : oldValue.split(',');\n\n/**\n * some option values require special processing\n * (e.g. if the type of the updated option changed)\n * \"legendLabels\": \"test,test2\" => \"legendLabels\": [\"test\", \"test2\"]\n */\nconst otherValueReplacements = {\n y2Fields: splitValue,\n overlayFields: splitValue,\n legendLabels: splitValue,\n seriesColorsByField: (oldValue: string | Record<string, unknown>): Record<string, unknown> => {\n if (typeof oldValue === 'object' && !Array.isArray(oldValue)) {\n return oldValue;\n }\n let nuValue = {};\n try {\n nuValue = JSON.parse(oldValue as string);\n } catch (e) {\n /* noop */\n }\n return nuValue;\n },\n};\n\n/**\n * migrateChartingOptions\n * - renames option keys\n * - checks if enum values have changed for new options, replaces it\n * - checks if other replacements are necessary and applies them\n * @param {object} options dashboard-viz charting options\n * @returns {object} migratedOptions viz charting options\n */\nconst migrateChartingOptions = (options: Record<string, unknown>): Record<string, unknown> => {\n const migratedOptions = {};\n Object.keys(options).forEach(key => {\n const value = options[key];\n const updatedKey = optionRenames[key] ?? key;\n let updatedValue = enumReplacements?.[updatedKey]?.[value] ?? value;\n if (otherValueReplacements[updatedKey]) {\n updatedValue = otherValueReplacements[updatedKey](updatedValue);\n }\n migratedOptions[updatedKey] = updatedValue;\n });\n return migratedOptions;\n};\n\nexport { migrateChartingOptions };\n","export * from './migrate';\n","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { migrateVizToSplunkColumn, migrateVizToSplunkBar } from './visualizations';\n\nconst supportedMigrations = {\n 'viz.column': {\n 'splunk.column': migrateVizToSplunkColumn,\n },\n 'viz.bar': {\n 'splunk.bar': migrateVizToSplunkBar,\n },\n};\n\nconst inferToType = (typeFromDefinition: string): string => typeFromDefinition.replace('viz.', 'splunk.');\n\ninterface MigrationParams {\n definition: VisualizationDefinition;\n toType?: string;\n}\n\nconst migrate = ({ definition, toType: toTypeFromParams }: MigrationParams): VisualizationDefinition => {\n const toType = toTypeFromParams ?? inferToType(definition.type);\n if (!supportedMigrations?.[definition?.type]?.[toType]) {\n throw new Error('Migration currently not supported');\n }\n return supportedMigrations[definition.type][toType](definition);\n};\n\ninterface CanMigrateParams {\n fromType: string;\n toType: string;\n}\n\nconst canMigrate = ({ fromType, toType }: CanMigrateParams): boolean => {\n if (supportedMigrations?.[fromType]?.[toType]) {\n return true;\n }\n return false;\n};\n\nexport { migrate, canMigrate };\n","export * from './column';\nexport * from './bar';\n","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { migrateChartingOptions } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Column';\n// @TODO(pwied): x,y,y2 need to be added to Column\nconst validOptions = {\n ...config.optionsSchema,\n x: 1,\n y: 1,\n y2: 1,\n};\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkColumn = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.column',\n options: {},\n context: {},\n };\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedOptions = {\n ...defaultChanges,\n ...migrateChartingOptions(options),\n ...dataOptions,\n };\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n migratedDefinition.options = migratedOptions;\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkColumn };\n","import {\n parseNameBasedFieldReference,\n parseIndexBasedFieldReference,\n} from '@splunk/visualization-encoding-parsers/Base';\n// @TODO(pwied): move the parsing helpers so we can deprecate visualization-encoding-parsers package\n\n// index based references are defined by <dataSource>[<index>]\n// this regex matches <text with numbers>[<anything>]\n// the \"[\" \"]\" part makes it an index based reference\nconst indexBasedRegx = /^[A-Za-z0-9_]+\\[.*\\].*$/;\n// name based references are defined by <dataSource>.<columnName>\n// the \".\" access makes it a name based reference\nconst nameBasedRegx = /^[A-Za-z0-9_]+\\..*$/;\n\ninterface AdvancedEncodingConfig {\n field: string;\n format?: Record<string, unknown>;\n}\ntype EncodingConfig = string | string[] | AdvancedEncodingConfig;\n\nexport type { EncodingConfig };\n\ninterface DynamicOptionsChunk {\n options: Record<string, unknown>;\n context: Record<string, unknown>;\n}\nconst isIndexBasedReference = ref => indexBasedRegx.test(ref);\nconst isNameBasedReference = ref => nameBasedRegx.test(ref);\n\n/**\n * Translates encoding data selections in array format\n *\n * Note:\n * 'frameBySeriesIndexes' only supports positive indexes\n *\n * Examples:\n * 1. all index based selection\n * ['primary[0]', 'primary[1]'] => '> primary | frameBySeriesIndexes(0,1)'\n *\n * 2. all name based selection\n * ['primary.foo', 'primary.bar'] => '> primary | frameBySeriesNames(\"foo\",\"bar\")'\n *\n * 3. index or name based selections\n * ['primary.foo', 'primary[1]'] => '> primary | frameBySeriesNamesOrIndexes(\"foo\",1)'\n */\nconst translateArrayFormatDataReference = (encodingDataReference: string[]): string => {\n if (encodingDataReference.length === 0) {\n return;\n }\n const allIndexBased = encodingDataReference.every(isIndexBasedReference);\n const allNameBased = encodingDataReference.every(isNameBasedReference);\n\n if (allIndexBased) {\n const { dataSourceName } = parseIndexBasedFieldReference(encodingDataReference[0]);\n const indexesStr = encodingDataReference\n .map(ref => parseIndexBasedFieldReference(ref)?.fieldIndex)\n .join(',');\n return `> ${dataSourceName} | frameBySeriesIndexes(${indexesStr})`;\n } else if (allNameBased) {\n const { dataSourceName } = parseNameBasedFieldReference(encodingDataReference[0]);\n const namesStr = encodingDataReference\n .map(ref => '\"' + parseNameBasedFieldReference(ref)?.fieldName + '\"')\n .join(',');\n return `> ${dataSourceName} | frameBySeriesNames(${namesStr})`;\n } else {\n // it's a mix of name and index based references\n // get the first ref to extract the dataSource\n const firstEntry = encodingDataReference[0];\n const { dataSourceName } = isIndexBasedReference(firstEntry)\n ? parseIndexBasedFieldReference(firstEntry)\n : parseNameBasedFieldReference(firstEntry);\n const paramStr = encodingDataReference\n .map(ref => {\n return isIndexBasedReference(ref)\n ? parseIndexBasedFieldReference(ref)?.fieldIndex\n : '\"' + parseNameBasedFieldReference(ref)?.fieldName + '\"';\n })\n .join(',');\n return `> ${dataSourceName} | frameBySeriesNamesOrIndexes(${paramStr})`;\n }\n};\n\n/**\n * Translates an encoding data selection string to a dynamic options data selection\n *\n * Index based column selection\n * 'primary[0]' => '> primary | seriesByIndex(0)'\n *\n * Index range based column selection\n * 'primary[1:]' => '> primary | frameBySeriesIndexRange(1)'\n * 'primary[0:3]' => '> primary | frameBySeriesIndexRange(0,2)'\n *\n * Name based column selection\n * 'primary.foo' => '> primary | seriesByName(\"foo\")'\n *\n * Encoding references\n * 'encoding.x' => '> x'\n */\nconst translateDataReference = (encodingDataReference: string): string => {\n if (encodingDataReference.indexOf('encoding.') === 0) {\n return `> ${encodingDataReference.replace('encoding.', '')}`;\n }\n const isIndexBasedRef = isIndexBasedReference(encodingDataReference);\n const isNameBasedRef = isNameBasedReference(encodingDataReference);\n\n if (!isIndexBasedRef && !isNameBasedRef) {\n console.warn('Unable to parse the encoding. Please verify the encoding format is correct');\n return;\n }\n\n if (isNameBasedRef) {\n const { dataSourceName, fieldName /* columnIndex */ } = parseNameBasedFieldReference(\n encodingDataReference\n );\n return `> ${dataSourceName} | seriesByName(\"${fieldName}\")`;\n }\n if (isIndexBasedRef) {\n const {\n dataSourceName,\n fieldIndex,\n /* columnIndex, */\n isFieldIndexRange,\n fromFieldIndex,\n toFieldIndex,\n } = parseIndexBasedFieldReference(encodingDataReference);\n if (isFieldIndexRange) {\n let dslToIndexString;\n if (toFieldIndex === -1) {\n dslToIndexString = '';\n } else {\n // adjust index, DSL is using default slice behavior whereas encoding behaved differently\n dslToIndexString = `,${toFieldIndex + 1}`;\n }\n return `> ${dataSourceName} | frameBySeriesIndexRange(${fromFieldIndex}${dslToIndexString})`;\n } else {\n return `> ${dataSourceName} | seriesByIndex(${fieldIndex})`;\n }\n }\n};\n/**\n * An encoding configuration can come in various different forms:\n *\n * 1. Simple data selection (either index or name based)\n * {\n * x: 'primary[0]',\n * y: 'primary.count'\n * }\n *\n * 2. Multi column selection in array format\n * {\n * x: 'primary[0]',\n * \t y: ['primary.count', 'primary.count2']\n * }\n *\n * 3. Advanced Encoding Configuration (for data selection and formatting)\n * {\n * x: {\n * \t field: 'primary[0]',\n * \t },\n * y: {\n * \t field: 'primary[1]',\n * format: {},\n * }\n * }\n */\nconst encodingToDynamicOptionsDSL = (encoding: Record<string, EncodingConfig>): DynamicOptionsChunk => {\n const dynamicOptions: DynamicOptionsChunk = {\n options: {},\n context: {},\n };\n const translatedOptions = {};\n Object.keys(encoding).forEach(key => {\n const fieldReference = encoding[key];\n let fieldReferenceStr = fieldReference as string;\n if (typeof fieldReference === 'object' && !Array.isArray(fieldReference)) {\n const { field } = fieldReference;\n if (field && !Array.isArray(field)) {\n fieldReferenceStr = field;\n }\n }\n let translatedValue;\n // field reference is either in form of array or string\n if (Array.isArray(fieldReference)) {\n translatedValue = translateArrayFormatDataReference(fieldReference);\n } else {\n translatedValue = translateDataReference(fieldReferenceStr);\n }\n // omit if translated value is not set\n if (translatedValue) {\n translatedOptions[key] = translatedValue;\n }\n });\n dynamicOptions.options = translatedOptions;\n return dynamicOptions;\n};\n\nexport { encodingToDynamicOptionsDSL };\n","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","module.exports = require(\"@splunk/visualizations/Column\");","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { migrateChartingOptions } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Bar';\n// @TODO(pwied): x,y,y2 need to be added to Bar\nconst validOptions = {\n ...config.optionsSchema,\n x: 1,\n y: 1,\n y2: 1,\n};\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkBar = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.bar',\n options: {},\n context: {},\n };\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedOptions = {\n ...defaultChanges,\n ...migrateChartingOptions(options),\n ...dataOptions,\n };\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n migratedDefinition.options = migratedOptions;\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkBar };\n","module.exports = require(\"@splunk/visualizations/Bar\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/visualizations/splunk-charting.ts","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///./src/encoding/index.ts","webpack:///./src/index.ts","webpack:///./src/migrate.ts","webpack:///./src/visualizations/index.ts","webpack:///./src/visualizations/area.ts","webpack:///./src/encoding/encoding.ts","webpack:///external \"@splunk/visualization-encoding-parsers/Base\"","webpack:///external \"@splunk/visualizations/Area\"","webpack:///./src/visualizations/bar.ts","webpack:///external \"@splunk/visualizations/Bar\"","webpack:///./src/visualizations/bubble.ts","webpack:///external \"@splunk/visualizations/Bubble\"","webpack:///./src/visualizations/column.ts","webpack:///external \"@splunk/visualizations/Column\"","webpack:///./src/visualizations/line.ts","webpack:///external \"@splunk/visualizations/Line\"","webpack:///./src/visualizations/pie.ts","webpack:///external \"@splunk/visualizations/Pie\"","webpack:///./src/visualizations/scatter.ts","webpack:///external \"@splunk/visualizations/Scatter\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChFA;AAEA;;;AAGG;;;AACH,IAAM,aAAa,GAAG;AAClB,qBAAmB,gBADD;AAElB,qBAAmB,gBAFD;AAGlB,sBAAoB,iBAHF;AAIlB,2BAAyB,sBAJP;AAKlB,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AAO,EAAE;AAHc,GADH,CAAxB,CAF8F,CAQ9F;;AAR8F,8BASvC,uCACnD,QADmD,CATuC;AAAA,MAS7E,WAT6E,yBAStF,OATsF;AAAA,MASvD,WATuD,yBAShE,OATgE;;AAa9F,MAAM,eAAe,+DACd,8BAA8B,CAAC,OAAD,CADhB,GAEd,yCAAuB,OAAvB,CAFc,GAGd,kBAAkB,CAAC,OAAD,CAHJ,GAId,WAJc,CAArB,CAb8F,CAmB9F;;AACA,QAAM,CAAC,IAAP,CAAY,eAAZ,EAA6B,OAA7B,CAAqC,aAAG,EAAG;AACvC,QAAI,CAAC,YAAY,CAAC,GAAD,CAAjB,EAAwB;AACpB,aAAO,eAAe,CAAC,GAAD,CAAtB;AACH;AACJ,GAJD;AAKA,oBAAkB,CAAC,OAAnB,GAA6B,eAA7B;AACA,oBAAkB,CAAC,OAAnB,GAA6B,WAA7B;AAEA,SAAO,kBAAP;AACH,CA7BD;;AA+BS,sD;;;;;;AClFT,uD;;;;;;;;;;;;;;ACCA;;AACA;;AAEA,IAAM,YAAY,qBACX,iBAAO,aADI,CAAlB,C,CAIA;;AACA,IAAM,cAAc,GAAG;AACnB,mBAAiB,EAAE,KADA;AAEnB,kBAAgB,EAAE;AAFC,CAAvB;;AAKA,IAAM,yBAAyB,GAAG,SAA5B,yBAA4B,CAAC,aAAD,EAAoE;AAClG,SAAO,mDAAiC;AACpC,kBAAc,EAAd,cADoC;AAEpC,gBAAY,EAAZ,YAFoC;AAGpC,iBAAa,EAAb,aAHoC;AAIpC,WAAO,EAAE;AAJ2B,GAAjC,CAAP;AAMH,CAPD;;AASS,8D;;;;;;ACvBT,2D","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\n\n/**\n * map of splunk charting based @splunk/dashboard-visualization option names\n * to updated @splunk/visualization option names\n */\nconst optionRenames = {\n 'axisTitleX.text': 'xAxisTitleText',\n 'axisTitleY.text': 'yAxisTitleText',\n 'axisTitleY2.text': 'y2AxisTitleText',\n 'axisTitleX.visibility': 'xAxisTitleVisibility',\n 'axisTitleY.visibility': 'yAxisTitleVisibility',\n 'axisTitleY2.visibility': 'y2AxisTitleVisibility',\n 'axisLabelsX.majorLabelStyle.rotation': 'xAxisLabelRotation',\n 'axisLabelsX.majorLabelVisibility': 'xAxisLabelVisibility',\n 'axisLabelsY.majorLabelVisibility': 'yAxisLabelVisibility',\n 'axisLabelsY2.majorLabelVisibility': 'y2AxisLabelVisibility',\n 'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',\n 'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',\n 'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',\n 'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',\n 'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',\n 'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',\n 'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',\n 'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',\n 'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',\n 'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',\n 'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',\n 'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',\n 'axisLabelsX.majorUnit': 'xAxisMajorTickInterval',\n 'axisLabelsY.majorUnit': 'yAxisMajorTickInterval',\n 'axisLabelsY2.majorUnit': 'y2AxisMajorTickInterval',\n 'axisX.abbreviation': 'xAxisAbbreviation',\n 'axisY.abbreviation': 'yAxisAbbreviation',\n 'axisY2.abbreviation': 'y2AxisAbbreviation',\n 'axisLabelsX.integerUnits': 'showRoundedXAxisLabels',\n 'axisLabelsY2.integerUnits': 'showRoundedY2AxisLabels',\n 'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',\n 'axisLabelsX.axisVisibility': 'xAxisLineVisibility',\n 'axisLabelsY.axisVisibility': 'yAxisLineVisibility',\n 'axisLabelsY2.axisVisibility': 'y2AxisLineVisibility',\n 'gridLinesX.showMajorLines': 'showXMajorGridLines',\n 'gridLinesY.showMajorLines': 'showYMajorGridLines',\n 'gridLinesX.showMinorLines': 'showXMinorGridLines',\n 'gridLinesY.showMinorLines': 'showYMinorGridLines',\n 'gridLinesY2.showMajorLines': 'showY2MajorGridLines',\n 'gridLinesY2.showMinorLines': 'showY2MinorGridLines',\n 'axisX.scale': 'xAxisScale',\n 'axisY.scale': 'yAxisScale',\n 'axisY2.scale': 'y2AxisScale',\n 'axisX.maximumNumber': 'xAxisMax',\n 'axisY.maximumNumber': 'yAxisMax',\n 'axisY2.maximumNumber': 'y2AxisMax',\n 'axisX.minimumNumber': 'xAxisMin',\n 'axisY.minimumNumber': 'yAxisMin',\n 'axisY2.minimumNumber': 'y2AxisMin',\n 'axisX.includeZero': 'showXAxisWithZero',\n 'axisY.includeZero': 'showYAxisWithZero',\n 'axisY2.includeZero': 'showY2AxisWithZero',\n 'axisLabelsX.extendsAxisRange': 'showXAxisExtendedRange',\n 'axisLabelsY.extendsAxisRange': 'showYAxisExtendedRange',\n 'layout.splitSeries': 'showSplitSeries',\n 'layout.splitSeries.allowIndependentYRanges': 'showIndependentYRanges',\n 'axisY2.enabled': 'showOverlayY2Axis',\n 'axisY2.fields': 'y2Fields',\n 'chart.overlayFields': 'overlayFields',\n 'legend.labels': 'legendLabels',\n 'legend.labelStyle.overflowMode': 'legendTruncation',\n 'legend.mode': 'legendMode',\n 'legend.placement': 'legendDisplay',\n 'chart.nullValueMode': 'nullValueDisplay',\n 'chart.showDataLabels': 'dataValuesDisplay',\n fieldColors: 'seriesColorsByField',\n 'chart.resultTruncationLimit': 'resultLimit',\n 'chart.stackMode': 'stackMode',\n 'chart.barSpacing': 'barSpacing',\n 'chart.columnSpacing': 'columnSpacing',\n 'chart.seriesSpacing': 'seriesSpacing',\n 'chart.sliceCollapsingLabel': 'collapseLabel',\n 'chart.sliceCollapsingThreshold': 'collapseThreshold',\n hasDonutHole: 'showDonutHole',\n // area specific mapped options\n areaFillOpacity: 'areaOpacity',\n 'chart.showLines': 'showLines',\n // bubble specific mapped options\n 'chart.bubbleMinimumSize': 'bubbleSizeMin',\n 'chart.bubbleMaximumSize': 'bubbleSizeMax',\n 'chart.bubbleSizeBy': 'bubbleSizeMethod',\n // line specific mapped options\n fieldDashStyles: 'lineDashStylesByField',\n 'chart.showMarkers': 'markerDisplay',\n // scatter-specific options\n 'chart.markerSize': 'markerSize',\n};\n\nconst visibilityEnumReplacements = {\n visible: 'show',\n collapsed: 'hide',\n};\nconst modeEnumReplacements = {\n none: 'off',\n};\n/**\n * for some options the valid values changed.\n * this maps enum values that need to be changed\n */\nconst enumReplacements = {\n xAxisTitleVisibility: visibilityEnumReplacements,\n yAxisTitleVisibility: visibilityEnumReplacements,\n y2AxisTitleVisibility: visibilityEnumReplacements,\n xAxisAbbreviation: modeEnumReplacements,\n yAxisAbbreviation: modeEnumReplacements,\n y2AxisAbbreviation: modeEnumReplacements,\n dataValuesDisplay: modeEnumReplacements,\n legendDisplay: modeEnumReplacements,\n legendTruncation: {\n ellipsisNone: 'ellipsisOff',\n },\n stackMode: {\n default: 'auto',\n },\n};\n\n// splits a string with multiple fields separated by comma\n// returns the same value if it's already an array\nconst splitValue = (oldValue: string | string[]) =>\n Array.isArray(oldValue) ? oldValue : oldValue.split(',');\n\n/**\n * converts stringified objects into plain objects\n *\n * @param {string | Object} oldValue stringified object to parse\n * @returns {Object}\n */\nconst parseObjects = (oldValue: string | Record<string, unknown>): Record<string, unknown> => {\n if (typeof oldValue === 'object' && !Array.isArray(oldValue)) {\n return oldValue;\n }\n let nuValue = {};\n try {\n nuValue = JSON.parse(oldValue as string);\n } catch (e) {\n /* noop */\n }\n return nuValue;\n};\n\n/**\n * some option values require special processing\n * (e.g. if the type of the updated option changed)\n * \"legendLabels\": \"test,test2\" => \"legendLabels\": [\"test\", \"test2\"]\n */\nconst otherValueReplacements = {\n y2Fields: splitValue,\n overlayFields: splitValue,\n legendLabels: splitValue,\n seriesColorsByField: parseObjects,\n lineDashStylesByField: parseObjects,\n /**\n * the original markerDisplay was only exposed as `chart.showMarkers`\n * setting chart.showMarkers to true is the equivalent of `markerDisplay: 'outlined'`\n */\n markerDisplay: (oldValue: boolean) => {\n if (oldValue === false) return 'off';\n else if (oldValue === true) return 'outlined';\n return oldValue;\n },\n};\n\n/**\n * migrateChartingOptions\n * - renames option keys\n * - checks if enum values have changed for new options, replaces it\n * - checks if other replacements are necessary and applies them\n * @param {object} options dashboard-viz charting options\n * @returns {object} migratedOptions viz charting options\n */\nconst migrateChartingOptions = (options: Record<string, unknown>): Record<string, unknown> => {\n const migratedOptions = {};\n Object.keys(options).forEach(key => {\n const value = options[key];\n const updatedKey = optionRenames[key] ?? key;\n let updatedValue = enumReplacements?.[updatedKey]?.[value] ?? value;\n if (otherValueReplacements[updatedKey]) {\n updatedValue = otherValueReplacements[updatedKey](updatedValue);\n }\n migratedOptions[updatedKey] = updatedValue;\n });\n return migratedOptions;\n};\n\n/**\n * helper that encapsulates shared migration logic across most charting-based viz\n * @param {Object} defaultChanges - map consistsing of default value changes from viz.* to splunk.*\n * @param {Object} validOptions - the list of options that the new splunk.* viz supports\n * @param {VisualizationDefinition} vizDefinition - the viz definition to migrate\n * @param {String} vizType - the value of splunk.*\n */\nconst migrateBaseChartingVizDefinition = ({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType,\n}: {\n defaultChanges: Record<string, unknown>;\n validOptions: Record<string, unknown>;\n vizDefinition: VisualizationDefinition;\n vizType: string;\n}) => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: vizType,\n options: {},\n context: {},\n };\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedOptions = {\n ...defaultChanges,\n ...migrateChartingOptions(options),\n ...dataOptions,\n };\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n migratedDefinition.options = migratedOptions;\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n\nexport { migrateBaseChartingVizDefinition, migrateChartingOptions, otherValueReplacements };\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","export * from './encoding';\n","export * from './migrate';\n","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport {\n migrateVizToSplunkArea,\n migrateVizToSplunkBar,\n migrateVizToSplunkBubble,\n migrateVizToSplunkColumn,\n migrateVizToSplunkLine,\n migrateVizToSplunkPie,\n migrateVizToSplunkScatter,\n} from './visualizations';\n\nconst supportedMigrations = {\n 'viz.area': {\n 'splunk.area': migrateVizToSplunkArea,\n },\n 'viz.bar': {\n 'splunk.bar': migrateVizToSplunkBar,\n },\n 'viz.bubble': {\n 'splunk.bubble': migrateVizToSplunkBubble,\n },\n 'viz.column': {\n 'splunk.column': migrateVizToSplunkColumn,\n },\n 'viz.line': {\n 'splunk.line': migrateVizToSplunkLine,\n },\n 'viz.pie': {\n 'splunk.pie': migrateVizToSplunkPie,\n },\n 'viz.scatter': {\n 'splunk.scatter': migrateVizToSplunkScatter,\n },\n};\n\nconst inferToType = (typeFromDefinition: string): string => typeFromDefinition.replace('viz.', 'splunk.');\n\ninterface MigrationParams {\n definition: VisualizationDefinition;\n toType?: string;\n}\n\nconst migrate = ({ definition, toType: toTypeFromParams }: MigrationParams): VisualizationDefinition => {\n const toType = toTypeFromParams ?? inferToType(definition.type);\n if (!supportedMigrations?.[definition?.type]?.[toType]) {\n throw new Error('Migration currently not supported');\n }\n return supportedMigrations[definition.type][toType](definition);\n};\n\ninterface CanMigrateParams {\n fromType: string;\n toType: string;\n}\n\nconst canMigrate = ({ fromType, toType }: CanMigrateParams): boolean => {\n if (supportedMigrations?.[fromType]?.[toType]) {\n return true;\n }\n return false;\n};\n\nexport { migrate, canMigrate };\n","export * from './area';\nexport * from './bar';\nexport * from './bubble';\nexport * from './column';\nexport * from './line';\nexport * from './pie';\nexport * from './scatter';\n","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Area';\n\nconst validOptions = {\n ...config.optionsSchema,\n};\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkArea = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n return migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.area',\n });\n};\n\nexport { migrateVizToSplunkArea };\n","import {\n parseNameBasedFieldReference,\n parseIndexBasedFieldReference,\n} from '@splunk/visualization-encoding-parsers/Base';\n// @TODO(pwied): move the parsing helpers so we can deprecate visualization-encoding-parsers package\n\n// index based references are defined by <dataSource>[<index>]\n// this regex matches <text with numbers>[<anything>]\n// the \"[\" \"]\" part makes it an index based reference\nconst indexBasedRegx = /^[A-Za-z0-9_]+\\[.*\\].*$/;\n// name based references are defined by <dataSource>.<columnName>\n// the \".\" access makes it a name based reference\nconst nameBasedRegx = /^[A-Za-z0-9_]+\\..*$/;\n\ninterface AdvancedEncodingConfig {\n field: string;\n format?: Record<string, unknown>;\n}\ntype EncodingConfig = string | string[] | AdvancedEncodingConfig;\n\nexport type { EncodingConfig };\n\ninterface DynamicOptionsChunk {\n options: Record<string, unknown>;\n context: Record<string, unknown>;\n}\nconst isIndexBasedReference = ref => indexBasedRegx.test(ref);\nconst isNameBasedReference = ref => nameBasedRegx.test(ref);\n\n/**\n * Translates encoding data selections in array format\n *\n * Note:\n * 'frameBySeriesIndexes' only supports positive indexes\n *\n * Examples:\n * 1. all index based selection\n * ['primary[0]', 'primary[1]'] => '> primary | frameBySeriesIndexes(0,1)'\n *\n * 2. all name based selection\n * ['primary.foo', 'primary.bar'] => '> primary | frameBySeriesNames(\"foo\",\"bar\")'\n *\n * 3. index or name based selections\n * ['primary.foo', 'primary[1]'] => '> primary | frameBySeriesNamesOrIndexes(\"foo\",1)'\n */\nconst translateArrayFormatDataReference = (encodingDataReference: string[]): string => {\n if (encodingDataReference.length === 0) {\n return;\n }\n const allIndexBased = encodingDataReference.every(isIndexBasedReference);\n const allNameBased = encodingDataReference.every(isNameBasedReference);\n\n if (allIndexBased) {\n const { dataSourceName } = parseIndexBasedFieldReference(encodingDataReference[0]);\n const indexesStr = encodingDataReference\n .map(ref => parseIndexBasedFieldReference(ref)?.fieldIndex)\n .join(',');\n return `> ${dataSourceName} | frameBySeriesIndexes(${indexesStr})`;\n } else if (allNameBased) {\n const { dataSourceName } = parseNameBasedFieldReference(encodingDataReference[0]);\n const namesStr = encodingDataReference\n .map(ref => '\"' + parseNameBasedFieldReference(ref)?.fieldName + '\"')\n .join(',');\n return `> ${dataSourceName} | frameBySeriesNames(${namesStr})`;\n } else {\n // it's a mix of name and index based references\n // get the first ref to extract the dataSource\n const firstEntry = encodingDataReference[0];\n const { dataSourceName } = isIndexBasedReference(firstEntry)\n ? parseIndexBasedFieldReference(firstEntry)\n : parseNameBasedFieldReference(firstEntry);\n const paramStr = encodingDataReference\n .map(ref => {\n return isIndexBasedReference(ref)\n ? parseIndexBasedFieldReference(ref)?.fieldIndex\n : '\"' + parseNameBasedFieldReference(ref)?.fieldName + '\"';\n })\n .join(',');\n return `> ${dataSourceName} | frameBySeriesNamesOrIndexes(${paramStr})`;\n }\n};\n\n/**\n * Translates an encoding data selection string to a dynamic options data selection\n *\n * Index based column selection\n * 'primary[0]' => '> primary | seriesByIndex(0)'\n *\n * Index range based column selection\n * 'primary[1:]' => '> primary | frameBySeriesIndexRange(1)'\n * 'primary[0:3]' => '> primary | frameBySeriesIndexRange(0,2)'\n *\n * Name based column selection\n * 'primary.foo' => '> primary | seriesByName(\"foo\")'\n *\n * Encoding references\n * 'encoding.x' => '> x'\n */\nconst translateDataReference = (encodingDataReference: string): string => {\n if (encodingDataReference.indexOf('encoding.') === 0) {\n return `> ${encodingDataReference.replace('encoding.', '')}`;\n }\n const isIndexBasedRef = isIndexBasedReference(encodingDataReference);\n const isNameBasedRef = isNameBasedReference(encodingDataReference);\n\n if (!isIndexBasedRef && !isNameBasedRef) {\n console.warn('Unable to parse the encoding. Please verify the encoding format is correct');\n return;\n }\n\n if (isNameBasedRef) {\n const { dataSourceName, fieldName /* columnIndex */ } = parseNameBasedFieldReference(\n encodingDataReference\n );\n return `> ${dataSourceName} | seriesByName(\"${fieldName}\")`;\n }\n if (isIndexBasedRef) {\n const {\n dataSourceName,\n fieldIndex,\n /* columnIndex, */\n isFieldIndexRange,\n fromFieldIndex,\n toFieldIndex,\n } = parseIndexBasedFieldReference(encodingDataReference);\n if (isFieldIndexRange) {\n let dslToIndexString;\n if (toFieldIndex === -1) {\n dslToIndexString = '';\n } else {\n // adjust index, DSL is using default slice behavior whereas encoding behaved differently\n dslToIndexString = `,${toFieldIndex + 1}`;\n }\n return `> ${dataSourceName} | frameBySeriesIndexRange(${fromFieldIndex}${dslToIndexString})`;\n } else {\n return `> ${dataSourceName} | seriesByIndex(${fieldIndex})`;\n }\n }\n};\n/**\n * An encoding configuration can come in various different forms:\n *\n * 1. Simple data selection (either index or name based)\n * {\n * x: 'primary[0]',\n * y: 'primary.count'\n * }\n *\n * 2. Multi column selection in array format\n * {\n * x: 'primary[0]',\n * \t y: ['primary.count', 'primary.count2']\n * }\n *\n * 3. Advanced Encoding Configuration (for data selection and formatting)\n * {\n * x: {\n * \t field: 'primary[0]',\n * \t },\n * y: {\n * \t field: 'primary[1]',\n * format: {},\n * }\n * }\n */\nconst encodingToDynamicOptionsDSL = (encoding: Record<string, EncodingConfig>): DynamicOptionsChunk => {\n const dynamicOptions: DynamicOptionsChunk = {\n options: {},\n context: {},\n };\n const translatedOptions = {};\n Object.keys(encoding).forEach(key => {\n const fieldReference = encoding[key];\n let fieldReferenceStr = fieldReference as string;\n if (typeof fieldReference === 'object' && !Array.isArray(fieldReference)) {\n const { field } = fieldReference;\n if (field && !Array.isArray(field)) {\n fieldReferenceStr = field;\n }\n }\n let translatedValue;\n // field reference is either in form of array or string\n if (Array.isArray(fieldReference)) {\n translatedValue = translateArrayFormatDataReference(fieldReference);\n } else {\n translatedValue = translateDataReference(fieldReferenceStr);\n }\n // omit if translated value is not set\n if (translatedValue) {\n translatedOptions[key] = translatedValue;\n }\n });\n dynamicOptions.options = translatedOptions;\n return dynamicOptions;\n};\n\nexport { encodingToDynamicOptionsDSL };\n","module.exports = require(\"@splunk/visualization-encoding-parsers/Base\");","module.exports = require(\"@splunk/visualizations/Area\");","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Bar';\n\nconst validOptions = {\n ...config.optionsSchema,\n};\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkBar = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n return migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.bar',\n });\n};\n\nexport { migrateVizToSplunkBar };\n","module.exports = require(\"@splunk/visualizations/Bar\");","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Bubble';\n\nconst validOptions = {\n ...config.optionsSchema,\n};\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n legendTruncation: 'ellipsisMiddle',\n};\n\nconst migrateVizToSplunkBubble = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n return migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.bubble',\n });\n};\n\nexport { migrateVizToSplunkBubble };\n","module.exports = require(\"@splunk/visualizations/Bubble\");","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Column';\n\nconst validOptions = {\n ...config.optionsSchema,\n};\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n};\n\nconst migrateVizToSplunkColumn = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n return migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.column',\n });\n};\n\nexport { migrateVizToSplunkColumn };\n","module.exports = require(\"@splunk/visualizations/Column\");","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Line';\n\nconst validOptions = {\n ...config.optionsSchema,\n};\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n y2AxisAbbreviation: 'off',\n showRoundedY2AxisLabels: false,\n legendTruncation: 'ellipsisMiddle',\n showY2MajorGridLines: true,\n markerDisplay: 'outlined',\n};\n\nconst migrateVizToSplunkLine = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n return migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.line',\n });\n};\n\nexport { migrateVizToSplunkLine };\n","module.exports = require(\"@splunk/visualizations/Line\");","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { migrateChartingOptions, otherValueReplacements } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Pie';\n\nconst validOptions = {\n ...config.optionsSchema,\n};\n\nconst migratePieChartLabelAndPercent = (options: Record<string, unknown>): Record<string, string> => {\n // if neither chart.showLabels or chart.showPercent is specified in viz.pie,\n // splunk.pie use the default labelDisplay value\n if (!('chart.showLabels' in options) && !('chart.showPercent' in options)) {\n return {};\n }\n\n // if only chart.showPercent is specified in viz.pie\n if (!('chart.showLabels' in options) && 'chart.showPercent' in options) {\n return { labelDisplay: options['chart.showPercent'] ? 'valuesAndPercentage' : 'values' };\n }\n\n // if only chart.showLabels is specified in viz.pie\n if ('chart.showLabels' in options && !('chart.showPercent' in options)) {\n return { labelDisplay: options['chart.showLabels'] ? 'values' : 'off' };\n }\n\n // if both chart.showLabels and chart.showPercent are specified in viz.pie\n const labelOption = {\n labelDisplay: 'values',\n };\n if (options['chart.showLabels'] && options['chart.showPercent']) {\n labelOption.labelDisplay = 'valuesAndPercentage';\n }\n if (!options['chart.showLabels']) {\n labelOption.labelDisplay = 'off';\n }\n\n return labelOption;\n};\n\nconst migrateFieldColors = (options: Record<string, any>): Record<string, any> => {\n if ('fieldColors' in options) {\n return {\n seriesColorsByValue: otherValueReplacements.seriesColorsByField(options.fieldColors),\n };\n } else {\n return {};\n }\n};\n\nconst migrateVizToSplunkPie = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n const { encoding = {}, options = {}, ...otherDefinitionParts } = vizDefinition;\n const migratedDefinition: VisualizationDefinition = {\n ...otherDefinitionParts,\n type: 'splunk.pie',\n options: {},\n context: {},\n };\n // translate encoding to dynamic options equivalent\n const { options: dataOptions, context: dataContext } = encodingToDynamicOptionsDSL(\n encoding as Record<string, EncodingConfig>\n );\n\n const migratedOptions = {\n ...migratePieChartLabelAndPercent(options),\n ...migrateChartingOptions(options),\n ...migrateFieldColors(options),\n ...dataOptions,\n };\n // remove invalid options\n Object.keys(migratedOptions).forEach(key => {\n if (!validOptions[key]) {\n delete migratedOptions[key];\n }\n });\n migratedDefinition.options = migratedOptions;\n migratedDefinition.context = dataContext;\n\n return migratedDefinition;\n};\n\nexport { migrateVizToSplunkPie };\n","module.exports = require(\"@splunk/visualizations/Pie\");","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport { migrateBaseChartingVizDefinition } from './splunk-charting';\nimport { config } from '@splunk/visualizations/Scatter';\n\nconst validOptions = {\n ...config.optionsSchema,\n};\n\n// old default configurations should be retained in migrated configuration\nconst defaultChanges = {\n yAxisAbbreviation: 'off',\n legendTruncation: 'ellipsisMiddle',\n};\n\nconst migrateVizToSplunkScatter = (vizDefinition: VisualizationDefinition): VisualizationDefinition => {\n return migrateBaseChartingVizDefinition({\n defaultChanges,\n validOptions,\n vizDefinition,\n vizType: 'splunk.scatter',\n });\n};\n\nexport { migrateVizToSplunkScatter };\n","module.exports = require(\"@splunk/visualizations/Scatter\");"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Migration scripts for visualization definitions",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"author": "Splunk",
|
|
6
|
-
"version": "23.
|
|
6
|
+
"version": "23.4.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "NODE_ENV=production webpack --config ./webpack.config.js --bail",
|
|
9
9
|
"clean": "yarn clean:webpack && yarn clean:test-reports",
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime": "^7.13.0",
|
|
19
19
|
"@splunk/dashboard-types": "^22.4.0",
|
|
20
|
-
"@splunk/visualization-encoding-parsers": "^23.
|
|
21
|
-
"@splunk/visualizations": "^23.
|
|
20
|
+
"@splunk/visualization-encoding-parsers": "^23.4.0",
|
|
21
|
+
"@splunk/visualizations": "^23.4.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@babel/cli": "^7.13.0",
|
|
25
25
|
"@babel/core": "^7.13.0",
|
|
26
|
-
"@splunk/
|
|
26
|
+
"@splunk/dashboard-types": "^23.0.0",
|
|
27
|
+
"@splunk/visualization-build-tools": "^23.4.0",
|
|
27
28
|
"babel-jest": "^26.0.0",
|
|
28
29
|
"jest": "^26.0.0"
|
|
29
30
|
},
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
import type { VisualizationDefinition } from '@splunk/dashboard-types';
|
|
2
|
+
/**
|
|
3
|
+
* some option values require special processing
|
|
4
|
+
* (e.g. if the type of the updated option changed)
|
|
5
|
+
* "legendLabels": "test,test2" => "legendLabels": ["test", "test2"]
|
|
6
|
+
*/
|
|
7
|
+
declare const otherValueReplacements: {
|
|
8
|
+
y2Fields: (oldValue: string | string[]) => string[];
|
|
9
|
+
overlayFields: (oldValue: string | string[]) => string[];
|
|
10
|
+
legendLabels: (oldValue: string | string[]) => string[];
|
|
11
|
+
seriesColorsByField: (oldValue: string | Record<string, unknown>) => Record<string, unknown>;
|
|
12
|
+
lineDashStylesByField: (oldValue: string | Record<string, unknown>) => Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* the original markerDisplay was only exposed as `chart.showMarkers`
|
|
15
|
+
* setting chart.showMarkers to true is the equivalent of `markerDisplay: 'outlined'`
|
|
16
|
+
*/
|
|
17
|
+
markerDisplay: (oldValue: boolean) => "off" | "outlined";
|
|
18
|
+
};
|
|
1
19
|
/**
|
|
2
20
|
* migrateChartingOptions
|
|
3
21
|
* - renames option keys
|
|
@@ -7,4 +25,17 @@
|
|
|
7
25
|
* @returns {object} migratedOptions viz charting options
|
|
8
26
|
*/
|
|
9
27
|
declare const migrateChartingOptions: (options: Record<string, unknown>) => Record<string, unknown>;
|
|
10
|
-
|
|
28
|
+
/**
|
|
29
|
+
* helper that encapsulates shared migration logic across most charting-based viz
|
|
30
|
+
* @param {Object} defaultChanges - map consistsing of default value changes from viz.* to splunk.*
|
|
31
|
+
* @param {Object} validOptions - the list of options that the new splunk.* viz supports
|
|
32
|
+
* @param {VisualizationDefinition} vizDefinition - the viz definition to migrate
|
|
33
|
+
* @param {String} vizType - the value of splunk.*
|
|
34
|
+
*/
|
|
35
|
+
declare const migrateBaseChartingVizDefinition: ({ defaultChanges, validOptions, vizDefinition, vizType, }: {
|
|
36
|
+
defaultChanges: Record<string, unknown>;
|
|
37
|
+
validOptions: Record<string, unknown>;
|
|
38
|
+
vizDefinition: VisualizationDefinition;
|
|
39
|
+
vizType: string;
|
|
40
|
+
}) => VisualizationDefinition;
|
|
41
|
+
export { migrateBaseChartingVizDefinition, migrateChartingOptions, otherValueReplacements };
|