@splunk/visualizations 28.4.0 → 28.5.1

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 (165) hide show
  1. package/Area.config.js +28 -7
  2. package/Area.config.js.map +2 -2
  3. package/Area.js +109 -39
  4. package/Area.js.map +2 -2
  5. package/Bar.config.js +28 -7
  6. package/Bar.config.js.map +2 -2
  7. package/Bar.js +109 -39
  8. package/Bar.js.map +2 -2
  9. package/Bubble.config.js +4 -4
  10. package/Bubble.config.js.map +2 -2
  11. package/Bubble.js +81 -30
  12. package/Bubble.js.map +2 -2
  13. package/CHANGELOG.external.md +98 -0
  14. package/ChoroplethSvg.js +74 -26
  15. package/ChoroplethSvg.js.map +2 -2
  16. package/Column.config.js +28 -7
  17. package/Column.config.js.map +2 -2
  18. package/Column.js +109 -39
  19. package/Column.js.map +2 -2
  20. package/Ellipse/config.d.ts.map +1 -1
  21. package/Ellipse.config.js +14 -5
  22. package/Ellipse.config.js.map +4 -4
  23. package/Ellipse.js +130 -73
  24. package/Ellipse.js.map +4 -4
  25. package/Events.js +74 -26
  26. package/Events.js.map +2 -2
  27. package/FillerGauge.js +234 -47
  28. package/FillerGauge.js.map +2 -2
  29. package/Image.js +74 -26
  30. package/Image.js.map +2 -2
  31. package/Line/lineUtils.d.ts.map +1 -1
  32. package/Line/mockdata/LineData.d.ts +95 -0
  33. package/Line/mockdata/LineData.d.ts.map +1 -1
  34. package/Line.config.js +28 -7
  35. package/Line.config.js.map +2 -2
  36. package/Line.js +125 -41
  37. package/Line.js.map +2 -2
  38. package/LinkGraph.js +74 -26
  39. package/LinkGraph.js.map +2 -2
  40. package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
  41. package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
  42. package/Map/PureMap/MapUtils.d.ts +2 -2
  43. package/Map/PureMap/MapUtils.d.ts.map +1 -1
  44. package/Map/PureMap/PureMap.d.ts.map +1 -1
  45. package/Map.js +111 -37
  46. package/Map.js.map +2 -2
  47. package/Markdown/config.d.ts.map +1 -1
  48. package/Markdown.config.js +14 -5
  49. package/Markdown.config.js.map +4 -4
  50. package/Markdown.js +91 -34
  51. package/Markdown.js.map +4 -4
  52. package/MarkerGauge.js +243 -56
  53. package/MarkerGauge.js.map +4 -4
  54. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -1
  55. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -1
  56. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -1
  57. package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts +78 -0
  58. package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts.map +1 -0
  59. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +1 -2
  60. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
  61. package/NetworkGraph/config.d.ts.map +1 -1
  62. package/NetworkGraph.config.js +1 -0
  63. package/NetworkGraph.config.js.map +2 -2
  64. package/NetworkGraph.js +366 -105
  65. package/NetworkGraph.js.map +4 -4
  66. package/PERFORMANCE.md +23 -0
  67. package/ParallelCoordinates/ParallelCoordinates.d.ts +1 -46
  68. package/ParallelCoordinates/ParallelCoordinates.d.ts.map +1 -1
  69. package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts +12 -58
  70. package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts.map +1 -1
  71. package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts +1 -0
  72. package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts.map +1 -1
  73. package/ParallelCoordinates.js +150 -153
  74. package/ParallelCoordinates.js.map +4 -4
  75. package/Pie/Pie.d.ts.map +1 -1
  76. package/Pie/config.d.ts.map +1 -1
  77. package/Pie/pieUtils.d.ts +4 -0
  78. package/Pie/pieUtils.d.ts.map +1 -1
  79. package/Pie.config.js +16 -0
  80. package/Pie.config.js.map +2 -2
  81. package/Pie.js +121 -35
  82. package/Pie.js.map +2 -2
  83. package/Punchcard.js +74 -26
  84. package/Punchcard.js.map +2 -2
  85. package/Rectangle/config.d.ts.map +1 -1
  86. package/Rectangle.config.js +14 -5
  87. package/Rectangle.config.js.map +4 -4
  88. package/Rectangle.js +92 -35
  89. package/Rectangle.js.map +4 -4
  90. package/Sankey/PureSankey/PureSankey.d.ts +26 -72
  91. package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
  92. package/Sankey/PureSankey/SankeyLink.d.ts +3 -19
  93. package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
  94. package/Sankey/PureSankey/SankeyNode.d.ts +3 -20
  95. package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
  96. package/Sankey/PureSankey/SankeyTooltip.d.ts +3 -24
  97. package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
  98. package/Sankey.js +270 -336
  99. package/Sankey.js.map +2 -2
  100. package/Scatter.config.js +168 -147
  101. package/Scatter.config.js.map +4 -4
  102. package/Scatter.js +249 -179
  103. package/Scatter.js.map +4 -4
  104. package/SingleValue.js +96 -75
  105. package/SingleValue.js.map +2 -2
  106. package/SingleValueIcon/config.d.ts.map +1 -1
  107. package/SingleValueIcon.config.js +14 -5
  108. package/SingleValueIcon.config.js.map +4 -4
  109. package/SingleValueIcon.js +118 -76
  110. package/SingleValueIcon.js.map +4 -4
  111. package/SingleValueRadial/PureSingleValueRadial/GaugeGraph.d.ts.map +1 -1
  112. package/SingleValueRadial.js +95 -76
  113. package/SingleValueRadial.js.map +2 -2
  114. package/Table/Table.d.ts.map +1 -1
  115. package/Table/hooks.d.ts +2 -0
  116. package/Table/hooks.d.ts.map +1 -1
  117. package/Table.js +95 -49
  118. package/Table.js.map +2 -2
  119. package/Timeline/PureTimeline/PureTimeline.d.ts.map +1 -1
  120. package/Timeline/PureTimeline/src/TimelinePlugin.d.ts.map +1 -1
  121. package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
  122. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +2 -1
  123. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
  124. package/Timeline.js +154 -54
  125. package/Timeline.js.map +2 -2
  126. package/common/Charting.d.ts.map +1 -1
  127. package/common/Charting.js +3 -0
  128. package/common/Charting.js.map +2 -2
  129. package/common/GaugeMajorTicks.js +150 -13
  130. package/common/GaugeMajorTicks.js.map +4 -4
  131. package/common/GaugeValueMarker.js +84 -17
  132. package/common/GaugeValueMarker.js.map +4 -4
  133. package/common/OptionsDoc.js.map +1 -1
  134. package/common/OverviewDoc.d.ts.map +1 -1
  135. package/common/OverviewDoc.js +2 -2
  136. package/common/OverviewDoc.js.map +2 -2
  137. package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
  138. package/common/TimeSeriesChartWrapper.js +72 -24
  139. package/common/TimeSeriesChartWrapper.js.map +2 -2
  140. package/common/chartingUtils.d.ts +9 -3
  141. package/common/chartingUtils.d.ts.map +1 -1
  142. package/common/chartingUtils.js +21 -16
  143. package/common/chartingUtils.js.map +2 -2
  144. package/common/editorConfig/AxesChartDataConfig.d.ts +3 -3
  145. package/common/editorConfig/AxesChartDataConfig.d.ts.map +1 -1
  146. package/common/editorConfig/AxesChartDataDisplay.d.ts +4 -0
  147. package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
  148. package/common/editorConfig/AxesChartLegend.d.ts.map +1 -1
  149. package/common/gaugeUtils.d.ts +37 -0
  150. package/common/gaugeUtils.d.ts.map +1 -1
  151. package/common/gaugeUtils.js +152 -2
  152. package/common/gaugeUtils.js.map +4 -4
  153. package/common/hocs/mockdata/trellisData.d.ts +119 -0
  154. package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
  155. package/common/interfaces/Overview.d.ts +1 -0
  156. package/common/interfaces/Overview.d.ts.map +1 -1
  157. package/common/interfaces/VizConfig.d.ts +2 -1
  158. package/common/interfaces/VizConfig.d.ts.map +1 -1
  159. package/common/utils/mapUtils.js.map +1 -1
  160. package/common/utils/trellisUtils.d.ts.map +1 -1
  161. package/common/utils/trellisUtils.js +4 -6
  162. package/common/utils/trellisUtils.js.map +2 -2
  163. package/common/withDashboardViz.js +74 -26
  164. package/common/withDashboardViz.js.map +2 -2
  165. package/package.json +36 -36
package/MarkerGauge.js CHANGED
@@ -169,11 +169,24 @@ var defaultImport11 = __toESM(require("@splunk/visualizations-shared/colorConsta
169
169
  __reExport(colorConstants_exports, require("@splunk/visualizations-shared/colorConstants"));
170
170
  var colorConstants_default = "default" in defaultImport11 ? defaultImport11.default : defaultImport11;
171
171
 
172
+ // esm-externals:@splunk/visualizations-shared/numberUtils
173
+ var numberUtils_exports = {};
174
+ __export(numberUtils_exports, {
175
+ default: () => numberUtils_default
176
+ });
177
+ var defaultImport12 = __toESM(require("@splunk/visualizations-shared/numberUtils"));
178
+ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUtils"));
179
+ var numberUtils_default = "default" in defaultImport12 ? defaultImport12.default : defaultImport12;
180
+
172
181
  // src/common/gaugeUtils.ts
173
182
  var GAUGE_THICKNESS = 50;
174
183
  var FILL_THICKNESS = 38;
175
184
  var GRADIENT_STOP_OFFSET_MIN = 0;
176
185
  var GRADIENT_STOP_OFFSET_MAX = 100;
186
+ var DEFAULT_NUM_OF_TICKS = 5;
187
+ var MAX_TICK_LABEL_DECIMAL_PLACES = 5;
188
+ var MAX_VALUE_LABEL_DIGITS_WITHOUT_PERCENT = 6;
189
+ var MAX_VALUE_LABEL_DIGITS_WITH_PERCENT = 5;
177
190
  var getGaugeWidth = ({ containerWidth, orientation }) => orientation === "vertical" ? GAUGE_THICKNESS : containerWidth * 0.8;
178
191
  var getGaugeHeight = ({ containerHeight, orientation }) => orientation === "vertical" ? containerHeight * 0.8 : GAUGE_THICKNESS;
179
192
  var getGaugeLength = ({ containerWidth, containerHeight, orientation }) => orientation === "vertical" ? getGaugeHeight({ containerHeight, orientation }) : getGaugeWidth({ containerWidth, orientation });
@@ -352,6 +365,137 @@ var getGradientDimensions = (orientation) => {
352
365
  const y2 = orientation === "horizontal" ? "0%" : "100%";
353
366
  return { x1, y1, x2, y2 };
354
367
  };
368
+ var getDecimalPlaces = (value) => {
369
+ const numericValue = Number(value);
370
+ if (!Number.isFinite(numericValue)) {
371
+ return 0;
372
+ }
373
+ const fractionPart = numericValue.toString().split(".")[1];
374
+ return fractionPart ? fractionPart.length : 0;
375
+ };
376
+ var getUniqueDecimalPlaces = ({
377
+ values,
378
+ minimumDecimalPlaces
379
+ }) => {
380
+ if (values.length <= 1) {
381
+ return minimumDecimalPlaces;
382
+ }
383
+ for (let decimalPlaces = minimumDecimalPlaces; decimalPlaces <= MAX_TICK_LABEL_DECIMAL_PLACES; decimalPlaces += 1) {
384
+ const roundedValues = values.map((value) => Number(value.toFixed(decimalPlaces)));
385
+ if (new Set(roundedValues).size === roundedValues.length) {
386
+ return decimalPlaces;
387
+ }
388
+ }
389
+ return MAX_TICK_LABEL_DECIMAL_PLACES;
390
+ };
391
+ var getPercentageFromRange = ({ value, min, range: range2 }) => {
392
+ if (range2 === 0) {
393
+ return 0;
394
+ }
395
+ return (value - min) / range2 * 100;
396
+ };
397
+ var getNumOfTicks = ({
398
+ min,
399
+ max,
400
+ majorUnit,
401
+ usePercentageRange
402
+ }) => {
403
+ const range2 = max - min;
404
+ const majorUnitNumber = Number(majorUnit);
405
+ const isAutoMajorUnit = majorUnit === "auto" || Number.isNaN(majorUnitNumber) || majorUnitNumber <= 0;
406
+ let numOfTicks = DEFAULT_NUM_OF_TICKS;
407
+ if (!isAutoMajorUnit) {
408
+ numOfTicks = usePercentageRange ? 100 / majorUnitNumber : range2 / majorUnitNumber;
409
+ }
410
+ return { numOfTicks, isAutoMajorUnit, majorUnitNumber };
411
+ };
412
+ var getTickLabelFormatter = ({
413
+ min,
414
+ max,
415
+ majorUnit,
416
+ usePercentageRange
417
+ }) => {
418
+ const range2 = max - min;
419
+ const { numOfTicks, isAutoMajorUnit, majorUnitNumber } = getNumOfTicks({
420
+ min,
421
+ max,
422
+ majorUnit,
423
+ usePercentageRange
424
+ });
425
+ const numericStep = range2 / numOfTicks;
426
+ const tickValues = [];
427
+ for (let i = 0; i <= numOfTicks; i += 1) {
428
+ tickValues.push(min + numericStep * i);
429
+ }
430
+ if (!Number.isInteger(numOfTicks)) {
431
+ tickValues.push(max);
432
+ }
433
+ const minimumNumericDecimalPlaces = Math.min(
434
+ MAX_TICK_LABEL_DECIMAL_PLACES,
435
+ Math.max(
436
+ getDecimalPlaces(min),
437
+ getDecimalPlaces(max),
438
+ isAutoMajorUnit ? 0 : getDecimalPlaces(majorUnitNumber)
439
+ )
440
+ );
441
+ const numericLabelDecimalPlaces = getUniqueDecimalPlaces({
442
+ values: tickValues,
443
+ minimumDecimalPlaces: minimumNumericDecimalPlaces
444
+ });
445
+ const percentageLabelDecimalPlaces = getUniqueDecimalPlaces({
446
+ values: tickValues.map((value) => getPercentageFromRange({ value, min, range: range2 })),
447
+ minimumDecimalPlaces: 0
448
+ });
449
+ const formatTickLabel = (value) => {
450
+ if (usePercentageRange) {
451
+ const percentageValue = getPercentageFromRange({ value, min, range: range2 });
452
+ return `${percentageValue.toFixed(percentageLabelDecimalPlaces)}%`;
453
+ }
454
+ const numericLabel = value.toFixed(numericLabelDecimalPlaces);
455
+ if (numericLabel.includes(".")) {
456
+ return numericLabel;
457
+ }
458
+ return (0, numberUtils_exports.formatNumber)(Number(numericLabel), 0, {
459
+ useThousandSeparators: true,
460
+ useTrendUnits: true
461
+ }).replace(/k$/, "K");
462
+ };
463
+ return { numOfTicks, numericStep, formatTickLabel };
464
+ };
465
+ var getDigitsBeforeDecimal = (numericValue) => Math.abs(Math.trunc(Number(numericValue))).toString().length;
466
+ var getCappedDecimalPlaces = (numericValue, rawDecimalPlaces, maxDigits) => {
467
+ const digitsBeforeDecimal = getDigitsBeforeDecimal(numericValue);
468
+ const maxDecimalPlaces = Math.max(0, maxDigits - digitsBeforeDecimal);
469
+ return Math.min(rawDecimalPlaces, maxDecimalPlaces);
470
+ };
471
+ var formatGaugeValueLabel = ({
472
+ value,
473
+ min,
474
+ max,
475
+ usePercentageValue
476
+ }) => {
477
+ const numericValue = Number(value);
478
+ const range2 = max - min || 1;
479
+ const percentageValue = getPercentageFromRange({ value: numericValue, min, range: range2 });
480
+ const trendFormatOptions = {
481
+ useThousandSeparators: true,
482
+ useTrendUnits: true
483
+ };
484
+ if (usePercentageValue) {
485
+ const percentageDecimalPlaces = getCappedDecimalPlaces(
486
+ percentageValue,
487
+ 2,
488
+ MAX_VALUE_LABEL_DIGITS_WITH_PERCENT
489
+ );
490
+ return `${(0, numberUtils_exports.formatNumber)(percentageValue, percentageDecimalPlaces, trendFormatOptions)}%`;
491
+ }
492
+ const valueDecimalPlaces = getCappedDecimalPlaces(
493
+ numericValue,
494
+ getDecimalPlaces(numericValue),
495
+ MAX_VALUE_LABEL_DIGITS_WITHOUT_PERCENT
496
+ );
497
+ return (0, numberUtils_exports.formatNumber)(numericValue, valueDecimalPlaces, trendFormatOptions);
498
+ };
355
499
  var gaugeOptionsMapping = {
356
500
  majorTickInterval: "majorUnit",
357
501
  gaugeRanges: "ranges"
@@ -379,19 +523,10 @@ var mapValueLabelDisplay = (labelOrValue, options) => {
379
523
  };
380
524
  var convertToGaugeProperties = (originalOptions) => (0, lodash_exports.chain)(mapToOldKey(originalOptions)).thru((options) => mapValueLabelDisplay("label", options)).thru((options) => mapValueLabelDisplay("value", options)).value();
381
525
 
382
- // esm-externals:@splunk/visualizations-shared/numberUtils
383
- var numberUtils_exports = {};
384
- __export(numberUtils_exports, {
385
- default: () => numberUtils_default
386
- });
387
- var defaultImport12 = __toESM(require("@splunk/visualizations-shared/numberUtils"));
388
- __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUtils"));
389
- var numberUtils_default = "default" in defaultImport12 ? defaultImport12.default : defaultImport12;
390
-
391
526
  // src/common/GaugeMajorTicks.jsx
392
- var DEFAULT_NUM_OF_TICKS = 5;
393
527
  var TICK_LENGTH_DELTA = 5;
394
528
  var TICK_LABEL_PADDING_FACTOR = 3.2;
529
+ var VERTICAL_START_ANCHOR_OFFSET = 8;
395
530
  var MajorTickLine = styled_components_default.line`
396
531
  stroke: ${(props) => props.majorTickStrokeColor};
397
532
  stroke-width: 2px;
@@ -404,7 +539,7 @@ var MajorTickLabel = styled_components_default.text`
404
539
  sans-serif;
405
540
  line-height: 19px;
406
541
  fill: ${(props) => props.majorTickFillColor};
407
- text-anchor: middle;
542
+ text-anchor: ${(props) => props.textAnchor};
408
543
  text-align: center;
409
544
  `;
410
545
  var MajorTick = ({
@@ -417,6 +552,7 @@ var MajorTick = ({
417
552
  label,
418
553
  labelX,
419
554
  labelY,
555
+ textAnchor = "middle",
420
556
  majorTickStrokeColor,
421
557
  majorTickFillColor
422
558
  }) => /* @__PURE__ */ react_default.createElement("g", null, /* @__PURE__ */ react_default.createElement(
@@ -435,13 +571,11 @@ var MajorTick = ({
435
571
  {
436
572
  x: labelX,
437
573
  y: labelY,
574
+ textAnchor,
438
575
  majorTickFillColor,
439
576
  "data-test": "major-tick-label"
440
577
  },
441
- (0, numberUtils_exports.isNumerial)(label) ? (0, numberUtils_exports.formatNumber)(label, 0, {
442
- useThousandSeparators: true,
443
- useTrendUnits: true
444
- }) : label
578
+ label
445
579
  ));
446
580
  MajorTick.propTypes = {
447
581
  index: prop_types_default.number,
@@ -453,6 +587,7 @@ MajorTick.propTypes = {
453
587
  label: prop_types_default.oneOfType([prop_types_default.string, prop_types_default.number]),
454
588
  labelX: prop_types_default.number,
455
589
  labelY: prop_types_default.number,
590
+ textAnchor: prop_types_default.string,
456
591
  majorTickStrokeColor: prop_types_default.string,
457
592
  majorTickFillColor: prop_types_default.string
458
593
  };
@@ -469,7 +604,7 @@ var positionMajorTick = ({ width, height, startX, startY, orientation, numOfTick
469
604
  y1 = y;
470
605
  x2 += width + TICK_LENGTH_DELTA;
471
606
  y2 = y;
472
- labelX += width + TICK_LENGTH_DELTA * TICK_LABEL_PADDING_FACTOR;
607
+ labelX += width + TICK_LENGTH_DELTA * TICK_LABEL_PADDING_FACTOR - VERTICAL_START_ANCHOR_OFFSET;
473
608
  labelY = y;
474
609
  } else {
475
610
  const x = width / numOfTicks * i + startX;
@@ -498,10 +633,17 @@ var MajorTicks = (_a) => {
498
633
  majorTickFillColor,
499
634
  majorTickStrokeColor
500
635
  } = props;
501
- const range2 = max - min;
502
- const numOfTicks = majorUnit === "auto" || Number.isNaN(Number(majorUnit)) || majorUnit <= 0 ? DEFAULT_NUM_OF_TICKS : range2 / majorUnit;
636
+ const isVertical = orientation === "vertical";
637
+ const textAnchor = isVertical ? "start" : "middle";
638
+ const { numOfTicks, numericStep, formatTickLabel } = getTickLabelFormatter({
639
+ min,
640
+ max,
641
+ majorUnit,
642
+ usePercentageRange
643
+ });
503
644
  const majorTicks = [];
504
645
  for (let i = 0; i <= numOfTicks; i += 1) {
646
+ const tickValue = min + numericStep * i;
505
647
  const { x1, y1, x2, y2, labelX, labelY } = positionMajorTick({
506
648
  width,
507
649
  height,
@@ -511,7 +653,7 @@ var MajorTicks = (_a) => {
511
653
  numOfTicks,
512
654
  i
513
655
  });
514
- const label = usePercentageRange ? `${parseInt((i / numOfTicks - min / range2) * 100, 10)}%` : parseInt(min + range2 / numOfTicks * i, 10);
656
+ const label = formatTickLabel(tickValue);
515
657
  majorTicks.push(
516
658
  /* @__PURE__ */ react_default.createElement(
517
659
  MajorTick,
@@ -526,6 +668,7 @@ var MajorTicks = (_a) => {
526
668
  label,
527
669
  labelX,
528
670
  labelY,
671
+ textAnchor,
529
672
  majorTickFillColor,
530
673
  majorTickStrokeColor
531
674
  }
@@ -554,9 +697,10 @@ var MajorTicks = (_a) => {
554
697
  x2,
555
698
  y2,
556
699
  showLabels,
557
- label: usePercentageRange ? "100%" : max,
700
+ label: formatTickLabel(max),
558
701
  labelX,
559
702
  labelY,
703
+ textAnchor,
560
704
  majorTickFillColor,
561
705
  majorTickStrokeColor
562
706
  }
@@ -711,10 +855,7 @@ var ValueMarker = (_a) => {
711
855
  valueMarkerLabelFillColor,
712
856
  "aria-label": (0, format_exports.sprintf)((0, i18n_exports._)("Marker gauge value: %s"), value)
713
857
  },
714
- usePercentageValue ? `${(value / (max - min) * 100).toFixed(2)}%` : (0, numberUtils_exports.formatNumber)(value, 0, {
715
- useThousandSeparators: true,
716
- useTrendUnits: true
717
- })
858
+ formatGaugeValueLabel({ value, min, max, usePercentageValue })
718
859
  )));
719
860
  };
720
861
  ValueMarker.propTypes = {
@@ -1779,7 +1920,7 @@ var Cover = styled_components_default.div`
1779
1920
  bottom: 0;
1780
1921
  `;
1781
1922
  var Blocker = styled_components_default.div.attrs({
1782
- "data-splunk-visualization-version": "28.4.0 - 002bd482f"
1923
+ "data-splunk-visualization-version": "28.5.1 - 617766eb3"
1783
1924
  })`
1784
1925
  position: relative;
1785
1926
  width: 100%;
@@ -1860,7 +2001,7 @@ var withFixedSizeContainer = (Viz) => {
1860
2001
  FixSizeItem,
1861
2002
  {
1862
2003
  "data-test": "fix-size-item",
1863
- "data-splunk-visualization-version": "28.4.0 - 002bd482f",
2004
+ "data-splunk-visualization-version": "28.5.1 - 617766eb3",
1864
2005
  width,
1865
2006
  height,
1866
2007
  backgroundColor
@@ -2477,16 +2618,14 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
2477
2618
  splitDataSources[val] = (0, lodash_exports.cloneDeep)(
2478
2619
  (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
2479
2620
  );
2480
- splitDataSources[val].primary.data.fields = [
2481
- { name: fields[0].name },
2482
- ...dataSourceKeys.map((k) => ({
2483
- name: k
2484
- }))
2485
- ];
2621
+ splitDataSources[val].primary.data.fields = [{ name: fields[0].name }];
2486
2622
  splitDataSources[val].primary.data.columns = [[...columns[0]]];
2487
2623
  dataSourceKeys.forEach((dsKey) => {
2488
2624
  fields.forEach((field, idx) => {
2489
2625
  if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
2626
+ splitDataSources[val].primary.data.fields.push({
2627
+ name: dsKey
2628
+ });
2490
2629
  splitDataSources[val].primary.data.columns.push([...columns[idx]]);
2491
2630
  }
2492
2631
  });
@@ -2787,25 +2926,27 @@ var parseAxisValue = (val) => {
2787
2926
  const num = typeof val === "number" ? val : Number.parseFloat(val);
2788
2927
  return Number.isNaN(num) ? void 0 : num;
2789
2928
  };
2790
- var SideLegendWidth = 75;
2791
- var SeriesCompareLegendWidth = 200;
2929
+ var parseXAxisLineVisibility = (visibility) => {
2930
+ if (visibility === "hide") return false;
2931
+ if (visibility === "show") return true;
2932
+ return void 0;
2933
+ };
2792
2934
  var getLegend = (props) => {
2793
2935
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
2794
- const { isSeriesCompare } = props;
2936
+ const { isSeriesCompare, legendTruncation } = props;
2795
2937
  const commonLegendProps = {
2796
2938
  center: true,
2797
2939
  fontSize: 12,
2798
2940
  largerTiles: true,
2799
- hideSeriesValue: !isSeriesCompare
2941
+ hideSeriesValue: !isSeriesCompare,
2800
2942
  // Show values if in seriesCompare mode
2943
+ legendTruncation
2801
2944
  };
2802
2945
  switch (legendPlacement) {
2803
2946
  case "off":
2804
2947
  return false;
2805
2948
  case "left":
2806
- return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
2807
- width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
2808
- }, commonLegendProps));
2949
+ return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
2809
2950
  case "bottom":
2810
2951
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
2811
2952
  wrap: true
@@ -2815,9 +2956,7 @@ var getLegend = (props) => {
2815
2956
  wrap: true
2816
2957
  }, commonLegendProps));
2817
2958
  default:
2818
- return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
2819
- width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
2820
- }, commonLegendProps));
2959
+ return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
2821
2960
  }
2822
2961
  };
2823
2962
  var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
@@ -2878,9 +3017,7 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
2878
3017
  if (yAxisAbbreviation !== "none") {
2879
3018
  yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
2880
3019
  }
2881
- if (yAxisAbbreviation === "none") {
2882
- yConfig.y.width = 55;
2883
- } else {
3020
+ if (yAxisAbbreviation !== "none") {
2884
3021
  yConfig.y.width = label && label.length > 0 ? 30 : 10;
2885
3022
  }
2886
3023
  if (yAxisLabelVisibility === "hide") {
@@ -2903,6 +3040,7 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
2903
3040
  y2Config.y2.type = scaleType;
2904
3041
  if (axisAbbreviation !== "none") {
2905
3042
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
3043
+ y2Config.y2.width = label && label.length > 0 ? 50 : 10;
2906
3044
  } else if (roundAxisLabelsToInteger) {
2907
3045
  y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
2908
3046
  }
@@ -2918,7 +3056,7 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
2918
3056
  }
2919
3057
  return y2Config;
2920
3058
  };
2921
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
3059
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
2922
3060
  const seriesConfig = {};
2923
3061
  let spanGaps;
2924
3062
  let replaceNullsWithZero;
@@ -2945,6 +3083,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
2945
3083
  );
2946
3084
  if (shouldAssignToY2) {
2947
3085
  seriesConfig[field].overrides.scale = "y2";
3086
+ } else {
3087
+ seriesConfig[field].overrides.scale = "y";
2948
3088
  }
2949
3089
  }
2950
3090
  if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
@@ -2957,6 +3097,11 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
2957
3097
  if (fieldDashStyle) {
2958
3098
  seriesConfig[field].lineDashStyle = fieldDashStyle;
2959
3099
  }
3100
+ const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
3101
+ const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
3102
+ if (fieldStepPosition && fieldStepPosition !== "off") {
3103
+ seriesConfig[field].stepPosition = fieldStepPosition;
3104
+ }
2960
3105
  if (replaceNullsWithZero !== void 0) {
2961
3106
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
2962
3107
  }
@@ -3139,6 +3284,9 @@ var TimeSeriesChartWrapper = (props) => {
3139
3284
  backgroundColor,
3140
3285
  defaultFontColor,
3141
3286
  additionalTooltipValues,
3287
+ xAxisLineVisibility: xAxisLineVisibility,
3288
+ yAxisLineVisibility,
3289
+ y2AxisLineVisibility,
3142
3290
  showYAxisWithZero: showYAxisWithZeroFromProps,
3143
3291
  showY2AxisWithZero: showY2AxisWithZeroFromProps
3144
3292
  } = _a, otherOptions = __objRest(_a, [
@@ -3162,6 +3310,10 @@ var TimeSeriesChartWrapper = (props) => {
3162
3310
  "backgroundColor",
3163
3311
  "defaultFontColor",
3164
3312
  "additionalTooltipValues",
3313
+ // Extract axis line visibility options from props
3314
+ "xAxisLineVisibility",
3315
+ "yAxisLineVisibility",
3316
+ "y2AxisLineVisibility",
3165
3317
  // Extract showYAxisWithZero directly from props for accelerated render mode
3166
3318
  "showYAxisWithZero",
3167
3319
  "showY2AxisWithZero"
@@ -3174,6 +3326,7 @@ var TimeSeriesChartWrapper = (props) => {
3174
3326
  fieldColors,
3175
3327
  legendLabels: legendLabelsStr,
3176
3328
  legendMode,
3329
+ legendTruncation,
3177
3330
  "axisTitleX.text": xAxisTitleText,
3178
3331
  "axisTitleY.text": yAxisTitleText,
3179
3332
  "axisTitleY2.text": y2AxisTitleText,
@@ -3182,6 +3335,7 @@ var TimeSeriesChartWrapper = (props) => {
3182
3335
  "axisTitleY2.visibility": y2AxisTitleVisibility,
3183
3336
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
3184
3337
  "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
3338
+ "axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
3185
3339
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
3186
3340
  "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
3187
3341
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
@@ -3199,6 +3353,8 @@ var TimeSeriesChartWrapper = (props) => {
3199
3353
  lineWidth,
3200
3354
  lineDashStyle,
3201
3355
  fieldDashStyles: lineDashStylesByFieldStr,
3356
+ stepPosition,
3357
+ fieldStepPositions: stepPositionsByFieldStr,
3202
3358
  yAxisMin: yAxisMinRaw,
3203
3359
  yAxisMax: yAxisMaxRaw,
3204
3360
  y2AxisMin: y2AxisMinRaw,
@@ -3209,6 +3365,8 @@ var TimeSeriesChartWrapper = (props) => {
3209
3365
  showYMinorGridLines,
3210
3366
  showY2MinorGridLines,
3211
3367
  showLineSmoothing,
3368
+ xAxisMajorTickVisibility,
3369
+ xAxisMajorTickSize,
3212
3370
  yAxisMajorTickVisibility,
3213
3371
  y2AxisMajorTickVisibility,
3214
3372
  yAxisMajorTickSize,
@@ -3225,10 +3383,14 @@ var TimeSeriesChartWrapper = (props) => {
3225
3383
  const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
3226
3384
  const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
3227
3385
  const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
3386
+ const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
3228
3387
  const showYMajorTicks = yAxisMajorTickVisibility === "show";
3229
3388
  const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
3230
3389
  const showYMinorTicks = yAxisMinorTickVisibility === "show";
3231
3390
  const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
3391
+ const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
3392
+ const showYAxisLine = yAxisLineVisibility === "show";
3393
+ const showY2AxisLine = y2AxisLineVisibility === "show";
3232
3394
  const yAxisMin = parseAxisValue(yAxisMinRaw);
3233
3395
  const yAxisMax = parseAxisValue(yAxisMaxRaw);
3234
3396
  const y2AxisMin = parseAxisValue(y2AxisMinRaw);
@@ -3243,13 +3405,15 @@ var TimeSeriesChartWrapper = (props) => {
3243
3405
  y2AxisMajorUnitFromSimpleXML,
3244
3406
  y2AxisMajorTickInterval
3245
3407
  );
3246
- const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
3247
- const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
3248
- const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
3249
- const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
3408
+ const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
3409
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
3410
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
3411
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
3412
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
3250
3413
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
3251
3414
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
3252
3415
  const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
3416
+ const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
3253
3417
  const legendLabels = parseArrayOption(legendLabelsStr);
3254
3418
  const bgColor = backgroundColor || bgColorFromOptions;
3255
3419
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
@@ -3337,7 +3501,9 @@ var TimeSeriesChartWrapper = (props) => {
3337
3501
  nullValueMode,
3338
3502
  markerDisplay,
3339
3503
  lineDashStyle,
3340
- lineDashStylesByField
3504
+ lineDashStylesByField,
3505
+ stepPosition,
3506
+ stepPositionsByField
3341
3507
  ),
3342
3508
  [
3343
3509
  yFields,
@@ -3348,7 +3514,9 @@ var TimeSeriesChartWrapper = (props) => {
3348
3514
  nullValueMode,
3349
3515
  markerDisplay,
3350
3516
  lineDashStyle,
3351
- lineDashStylesByField
3517
+ lineDashStylesByField,
3518
+ stepPosition,
3519
+ stepPositionsByField
3352
3520
  ]
3353
3521
  );
3354
3522
  const chartingEventAnnotations = (0, react_exports.useMemo)(
@@ -3363,9 +3531,14 @@ var TimeSeriesChartWrapper = (props) => {
3363
3531
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
3364
3532
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
3365
3533
  );
3534
+ const isSeriesCompare = legendMode === "seriesCompare";
3366
3535
  const legend = (0, react_exports.useMemo)(
3367
- () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
3368
- [legendDisplay, legendMode]
3536
+ () => getLegend({
3537
+ legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
3538
+ isSeriesCompare,
3539
+ legendTruncation
3540
+ }),
3541
+ [legendDisplay, isSeriesCompare, legendTruncation]
3369
3542
  );
3370
3543
  const handleChartClick = react_exports.useCallback(
3371
3544
  (event) => {
@@ -3470,6 +3643,7 @@ var TimeSeriesChartWrapper = (props) => {
3470
3643
  seriesConfig: seriesOverrides,
3471
3644
  legend,
3472
3645
  legendLabels,
3646
+ legendTruncation,
3473
3647
  isSeriesCompare: legendMode === "seriesCompare",
3474
3648
  maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
3475
3649
  scaleConfig,
@@ -3491,6 +3665,8 @@ var TimeSeriesChartWrapper = (props) => {
3491
3665
  showY2MinorGridLines,
3492
3666
  showLineSmoothing,
3493
3667
  dataValuesDisplay,
3668
+ showXMajorTicks,
3669
+ xAxisMajorTickSize: xAxisMajorTickSizeNum,
3494
3670
  showYMajorTicks,
3495
3671
  showY2MajorTicks,
3496
3672
  yAxisMajorTickSize: yAxisMajorTickSizeNum,
@@ -3502,7 +3678,11 @@ var TimeSeriesChartWrapper = (props) => {
3502
3678
  yAxisMinorTickSize: yAxisMinorTickSizeNum,
3503
3679
  y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
3504
3680
  showYAxisWithZero,
3505
- showY2AxisWithZero
3681
+ showY2AxisWithZero,
3682
+ showXAxisLine,
3683
+ showYAxisLine,
3684
+ showY2AxisLine,
3685
+ xAxisMaxLabelParts
3506
3686
  }
3507
3687
  ));
3508
3688
  }, [
@@ -3517,6 +3697,7 @@ var TimeSeriesChartWrapper = (props) => {
3517
3697
  seriesOverrides,
3518
3698
  legend,
3519
3699
  legendLabels,
3700
+ legendTruncation,
3520
3701
  scaleConfig,
3521
3702
  onClick,
3522
3703
  handleChartClick,
@@ -3535,6 +3716,8 @@ var TimeSeriesChartWrapper = (props) => {
3535
3716
  showY2MinorGridLines,
3536
3717
  showLineSmoothing,
3537
3718
  dataValuesDisplay,
3719
+ showXMajorTicks,
3720
+ xAxisMajorTickSizeNum,
3538
3721
  showYMajorTicks,
3539
3722
  showY2MajorTicks,
3540
3723
  yAxisMajorTickSizeNum,
@@ -3547,7 +3730,11 @@ var TimeSeriesChartWrapper = (props) => {
3547
3730
  y2AxisMinorTickSizeNum,
3548
3731
  showYAxisWithZero,
3549
3732
  showY2AxisWithZero,
3550
- legendMode
3733
+ showXAxisLine,
3734
+ showYAxisLine,
3735
+ showY2AxisLine,
3736
+ legendMode,
3737
+ xAxisMaxLabelParts
3551
3738
  ]);
3552
3739
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
3553
3740
  return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);