@splunk/visualizations 26.1.1 → 26.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +2 -1
- package/Area.config.js.map +1 -1
- package/Area.js +1562 -433
- package/Area.js.map +1 -1
- package/Bar.config.js +1 -0
- package/Bar.config.js.map +1 -1
- package/Bar.js +1555 -430
- package/Bar.js.map +1 -1
- package/Bubble.config.js +1 -0
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +1580 -455
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +1 -0
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +1418 -351
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +2 -1
- package/Column.config.js.map +1 -1
- package/Column.js +1564 -435
- package/Column.js.map +1 -1
- package/Ellipse.config.js +1 -0
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +1342 -297
- package/Ellipse.js.map +1 -1
- package/Events.config.js +4 -0
- package/Events.config.js.map +1 -1
- package/Events.js +1503 -489
- package/Events.js.map +1 -1
- package/FEATUREFLAGS.md +3 -0
- package/FillerGauge.config.js +1 -0
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +1406 -345
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +1 -0
- package/Image.config.js.map +1 -1
- package/Image.js +2355 -1183
- package/Image.js.map +1 -1
- package/Line.config.js +2 -1
- package/Line.config.js.map +1 -1
- package/Line.js +1562 -433
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +1 -0
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +2013 -968
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +1 -0
- package/Map.config.js.map +1 -1
- package/Map.js +2556 -1527
- package/Map.js.map +1 -1
- package/Markdown.config.js +1 -0
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +1952 -883
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +1 -0
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +4049 -2965
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +1 -0
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +3286 -2215
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +1 -0
- package/Pie.config.js.map +1 -1
- package/Pie.js +2187 -1036
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +1 -0
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +3397 -2299
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +1 -0
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +2181 -1112
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +1 -0
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +3275 -2199
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +1 -0
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +3551 -2400
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +27 -0
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +5551 -4397
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +1227 -1209
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +27 -0
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +2850 -1696
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +1 -0
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +6334 -5215
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +96 -96
- package/SparkLine.js.map +1 -1
- package/Table.config.js +172 -7
- package/Table.config.js.map +1 -1
- package/Table.js +3517 -2212
- package/Table.js.map +1 -1
- package/common/Charting.js +1009 -82
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +4 -4
- package/common/ChartingApi.js.map +1 -1
- package/common/DocExampleWithVizSandbox.js +54 -57
- package/common/DocExampleWithVizSandbox.js.map +1 -1
- package/common/EventsDoc.js +40 -40
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +15 -13
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +12 -12
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +34 -34
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +124 -103
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +49 -49
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +4 -4
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +31 -31
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +24 -8
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +4 -4
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +16 -16
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +36 -36
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +48 -47
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +832 -6
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/featureFlagUtils.js +139 -0
- package/common/utils/featureFlagUtils.js.map +1 -0
- package/common/utils/hocUtils.js +2 -2
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +2 -2
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +77 -54
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +28 -19
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +10 -10
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +6 -6
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +2 -2
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +1313 -235
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +13 -12
- package/__mocks__/fileMock.js +0 -2
- package/__mocks__/styleMock.js +0 -2
- package/babel.config.js +0 -11
- package/jest.config.js +0 -8
- package/loki.config.js +0 -14
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 = 118);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -95,142 +95,65 @@ module.exports =
|
|
|
95
95
|
/***/ 0:
|
|
96
96
|
/***/ (function(module, exports) {
|
|
97
97
|
|
|
98
|
-
module.exports = require("prop-types");
|
|
99
|
-
|
|
100
|
-
/***/ }),
|
|
101
|
-
|
|
102
|
-
/***/ 1:
|
|
103
|
-
/***/ (function(module, exports) {
|
|
104
|
-
|
|
105
98
|
module.exports = require("react");
|
|
106
99
|
|
|
107
100
|
/***/ }),
|
|
108
101
|
|
|
109
|
-
/***/
|
|
110
|
-
/***/ (function(module, exports) {
|
|
111
|
-
|
|
112
|
-
module.exports = require("@babel/runtime/helpers/createClass");
|
|
113
|
-
|
|
114
|
-
/***/ }),
|
|
115
|
-
|
|
116
|
-
/***/ 2:
|
|
117
|
-
/***/ (function(module, exports) {
|
|
118
|
-
|
|
119
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
120
|
-
|
|
121
|
-
/***/ }),
|
|
122
|
-
|
|
123
|
-
/***/ 25:
|
|
124
|
-
/***/ (function(module, exports) {
|
|
125
|
-
|
|
126
|
-
module.exports = require("@splunk/ui-utils/id");
|
|
127
|
-
|
|
128
|
-
/***/ }),
|
|
129
|
-
|
|
130
|
-
/***/ 3:
|
|
131
|
-
/***/ (function(module, exports) {
|
|
132
|
-
|
|
133
|
-
module.exports = require("lodash");
|
|
134
|
-
|
|
135
|
-
/***/ }),
|
|
136
|
-
|
|
137
|
-
/***/ 4:
|
|
138
|
-
/***/ (function(module, exports) {
|
|
139
|
-
|
|
140
|
-
module.exports = require("styled-components");
|
|
141
|
-
|
|
142
|
-
/***/ }),
|
|
143
|
-
|
|
144
|
-
/***/ 48:
|
|
145
|
-
/***/ (function(module, exports) {
|
|
146
|
-
|
|
147
|
-
module.exports = require("@babel/runtime/helpers/extends");
|
|
148
|
-
|
|
149
|
-
/***/ }),
|
|
150
|
-
|
|
151
|
-
/***/ 62:
|
|
152
|
-
/***/ (function(module, exports) {
|
|
153
|
-
|
|
154
|
-
module.exports = require("@splunk/react-ui/Popover");
|
|
155
|
-
|
|
156
|
-
/***/ }),
|
|
157
|
-
|
|
158
|
-
/***/ 63:
|
|
159
|
-
/***/ (function(module, exports) {
|
|
160
|
-
|
|
161
|
-
module.exports = require("@babel/runtime/helpers/getPrototypeOf");
|
|
162
|
-
|
|
163
|
-
/***/ }),
|
|
164
|
-
|
|
165
|
-
/***/ 7:
|
|
166
|
-
/***/ (function(module, exports) {
|
|
167
|
-
|
|
168
|
-
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
169
|
-
|
|
170
|
-
/***/ }),
|
|
171
|
-
|
|
172
|
-
/***/ 71:
|
|
102
|
+
/***/ 1:
|
|
173
103
|
/***/ (function(module, exports) {
|
|
174
104
|
|
|
175
|
-
module.exports = require("
|
|
105
|
+
module.exports = require("prop-types");
|
|
176
106
|
|
|
177
107
|
/***/ }),
|
|
178
108
|
|
|
179
|
-
/***/
|
|
109
|
+
/***/ 10:
|
|
180
110
|
/***/ (function(module, exports) {
|
|
181
111
|
|
|
182
|
-
module.exports = require("@babel/runtime/helpers/
|
|
112
|
+
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
183
113
|
|
|
184
114
|
/***/ }),
|
|
185
115
|
|
|
186
|
-
/***/
|
|
116
|
+
/***/ 111:
|
|
187
117
|
/***/ (function(module, exports) {
|
|
188
118
|
|
|
189
119
|
module.exports = require("@babel/runtime/helpers/assertThisInitialized");
|
|
190
120
|
|
|
191
121
|
/***/ }),
|
|
192
122
|
|
|
193
|
-
/***/
|
|
194
|
-
/***/ (function(module, exports) {
|
|
195
|
-
|
|
196
|
-
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
197
|
-
|
|
198
|
-
/***/ }),
|
|
199
|
-
|
|
200
|
-
/***/ 95:
|
|
123
|
+
/***/ 118:
|
|
201
124
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
202
125
|
|
|
203
126
|
"use strict";
|
|
204
127
|
__webpack_require__.r(__webpack_exports__);
|
|
205
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
128
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70);
|
|
206
129
|
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
207
|
-
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
130
|
+
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
|
|
208
131
|
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
|
|
209
|
-
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
132
|
+
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
|
|
210
133
|
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
|
|
211
|
-
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
134
|
+
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(111);
|
|
212
135
|
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);
|
|
213
|
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
136
|
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(94);
|
|
214
137
|
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
|
|
215
|
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
138
|
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95);
|
|
216
139
|
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);
|
|
217
|
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
140
|
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85);
|
|
218
141
|
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
|
|
219
|
-
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
142
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9);
|
|
220
143
|
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__);
|
|
221
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
144
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1);
|
|
222
145
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
|
|
223
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
|
|
146
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(0);
|
|
224
147
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
|
|
225
148
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(3);
|
|
226
149
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_10__);
|
|
227
150
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4);
|
|
228
151
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_11__);
|
|
229
|
-
/* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
|
|
152
|
+
/* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(84);
|
|
230
153
|
/* harmony import */ var _splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Popover__WEBPACK_IMPORTED_MODULE_12__);
|
|
231
154
|
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2);
|
|
232
155
|
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_13__);
|
|
233
|
-
/* harmony import */ var _splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(
|
|
156
|
+
/* harmony import */ var _splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(31);
|
|
234
157
|
/* harmony import */ var _splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_id__WEBPACK_IMPORTED_MODULE_14__);
|
|
235
158
|
|
|
236
159
|
|
|
@@ -837,6 +760,83 @@ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(Spa
|
|
|
837
760
|
|
|
838
761
|
/* harmony default export */ __webpack_exports__["default"] = (SparkLine);
|
|
839
762
|
|
|
763
|
+
/***/ }),
|
|
764
|
+
|
|
765
|
+
/***/ 2:
|
|
766
|
+
/***/ (function(module, exports) {
|
|
767
|
+
|
|
768
|
+
module.exports = require("@splunk/ui-utils/i18n");
|
|
769
|
+
|
|
770
|
+
/***/ }),
|
|
771
|
+
|
|
772
|
+
/***/ 25:
|
|
773
|
+
/***/ (function(module, exports) {
|
|
774
|
+
|
|
775
|
+
module.exports = require("@babel/runtime/helpers/createClass");
|
|
776
|
+
|
|
777
|
+
/***/ }),
|
|
778
|
+
|
|
779
|
+
/***/ 3:
|
|
780
|
+
/***/ (function(module, exports) {
|
|
781
|
+
|
|
782
|
+
module.exports = require("lodash");
|
|
783
|
+
|
|
784
|
+
/***/ }),
|
|
785
|
+
|
|
786
|
+
/***/ 31:
|
|
787
|
+
/***/ (function(module, exports) {
|
|
788
|
+
|
|
789
|
+
module.exports = require("@splunk/ui-utils/id");
|
|
790
|
+
|
|
791
|
+
/***/ }),
|
|
792
|
+
|
|
793
|
+
/***/ 4:
|
|
794
|
+
/***/ (function(module, exports) {
|
|
795
|
+
|
|
796
|
+
module.exports = require("styled-components");
|
|
797
|
+
|
|
798
|
+
/***/ }),
|
|
799
|
+
|
|
800
|
+
/***/ 70:
|
|
801
|
+
/***/ (function(module, exports) {
|
|
802
|
+
|
|
803
|
+
module.exports = require("@babel/runtime/helpers/extends");
|
|
804
|
+
|
|
805
|
+
/***/ }),
|
|
806
|
+
|
|
807
|
+
/***/ 84:
|
|
808
|
+
/***/ (function(module, exports) {
|
|
809
|
+
|
|
810
|
+
module.exports = require("@splunk/react-ui/Popover");
|
|
811
|
+
|
|
812
|
+
/***/ }),
|
|
813
|
+
|
|
814
|
+
/***/ 85:
|
|
815
|
+
/***/ (function(module, exports) {
|
|
816
|
+
|
|
817
|
+
module.exports = require("@babel/runtime/helpers/getPrototypeOf");
|
|
818
|
+
|
|
819
|
+
/***/ }),
|
|
820
|
+
|
|
821
|
+
/***/ 9:
|
|
822
|
+
/***/ (function(module, exports) {
|
|
823
|
+
|
|
824
|
+
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
825
|
+
|
|
826
|
+
/***/ }),
|
|
827
|
+
|
|
828
|
+
/***/ 94:
|
|
829
|
+
/***/ (function(module, exports) {
|
|
830
|
+
|
|
831
|
+
module.exports = require("@babel/runtime/helpers/inherits");
|
|
832
|
+
|
|
833
|
+
/***/ }),
|
|
834
|
+
|
|
835
|
+
/***/ 95:
|
|
836
|
+
/***/ (function(module, exports) {
|
|
837
|
+
|
|
838
|
+
module.exports = require("@babel/runtime/helpers/possibleConstructorReturn");
|
|
839
|
+
|
|
840
840
|
/***/ })
|
|
841
841
|
|
|
842
842
|
/******/ });
|
package/SparkLine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"prop-types\"","webpack:///external \"react\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@splunk/ui-utils/id\"","webpack:///external \"lodash\"","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\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///./src/SparkLine/SparkLine.jsx"],"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":";;;;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HO;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","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 = 95);\n","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@splunk/ui-utils/id\");","module.exports = require(\"lodash\");","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\");","module.exports = require(\"@babel/runtime/helpers/assertThisInitialized\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","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"],"sourceRoot":""}
|
|
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"],"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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{};\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":""}
|