@splunk/visualizations 26.1.0 → 26.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/Area.config.js +1 -1
  2. package/Area.js +31 -25
  3. package/Area.js.map +1 -1
  4. package/Bar.config.js +1 -1
  5. package/Bar.js +33 -22
  6. package/Bar.js.map +1 -1
  7. package/Bubble.config.js +1 -1
  8. package/Bubble.js +33 -22
  9. package/Bubble.js.map +1 -1
  10. package/ChoroplethSvg.config.js +1 -1
  11. package/ChoroplethSvg.js +42 -31
  12. package/ChoroplethSvg.js.map +1 -1
  13. package/Column.config.js +1 -1
  14. package/Column.js +33 -22
  15. package/Column.js.map +1 -1
  16. package/Ellipse.config.js +1 -1
  17. package/Ellipse.js +22 -11
  18. package/Ellipse.js.map +1 -1
  19. package/Events.config.js +1 -1
  20. package/Events.js +45 -34
  21. package/Events.js.map +1 -1
  22. package/FillerGauge.config.js +1 -1
  23. package/FillerGauge.js +30 -19
  24. package/FillerGauge.js.map +1 -1
  25. package/Image.config.js +1 -1
  26. package/Image.js +23 -13
  27. package/Image.js.map +1 -1
  28. package/Line.config.js +1 -1
  29. package/Line.js +234 -257
  30. package/Line.js.map +1 -1
  31. package/LinkGraph.config.js +1 -1
  32. package/LinkGraph.js +24 -14
  33. package/LinkGraph.js.map +1 -1
  34. package/Map.config.js +3 -2
  35. package/Map.config.js.map +1 -1
  36. package/Map.js +31 -20
  37. package/Map.js.map +1 -1
  38. package/Markdown.config.js +1 -1
  39. package/Markdown.js +20 -10
  40. package/Markdown.js.map +1 -1
  41. package/MarkerGauge.config.js +1 -1
  42. package/MarkerGauge.js +20 -10
  43. package/MarkerGauge.js.map +1 -1
  44. package/ParallelCoordinates.config.js +1 -1
  45. package/ParallelCoordinates.js +20 -10
  46. package/ParallelCoordinates.js.map +1 -1
  47. package/Pie.config.js +1 -1
  48. package/Pie.js +29 -19
  49. package/Pie.js.map +1 -1
  50. package/Punchcard.config.js +1 -1
  51. package/Punchcard.js +23 -12
  52. package/Punchcard.js.map +1 -1
  53. package/Rectangle.config.js +1 -1
  54. package/Rectangle.js +20 -10
  55. package/Rectangle.js.map +1 -1
  56. package/Sankey.config.js +1 -1
  57. package/Sankey.js +20 -10
  58. package/Sankey.js.map +1 -1
  59. package/Scatter.config.js +1 -1
  60. package/Scatter.js +30 -20
  61. package/Scatter.js.map +1 -1
  62. package/SingleValue.config.js +1 -1
  63. package/SingleValue.js +19 -9
  64. package/SingleValue.js.map +1 -1
  65. package/SingleValueBasic.js +1 -1
  66. package/SingleValueIcon.config.js +1 -1
  67. package/SingleValueIcon.js +29 -19
  68. package/SingleValueIcon.js.map +1 -1
  69. package/SingleValueRadial.config.js +1 -1
  70. package/SingleValueRadial.js +21 -11
  71. package/SingleValueRadial.js.map +1 -1
  72. package/SparkLine.js +1 -1
  73. package/Table.config.js +1 -1
  74. package/Table.js +37 -27
  75. package/Table.js.map +1 -1
  76. package/common/Charting.js +45 -34
  77. package/common/Charting.js.map +1 -1
  78. package/common/ChartingApi.js +7 -7
  79. package/common/ChartingApi.js.map +1 -1
  80. package/common/DocExampleWithVizSandbox.js +530 -0
  81. package/common/DocExampleWithVizSandbox.js.map +1 -0
  82. package/common/EventsDoc.js +63 -82
  83. package/common/EventsDoc.js.map +1 -1
  84. package/common/GaugeMajorTicks.js +11 -11
  85. package/common/GaugeMajorTicks.js.map +1 -1
  86. package/common/GaugeValueMarker.js +11 -11
  87. package/common/GaugeValueMarker.js.map +1 -1
  88. package/common/OptionsDoc.js +22 -22
  89. package/common/OptionsDoc.js.map +1 -1
  90. package/common/OverviewDoc.js +498 -64
  91. package/common/OverviewDoc.js.map +1 -1
  92. package/common/SplunkVisualization.js +17 -17
  93. package/common/SplunkVisualization.js.map +1 -1
  94. package/common/SplunkVisualizationApi.js +7 -7
  95. package/common/SplunkVisualizationApi.js.map +1 -1
  96. package/common/ThemesDoc.js +30 -30
  97. package/common/ThemesDoc.js.map +1 -1
  98. package/common/chartingUtils.js +8 -8
  99. package/common/chartingUtils.js.map +1 -1
  100. package/common/docUtils.js +128 -6
  101. package/common/docUtils.js.map +1 -1
  102. package/common/gaugeUtils.js +12 -12
  103. package/common/gaugeUtils.js.map +1 -1
  104. package/common/shapeUtils.js +15 -15
  105. package/common/shapeUtils.js.map +1 -1
  106. package/common/utils/configUtils.js +1 -1
  107. package/common/utils/dataUtils.js +1 -1
  108. package/common/utils/hocUtils.js +1 -1
  109. package/common/utils/layoutUtils.js +1 -1
  110. package/common/utils/mapUtils.js +1 -1
  111. package/common/utils/singleValueUtils.js +1 -1
  112. package/common/utils/testHelper.js +1 -1
  113. package/common/utils/trellisUtils.js +1 -1
  114. package/common/utils/urlUtils.js +1 -1
  115. package/common/withDashboardViz.js +119 -101
  116. package/common/withDashboardViz.js.map +1 -1
  117. package/package.json +14 -20
package/Line.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/Line.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 223);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 224);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -271,7 +271,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
271
271
 
272
272
  return React.createElement(FixSizeItem, {
273
273
  "data-test": "fix-size-item",
274
- "data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
274
+ "data-splunk-visualization-version": "26.1.2 - 9c7479612",
275
275
  width: width,
276
276
  height: height,
277
277
  backgroundColor: backgroundColor
@@ -712,7 +712,8 @@ var IconPlaceholder = function IconPlaceholder(props) {
712
712
  transform: 'translate(-50%, -50%)'
713
713
  },
714
714
  width: '50%',
715
- height: '50%'
715
+ height: '50%',
716
+ 'data-test': 'icon-placeholder'
716
717
  });
717
718
  }
718
719
 
@@ -1150,11 +1151,12 @@ var withDashboardViz = function withDashboardViz(opts) {
1150
1151
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1151
1152
  var supportedEvents = vizConfig.events;
1152
1153
  Object.keys(supportedEvents).forEach(function (eventName) {
1153
- var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1154
- eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1154
+ var _supportedEvents$even = supportedEvents[eventName],
1155
+ parentKeys = _supportedEvents$even.parentKeys,
1156
+ payloadKeys = _supportedEvents$even.payloadKeys;
1157
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName)); // todo: refactor single value and single value icon to send payload from viz
1155
1158
  // then remove these lines
1156
1159
 
1157
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1158
1160
  var payload = {};
1159
1161
 
1160
1162
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
@@ -1174,6 +1176,14 @@ var withDashboardViz = function withDashboardViz(opts) {
1174
1176
  type: eventName
1175
1177
  });
1176
1178
  };
1179
+
1180
+ if (parentKeys) {
1181
+ for (var i = parentKeys.length - 1; i >= 0; i -= 1) {
1182
+ var newObject = {};
1183
+ newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
1184
+ eventCallbackProps[eventCallbackPropName] = newObject;
1185
+ }
1186
+ }
1177
1187
  });
1178
1188
  } // compute pure viz props which are not from options
1179
1189
 
@@ -1608,7 +1618,7 @@ var Cover = styled_components_1.default.div.withConfig({
1608
1618
  componentId: "sc-1gsbnxb-0"
1609
1619
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1610
1620
  var Blocker = styled_components_1.default.div.attrs({
1611
- 'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
1621
+ 'data-splunk-visualization-version': "26.1.2 - 9c7479612"
1612
1622
  }).withConfig({
1613
1623
  displayName: "withEditModeCover__Blocker",
1614
1624
  componentId: "sc-1gsbnxb-1"
@@ -1761,6 +1771,12 @@ module.exports = require("@splunk/charting-bundle");
1761
1771
 
1762
1772
  /***/ }),
1763
1773
  /* 56 */
1774
+ /***/ (function(module, exports) {
1775
+
1776
+ module.exports = require("@splunk/themes/useSplunkTheme");
1777
+
1778
+ /***/ }),
1779
+ /* 57 */
1764
1780
  /***/ (function(module, exports, __webpack_require__) {
1765
1781
 
1766
1782
  "use strict";
@@ -1980,12 +1996,6 @@ var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
1980
1996
 
1981
1997
  exports.constructFieldsAndColumns = constructFieldsAndColumns;
1982
1998
 
1983
- /***/ }),
1984
- /* 57 */
1985
- /***/ (function(module, exports) {
1986
-
1987
- module.exports = require("@splunk/themes/useSplunkTheme");
1988
-
1989
1999
  /***/ }),
1990
2000
  /* 58 */,
1991
2001
  /* 59 */,
@@ -2033,7 +2043,7 @@ var styled_components_1 = __webpack_require__(4);
2033
2043
 
2034
2044
  var Message_1 = __webpack_require__(10);
2035
2045
 
2036
- var useSplunkTheme_1 = __webpack_require__(57);
2046
+ var useSplunkTheme_1 = __webpack_require__(56);
2037
2047
 
2038
2048
  var themeUtils_1 = __webpack_require__(68);
2039
2049
 
@@ -3620,29 +3630,22 @@ var __rest = this && this.__rest || function (s, e) {
3620
3630
  Object.defineProperty(exports, "__esModule", {
3621
3631
  value: true
3622
3632
  });
3623
- exports.config = exports.themes = exports.computeVizProps = void 0;
3633
+ exports.config = exports.themes = exports.computeVizProps = void 0; // Charting imports i18n which needs to be run to instantiate window globals in the tests
3624
3634
 
3625
- var lodash_1 = __webpack_require__(3); // Charting imports i18n which needs to be run to instantiate window globals in the tests
3626
- // eslint-disable-next-line import/order
3635
+ var Charting_1 = __webpack_require__(65); // eslint-disable-next-line import/order
3627
3636
 
3628
3637
 
3629
- var Charting_1 = __webpack_require__(65);
3630
-
3631
3638
  var charting_bundle_1 = __webpack_require__(55);
3632
3639
 
3633
- var simpleXMLOptions_1 = __webpack_require__(70);
3634
-
3635
- var config_1 = __webpack_require__(224);
3640
+ var config_1 = __webpack_require__(156);
3636
3641
 
3637
3642
  exports.config = config_1.default;
3638
3643
 
3639
3644
  var withDashboardViz_1 = __webpack_require__(37);
3640
3645
 
3641
- var lineUtils_1 = __webpack_require__(225);
3642
-
3643
- var chartingUtils_1 = __webpack_require__(56);
3646
+ var chartingUtils_1 = __webpack_require__(57);
3644
3647
 
3645
- var validOptions = Object.keys(config_1.default.optionsSchema);
3648
+ var lineUtils_1 = __webpack_require__(225);
3646
3649
 
3647
3650
  var computeVizProps = function computeVizProps(_a) {
3648
3651
  var dataSources = _a.dataSources,
@@ -3664,11 +3667,7 @@ var computeVizProps = function computeVizProps(_a) {
3664
3667
  var y2 = otherOptions.y2,
3665
3668
  y2Fields = otherOptions.y2Fields,
3666
3669
  hasEventHandlers = otherOptions.hasEventHandlers;
3667
- computedProps.options = (0, lodash_1.chain)(otherOptions).pick(validOptions).thru(lineUtils_1.convertToLineSCProperties).thru(function (options) {
3668
- return Object.assign(Object.assign({}, (0, simpleXMLOptions_1.getSimpleXMLOptionsForProps)(options)), {
3669
- chart: 'line'
3670
- });
3671
- }).value();
3670
+ computedProps.options = (0, lineUtils_1.transformOptions)(otherOptions);
3672
3671
  var chartingAnnotations = (0, chartingUtils_1.getAnnotations)({
3673
3672
  annotationX: annotationX,
3674
3673
  annotationColor: annotationColor,
@@ -3720,122 +3719,7 @@ exports.themes = themes;
3720
3719
  exports.default = Line;
3721
3720
 
3722
3721
  /***/ }),
3723
- /* 156 */,
3724
- /* 157 */,
3725
- /* 158 */,
3726
- /* 159 */,
3727
- /* 160 */,
3728
- /* 161 */,
3729
- /* 162 */,
3730
- /* 163 */,
3731
- /* 164 */,
3732
- /* 165 */,
3733
- /* 166 */,
3734
- /* 167 */,
3735
- /* 168 */,
3736
- /* 169 */,
3737
- /* 170 */,
3738
- /* 171 */,
3739
- /* 172 */,
3740
- /* 173 */,
3741
- /* 174 */,
3742
- /* 175 */,
3743
- /* 176 */,
3744
- /* 177 */,
3745
- /* 178 */,
3746
- /* 179 */,
3747
- /* 180 */,
3748
- /* 181 */,
3749
- /* 182 */,
3750
- /* 183 */,
3751
- /* 184 */,
3752
- /* 185 */,
3753
- /* 186 */,
3754
- /* 187 */,
3755
- /* 188 */,
3756
- /* 189 */,
3757
- /* 190 */,
3758
- /* 191 */,
3759
- /* 192 */,
3760
- /* 193 */,
3761
- /* 194 */,
3762
- /* 195 */,
3763
- /* 196 */,
3764
- /* 197 */,
3765
- /* 198 */,
3766
- /* 199 */,
3767
- /* 200 */,
3768
- /* 201 */,
3769
- /* 202 */,
3770
- /* 203 */,
3771
- /* 204 */,
3772
- /* 205 */,
3773
- /* 206 */,
3774
- /* 207 */,
3775
- /* 208 */,
3776
- /* 209 */,
3777
- /* 210 */,
3778
- /* 211 */,
3779
- /* 212 */,
3780
- /* 213 */,
3781
- /* 214 */,
3782
- /* 215 */,
3783
- /* 216 */,
3784
- /* 217 */,
3785
- /* 218 */,
3786
- /* 219 */,
3787
- /* 220 */,
3788
- /* 221 */,
3789
- /* 222 */,
3790
- /* 223 */
3791
- /***/ (function(module, exports, __webpack_require__) {
3792
-
3793
- "use strict";
3794
-
3795
-
3796
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
3797
- if (k2 === undefined) k2 = k;
3798
- var desc = Object.getOwnPropertyDescriptor(m, k);
3799
-
3800
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3801
- desc = {
3802
- enumerable: true,
3803
- get: function get() {
3804
- return m[k];
3805
- }
3806
- };
3807
- }
3808
-
3809
- Object.defineProperty(o, k2, desc);
3810
- } : function (o, m, k, k2) {
3811
- if (k2 === undefined) k2 = k;
3812
- o[k2] = m[k];
3813
- });
3814
-
3815
- var __exportStar = this && this.__exportStar || function (m, exports) {
3816
- for (var p in m) {
3817
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
3818
- }
3819
- };
3820
-
3821
- Object.defineProperty(exports, "__esModule", {
3822
- value: true
3823
- });
3824
- exports.default = void 0;
3825
-
3826
- __exportStar(__webpack_require__(155), exports);
3827
-
3828
- var Line_1 = __webpack_require__(155);
3829
-
3830
- Object.defineProperty(exports, "default", {
3831
- enumerable: true,
3832
- get: function get() {
3833
- return Line_1.default;
3834
- }
3835
- });
3836
-
3837
- /***/ }),
3838
- /* 224 */
3722
+ /* 156 */
3839
3723
  /***/ (function(module, exports, __webpack_require__) {
3840
3724
 
3841
3725
  "use strict";
@@ -4507,6 +4391,121 @@ var config = {
4507
4391
  };
4508
4392
  exports.default = (0, configUtils_1.enhanceConfig)(config);
4509
4393
 
4394
+ /***/ }),
4395
+ /* 157 */,
4396
+ /* 158 */,
4397
+ /* 159 */,
4398
+ /* 160 */,
4399
+ /* 161 */,
4400
+ /* 162 */,
4401
+ /* 163 */,
4402
+ /* 164 */,
4403
+ /* 165 */,
4404
+ /* 166 */,
4405
+ /* 167 */,
4406
+ /* 168 */,
4407
+ /* 169 */,
4408
+ /* 170 */,
4409
+ /* 171 */,
4410
+ /* 172 */,
4411
+ /* 173 */,
4412
+ /* 174 */,
4413
+ /* 175 */,
4414
+ /* 176 */,
4415
+ /* 177 */,
4416
+ /* 178 */,
4417
+ /* 179 */,
4418
+ /* 180 */,
4419
+ /* 181 */,
4420
+ /* 182 */,
4421
+ /* 183 */,
4422
+ /* 184 */,
4423
+ /* 185 */,
4424
+ /* 186 */,
4425
+ /* 187 */,
4426
+ /* 188 */,
4427
+ /* 189 */,
4428
+ /* 190 */,
4429
+ /* 191 */,
4430
+ /* 192 */,
4431
+ /* 193 */,
4432
+ /* 194 */,
4433
+ /* 195 */,
4434
+ /* 196 */,
4435
+ /* 197 */,
4436
+ /* 198 */,
4437
+ /* 199 */,
4438
+ /* 200 */,
4439
+ /* 201 */,
4440
+ /* 202 */,
4441
+ /* 203 */,
4442
+ /* 204 */,
4443
+ /* 205 */,
4444
+ /* 206 */,
4445
+ /* 207 */,
4446
+ /* 208 */,
4447
+ /* 209 */,
4448
+ /* 210 */,
4449
+ /* 211 */,
4450
+ /* 212 */,
4451
+ /* 213 */,
4452
+ /* 214 */,
4453
+ /* 215 */,
4454
+ /* 216 */,
4455
+ /* 217 */,
4456
+ /* 218 */,
4457
+ /* 219 */,
4458
+ /* 220 */,
4459
+ /* 221 */,
4460
+ /* 222 */,
4461
+ /* 223 */,
4462
+ /* 224 */
4463
+ /***/ (function(module, exports, __webpack_require__) {
4464
+
4465
+ "use strict";
4466
+
4467
+
4468
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
4469
+ if (k2 === undefined) k2 = k;
4470
+ var desc = Object.getOwnPropertyDescriptor(m, k);
4471
+
4472
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
4473
+ desc = {
4474
+ enumerable: true,
4475
+ get: function get() {
4476
+ return m[k];
4477
+ }
4478
+ };
4479
+ }
4480
+
4481
+ Object.defineProperty(o, k2, desc);
4482
+ } : function (o, m, k, k2) {
4483
+ if (k2 === undefined) k2 = k;
4484
+ o[k2] = m[k];
4485
+ });
4486
+
4487
+ var __exportStar = this && this.__exportStar || function (m, exports) {
4488
+ for (var p in m) {
4489
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
4490
+ }
4491
+ };
4492
+
4493
+ Object.defineProperty(exports, "__esModule", {
4494
+ value: true
4495
+ });
4496
+ exports.default = void 0;
4497
+
4498
+ __exportStar(__webpack_require__(155), exports);
4499
+
4500
+ var Line_1 = __webpack_require__(155);
4501
+
4502
+ Object.defineProperty(exports, "default", {
4503
+ enumerable: true,
4504
+ get: function get() {
4505
+ return Line_1.default;
4506
+ }
4507
+ });
4508
+
4510
4509
  /***/ }),
4511
4510
  /* 225 */
4512
4511
  /***/ (function(module, exports, __webpack_require__) {
@@ -4517,78 +4516,24 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
4517
4516
  Object.defineProperty(exports, "__esModule", {
4518
4517
  value: true
4519
4518
  });
4520
- exports.convertToLineSCProperties = exports.convertToStringValues = exports.mapToOldKey = exports.convertMarkerOptions = exports.lineOptionValuesSCMapping = void 0;
4519
+ exports.convertToLineSCProperties = exports.convertMarkerOptions = exports.transformOptions = void 0;
4520
+
4521
+ var propUtils_1 = __webpack_require__(29);
4522
+
4523
+ var simpleXMLOptions_1 = __webpack_require__(70);
4521
4524
 
4522
4525
  var lodash_1 = __webpack_require__(3);
4523
4526
 
4524
- var propUtils_1 = __webpack_require__(29);
4527
+ var config_1 = __webpack_require__(156);
4525
4528
 
4526
- var chartingUtils_1 = __webpack_require__(56); // map for key names which are either new or not present in SimpleXML options mapping
4527
-
4528
-
4529
- var lineOptionsSCMapping = {
4530
- markerDisplay: 'lineMarkerStyle',
4531
- legendDisplay: 'legendPlacement',
4532
- legendTruncation: 'legendLabelOverflowMode',
4533
- showYAxisWithZero: 'yAxisIncludeZero',
4534
- showY2AxisWithZero: 'y2AxisIncludeZero',
4535
- showYAxisExtendedRange: 'yAxisExtendsAxisRange',
4536
- showSplitSeries: 'splitSeries',
4537
- showIndependentYRanges: 'allowIndependentYRanges',
4538
- showOverlayY2Axis: 'enableY2Axis',
4539
- showXMajorGridLines: 'showMajorXGridLines',
4540
- showYMajorGridLines: 'showMajorYGridLines',
4541
- showYMinorGridLines: 'showMinorYGridLines',
4542
- showY2MajorGridLines: 'showMajorY2GridLines',
4543
- showY2MinorGridLines: 'showMinorY2GridLines',
4544
- yAxisMajorTickInterval: 'yAxisMajorUnit',
4545
- yAxisLabelVisibility: 'yAxisMajorLabelVisibility',
4546
- dataValuesDisplay: 'showDataLabels',
4547
- nullValueDisplay: 'nullValueMode',
4548
- lineDashStylesByField: 'fieldDashStyles',
4549
- xAxisLabelRotation: 'xAxisMajorLabelRotation',
4550
- xAxisLabelVisibility: 'xAxisMajorLabelVisibility',
4551
- seriesColorsByField: 'fieldColors',
4552
- resultLimit: 'resultTruncationLimit',
4553
- y2AxisLabelVisibility: 'y2AxisMajorLabelVisibility',
4554
- y2AxisMajorTickInterval: 'y2AxisMajorUnit',
4555
- showRoundedY2AxisLabels: 'roundY2AxisLabelsToInteger',
4556
- xAxisLineVisibility: 'xAxisVisibility',
4557
- yAxisLineVisibility: 'yAxisVisibility',
4558
- y2AxisLineVisibility: 'y2AxisVisibility',
4559
- showLineSmoothing: 'enableLineSmoothing'
4560
- }; // key value mapping of what options (and their corresponding values) which we expose in config.ts to property values SC understands
4561
-
4562
- exports.lineOptionValuesSCMapping = {
4563
- lineMarkerStyle: {
4564
- filled: 'normal',
4565
- outlined: 'hollow'
4566
- },
4567
- xAxisTitleVisibility: {
4568
- hide: 'collapsed'
4569
- },
4570
- yAxisTitleVisibility: {
4571
- hide: 'collapsed'
4572
- },
4573
- y2AxisTitleVisibility: {
4574
- hide: 'collapsed'
4575
- },
4576
- legendPlacement: {
4577
- off: 'none'
4578
- },
4579
- legendLabelOverflowMode: {
4580
- ellipsisOff: 'ellipsisNone'
4581
- },
4582
- y2AxisAbbreviation: {
4583
- off: 'none'
4584
- },
4585
- yAxisAbbreviation: {
4586
- off: 'none'
4587
- },
4588
- showDataLabels: {
4589
- off: 'none'
4590
- }
4529
+ var transformOptions = function transformOptions(originalOptions) {
4530
+ var returnOptions = (0, propUtils_1.adjustOptionsToSchema)(originalOptions, config_1.default.optionsSchema);
4531
+ return Object.assign(Object.assign({}, (0, simpleXMLOptions_1.getSimpleXMLOptionsForProps)((0, exports.convertToLineSCProperties)(returnOptions))), {
4532
+ chart: 'line'
4533
+ });
4591
4534
  };
4535
+
4536
+ exports.transformOptions = transformOptions;
4592
4537
  /**
4593
4538
  * Helper function to convert values for marker options
4594
4539
  * @method convertMarkerOptions
@@ -4596,54 +4541,21 @@ exports.lineOptionValuesSCMapping = {
4596
4541
  * @returns {Object}
4597
4542
  */
4598
4543
 
4599
- var convertMarkerOptions = function convertMarkerOptions(originalOptions) {
4600
- var convertedOptions = {
4601
- showMarkers: false
4602
- };
4544
+ var convertMarkerOptions = function convertMarkerOptions(originalOptions, lineOptionValuesSCMapping) {
4545
+ var originalOptionsWithAdditionalProps = originalOptions;
4603
4546
 
4604
- if ((0, lodash_1.values)(exports.lineOptionValuesSCMapping.lineMarkerStyle).includes(originalOptions.lineMarkerStyle)) {
4605
- convertedOptions.showMarkers = true;
4606
- return Object.assign(Object.assign({}, originalOptions), convertedOptions);
4547
+ if ((0, lodash_1.values)(lineOptionValuesSCMapping.lineMarkerStyle).includes(originalOptions.lineMarkerStyle)) {
4548
+ originalOptionsWithAdditionalProps.showMarkers = true;
4549
+ return originalOptionsWithAdditionalProps;
4607
4550
  }
4608
4551
 
4609
- return (0, lodash_1.omit)(Object.assign(Object.assign({}, originalOptions), convertedOptions), ['lineMarkerStyle']);
4552
+ originalOptionsWithAdditionalProps.showMarkers = false;
4553
+ return (0, lodash_1.omit)(originalOptionsWithAdditionalProps, 'lineMarkerStyle');
4610
4554
  };
4611
4555
 
4612
4556
  exports.convertMarkerOptions = convertMarkerOptions;
4613
4557
  /**
4614
- * Helper method to update the option names which can be mapped to SimpleXML options or
4615
- * can be used directly with SC if don't have a 1-1 mapping in SimpleXML
4616
- * @method mapToOldKey
4617
- * @param {Object} options
4618
- * @returns {Object}
4619
- */
4620
-
4621
- var mapToOldKey = function mapToOldKey(options) {
4622
- return (0, lodash_1.mapKeys)(options, function (val, key) {
4623
- return lineOptionsSCMapping[key] ? lineOptionsSCMapping[key] : key;
4624
- });
4625
- };
4626
-
4627
- exports.mapToOldKey = mapToOldKey;
4628
- /**
4629
- * Helper method to convert option which contains object literal values (e.g. arrays, objects)
4630
- * to strings as SC can only accept their stringified equivalents
4631
- * @method convertToStringValues
4632
- * @param {Object} options
4633
- * @returns {Object}
4634
- */
4635
-
4636
- var convertToStringValues = function convertToStringValues(options) {
4637
- var updatedOptions = (0, propUtils_1.convertPropsToString)({
4638
- vizProps: options,
4639
- propNames: ['fieldDashStyles', 'seriesColors', 'fieldColors', 'legendLabels']
4640
- });
4641
- return Object.assign(Object.assign({}, options), updatedOptions);
4642
- };
4643
-
4644
- exports.convertToStringValues = convertToStringValues;
4645
- /**
4646
- * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
4558
+ * Helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
4647
4559
  * This is for options that has new key name and can not directly be mapped with SimpleXML or
4648
4560
  * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)
4649
4561
  * @method convertToLineSCProperties
@@ -4652,7 +4564,72 @@ exports.convertToStringValues = convertToStringValues;
4652
4564
  */
4653
4565
 
4654
4566
  var convertToLineSCProperties = function convertToLineSCProperties(originalOptions) {
4655
- return (0, lodash_1.chain)((0, exports.mapToOldKey)(originalOptions)).thru((0, chartingUtils_1.mapToValues)(exports.lineOptionValuesSCMapping)).thru(exports.convertToStringValues).thru(exports.convertMarkerOptions).thru(chartingUtils_1.convertOverlayFields).thru(chartingUtils_1.convertY2AxisOptions).value();
4567
+ // map for key names which are either new or not present in SimpleXML options mapping
4568
+ var lineOptionsSCMapping = {
4569
+ markerDisplay: 'lineMarkerStyle',
4570
+ legendDisplay: 'legendPlacement',
4571
+ legendTruncation: 'legendLabelOverflowMode',
4572
+ showYAxisWithZero: 'yAxisIncludeZero',
4573
+ showY2AxisWithZero: 'y2AxisIncludeZero',
4574
+ showYAxisExtendedRange: 'yAxisExtendsAxisRange',
4575
+ showSplitSeries: 'splitSeries',
4576
+ showIndependentYRanges: 'allowIndependentYRanges',
4577
+ showOverlayY2Axis: 'enableY2Axis',
4578
+ showXMajorGridLines: 'showMajorXGridLines',
4579
+ showYMajorGridLines: 'showMajorYGridLines',
4580
+ showYMinorGridLines: 'showMinorYGridLines',
4581
+ showY2MajorGridLines: 'showMajorY2GridLines',
4582
+ showY2MinorGridLines: 'showMinorY2GridLines',
4583
+ yAxisMajorTickInterval: 'yAxisMajorUnit',
4584
+ yAxisLabelVisibility: 'yAxisMajorLabelVisibility',
4585
+ dataValuesDisplay: 'showDataLabels',
4586
+ nullValueDisplay: 'nullValueMode',
4587
+ lineDashStylesByField: 'fieldDashStyles',
4588
+ xAxisLabelRotation: 'xAxisMajorLabelRotation',
4589
+ xAxisLabelVisibility: 'xAxisMajorLabelVisibility',
4590
+ seriesColorsByField: 'fieldColors',
4591
+ resultLimit: 'resultTruncationLimit',
4592
+ y2AxisLabelVisibility: 'y2AxisMajorLabelVisibility',
4593
+ y2AxisMajorTickInterval: 'y2AxisMajorUnit',
4594
+ showRoundedY2AxisLabels: 'roundY2AxisLabelsToInteger',
4595
+ xAxisLineVisibility: 'xAxisVisibility',
4596
+ yAxisLineVisibility: 'yAxisVisibility',
4597
+ y2AxisLineVisibility: 'y2AxisVisibility',
4598
+ showLineSmoothing: 'enableLineSmoothing'
4599
+ }; // key value mapping of what options (and their corresponding values) which we expose in config.ts to property values SC understands
4600
+
4601
+ var lineOptionValuesSCMapping = {
4602
+ lineMarkerStyle: {
4603
+ filled: 'normal',
4604
+ outlined: 'hollow'
4605
+ },
4606
+ xAxisTitleVisibility: {
4607
+ hide: 'collapsed'
4608
+ },
4609
+ yAxisTitleVisibility: {
4610
+ hide: 'collapsed'
4611
+ },
4612
+ y2AxisTitleVisibility: {
4613
+ hide: 'collapsed'
4614
+ },
4615
+ legendPlacement: {
4616
+ off: 'none'
4617
+ },
4618
+ legendLabelOverflowMode: {
4619
+ ellipsisOff: 'ellipsisNone'
4620
+ },
4621
+ y2AxisAbbreviation: {
4622
+ off: 'none'
4623
+ },
4624
+ yAxisAbbreviation: {
4625
+ off: 'none'
4626
+ },
4627
+ showDataLabels: {
4628
+ off: 'none'
4629
+ }
4630
+ };
4631
+ var stingValues = ['fieldDashStyles', 'seriesColors', 'fieldColors', 'legendLabels'];
4632
+ return (0, exports.convertMarkerOptions)((0, propUtils_1.convertToSCProperties)(originalOptions, lineOptionsSCMapping, lineOptionValuesSCMapping, stingValues), lineOptionValuesSCMapping);
4656
4633
  };
4657
4634
 
4658
4635
  exports.convertToLineSCProperties = convertToLineSCProperties;