@splunk/visualization-migrations 23.3.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 +136 -98
- package/index.js.map +1 -1
- package/package.json +5 -4
- package/types/visualizations/bubble.d.ts +3 -0
- package/types/visualizations/index.d.ts +2 -0
- package/types/visualizations/scatter.d.ts +3 -0
package/index.js
CHANGED
|
@@ -97,7 +97,7 @@ module.exports =
|
|
|
97
97
|
"use strict";
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
var _typeof = __webpack_require__(
|
|
100
|
+
var _typeof = __webpack_require__(1);
|
|
101
101
|
|
|
102
102
|
var __rest = this && this.__rest || function (s, e) {
|
|
103
103
|
var t = {};
|
|
@@ -117,7 +117,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
117
117
|
});
|
|
118
118
|
exports.otherValueReplacements = exports.migrateChartingOptions = exports.migrateBaseChartingVizDefinition = void 0;
|
|
119
119
|
|
|
120
|
-
var encoding_1 = __webpack_require__(
|
|
120
|
+
var encoding_1 = __webpack_require__(2);
|
|
121
121
|
/**
|
|
122
122
|
* map of splunk charting based @splunk/dashboard-visualization option names
|
|
123
123
|
* to updated @splunk/visualization option names
|
|
@@ -138,17 +138,22 @@ var optionRenames = {
|
|
|
138
138
|
'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',
|
|
139
139
|
'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',
|
|
140
140
|
'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',
|
|
141
|
+
'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',
|
|
141
142
|
'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',
|
|
142
143
|
'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',
|
|
143
144
|
'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',
|
|
144
145
|
'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',
|
|
145
146
|
'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',
|
|
147
|
+
'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',
|
|
146
148
|
'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',
|
|
147
149
|
'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',
|
|
150
|
+
'axisLabelsX.majorUnit': 'xAxisMajorTickInterval',
|
|
148
151
|
'axisLabelsY.majorUnit': 'yAxisMajorTickInterval',
|
|
149
152
|
'axisLabelsY2.majorUnit': 'y2AxisMajorTickInterval',
|
|
153
|
+
'axisX.abbreviation': 'xAxisAbbreviation',
|
|
150
154
|
'axisY.abbreviation': 'yAxisAbbreviation',
|
|
151
155
|
'axisY2.abbreviation': 'y2AxisAbbreviation',
|
|
156
|
+
'axisLabelsX.integerUnits': 'showRoundedXAxisLabels',
|
|
152
157
|
'axisLabelsY2.integerUnits': 'showRoundedY2AxisLabels',
|
|
153
158
|
'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',
|
|
154
159
|
'axisLabelsX.axisVisibility': 'xAxisLineVisibility',
|
|
@@ -156,17 +161,23 @@ var optionRenames = {
|
|
|
156
161
|
'axisLabelsY2.axisVisibility': 'y2AxisLineVisibility',
|
|
157
162
|
'gridLinesX.showMajorLines': 'showXMajorGridLines',
|
|
158
163
|
'gridLinesY.showMajorLines': 'showYMajorGridLines',
|
|
164
|
+
'gridLinesX.showMinorLines': 'showXMinorGridLines',
|
|
159
165
|
'gridLinesY.showMinorLines': 'showYMinorGridLines',
|
|
160
166
|
'gridLinesY2.showMajorLines': 'showY2MajorGridLines',
|
|
161
167
|
'gridLinesY2.showMinorLines': 'showY2MinorGridLines',
|
|
168
|
+
'axisX.scale': 'xAxisScale',
|
|
162
169
|
'axisY.scale': 'yAxisScale',
|
|
163
170
|
'axisY2.scale': 'y2AxisScale',
|
|
171
|
+
'axisX.maximumNumber': 'xAxisMax',
|
|
164
172
|
'axisY.maximumNumber': 'yAxisMax',
|
|
165
173
|
'axisY2.maximumNumber': 'y2AxisMax',
|
|
174
|
+
'axisX.minimumNumber': 'xAxisMin',
|
|
166
175
|
'axisY.minimumNumber': 'yAxisMin',
|
|
167
176
|
'axisY2.minimumNumber': 'y2AxisMin',
|
|
177
|
+
'axisX.includeZero': 'showXAxisWithZero',
|
|
168
178
|
'axisY.includeZero': 'showYAxisWithZero',
|
|
169
179
|
'axisY2.includeZero': 'showY2AxisWithZero',
|
|
180
|
+
'axisLabelsX.extendsAxisRange': 'showXAxisExtendedRange',
|
|
170
181
|
'axisLabelsY.extendsAxisRange': 'showYAxisExtendedRange',
|
|
171
182
|
'layout.splitSeries': 'showSplitSeries',
|
|
172
183
|
'layout.splitSeries.allowIndependentYRanges': 'showIndependentYRanges',
|
|
@@ -191,9 +202,15 @@ var optionRenames = {
|
|
|
191
202
|
// area specific mapped options
|
|
192
203
|
areaFillOpacity: 'areaOpacity',
|
|
193
204
|
'chart.showLines': 'showLines',
|
|
205
|
+
// bubble specific mapped options
|
|
206
|
+
'chart.bubbleMinimumSize': 'bubbleSizeMin',
|
|
207
|
+
'chart.bubbleMaximumSize': 'bubbleSizeMax',
|
|
208
|
+
'chart.bubbleSizeBy': 'bubbleSizeMethod',
|
|
194
209
|
// line specific mapped options
|
|
195
210
|
fieldDashStyles: 'lineDashStylesByField',
|
|
196
|
-
'chart.showMarkers': 'markerDisplay'
|
|
211
|
+
'chart.showMarkers': 'markerDisplay',
|
|
212
|
+
// scatter-specific options
|
|
213
|
+
'chart.markerSize': 'markerSize'
|
|
197
214
|
};
|
|
198
215
|
var visibilityEnumReplacements = {
|
|
199
216
|
visible: 'show',
|
|
@@ -211,6 +228,7 @@ var enumReplacements = {
|
|
|
211
228
|
xAxisTitleVisibility: visibilityEnumReplacements,
|
|
212
229
|
yAxisTitleVisibility: visibilityEnumReplacements,
|
|
213
230
|
y2AxisTitleVisibility: visibilityEnumReplacements,
|
|
231
|
+
xAxisAbbreviation: modeEnumReplacements,
|
|
214
232
|
yAxisAbbreviation: modeEnumReplacements,
|
|
215
233
|
y2AxisAbbreviation: modeEnumReplacements,
|
|
216
234
|
dataValuesDisplay: modeEnumReplacements,
|
|
@@ -348,6 +366,12 @@ exports.migrateBaseChartingVizDefinition = migrateBaseChartingVizDefinition;
|
|
|
348
366
|
|
|
349
367
|
/***/ }),
|
|
350
368
|
/* 1 */
|
|
369
|
+
/***/ (function(module, exports) {
|
|
370
|
+
|
|
371
|
+
module.exports = require("@babel/runtime/helpers/typeof");
|
|
372
|
+
|
|
373
|
+
/***/ }),
|
|
374
|
+
/* 2 */
|
|
351
375
|
/***/ (function(module, exports, __webpack_require__) {
|
|
352
376
|
|
|
353
377
|
"use strict";
|
|
@@ -378,12 +402,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
378
402
|
|
|
379
403
|
__exportStar(__webpack_require__(7), exports);
|
|
380
404
|
|
|
381
|
-
/***/ }),
|
|
382
|
-
/* 2 */
|
|
383
|
-
/***/ (function(module, exports) {
|
|
384
|
-
|
|
385
|
-
module.exports = require("@babel/runtime/helpers/typeof");
|
|
386
|
-
|
|
387
405
|
/***/ }),
|
|
388
406
|
/* 3 */
|
|
389
407
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -434,17 +452,23 @@ var supportedMigrations = {
|
|
|
434
452
|
'viz.area': {
|
|
435
453
|
'splunk.area': visualizations_1.migrateVizToSplunkArea
|
|
436
454
|
},
|
|
437
|
-
'viz.column': {
|
|
438
|
-
'splunk.column': visualizations_1.migrateVizToSplunkColumn
|
|
439
|
-
},
|
|
440
455
|
'viz.bar': {
|
|
441
456
|
'splunk.bar': visualizations_1.migrateVizToSplunkBar
|
|
442
457
|
},
|
|
458
|
+
'viz.bubble': {
|
|
459
|
+
'splunk.bubble': visualizations_1.migrateVizToSplunkBubble
|
|
460
|
+
},
|
|
461
|
+
'viz.column': {
|
|
462
|
+
'splunk.column': visualizations_1.migrateVizToSplunkColumn
|
|
463
|
+
},
|
|
443
464
|
'viz.line': {
|
|
444
465
|
'splunk.line': visualizations_1.migrateVizToSplunkLine
|
|
445
466
|
},
|
|
446
467
|
'viz.pie': {
|
|
447
468
|
'splunk.pie': visualizations_1.migrateVizToSplunkPie
|
|
469
|
+
},
|
|
470
|
+
'viz.scatter': {
|
|
471
|
+
'splunk.scatter': visualizations_1.migrateVizToSplunkScatter
|
|
448
472
|
}
|
|
449
473
|
};
|
|
450
474
|
|
|
@@ -524,6 +548,10 @@ __exportStar(__webpack_require__(14), exports);
|
|
|
524
548
|
|
|
525
549
|
__exportStar(__webpack_require__(16), exports);
|
|
526
550
|
|
|
551
|
+
__exportStar(__webpack_require__(18), exports);
|
|
552
|
+
|
|
553
|
+
__exportStar(__webpack_require__(20), exports);
|
|
554
|
+
|
|
527
555
|
/***/ }),
|
|
528
556
|
/* 6 */
|
|
529
557
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -568,7 +596,7 @@ exports.migrateVizToSplunkArea = migrateVizToSplunkArea;
|
|
|
568
596
|
"use strict";
|
|
569
597
|
|
|
570
598
|
|
|
571
|
-
var _typeof = __webpack_require__(
|
|
599
|
+
var _typeof = __webpack_require__(1);
|
|
572
600
|
|
|
573
601
|
Object.defineProperty(exports, "__esModule", {
|
|
574
602
|
value: true
|
|
@@ -802,26 +830,11 @@ module.exports = require("@splunk/visualizations/Area");
|
|
|
802
830
|
"use strict";
|
|
803
831
|
|
|
804
832
|
|
|
805
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
806
|
-
var t = {};
|
|
807
|
-
|
|
808
|
-
for (var p in s) {
|
|
809
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
813
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
814
|
-
}
|
|
815
|
-
return t;
|
|
816
|
-
};
|
|
817
|
-
|
|
818
833
|
Object.defineProperty(exports, "__esModule", {
|
|
819
834
|
value: true
|
|
820
835
|
});
|
|
821
836
|
exports.migrateVizToSplunkBar = void 0;
|
|
822
837
|
|
|
823
|
-
var encoding_1 = __webpack_require__(1);
|
|
824
|
-
|
|
825
838
|
var splunk_charting_1 = __webpack_require__(0);
|
|
826
839
|
|
|
827
840
|
var Bar_1 = __webpack_require__(11);
|
|
@@ -837,32 +850,12 @@ var defaultChanges = {
|
|
|
837
850
|
};
|
|
838
851
|
|
|
839
852
|
var migrateVizToSplunkBar = function migrateVizToSplunkBar(vizDefinition) {
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
var migratedDefinition = Object.assign(Object.assign({}, otherDefinitionParts), {
|
|
847
|
-
type: 'splunk.bar',
|
|
848
|
-
options: {},
|
|
849
|
-
context: {}
|
|
850
|
-
}); // translate encoding to dynamic options equivalent
|
|
851
|
-
|
|
852
|
-
var _encoding_1$encodingT = encoding_1.encodingToDynamicOptionsDSL(encoding),
|
|
853
|
-
dataOptions = _encoding_1$encodingT.options,
|
|
854
|
-
dataContext = _encoding_1$encodingT.context;
|
|
855
|
-
|
|
856
|
-
var migratedOptions = Object.assign(Object.assign(Object.assign({}, defaultChanges), splunk_charting_1.migrateChartingOptions(options)), dataOptions); // remove invalid options
|
|
857
|
-
|
|
858
|
-
Object.keys(migratedOptions).forEach(function (key) {
|
|
859
|
-
if (!validOptions[key]) {
|
|
860
|
-
delete migratedOptions[key];
|
|
861
|
-
}
|
|
853
|
+
return splunk_charting_1.migrateBaseChartingVizDefinition({
|
|
854
|
+
defaultChanges: defaultChanges,
|
|
855
|
+
validOptions: validOptions,
|
|
856
|
+
vizDefinition: vizDefinition,
|
|
857
|
+
vizType: 'splunk.bar'
|
|
862
858
|
});
|
|
863
|
-
migratedDefinition.options = migratedOptions;
|
|
864
|
-
migratedDefinition.context = dataContext;
|
|
865
|
-
return migratedDefinition;
|
|
866
859
|
};
|
|
867
860
|
|
|
868
861
|
exports.migrateVizToSplunkBar = migrateVizToSplunkBar;
|
|
@@ -880,29 +873,54 @@ module.exports = require("@splunk/visualizations/Bar");
|
|
|
880
873
|
"use strict";
|
|
881
874
|
|
|
882
875
|
|
|
883
|
-
|
|
884
|
-
|
|
876
|
+
Object.defineProperty(exports, "__esModule", {
|
|
877
|
+
value: true
|
|
878
|
+
});
|
|
879
|
+
exports.migrateVizToSplunkBubble = void 0;
|
|
885
880
|
|
|
886
|
-
|
|
887
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
888
|
-
}
|
|
881
|
+
var splunk_charting_1 = __webpack_require__(0);
|
|
889
882
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
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
|
+
});
|
|
894
899
|
};
|
|
895
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
|
+
|
|
896
916
|
Object.defineProperty(exports, "__esModule", {
|
|
897
917
|
value: true
|
|
898
918
|
});
|
|
899
919
|
exports.migrateVizToSplunkColumn = void 0;
|
|
900
920
|
|
|
901
|
-
var encoding_1 = __webpack_require__(1);
|
|
902
|
-
|
|
903
921
|
var splunk_charting_1 = __webpack_require__(0);
|
|
904
922
|
|
|
905
|
-
var Column_1 = __webpack_require__(
|
|
923
|
+
var Column_1 = __webpack_require__(15);
|
|
906
924
|
|
|
907
925
|
var validOptions = Object.assign({}, Column_1.config.optionsSchema); // old default configurations should be retained in migrated configuration
|
|
908
926
|
|
|
@@ -915,44 +933,24 @@ var defaultChanges = {
|
|
|
915
933
|
};
|
|
916
934
|
|
|
917
935
|
var migrateVizToSplunkColumn = function migrateVizToSplunkColumn(vizDefinition) {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
var migratedDefinition = Object.assign(Object.assign({}, otherDefinitionParts), {
|
|
925
|
-
type: 'splunk.column',
|
|
926
|
-
options: {},
|
|
927
|
-
context: {}
|
|
928
|
-
}); // translate encoding to dynamic options equivalent
|
|
929
|
-
|
|
930
|
-
var _encoding_1$encodingT = encoding_1.encodingToDynamicOptionsDSL(encoding),
|
|
931
|
-
dataOptions = _encoding_1$encodingT.options,
|
|
932
|
-
dataContext = _encoding_1$encodingT.context;
|
|
933
|
-
|
|
934
|
-
var migratedOptions = Object.assign(Object.assign(Object.assign({}, defaultChanges), splunk_charting_1.migrateChartingOptions(options)), dataOptions); // remove invalid options
|
|
935
|
-
|
|
936
|
-
Object.keys(migratedOptions).forEach(function (key) {
|
|
937
|
-
if (!validOptions[key]) {
|
|
938
|
-
delete migratedOptions[key];
|
|
939
|
-
}
|
|
936
|
+
return splunk_charting_1.migrateBaseChartingVizDefinition({
|
|
937
|
+
defaultChanges: defaultChanges,
|
|
938
|
+
validOptions: validOptions,
|
|
939
|
+
vizDefinition: vizDefinition,
|
|
940
|
+
vizType: 'splunk.column'
|
|
940
941
|
});
|
|
941
|
-
migratedDefinition.options = migratedOptions;
|
|
942
|
-
migratedDefinition.context = dataContext;
|
|
943
|
-
return migratedDefinition;
|
|
944
942
|
};
|
|
945
943
|
|
|
946
944
|
exports.migrateVizToSplunkColumn = migrateVizToSplunkColumn;
|
|
947
945
|
|
|
948
946
|
/***/ }),
|
|
949
|
-
/*
|
|
947
|
+
/* 15 */
|
|
950
948
|
/***/ (function(module, exports) {
|
|
951
949
|
|
|
952
950
|
module.exports = require("@splunk/visualizations/Column");
|
|
953
951
|
|
|
954
952
|
/***/ }),
|
|
955
|
-
/*
|
|
953
|
+
/* 16 */
|
|
956
954
|
/***/ (function(module, exports, __webpack_require__) {
|
|
957
955
|
|
|
958
956
|
"use strict";
|
|
@@ -965,7 +963,7 @@ exports.migrateVizToSplunkLine = void 0;
|
|
|
965
963
|
|
|
966
964
|
var splunk_charting_1 = __webpack_require__(0);
|
|
967
965
|
|
|
968
|
-
var Line_1 = __webpack_require__(
|
|
966
|
+
var Line_1 = __webpack_require__(17);
|
|
969
967
|
|
|
970
968
|
var validOptions = Object.assign({}, Line_1.config.optionsSchema); // old default configurations should be retained in migrated configuration
|
|
971
969
|
|
|
@@ -990,13 +988,13 @@ var migrateVizToSplunkLine = function migrateVizToSplunkLine(vizDefinition) {
|
|
|
990
988
|
exports.migrateVizToSplunkLine = migrateVizToSplunkLine;
|
|
991
989
|
|
|
992
990
|
/***/ }),
|
|
993
|
-
/*
|
|
991
|
+
/* 17 */
|
|
994
992
|
/***/ (function(module, exports) {
|
|
995
993
|
|
|
996
994
|
module.exports = require("@splunk/visualizations/Line");
|
|
997
995
|
|
|
998
996
|
/***/ }),
|
|
999
|
-
/*
|
|
997
|
+
/* 18 */
|
|
1000
998
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1001
999
|
|
|
1002
1000
|
"use strict";
|
|
@@ -1020,11 +1018,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1020
1018
|
});
|
|
1021
1019
|
exports.migrateVizToSplunkPie = void 0;
|
|
1022
1020
|
|
|
1023
|
-
var encoding_1 = __webpack_require__(
|
|
1021
|
+
var encoding_1 = __webpack_require__(2);
|
|
1024
1022
|
|
|
1025
1023
|
var splunk_charting_1 = __webpack_require__(0);
|
|
1026
1024
|
|
|
1027
|
-
var Pie_1 = __webpack_require__(
|
|
1025
|
+
var Pie_1 = __webpack_require__(19);
|
|
1028
1026
|
|
|
1029
1027
|
var validOptions = Object.assign({}, Pie_1.config.optionsSchema);
|
|
1030
1028
|
|
|
@@ -1107,11 +1105,51 @@ var migrateVizToSplunkPie = function migrateVizToSplunkPie(vizDefinition) {
|
|
|
1107
1105
|
exports.migrateVizToSplunkPie = migrateVizToSplunkPie;
|
|
1108
1106
|
|
|
1109
1107
|
/***/ }),
|
|
1110
|
-
/*
|
|
1108
|
+
/* 19 */
|
|
1111
1109
|
/***/ (function(module, exports) {
|
|
1112
1110
|
|
|
1113
1111
|
module.exports = require("@splunk/visualizations/Pie");
|
|
1114
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");
|
|
1152
|
+
|
|
1115
1153
|
/***/ })
|
|
1116
1154
|
/******/ ]);
|
|
1117
1155
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/visualizations/splunk-charting.ts","webpack:///./src/encoding/index.ts","webpack:///external \"@babel/runtime/helpers/typeof\"","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/column.ts","webpack:///external \"@splunk/visualizations/Column\"","webpack:///./src/visualizations/line.ts","webpack:///external \"@splunk/visualizations/Line\"","webpack:///./src/visualizations/pie.ts","webpack:///external \"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F8F,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","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 '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 'chart.sliceCollapsingLabel': 'collapseLabel',\n 'chart.sliceCollapsingThreshold': 'collapseThreshold',\n hasDonutHole: 'showDonutHole',\n // area specific mapped options\n areaFillOpacity: 'areaOpacity',\n 'chart.showLines': 'showLines',\n // line specific mapped options\n fieldDashStyles: 'lineDashStylesByField',\n 'chart.showMarkers': 'markerDisplay',\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 * 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","export * from './encoding';\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","export * from './migrate';\n","import type { VisualizationDefinition } from '@splunk/dashboard-types';\nimport {\n migrateVizToSplunkArea,\n migrateVizToSplunkColumn,\n migrateVizToSplunkBar,\n migrateVizToSplunkPie,\n migrateVizToSplunkLine,\n} from './visualizations';\n\nconst supportedMigrations = {\n 'viz.area': {\n 'splunk.area': migrateVizToSplunkArea,\n },\n 'viz.column': {\n 'splunk.column': migrateVizToSplunkColumn,\n },\n 'viz.bar': {\n 'splunk.bar': migrateVizToSplunkBar,\n },\n 'viz.line': {\n 'splunk.line': migrateVizToSplunkLine,\n },\n 'viz.pie': {\n 'splunk.pie': migrateVizToSplunkPie,\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 './column';\nexport * from './line';\nexport * from './pie';\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 type { EncodingConfig } from '../encoding';\nimport { encodingToDynamicOptionsDSL } from '../encoding';\nimport { migrateChartingOptions } 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 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\");","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\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 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","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\");"],"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,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,0B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vB,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
|
},
|