@splunk/visualizations 26.2.0 → 26.3.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.
Files changed (149) hide show
  1. package/Area.config.js +91 -594
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +184 -689
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +92 -561
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +184 -655
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +83 -482
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +177 -578
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +76 -201
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +173 -301
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +92 -599
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +184 -693
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +82 -200
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +137 -262
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +61 -282
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +222 -428
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +90 -219
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +163 -299
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +61 -157
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +130 -242
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +91 -606
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +184 -701
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +74 -256
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +17198 -24224
  44. package/LinkGraph.js.map +1 -1
  45. package/Map.config.js +128 -1123
  46. package/Map.config.js.map +1 -1
  47. package/Map.js +309 -680
  48. package/Map.js.map +1 -1
  49. package/Markdown.config.js +61 -188
  50. package/Markdown.config.js.map +1 -1
  51. package/Markdown.js +190 -323
  52. package/Markdown.js.map +1 -1
  53. package/MarkerGauge.config.js +137 -297
  54. package/MarkerGauge.config.js.map +1 -1
  55. package/MarkerGauge.js +1038 -1203
  56. package/MarkerGauge.js.map +1 -1
  57. package/ParallelCoordinates.config.js +71 -191
  58. package/ParallelCoordinates.config.js.map +1 -1
  59. package/ParallelCoordinates.js +218 -343
  60. package/ParallelCoordinates.js.map +1 -1
  61. package/Pie.config.js +72 -240
  62. package/Pie.config.js.map +1 -1
  63. package/Pie.js +214 -381
  64. package/Pie.js.map +1 -1
  65. package/Punchcard.config.js +71 -305
  66. package/Punchcard.config.js.map +1 -1
  67. package/Punchcard.js +246 -477
  68. package/Punchcard.js.map +1 -1
  69. package/Rectangle.config.js +211 -347
  70. package/Rectangle.config.js.map +1 -1
  71. package/Rectangle.js +274 -416
  72. package/Rectangle.js.map +1 -1
  73. package/Sankey.config.js +71 -213
  74. package/Sankey.config.js.map +1 -1
  75. package/Sankey.js +246 -382
  76. package/Sankey.js.map +1 -1
  77. package/Scatter.config.js +85 -463
  78. package/Scatter.config.js.map +1 -1
  79. package/Scatter.js +825 -1202
  80. package/Scatter.js.map +1 -1
  81. package/SingleValue.config.js +114 -409
  82. package/SingleValue.config.js.map +1 -1
  83. package/SingleValue.js +287 -582
  84. package/SingleValue.js.map +1 -1
  85. package/SingleValueBasic.js +30 -30
  86. package/SingleValueBasic.js.map +1 -1
  87. package/SingleValueIcon.config.js +113 -378
  88. package/SingleValueIcon.config.js.map +1 -1
  89. package/SingleValueIcon.js +268 -533
  90. package/SingleValueIcon.js.map +1 -1
  91. package/SingleValueRadial.config.js +110 -382
  92. package/SingleValueRadial.config.js.map +1 -1
  93. package/SingleValueRadial.js +272 -543
  94. package/SingleValueRadial.js.map +1 -1
  95. package/SparkLine.js +24 -24
  96. package/SparkLine.js.map +1 -1
  97. package/Table.config.js +74 -496
  98. package/Table.config.js.map +1 -1
  99. package/Table.js +302 -720
  100. package/Table.js.map +1 -1
  101. package/common/Charting.js +22 -34
  102. package/common/Charting.js.map +1 -1
  103. package/common/DocExampleWithVizSandbox.js +21 -21
  104. package/common/DocExampleWithVizSandbox.js.map +1 -1
  105. package/common/EventsDoc.js +18 -18
  106. package/common/EventsDoc.js.map +1 -1
  107. package/common/GaugeMajorTicks.js +4 -4
  108. package/common/GaugeMajorTicks.js.map +1 -1
  109. package/common/GaugeValueMarker.js +2 -2
  110. package/common/GaugeValueMarker.js.map +1 -1
  111. package/common/OptionsDoc.js +4 -4
  112. package/common/OptionsDoc.js.map +1 -1
  113. package/common/OverviewDoc.js +39 -40
  114. package/common/OverviewDoc.js.map +1 -1
  115. package/common/SplunkVisualization.js +2 -2
  116. package/common/SplunkVisualization.js.map +1 -1
  117. package/common/SplunkVisualizationApi.js +2 -2
  118. package/common/SplunkVisualizationApi.js.map +1 -1
  119. package/common/ThemesDoc.js +19 -19
  120. package/common/ThemesDoc.js.map +1 -1
  121. package/common/chartingUtils.js +2 -2
  122. package/common/chartingUtils.js.map +1 -1
  123. package/common/gaugeUtils.js +10 -10
  124. package/common/gaugeUtils.js.map +1 -1
  125. package/common/shapeUtils.js +10 -10
  126. package/common/shapeUtils.js.map +1 -1
  127. package/common/utils/configUtils.js +25 -155
  128. package/common/utils/configUtils.js.map +1 -1
  129. package/common/utils/dataUtils.js +75 -87
  130. package/common/utils/dataUtils.js.map +1 -1
  131. package/common/utils/featureFlagUtils.js +4 -4
  132. package/common/utils/featureFlagUtils.js.map +1 -1
  133. package/common/utils/hocUtils.js +2 -2
  134. package/common/utils/hocUtils.js.map +1 -1
  135. package/common/utils/mapUtils.js +51 -54
  136. package/common/utils/mapUtils.js.map +1 -1
  137. package/common/utils/singleValueUtils.js +7 -7
  138. package/common/utils/singleValueUtils.js.map +1 -1
  139. package/common/utils/testHelper.js +7 -36
  140. package/common/utils/testHelper.js.map +1 -1
  141. package/common/utils/trellisUtils.js +7 -6
  142. package/common/utils/trellisUtils.js.map +1 -1
  143. package/common/utils/urlUtils.js +2 -2
  144. package/common/utils/urlUtils.js.map +1 -1
  145. package/common/withDashboardViz.js +65 -77
  146. package/common/withDashboardViz.js.map +1 -1
  147. package/package.json +46 -49
  148. package/common/utils/layoutUtils.js +0 -115
  149. package/common/utils/layoutUtils.js.map +0 -1
package/SparkLine.js CHANGED
@@ -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 = 118);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 115);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -106,40 +106,33 @@ module.exports = require("prop-types");
106
106
 
107
107
  /***/ }),
108
108
 
109
- /***/ 10:
110
- /***/ (function(module, exports) {
111
-
112
- module.exports = require("@babel/runtime/helpers/classCallCheck");
113
-
114
- /***/ }),
115
-
116
- /***/ 111:
109
+ /***/ 109:
117
110
  /***/ (function(module, exports) {
118
111
 
119
112
  module.exports = require("@babel/runtime/helpers/assertThisInitialized");
120
113
 
121
114
  /***/ }),
122
115
 
123
- /***/ 118:
116
+ /***/ 115:
124
117
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
125
118
 
126
119
  "use strict";
127
120
  __webpack_require__.r(__webpack_exports__);
128
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70);
121
+ /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69);
129
122
  /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
130
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
123
+ /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
131
124
  /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
132
125
  /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
133
126
  /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
134
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(111);
127
+ /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(109);
135
128
  /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);
136
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94);
129
+ /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(92);
137
130
  /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
138
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95);
131
+ /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93);
139
132
  /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);
140
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85);
133
+ /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(83);
141
134
  /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
142
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9);
135
+ /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13);
143
136
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__);
144
137
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1);
145
138
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
@@ -149,7 +142,7 @@ __webpack_require__.r(__webpack_exports__);
149
142
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__);
150
143
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4);
151
144
  /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_11__);
152
- /* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(84);
145
+ /* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(82);
153
146
  /* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__);
154
147
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2);
155
148
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__);
@@ -762,6 +755,13 @@ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(Spa
762
755
 
763
756
  /***/ }),
764
757
 
758
+ /***/ 13:
759
+ /***/ (function(module, exports) {
760
+
761
+ module.exports = require("@babel/runtime/helpers/defineProperty");
762
+
763
+ /***/ }),
764
+
765
765
  /***/ 2:
766
766
  /***/ (function(module, exports) {
767
767
 
@@ -797,21 +797,21 @@ module.exports = require("styled-components");
797
797
 
798
798
  /***/ }),
799
799
 
800
- /***/ 70:
800
+ /***/ 69:
801
801
  /***/ (function(module, exports) {
802
802
 
803
803
  module.exports = require("@babel/runtime/helpers/extends");
804
804
 
805
805
  /***/ }),
806
806
 
807
- /***/ 84:
807
+ /***/ 82:
808
808
  /***/ (function(module, exports) {
809
809
 
810
810
  module.exports = require("@splunk/react-ui/Popover");
811
811
 
812
812
  /***/ }),
813
813
 
814
- /***/ 85:
814
+ /***/ 83:
815
815
  /***/ (function(module, exports) {
816
816
 
817
817
  module.exports = require("@babel/runtime/helpers/getPrototypeOf");
@@ -821,18 +821,18 @@ module.exports = require("@babel/runtime/helpers/getPrototypeOf");
821
821
  /***/ 9:
822
822
  /***/ (function(module, exports) {
823
823
 
824
- module.exports = require("@babel/runtime/helpers/defineProperty");
824
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
825
825
 
826
826
  /***/ }),
827
827
 
828
- /***/ 94:
828
+ /***/ 92:
829
829
  /***/ (function(module, exports) {
830
830
 
831
831
  module.exports = require("@babel/runtime/helpers/inherits");
832
832
 
833
833
  /***/ }),
834
834
 
835
- /***/ 95:
835
+ /***/ 93:
836
836
  /***/ (function(module, exports) {
837
837
 
838
838
  module.exports = require("@babel/runtime/helpers/possibleConstructorReturn");
package/SparkLine.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///./src/SparkLine/SparkLine.jsx","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"lodash\"","webpack:///external \"@splunk/ui-utils/id\"","webpack:///external \"styled-components\"","webpack:///external \"@babel/runtime/helpers/extends\"","webpack:///external \"@splunk/react-ui/Popover\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\""],"names":["StyledSvg","styled","StyledTooltip","SparkLine","rest","anchor","el","currentPointX","open","rectArea","tooltip","createDOMID","data","acceptNull","yMax","dataMax","max","yMin","dataMin","min","width","xUnit","xMargin","Math","height","maxValue","minValue","yUnit","yMargin","lines","currentLine","isNull","points","value","x","idx","y","p","i","fillOpacity","e","fillColor","isArea","segments","s","fill","strokeWidth","cursorStroke","cursorStrokeWidth","cursorStrokeLinecap","cursorStrokeDasharray","stroke","strokeLinecap","strokeDasharray","endDotFillColor","endDotRadius","endDotStroke","endDotStrokeWidth","point","lineColor","lineLength","lineStrokeWidth","linePoints","isFinite","lineData","strokeLinejoin","elementRef","showTooltip","showEndDot","endDotCount","title","dotsToShow","omit","keys","_","Component","PropTypes","isArray","props","string"],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,cAAY,EAZM;AAalBC,mBAAiB,EAbC;AAclBC,qBAAmB,EAdD;AAelBC,uBAAqB,EAfH;AAgBlBR,QAAM,EAhBY;AAiBlBiB,WAAS,EAjBS;AAkBlBE,iBAAe,EAAE;AAlBC,C;;AA6Y1B,0E;;;;;;;AC3eA,kD;;;;;;;ACAA,+D;;;;;;;ACAA,mC;;;;;;;ACAA,gD;;;;;;;ACAA,8C;;;;;;;ACAA,2D;;;;;;;ACAA,qD;;;;;;;ACAA,kE;;;;;;;ACAA,kE;;;;;;;ACAA,4D;;;;;;;ACAA,6E","file":"SparkLine.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 = 118);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/assertThisInitialized\");","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { isArray, isFinite, isNull, keys, max, min, omit } from 'lodash';\nimport styled from 'styled-components';\nimport Popover from '@splunk/react-ui/Popover';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { createDOMID } from '@splunk/ui-utils/id';\n\nconst StyledSvg = styled.svg`\n /* For fixing IE11 shows overflow part line issue */\n overflow: hidden;\n`;\n\nconst StyledTooltip = styled.div`\n padding: 3px 8px;\n font-size: 12px;\n`;\n\nclass SparkLine extends Component {\n static propTypes = {\n /**\n * If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.\n */\n acceptNull: PropTypes.bool,\n /** Array of numbers. These data numbers are converted to points and show on sparkline. */\n data: props => {\n if (!isArray(props.data)) {\n return new Error('Data provided to Sparkline must be an array.');\n }\n\n if (props.acceptNull && !props.data.every(value => isNull(value) || isFinite(value))) {\n return new Error('Data provided to Sparkline must be finite numbers or null.');\n }\n\n if (!props.acceptNull && !props.data.every(value => isFinite(value))) {\n return new Error('Data provided to Sparkline must be finite numbers.');\n }\n return null;\n },\n /** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */\n elementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n /** Sets the number of end dots to display. When showEndDot is set to `true`, endDotCount is at least 1. If set to a positive value, this overrides showEndDot. */\n endDotCount: PropTypes.number,\n /** Fills color to the end dot. */\n endDotFillColor: PropTypes.string,\n /**\n * Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.\n */\n endDotRadius: PropTypes.number,\n /** Sets end dot circle stroke color. */\n endDotStroke: PropTypes.string,\n /** Sets end dot circle stroke width in pixels. */\n endDotStrokeWidth: PropTypes.number,\n /** Fills color to area. */\n fillColor: PropTypes.string,\n /** Fills opacity to area. Value must be in 0 ~ 1. */\n fillOpacity: PropTypes.string,\n /** Sets cursor stroke color. */\n cursorStroke: PropTypes.string,\n /** Sets cursor stroke width in pixels. */\n cursorStrokeWidth: PropTypes.number,\n /** Sets cursor line cap style. */\n cursorStrokeLinecap: PropTypes.oneOf(['butt', 'round', 'square']),\n /** Sets cursor dash array style. */\n cursorStrokeDasharray: PropTypes.string,\n /**\n * Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,\n * sparkline figures out the container height by itself.\n */\n height: PropTypes.number.isRequired,\n /** When set to `true`, sparkline shows as area. */\n isArea: PropTypes.bool,\n /** The sparkline line color. */\n lineColor: PropTypes.string,\n /** Allows user to draw only the last data points for the line. */\n lineLength: PropTypes.number,\n /** The sparkline line stroke width in pixels. */\n lineStrokeWidth: PropTypes.number,\n /** Enable to show end dot. */\n showEndDot: PropTypes.bool,\n /** Enable to show tooltip. */\n showTooltip: PropTypes.bool,\n /** Sets the data value range and maximum value shown on sparkline. */\n yMax: PropTypes.number,\n /** Sets the data value range and minimum value shown on sparkline. */\n yMin: PropTypes.number,\n /**\n * The width of the container.\n */\n width: PropTypes.number.isRequired,\n /** Sets the a11y title text on sparkline. */\n title: PropTypes.string,\n };\n\n static defaultProps = {\n acceptNull: false,\n data: [],\n showTooltip: true,\n endDotCount: 0,\n showEndDot: false,\n endDotRadius: 0,\n endDotFillColor: 'white',\n endDotStroke: 'black',\n endDotStrokeWidth: 0,\n fillColor: '#65a637',\n fillOpacity: '.1',\n cursorStroke: '#5184AF',\n cursorStrokeWidth: 3,\n cursorStrokeLinecap: 'square',\n cursorStrokeDasharray: '1, 5',\n isArea: false,\n lineColor: '#65a637',\n lineStrokeWidth: 1,\n };\n\n constructor(props, ...rest) {\n super(props, ...rest);\n this.state = {\n anchor: null,\n currentPointX: null,\n open: false,\n rectArea: null,\n tooltip: null,\n };\n this.titleId = createDOMID();\n }\n\n getMax() {\n const { data, acceptNull, yMax } = this.props;\n const dataMax = () => (acceptNull ? max(this.fillNull(data)) : max(data));\n return yMax !== undefined ? yMax : dataMax();\n }\n\n getMin() {\n const { data, acceptNull, yMin } = this.props;\n const dataMin = () => (acceptNull ? min(this.fillNull(data)) : min(data));\n return yMin !== undefined ? yMin : dataMin();\n }\n\n /**\n * Gets unit value of x axis.\n * @param {Number} xMargin - margin of x axis.\n * @return {Number} unit value of x axis.\n * @private\n */\n getXUnit(xMargin) {\n const { data, width } = this.props;\n // Calculate xUnit. Width substract the left margin and right margin, then divide by data length.\n const xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);\n return Math.max(0, xUnit);\n }\n\n /**\n * Gets unit value of y axis.\n * @param {String} yMargin - margin of y axis.\n * @return {Number} unit value of y axis.\n * @private\n */\n getYUnit(yMargin) {\n const { height } = this.props;\n const maxValue = this.getMax();\n const minValue = this.getMin();\n\n // Calculate yUnit. Height substract the upper margin and bottom margin, then divide by value range of values in data.\n // if the maxValue equals minValue, means all values in data are the same, then, we need to set the YUnit at the mid value of Height.\n // So, draws sparkline right in the mid of the container.\n const yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);\n return Math.max(0, yUnit);\n }\n\n /**\n * Get a list of arrays of points for drawing lines, based on acceptNull property\n * @method getSegmentSets\n * @param {Array} data\n * @param {Array} points\n * @returns {Array} List of datapoint sets used for drawing lines\n */\n getSegmentSets(data, points) {\n const { acceptNull } = this.props;\n const lines = [];\n let currentLine = [];\n\n data.forEach((p, idx) => {\n // Found null data\n if (!acceptNull && isNull(p)) {\n // need at least 2 points to draw a segment\n if (currentLine.length > 1) {\n lines.push(currentLine);\n }\n // reset for the next segment\n currentLine = [];\n } else {\n // data is good, add point data\n currentLine.push(points[idx]);\n }\n });\n\n // Add the last line\n if (currentLine.length > 1) {\n lines.push(currentLine);\n }\n\n return lines;\n }\n\n handleCursorMount = el => {\n this.setState({\n anchor: el,\n });\n };\n\n /**\n * Utility for fill null value with number 0.\n * @private\n */\n fillNull() {\n const { data } = this.props;\n return data.map(value => (value === null ? 0 : value));\n }\n\n /**\n * Converts data to points in svg\n * @param {Number} xMargin - margin of x axis.\n * @param {Number} yMargin - margin of x axis.\n * @return {Array} points coordination.\n * @private\n */\n dataToPoints(xMargin, yMargin) {\n const { data } = this.props;\n const xUnit = this.getXUnit(xMargin);\n const yUnit = this.getYUnit(yMargin);\n const maxValue = this.getMax();\n const minValue = this.getMin();\n return data\n .map((val, idx) => ({\n x: idx * xUnit + xMargin,\n y: maxValue === minValue ? yUnit + yMargin : (maxValue - val) * yUnit + yMargin,\n }))\n .map(p => [p.x, p.y]);\n }\n\n /**\n * Renders rect area for helping figure out which is the nearest point so that\n * render related cursor and tooltip.\n * @param {Array} points - array of points coordination.\n * @param {Number} xMargin - margin of x axis.\n * @return {Array} array of svg rect objects\n * @private\n */\n renderRect(points, xMargin) {\n const { data, height } = this.props;\n const xUnit = this.getXUnit(xMargin);\n\n return points.map((p, i) => (\n /* eslint-disable react/no-array-index-key */\n <rect // eslint-disable-line jsx-a11y/mouse-events-have-key-events\n key={`${i}_${p[0]}`}\n data-test={`rect-${i}`}\n x={p[0] - xUnit / 2 <= 0 ? 0 : p[0] - xUnit / 2}\n y={0}\n width={i === 0 && data.length !== 1 ? xUnit / 2 : xUnit}\n height={height}\n style={{ fillOpacity: 0 }}\n onMouseOver={e => {\n this.setState({\n open: data[i] !== null,\n rectArea: data[i] === null ? null : e.target,\n tooltip: data[i],\n currentPointX: p[0],\n });\n }}\n />\n /* eslint-enable react/no-array-index-key */\n ));\n }\n\n // Renders area chart\n renderArea(points) {\n const { data, fillColor, fillOpacity, height, isArea } = this.props;\n\n if (!isArea || points.length === 0) {\n return null;\n }\n\n let segments = this.getSegmentSets(data, points);\n segments = segments.map(s =>\n s.concat([\n [s[s.length - 1][0], height], // down to bottom of graph\n [s[0][0], height], // over to below first data point\n s[0], // up to first data point to close the box\n ])\n );\n\n return (\n <g data-test=\"area\">\n {segments.map(s => (\n <polyline\n key={`area${s.join('')}`}\n points={s.join(' ')}\n data-test=\"area-line\"\n style={{\n fill: fillColor,\n fillOpacity,\n strokeWidth: '0',\n }}\n />\n ))}\n </g>\n );\n }\n\n renderCursor() {\n const {\n cursorStroke,\n cursorStrokeWidth,\n cursorStrokeLinecap,\n cursorStrokeDasharray,\n height,\n } = this.props;\n\n return (\n this.state.rectArea !== null && (\n <line\n data-test=\"cursor\"\n ref={this.handleCursorMount}\n x1={this.state.currentPointX}\n y1={0}\n x2={this.state.currentPointX}\n y2={height}\n style={{\n stroke: cursorStroke,\n strokeWidth: cursorStrokeWidth,\n strokeLinecap: cursorStrokeLinecap,\n strokeDasharray: cursorStrokeDasharray,\n }}\n />\n )\n );\n }\n\n renderTooltip() {\n return (\n this.state.anchor !== null && (\n <Popover\n data-test=\"tooltip\"\n open={this.state.open}\n anchor={this.state.anchor}\n data-test-value={this.state.tooltip}\n appearance=\"inverted\"\n defaultPlacement=\"above\"\n animation={false}\n >\n <StyledTooltip>\n {this.state.anchor !== null ? this.state.tooltip : undefined}\n </StyledTooltip>\n </Popover>\n )\n );\n }\n\n /**\n * Renders one or more svg circles to highlight values on the sparkline\n * @method renderEndDots\n * @param {Array[Array[Number]]} points // x,y coordinates of values\n * @param {Number} dotsToShow // number of end dots to display\n * @param {Number} xMargin // used when calculating the dot radius\n * @returns {Object} React representation of SVG group\n * @private\n */\n renderEndDots(points, dotsToShow, xMargin) {\n const { endDotFillColor, endDotRadius, endDotStroke, endDotStrokeWidth } = this.props;\n\n return (\n <g>\n {points.slice(-dotsToShow).map(point => (\n <circle\n key={`end-dot${point[0]}${point[1]}`}\n data-test=\"end-dot\"\n cx={point[0]}\n cy={point[1]}\n r={endDotRadius === 0 ? xMargin : endDotRadius}\n style={{\n fill: endDotFillColor,\n stroke: endDotStroke,\n strokeWidth: endDotStrokeWidth,\n }}\n />\n ))}\n </g>\n );\n }\n\n /**\n * Renders the line(s) above the area graph\n * @method renderPolyline\n * @param {Array} points\n * @returns {Object} SVG Group of polylines\n */\n renderPolyline(points) {\n const { data, lineColor, lineLength, lineStrokeWidth } = this.props;\n\n const linePoints = isFinite(lineLength) && lineLength > 0 ? lineLength : points.length;\n const lines = this.getSegmentSets(data.slice(-linePoints), points.slice(-linePoints));\n\n return (\n <g data-test=\"sparkline\">\n {lines.map(lineData => (\n <polyline\n key={`line${lineData.join('')}`}\n data-test=\"polyline\"\n style={{\n fill: 'none',\n stroke: lineColor,\n strokeWidth: lineStrokeWidth,\n strokeLinejoin: 'round',\n strokeLinecap: 'round',\n }}\n points={lineData.join(' ')}\n />\n ))}\n </g>\n );\n }\n\n render() {\n const {\n data,\n elementRef,\n showTooltip,\n showEndDot,\n endDotRadius,\n endDotStrokeWidth,\n endDotCount,\n height,\n isArea,\n lineStrokeWidth,\n width,\n title,\n } = this.props;\n\n if (data.length === 0) {\n return null;\n }\n\n // Calculate horizontal and vertical margin so that fit line or end dot.\n const xMargin = endDotRadius + endDotStrokeWidth / 2;\n const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);\n\n const points = this.dataToPoints(xMargin, yMargin);\n\n const dotsToShow = Math.max(showEndDot && 1, isFinite(endDotCount) && endDotCount > 0 && endDotCount);\n\n return (\n <div // eslint-disable-line jsx-a11y/mouse-events-have-key-events\n data-test=\"line\"\n data-test-type={isArea ? 'area' : 'line'}\n onMouseOut={() => {\n this.setState({\n open: false,\n anchor: null,\n rectArea: null,\n currentPointX: null,\n });\n }}\n ref={elementRef}\n {...omit(this.props, keys(SparkLine.propTypes))}\n >\n <StyledSvg\n height={height}\n width={width}\n role=\"img\"\n aria-labelledby={this.titleId}\n data-test=\"sparkline-svg\"\n >\n <title id={this.titleId} data-test=\"sparkline-title\">\n {title || _('Source count over time sparkline trend')}\n </title>\n <g>\n {this.renderCursor()}\n {this.renderPolyline(points)}\n {this.renderArea(points)}\n {dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null}\n {showTooltip ? this.renderRect(points, xMargin) : null}\n {showTooltip ? this.renderTooltip() : null}\n </g>\n </StyledSvg>\n </div>\n );\n }\n}\n\nexport default SparkLine;\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"lodash\");","module.exports = require(\"@splunk/ui-utils/id\");","module.exports = require(\"styled-components\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/react-ui/Popover\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///./src/SparkLine/SparkLine.jsx","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"lodash\"","webpack:///external \"@splunk/ui-utils/id\"","webpack:///external \"styled-components\"","webpack:///external \"@babel/runtime/helpers/extends\"","webpack:///external \"@splunk/react-ui/Popover\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\""],"names":["StyledSvg","styled","StyledTooltip","SparkLine","rest","anchor","el","currentPointX","open","rectArea","tooltip","createDOMID","data","acceptNull","yMax","dataMax","max","yMin","dataMin","min","width","xUnit","xMargin","Math","height","maxValue","minValue","yUnit","yMargin","lines","currentLine","isNull","points","value","x","idx","y","p","i","fillOpacity","e","fillColor","isArea","segments","s","fill","strokeWidth","cursorStroke","cursorStrokeWidth","cursorStrokeLinecap","cursorStrokeDasharray","stroke","strokeLinecap","strokeDasharray","endDotFillColor","endDotRadius","endDotStroke","endDotStrokeWidth","point","lineColor","lineLength","lineStrokeWidth","linePoints","isFinite","lineData","strokeLinejoin","elementRef","showTooltip","showEndDot","endDotCount","title","dotsToShow","omit","keys","_","Component","PropTypes","isArray","props","string"],"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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edModules = {};\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 = 115);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@babel/runtime/helpers/assertThisInitialized\");","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport { isArray, isFinite, isNull, keys, max, min, omit } from 'lodash';\nimport styled from 'styled-components';\nimport Popover from '@splunk/react-ui/Popover';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { createDOMID } from '@splunk/ui-utils/id';\n\nconst StyledSvg = styled.svg`\n /* For fixing IE11 shows overflow part line issue */\n overflow: hidden;\n`;\n\nconst StyledTooltip = styled.div`\n padding: 3px 8px;\n font-size: 12px;\n`;\n\nclass SparkLine extends Component {\n static propTypes = {\n /**\n * If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.\n */\n acceptNull: PropTypes.bool,\n /** Array of numbers. These data numbers are converted to points and show on sparkline. */\n data: props => {\n if (!isArray(props.data)) {\n return new Error('Data provided to Sparkline must be an array.');\n }\n\n if (props.acceptNull && !props.data.every(value => isNull(value) || isFinite(value))) {\n return new Error('Data provided to Sparkline must be finite numbers or null.');\n }\n\n if (!props.acceptNull && !props.data.every(value => isFinite(value))) {\n return new Error('Data provided to Sparkline must be finite numbers.');\n }\n return null;\n },\n /** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */\n elementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n /** Sets the number of end dots to display. When showEndDot is set to `true`, endDotCount is at least 1. If set to a positive value, this overrides showEndDot. */\n endDotCount: PropTypes.number,\n /** Fills color to the end dot. */\n endDotFillColor: PropTypes.string,\n /**\n * Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.\n */\n endDotRadius: PropTypes.number,\n /** Sets end dot circle stroke color. */\n endDotStroke: PropTypes.string,\n /** Sets end dot circle stroke width in pixels. */\n endDotStrokeWidth: PropTypes.number,\n /** Fills color to area. */\n fillColor: PropTypes.string,\n /** Fills opacity to area. Value must be in 0 ~ 1. */\n fillOpacity: PropTypes.string,\n /** Sets cursor stroke color. */\n cursorStroke: PropTypes.string,\n /** Sets cursor stroke width in pixels. */\n cursorStrokeWidth: PropTypes.number,\n /** Sets cursor line cap style. */\n cursorStrokeLinecap: PropTypes.oneOf(['butt', 'round', 'square']),\n /** Sets cursor dash array style. */\n cursorStrokeDasharray: PropTypes.string,\n /**\n * Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,\n * sparkline figures out the container height by itself.\n */\n height: PropTypes.number.isRequired,\n /** When set to `true`, sparkline shows as area. */\n isArea: PropTypes.bool,\n /** The sparkline line color. */\n lineColor: PropTypes.string,\n /** Allows user to draw only the last data points for the line. */\n lineLength: PropTypes.number,\n /** The sparkline line stroke width in pixels. */\n lineStrokeWidth: PropTypes.number,\n /** Enable to show end dot. */\n showEndDot: PropTypes.bool,\n /** Enable to show tooltip. */\n showTooltip: PropTypes.bool,\n /** Sets the data value range and maximum value shown on sparkline. */\n yMax: PropTypes.number,\n /** Sets the data value range and minimum value shown on sparkline. */\n yMin: PropTypes.number,\n /**\n * The width of the container.\n */\n width: PropTypes.number.isRequired,\n /** Sets the a11y title text on sparkline. */\n title: PropTypes.string,\n };\n\n static defaultProps = {\n acceptNull: false,\n data: [],\n showTooltip: true,\n endDotCount: 0,\n showEndDot: false,\n endDotRadius: 0,\n endDotFillColor: 'white',\n endDotStroke: 'black',\n endDotStrokeWidth: 0,\n fillColor: '#65a637',\n fillOpacity: '.1',\n cursorStroke: '#5184AF',\n cursorStrokeWidth: 3,\n cursorStrokeLinecap: 'square',\n cursorStrokeDasharray: '1, 5',\n isArea: false,\n lineColor: '#65a637',\n lineStrokeWidth: 1,\n };\n\n constructor(props, ...rest) {\n super(props, ...rest);\n this.state = {\n anchor: null,\n currentPointX: null,\n open: false,\n rectArea: null,\n tooltip: null,\n };\n this.titleId = createDOMID();\n }\n\n getMax() {\n const { data, acceptNull, yMax } = this.props;\n const dataMax = () => (acceptNull ? max(this.fillNull(data)) : max(data));\n return yMax !== undefined ? yMax : dataMax();\n }\n\n getMin() {\n const { data, acceptNull, yMin } = this.props;\n const dataMin = () => (acceptNull ? min(this.fillNull(data)) : min(data));\n return yMin !== undefined ? yMin : dataMin();\n }\n\n /**\n * Gets unit value of x axis.\n * @param {Number} xMargin - margin of x axis.\n * @return {Number} unit value of x axis.\n * @private\n */\n getXUnit(xMargin) {\n const { data, width } = this.props;\n // Calculate xUnit. Width substract the left margin and right margin, then divide by data length.\n const xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);\n return Math.max(0, xUnit);\n }\n\n /**\n * Gets unit value of y axis.\n * @param {String} yMargin - margin of y axis.\n * @return {Number} unit value of y axis.\n * @private\n */\n getYUnit(yMargin) {\n const { height } = this.props;\n const maxValue = this.getMax();\n const minValue = this.getMin();\n\n // Calculate yUnit. Height substract the upper margin and bottom margin, then divide by value range of values in data.\n // if the maxValue equals minValue, means all values in data are the same, then, we need to set the YUnit at the mid value of Height.\n // So, draws sparkline right in the mid of the container.\n const yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);\n return Math.max(0, yUnit);\n }\n\n /**\n * Get a list of arrays of points for drawing lines, based on acceptNull property\n * @method getSegmentSets\n * @param {Array} data\n * @param {Array} points\n * @returns {Array} List of datapoint sets used for drawing lines\n */\n getSegmentSets(data, points) {\n const { acceptNull } = this.props;\n const lines = [];\n let currentLine = [];\n\n data.forEach((p, idx) => {\n // Found null data\n if (!acceptNull && isNull(p)) {\n // need at least 2 points to draw a segment\n if (currentLine.length > 1) {\n lines.push(currentLine);\n }\n // reset for the next segment\n currentLine = [];\n } else {\n // data is good, add point data\n currentLine.push(points[idx]);\n }\n });\n\n // Add the last line\n if (currentLine.length > 1) {\n lines.push(currentLine);\n }\n\n return lines;\n }\n\n handleCursorMount = el => {\n this.setState({\n anchor: el,\n });\n };\n\n /**\n * Utility for fill null value with number 0.\n * @private\n */\n fillNull() {\n const { data } = this.props;\n return data.map(value => (value === null ? 0 : value));\n }\n\n /**\n * Converts data to points in svg\n * @param {Number} xMargin - margin of x axis.\n * @param {Number} yMargin - margin of x axis.\n * @return {Array} points coordination.\n * @private\n */\n dataToPoints(xMargin, yMargin) {\n const { data } = this.props;\n const xUnit = this.getXUnit(xMargin);\n const yUnit = this.getYUnit(yMargin);\n const maxValue = this.getMax();\n const minValue = this.getMin();\n return data\n .map((val, idx) => ({\n x: idx * xUnit + xMargin,\n y: maxValue === minValue ? yUnit + yMargin : (maxValue - val) * yUnit + yMargin,\n }))\n .map(p => [p.x, p.y]);\n }\n\n /**\n * Renders rect area for helping figure out which is the nearest point so that\n * render related cursor and tooltip.\n * @param {Array} points - array of points coordination.\n * @param {Number} xMargin - margin of x axis.\n * @return {Array} array of svg rect objects\n * @private\n */\n renderRect(points, xMargin) {\n const { data, height } = this.props;\n const xUnit = this.getXUnit(xMargin);\n\n return points.map((p, i) => (\n /* eslint-disable react/no-array-index-key */\n <rect // eslint-disable-line jsx-a11y/mouse-events-have-key-events\n key={`${i}_${p[0]}`}\n data-test={`rect-${i}`}\n x={p[0] - xUnit / 2 <= 0 ? 0 : p[0] - xUnit / 2}\n y={0}\n width={i === 0 && data.length !== 1 ? xUnit / 2 : xUnit}\n height={height}\n style={{ fillOpacity: 0 }}\n onMouseOver={e => {\n this.setState({\n open: data[i] !== null,\n rectArea: data[i] === null ? null : e.target,\n tooltip: data[i],\n currentPointX: p[0],\n });\n }}\n />\n /* eslint-enable react/no-array-index-key */\n ));\n }\n\n // Renders area chart\n renderArea(points) {\n const { data, fillColor, fillOpacity, height, isArea } = this.props;\n\n if (!isArea || points.length === 0) {\n return null;\n }\n\n let segments = this.getSegmentSets(data, points);\n segments = segments.map(s =>\n s.concat([\n [s[s.length - 1][0], height], // down to bottom of graph\n [s[0][0], height], // over to below first data point\n s[0], // up to first data point to close the box\n ])\n );\n\n return (\n <g data-test=\"area\">\n {segments.map(s => (\n <polyline\n key={`area${s.join('')}`}\n points={s.join(' ')}\n data-test=\"area-line\"\n style={{\n fill: fillColor,\n fillOpacity,\n strokeWidth: '0',\n }}\n />\n ))}\n </g>\n );\n }\n\n renderCursor() {\n const {\n cursorStroke,\n cursorStrokeWidth,\n cursorStrokeLinecap,\n cursorStrokeDasharray,\n height,\n } = this.props;\n\n return (\n this.state.rectArea !== null && (\n <line\n data-test=\"cursor\"\n ref={this.handleCursorMount}\n x1={this.state.currentPointX}\n y1={0}\n x2={this.state.currentPointX}\n y2={height}\n style={{\n stroke: cursorStroke,\n strokeWidth: cursorStrokeWidth,\n strokeLinecap: cursorStrokeLinecap,\n strokeDasharray: cursorStrokeDasharray,\n }}\n />\n )\n );\n }\n\n renderTooltip() {\n return (\n this.state.anchor !== null && (\n <Popover\n data-test=\"tooltip\"\n open={this.state.open}\n anchor={this.state.anchor}\n data-test-value={this.state.tooltip}\n appearance=\"inverted\"\n defaultPlacement=\"above\"\n animation={false}\n >\n <StyledTooltip>\n {this.state.anchor !== null ? this.state.tooltip : undefined}\n </StyledTooltip>\n </Popover>\n )\n );\n }\n\n /**\n * Renders one or more svg circles to highlight values on the sparkline\n * @method renderEndDots\n * @param {Array[Array[Number]]} points // x,y coordinates of values\n * @param {Number} dotsToShow // number of end dots to display\n * @param {Number} xMargin // used when calculating the dot radius\n * @returns {Object} React representation of SVG group\n * @private\n */\n renderEndDots(points, dotsToShow, xMargin) {\n const { endDotFillColor, endDotRadius, endDotStroke, endDotStrokeWidth } = this.props;\n\n return (\n <g>\n {points.slice(-dotsToShow).map(point => (\n <circle\n key={`end-dot${point[0]}${point[1]}`}\n data-test=\"end-dot\"\n cx={point[0]}\n cy={point[1]}\n r={endDotRadius === 0 ? xMargin : endDotRadius}\n style={{\n fill: endDotFillColor,\n stroke: endDotStroke,\n strokeWidth: endDotStrokeWidth,\n }}\n />\n ))}\n </g>\n );\n }\n\n /**\n * Renders the line(s) above the area graph\n * @method renderPolyline\n * @param {Array} points\n * @returns {Object} SVG Group of polylines\n */\n renderPolyline(points) {\n const { data, lineColor, lineLength, lineStrokeWidth } = this.props;\n\n const linePoints = isFinite(lineLength) && lineLength > 0 ? lineLength : points.length;\n const lines = this.getSegmentSets(data.slice(-linePoints), points.slice(-linePoints));\n\n return (\n <g data-test=\"sparkline\">\n {lines.map(lineData => (\n <polyline\n key={`line${lineData.join('')}`}\n data-test=\"polyline\"\n style={{\n fill: 'none',\n stroke: lineColor,\n strokeWidth: lineStrokeWidth,\n strokeLinejoin: 'round',\n strokeLinecap: 'round',\n }}\n points={lineData.join(' ')}\n />\n ))}\n </g>\n );\n }\n\n render() {\n const {\n data,\n elementRef,\n showTooltip,\n showEndDot,\n endDotRadius,\n endDotStrokeWidth,\n endDotCount,\n height,\n isArea,\n lineStrokeWidth,\n width,\n title,\n } = this.props;\n\n if (data.length === 0) {\n return null;\n }\n\n // Calculate horizontal and vertical margin so that fit line or end dot.\n const xMargin = endDotRadius + endDotStrokeWidth / 2;\n const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);\n\n const points = this.dataToPoints(xMargin, yMargin);\n\n const dotsToShow = Math.max(showEndDot && 1, isFinite(endDotCount) && endDotCount > 0 && endDotCount);\n\n return (\n <div // eslint-disable-line jsx-a11y/mouse-events-have-key-events\n data-test=\"line\"\n data-test-type={isArea ? 'area' : 'line'}\n onMouseOut={() => {\n this.setState({\n open: false,\n anchor: null,\n rectArea: null,\n currentPointX: null,\n });\n }}\n ref={elementRef}\n {...omit(this.props, keys(SparkLine.propTypes))}\n >\n <StyledSvg\n height={height}\n width={width}\n role=\"img\"\n aria-labelledby={this.titleId}\n data-test=\"sparkline-svg\"\n >\n <title id={this.titleId} data-test=\"sparkline-title\">\n {title || _('Source count over time sparkline trend')}\n </title>\n <g>\n {this.renderCursor()}\n {this.renderPolyline(points)}\n {this.renderArea(points)}\n {dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null}\n {showTooltip ? this.renderRect(points, xMargin) : null}\n {showTooltip ? this.renderTooltip() : null}\n </g>\n </StyledSvg>\n </div>\n );\n }\n}\n\nexport default SparkLine;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"lodash\");","module.exports = require(\"@splunk/ui-utils/id\");","module.exports = require(\"styled-components\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@splunk/react-ui/Popover\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");"],"sourceRoot":""}