@splunk/visualizations 26.3.0 → 26.4.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.
- package/Area.config.js +1 -1
- package/Area.config.js.map +1 -1
- package/Area.js +300 -290
- package/Area.js.map +1 -1
- package/Bar.config.js +1 -1
- package/Bar.config.js.map +1 -1
- package/Bar.js +303 -293
- package/Bar.js.map +1 -1
- package/Bubble.config.js +1 -1
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +292 -282
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +1 -1
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +262 -260
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +1 -1
- package/Column.config.js.map +1 -1
- package/Column.js +303 -293
- package/Column.js.map +1 -1
- package/Ellipse.js +220 -218
- package/Ellipse.js.map +1 -1
- package/Events.config.js +1 -1
- package/Events.config.js.map +1 -1
- package/Events.js +285 -283
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +1 -1
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +250 -248
- package/FillerGauge.js.map +1 -1
- package/Image.js +212 -210
- package/Image.js.map +1 -1
- package/Line.config.js +1 -1
- package/Line.config.js.map +1 -1
- package/Line.js +301 -291
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +1 -1
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +1725 -17201
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +12 -0
- package/Map.config.js +1 -1
- package/Map.config.js.map +1 -1
- package/Map.js +465 -406
- package/Map.js.map +1 -1
- package/Markdown.config.js +1 -1
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +281 -277
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +1 -1
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +926 -922
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +1 -1
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +336 -320
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +5 -1
- package/Pie.config.js.map +1 -1
- package/Pie.js +374 -332
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +1 -1
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +342 -338
- package/Punchcard.js.map +1 -1
- package/Rectangle.js +260 -256
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +1 -1
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +339 -335
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +1 -1
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +351 -339
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +10 -2
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +455 -427
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +65 -53
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +10 -2
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +449 -421
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +11 -3
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1580 -1552
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +33 -33
- package/SparkLine.js.map +1 -1
- package/Table.js +354 -350
- package/Table.js.map +1 -1
- package/common/Charting.js +25 -24
- package/common/Charting.js.map +1 -1
- package/common/utils/dataUtils.js +12 -18
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +23 -11
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/withDashboardViz.js +31 -27
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +17 -16
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 =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 114);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -95,58 +95,58 @@ module.exports =
|
|
|
95
95
|
/***/ 0:
|
|
96
96
|
/***/ (function(module, exports) {
|
|
97
97
|
|
|
98
|
-
module.exports = require("
|
|
98
|
+
module.exports = require("prop-types");
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
102
102
|
/***/ 1:
|
|
103
103
|
/***/ (function(module, exports) {
|
|
104
104
|
|
|
105
|
-
module.exports = require("
|
|
105
|
+
module.exports = require("react");
|
|
106
106
|
|
|
107
107
|
/***/ }),
|
|
108
108
|
|
|
109
|
-
/***/
|
|
109
|
+
/***/ 108:
|
|
110
110
|
/***/ (function(module, exports) {
|
|
111
111
|
|
|
112
112
|
module.exports = require("@babel/runtime/helpers/assertThisInitialized");
|
|
113
113
|
|
|
114
114
|
/***/ }),
|
|
115
115
|
|
|
116
|
-
/***/
|
|
116
|
+
/***/ 114:
|
|
117
117
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
118
118
|
|
|
119
119
|
"use strict";
|
|
120
120
|
__webpack_require__.r(__webpack_exports__);
|
|
121
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
121
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68);
|
|
122
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__);
|
|
123
|
-
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
123
|
+
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
|
|
124
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__);
|
|
125
|
-
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
125
|
+
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
|
|
126
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__);
|
|
127
|
-
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
127
|
+
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(108);
|
|
128
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__);
|
|
129
|
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
129
|
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91);
|
|
130
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__);
|
|
131
|
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
131
|
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(92);
|
|
132
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__);
|
|
133
|
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
133
|
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(82);
|
|
134
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__);
|
|
135
|
-
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
135
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12);
|
|
136
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__);
|
|
137
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
137
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(0);
|
|
138
138
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
|
|
139
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
|
|
139
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1);
|
|
140
140
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
|
|
141
|
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
|
|
141
|
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2);
|
|
142
142
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__);
|
|
143
143
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4);
|
|
144
144
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_11__);
|
|
145
|
-
/* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
|
|
145
|
+
/* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(81);
|
|
146
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__);
|
|
147
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(
|
|
147
|
+
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(3);
|
|
148
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__);
|
|
149
|
-
/* harmony import */ var _splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(
|
|
149
|
+
/* harmony import */ var _splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(30);
|
|
150
150
|
/* harmony import */ var _splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__);
|
|
151
151
|
|
|
152
152
|
|
|
@@ -755,7 +755,7 @@ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(Spa
|
|
|
755
755
|
|
|
756
756
|
/***/ }),
|
|
757
757
|
|
|
758
|
-
/***/
|
|
758
|
+
/***/ 12:
|
|
759
759
|
/***/ (function(module, exports) {
|
|
760
760
|
|
|
761
761
|
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
@@ -765,11 +765,11 @@ module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
|
765
765
|
/***/ 2:
|
|
766
766
|
/***/ (function(module, exports) {
|
|
767
767
|
|
|
768
|
-
module.exports = require("
|
|
768
|
+
module.exports = require("lodash");
|
|
769
769
|
|
|
770
770
|
/***/ }),
|
|
771
771
|
|
|
772
|
-
/***/
|
|
772
|
+
/***/ 24:
|
|
773
773
|
/***/ (function(module, exports) {
|
|
774
774
|
|
|
775
775
|
module.exports = require("@babel/runtime/helpers/createClass");
|
|
@@ -779,11 +779,11 @@ module.exports = require("@babel/runtime/helpers/createClass");
|
|
|
779
779
|
/***/ 3:
|
|
780
780
|
/***/ (function(module, exports) {
|
|
781
781
|
|
|
782
|
-
module.exports = require("
|
|
782
|
+
module.exports = require("@splunk/ui-utils/i18n");
|
|
783
783
|
|
|
784
784
|
/***/ }),
|
|
785
785
|
|
|
786
|
-
/***/
|
|
786
|
+
/***/ 30:
|
|
787
787
|
/***/ (function(module, exports) {
|
|
788
788
|
|
|
789
789
|
module.exports = require("@splunk/ui-utils/id");
|
|
@@ -797,42 +797,42 @@ module.exports = require("styled-components");
|
|
|
797
797
|
|
|
798
798
|
/***/ }),
|
|
799
799
|
|
|
800
|
-
/***/
|
|
800
|
+
/***/ 68:
|
|
801
801
|
/***/ (function(module, exports) {
|
|
802
802
|
|
|
803
803
|
module.exports = require("@babel/runtime/helpers/extends");
|
|
804
804
|
|
|
805
805
|
/***/ }),
|
|
806
806
|
|
|
807
|
-
/***/
|
|
807
|
+
/***/ 8:
|
|
808
808
|
/***/ (function(module, exports) {
|
|
809
809
|
|
|
810
|
-
module.exports = require("@
|
|
810
|
+
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
811
811
|
|
|
812
812
|
/***/ }),
|
|
813
813
|
|
|
814
|
-
/***/
|
|
814
|
+
/***/ 81:
|
|
815
815
|
/***/ (function(module, exports) {
|
|
816
816
|
|
|
817
|
-
module.exports = require("@
|
|
817
|
+
module.exports = require("@splunk/react-ui/Popover");
|
|
818
818
|
|
|
819
819
|
/***/ }),
|
|
820
820
|
|
|
821
|
-
/***/
|
|
821
|
+
/***/ 82:
|
|
822
822
|
/***/ (function(module, exports) {
|
|
823
823
|
|
|
824
|
-
module.exports = require("@babel/runtime/helpers/
|
|
824
|
+
module.exports = require("@babel/runtime/helpers/getPrototypeOf");
|
|
825
825
|
|
|
826
826
|
/***/ }),
|
|
827
827
|
|
|
828
|
-
/***/
|
|
828
|
+
/***/ 91:
|
|
829
829
|
/***/ (function(module, exports) {
|
|
830
830
|
|
|
831
831
|
module.exports = require("@babel/runtime/helpers/inherits");
|
|
832
832
|
|
|
833
833
|
/***/ }),
|
|
834
834
|
|
|
835
|
-
/***/
|
|
835
|
+
/***/ 92:
|
|
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/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;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE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8Cf;AACR;AACA;AACA;AACQpD,QAAM,EAAEoD,iDAAS,CAATA,OAlDO;;AAmDf;AACAlC,QAAM,EAAEkC,iDAAS,CApDF;;AAqDf;AACAjB,WAAS,EAAEiB,iDAAS,CAtDL;;AAuDf;AACAhB,YAAU,EAAEgB,iDAAS,CAxDN;;AAyDf;AACAf,iBAAe,EAAEe,iDAAS,CA1DX;;AA2Df;AACAR,YAAU,EAAEQ,iDAAS,CA5DN;;AA6Df;AACAT,aAAW,EAAES,iDAAS,CA9DP;;AA+Df;AACA9D,MAAI,EAAE8D,iDAAS,CAhEA;;AAiEf;AACA3D,MAAI,EAAE2D,iDAAS,CAlEA;;AAmEf;AACR;AACA;AACQxD,OAAK,EAAEwD,iDAAS,CAATA,OAtEQ;;AAuEf;AACAN,OAAK,EAAEM,iDAAS,CAACG;AAxEF,C;;6EADjB5E,S,kBA4EoB;AAClBU,YAAU,EADQ;AAElBD,MAAI,EAFc;AAGlBuD,aAAW,EAHO;AAIlBE,aAAW,EAJO;AAKlBD,YAAU,EALQ;AAMlBb,cAAY,EANM;AAOlBD,iBAAe,EAPG;AAQlBE,cAAY,EARM;AASlBC,mBAAiB,EATC;AAUlBhB,WAAS,EAVS;AAWlBF,aAAW,EAXO;AAYlBQ,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,kE;;;;;;;ACAA,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 = 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":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"prop-types\"","webpack:///external \"react\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///./src/SparkLine/SparkLine.jsx","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/ui-utils/id\"","webpack:///external \"styled-components\"","webpack:///external \"@babel/runtime/helpers/extends\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@splunk/react-ui/Popover\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","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;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,uC;;;;;;;ACAA,kC;;;;;;;ACAA,yE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,SAAS,GAAGC,yDAAM,CAAT,GAAGA,CAAH,UAAGA,CAAH;AAAA;AAAA;AAAA,CAAGA,EAAH,CAAf,kBAAe,CAAGA,CA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2D,iDAAS,CAlEA;;AAmEf;AACR;AACA;AACQxD,OAAK,EAAEwD,iDAAS,CAATA,OAtEQ;;AAuEf;AACAN,OAAK,EAAEM,iDAAS,CAACG;AAxEF,C;;6EADjB5E,S,kBA4EoB;AAClBU,YAAU,EADQ;AAElBD,MAAI,EAFc;AAGlBuD,aAAW,EAHO;AAIlBE,aAAW,EAJO;AAKlBD,YAAU,EALQ;AAMlBb,cAAY,EANM;AAOlBD,iBAAe,EAPG;AAQlBE,cAAY,EARM;AASlBC,mBAAiB,EATC;AAUlBhB,WAAS,EAVS;AAWlBF,aAAW,EAXO;AAYlBQ,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,kE;;;;;;;ACAA,mC;;;;;;;ACAA,+D;;;;;;;ACAA,kD;;;;;;;ACAA,gD;;;;;;;ACAA,8C;;;;;;;ACAA,2D;;;;;;;ACAA,kE;;;;;;;ACAA,qD;;;;;;;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 = 114);\n","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","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(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/ui-utils/id\");","module.exports = require(\"styled-components\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@splunk/react-ui/Popover\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");"],"sourceRoot":""}
|