@splunk/visualizations 26.4.1 → 27.1.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 +1399 -1590
- package/Area.config.js.map +7 -1
- package/Area.js +3750 -4822
- package/Area.js.map +7 -1
- package/Bar.config.js +1423 -1566
- package/Bar.config.js.map +7 -1
- package/Bar.js +3856 -4884
- package/Bar.js.map +7 -1
- package/Bubble.config.js +1009 -1200
- package/Bubble.config.js.map +7 -1
- package/Bubble.js +2768 -4491
- package/Bubble.js.map +7 -1
- package/ChoroplethSvg.config.js +282 -582
- package/ChoroplethSvg.config.js.map +7 -1
- package/ChoroplethSvg.js +2032 -3808
- package/ChoroplethSvg.js.map +7 -1
- package/Column.config.js +1390 -1534
- package/Column.config.js.map +7 -1
- package/Column.js +3849 -4906
- package/Column.js.map +7 -1
- package/Ellipse.config.js +443 -774
- package/Ellipse.config.js.map +7 -1
- package/Ellipse.js +1667 -3327
- package/Ellipse.js.map +7 -1
- package/Events.config.js +207 -492
- package/Events.config.js.map +7 -1
- package/Events.js +2643 -4647
- package/Events.js.map +7 -1
- package/FillerGauge.config.js +420 -775
- package/FillerGauge.config.js.map +7 -1
- package/FillerGauge.js +2164 -4575
- package/FillerGauge.js.map +7 -1
- package/Image.config.js +144 -411
- package/Image.config.js.map +7 -1
- package/Image.js +1423 -3046
- package/Image.js.map +7 -1
- package/Line.config.js +1421 -1616
- package/Line.config.js.map +7 -1
- package/Line.js +3790 -4901
- package/Line.js.map +7 -1
- package/LinkGraph.config.js +390 -632
- package/LinkGraph.config.js.map +7 -1
- package/LinkGraph.js +5272 -6185
- package/LinkGraph.js.map +7 -1
- package/MIGRATION.md +6 -0
- package/Map.config.js +501 -801
- package/Map.config.js.map +7 -1
- package/Map.js +3382 -5659
- package/Map.js.map +7 -1
- package/Markdown.config.js +232 -528
- package/Markdown.config.js.map +7 -1
- package/Markdown.js +1671 -3212
- package/Markdown.js.map +7 -1
- package/MarkerGauge.config.js +308 -613
- package/MarkerGauge.config.js.map +7 -1
- package/MarkerGauge.js +2215 -4531
- package/MarkerGauge.js.map +7 -1
- package/ParallelCoordinates.config.js +282 -581
- package/ParallelCoordinates.config.js.map +7 -1
- package/ParallelCoordinates.js +2057 -4718
- package/ParallelCoordinates.js.map +7 -1
- package/Pie.config.js +278 -547
- package/Pie.config.js.map +7 -1
- package/Pie.js +2107 -3984
- package/Pie.js.map +7 -1
- package/Punchcard.config.js +291 -578
- package/Punchcard.config.js.map +7 -1
- package/Punchcard.js +2734 -5037
- package/Punchcard.js.map +7 -1
- package/Rectangle.config.js +455 -770
- package/Rectangle.config.js.map +7 -1
- package/Rectangle.js +1664 -3258
- package/Rectangle.js.map +7 -1
- package/Sankey.config.js +291 -626
- package/Sankey.config.js.map +7 -1
- package/Sankey.js +2766 -4908
- package/Sankey.js.map +7 -1
- package/Scatter.config.js +988 -1180
- package/Scatter.config.js.map +7 -1
- package/Scatter.js +2801 -4506
- package/Scatter.js.map +7 -1
- package/SingleValue.config.js +794 -1250
- package/SingleValue.config.js.map +7 -1
- package/SingleValue.js +4185 -7327
- package/SingleValue.js.map +7 -1
- package/SingleValueBasic.js +382 -1527
- package/SingleValueBasic.js.map +7 -1
- package/SingleValueIcon.config.js +757 -1207
- package/SingleValueIcon.config.js.map +7 -1
- package/SingleValueIcon.js +3427 -6293
- package/SingleValueIcon.js.map +7 -1
- package/SingleValueRadial.config.js +686 -1121
- package/SingleValueRadial.config.js.map +7 -1
- package/SingleValueRadial.js +3923 -6994
- package/SingleValueRadial.js.map +7 -1
- package/SparkLine.js +439 -746
- package/SparkLine.js.map +7 -1
- package/TRELLIS.md +16 -15
- package/Table.config.js +565 -879
- package/Table.config.js.map +7 -1
- package/Table.js +3260 -5334
- package/Table.js.map +7 -1
- package/common/Charting.js +617 -1498
- package/common/Charting.js.map +7 -1
- package/common/ChartingApi.js +46 -170
- package/common/ChartingApi.js.map +7 -1
- package/common/DocExampleWithVizSandbox.js +270 -473
- package/common/DocExampleWithVizSandbox.js.map +7 -1
- package/common/EventsDoc.js +172 -464
- package/common/EventsDoc.js.map +7 -1
- package/common/GaugeMajorTicks.js +249 -347
- package/common/GaugeMajorTicks.js.map +7 -1
- package/common/GaugeValueMarker.js +201 -311
- package/common/GaugeValueMarker.js.map +7 -1
- package/common/OptionsDoc.js +351 -911
- package/common/OptionsDoc.js.map +7 -1
- package/common/OverviewDoc.js +435 -769
- package/common/OverviewDoc.js.map +7 -1
- package/common/SplunkVisualization.js +116 -259
- package/common/SplunkVisualization.js.map +7 -1
- package/common/SplunkVisualizationApi.js +40 -156
- package/common/SplunkVisualizationApi.js.map +7 -1
- package/common/ThemesDoc.js +271 -420
- package/common/ThemesDoc.js.map +7 -1
- package/common/chartingUtils.js +140 -312
- package/common/chartingUtils.js.map +7 -1
- package/common/docUtils.js +148 -266
- package/common/docUtils.js.map +7 -1
- package/common/gaugeUtils.js +280 -808
- package/common/gaugeUtils.js.map +7 -1
- package/common/shapeUtils.js +106 -211
- package/common/shapeUtils.js.map +7 -1
- package/common/utils/configUtils.js +126 -252
- package/common/utils/configUtils.js.map +7 -1
- package/common/utils/dataUtils.js +217 -812
- package/common/utils/dataUtils.js.map +7 -1
- package/common/utils/featureFlagUtils.js +53 -133
- package/common/utils/featureFlagUtils.js.map +7 -1
- package/common/utils/hocUtils.js +32 -122
- package/common/utils/hocUtils.js.map +7 -1
- package/common/utils/mapUtils.js +502 -1337
- package/common/utils/mapUtils.js.map +7 -1
- package/common/utils/singleValueUtils.js +466 -1013
- package/common/utils/singleValueUtils.js.map +7 -1
- package/common/utils/testHelper.js +92 -146
- package/common/utils/testHelper.js.map +7 -1
- package/common/utils/trellisUtils.js +277 -489
- package/common/utils/trellisUtils.js.map +7 -1
- package/common/utils/urlUtils.js +28 -112
- package/common/utils/urlUtils.js.map +7 -1
- package/common/withDashboardViz.js +1191 -2431
- package/common/withDashboardViz.js.map +7 -1
- package/package.json +53 -45
package/common/Charting.js
CHANGED
|
@@ -1,1640 +1,759 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
60
|
-
/******/ // mode & 4: return value when already ns object
|
|
61
|
-
/******/ // mode & 8|1: behave like require
|
|
62
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
63
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
64
|
-
/******/ if(mode & 8) return value;
|
|
65
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
66
|
-
/******/ var ns = Object.create(null);
|
|
67
|
-
/******/ __webpack_require__.r(ns);
|
|
68
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
69
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
70
|
-
/******/ return ns;
|
|
71
|
-
/******/ };
|
|
72
|
-
/******/
|
|
73
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
74
|
-
/******/ __webpack_require__.n = function(module) {
|
|
75
|
-
/******/ var getter = module && module.__esModule ?
|
|
76
|
-
/******/ function getDefault() { return module['default']; } :
|
|
77
|
-
/******/ function getModuleExports() { return module; };
|
|
78
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
79
|
-
/******/ return getter;
|
|
80
|
-
/******/ };
|
|
81
|
-
/******/
|
|
82
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
83
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
84
|
-
/******/
|
|
85
|
-
/******/ // __webpack_public_path__
|
|
86
|
-
/******/ __webpack_require__.p = "";
|
|
87
|
-
/******/
|
|
88
|
-
/******/
|
|
89
|
-
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s = 73);
|
|
91
|
-
/******/ })
|
|
92
|
-
/************************************************************************/
|
|
93
|
-
/******/ ([
|
|
94
|
-
/* 0 */
|
|
95
|
-
/***/ (function(module, exports) {
|
|
96
|
-
|
|
97
|
-
module.exports = require("react");
|
|
98
|
-
|
|
99
|
-
/***/ }),
|
|
100
|
-
/* 1 */
|
|
101
|
-
/***/ (function(module, exports) {
|
|
102
|
-
|
|
103
|
-
module.exports = require("prop-types");
|
|
104
|
-
|
|
105
|
-
/***/ }),
|
|
106
|
-
/* 2 */
|
|
107
|
-
/***/ (function(module, exports) {
|
|
108
|
-
|
|
109
|
-
module.exports = require("styled-components");
|
|
110
|
-
|
|
111
|
-
/***/ }),
|
|
112
|
-
/* 3 */
|
|
113
|
-
/***/ (function(module, exports) {
|
|
114
|
-
|
|
115
|
-
module.exports = require("lodash");
|
|
116
|
-
|
|
117
|
-
/***/ }),
|
|
118
|
-
/* 4 */
|
|
119
|
-
/***/ (function(module, exports) {
|
|
120
|
-
|
|
121
|
-
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
122
|
-
|
|
123
|
-
/***/ }),
|
|
124
|
-
/* 5 */
|
|
125
|
-
/***/ (function(module, exports) {
|
|
126
|
-
|
|
127
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
128
|
-
|
|
129
|
-
/***/ }),
|
|
130
|
-
/* 6 */,
|
|
131
|
-
/* 7 */
|
|
132
|
-
/***/ (function(module, exports) {
|
|
133
|
-
|
|
134
|
-
module.exports = require("@babel/runtime/helpers/createClass");
|
|
135
|
-
|
|
136
|
-
/***/ }),
|
|
137
|
-
/* 8 */,
|
|
138
|
-
/* 9 */
|
|
139
|
-
/***/ (function(module, exports) {
|
|
140
|
-
|
|
141
|
-
module.exports = require("@splunk/visualizations-shared/numberUtils");
|
|
142
|
-
|
|
143
|
-
/***/ }),
|
|
144
|
-
/* 10 */,
|
|
145
|
-
/* 11 */,
|
|
146
|
-
/* 12 */,
|
|
147
|
-
/* 13 */,
|
|
148
|
-
/* 14 */
|
|
149
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
150
|
-
|
|
151
|
-
"use strict";
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
var _classCallCheck = __webpack_require__(4);
|
|
155
|
-
|
|
156
|
-
var _createClass = __webpack_require__(7);
|
|
157
|
-
|
|
158
|
-
Object.defineProperty(exports, "__esModule", {
|
|
159
|
-
value: true
|
|
160
|
-
});
|
|
161
|
-
exports.DefaultVizActionHandler = void 0;
|
|
162
|
-
|
|
163
|
-
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
164
|
-
function DefaultVizActionHandler() {
|
|
165
|
-
_classCallCheck(this, DefaultVizActionHandler);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
_createClass(DefaultVizActionHandler, [{
|
|
169
|
-
key: "focus",
|
|
170
|
-
value: function focus() {// noop
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
|
-
key: "snapshot",
|
|
174
|
-
value: function snapshot() {
|
|
175
|
-
return null; // noop
|
|
176
|
-
}
|
|
177
|
-
}]);
|
|
178
|
-
|
|
179
|
-
return DefaultVizActionHandler;
|
|
180
|
-
}();
|
|
181
|
-
|
|
182
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
183
|
-
|
|
184
|
-
/***/ }),
|
|
185
|
-
/* 15 */,
|
|
186
|
-
/* 16 */,
|
|
187
|
-
/* 17 */,
|
|
188
|
-
/* 18 */
|
|
189
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
190
|
-
|
|
191
|
-
"use strict";
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
Object.defineProperty(exports, "__esModule", {
|
|
195
|
-
value: true
|
|
196
|
-
});
|
|
197
|
-
exports.VizBehavior = void 0;
|
|
198
|
-
var VizBehavior;
|
|
199
|
-
|
|
200
|
-
(function (VizBehavior) {
|
|
201
|
-
/**
|
|
202
|
-
* Dynamic Options Behavior.
|
|
203
|
-
* This allows visualization options to be powered by data
|
|
204
|
-
*
|
|
205
|
-
* **Example**
|
|
206
|
-
*
|
|
207
|
-
* sparklineValues: ">primary|seriesByIndex(0)"
|
|
208
|
-
* would configure sparklineValues with an array of data points
|
|
209
|
-
* coming from the first series in the primary datasource
|
|
210
|
-
*
|
|
211
|
-
*/
|
|
212
|
-
VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
|
|
213
|
-
VizBehavior["EVENTS"] = "events";
|
|
214
|
-
VizBehavior["DOWNSAMPLING"] = "downsampling";
|
|
215
|
-
/**
|
|
216
|
-
* Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
|
|
217
|
-
* missing.
|
|
218
|
-
* @type {string}
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
222
|
-
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
223
|
-
VizBehavior["TRELLIS"] = "trellis";
|
|
224
|
-
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
225
|
-
|
|
226
|
-
/***/ }),
|
|
227
|
-
/* 19 */
|
|
228
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
229
|
-
|
|
230
|
-
"use strict";
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
Object.defineProperty(exports, "__esModule", {
|
|
234
|
-
value: true
|
|
235
|
-
});
|
|
236
|
-
exports.VizCategory = void 0;
|
|
237
|
-
var VizCategory;
|
|
238
|
-
|
|
239
|
-
(function (VizCategory) {
|
|
240
|
-
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
241
|
-
VizCategory["TRENDS"] = "Trends";
|
|
242
|
-
VizCategory["COMPARISONS"] = "Comparisons";
|
|
243
|
-
VizCategory["TABLE"] = "Table";
|
|
244
|
-
VizCategory["GAUGE"] = "Gauge";
|
|
245
|
-
VizCategory["DISTRIBUTIONS"] = "Distributions";
|
|
246
|
-
VizCategory["CHOROPLETH"] = "Choropleth Maps";
|
|
247
|
-
VizCategory["SHAPES"] = "Shapes";
|
|
248
|
-
VizCategory["MISC"] = "misc";
|
|
249
|
-
VizCategory["FLOW"] = "Flow";
|
|
250
|
-
VizCategory["CORRELATION"] = "Correlation";
|
|
251
|
-
VizCategory["SPATIAL"] = "Spatial";
|
|
252
|
-
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
253
|
-
|
|
254
|
-
/***/ }),
|
|
255
|
-
/* 20 */,
|
|
256
|
-
/* 21 */,
|
|
257
|
-
/* 22 */,
|
|
258
|
-
/* 23 */,
|
|
259
|
-
/* 24 */
|
|
260
|
-
/***/ (function(module, exports) {
|
|
261
|
-
|
|
262
|
-
module.exports = require("@splunk/visualizations-shared/Message");
|
|
263
|
-
|
|
264
|
-
/***/ }),
|
|
265
|
-
/* 25 */
|
|
266
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
267
|
-
|
|
268
|
-
"use strict";
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
Object.defineProperty(exports, "__esModule", {
|
|
272
|
-
value: true
|
|
273
|
-
});
|
|
274
|
-
exports.downsampleDataSources = exports.calculateDownsamplingThreshold = exports.calculateThresholdOnRangeSelect = exports.isDownsamplingEnabledForViz = exports.convertToArrOfObjects = void 0;
|
|
275
|
-
|
|
276
|
-
var numberUtils_1 = __webpack_require__(9);
|
|
277
|
-
|
|
278
|
-
var interfaces_1 = __webpack_require__(32); // TODO: utilize this fn in ParallelCoordinates
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
var convertToArrOfObjects = function convertToArrOfObjects(columns, fields) {
|
|
282
|
-
if (!columns || !columns[0] || !columns[0].length) return [];
|
|
283
|
-
var data = [];
|
|
284
|
-
|
|
285
|
-
var _loop = function _loop(i) {
|
|
286
|
-
var newObj = {};
|
|
287
|
-
fields.forEach(function (field, index) {
|
|
288
|
-
var fieldName = typeof field === 'string' ? field : field.name;
|
|
289
|
-
|
|
290
|
-
if (columns[index][i] === '') {
|
|
291
|
-
newObj[fieldName] = null;
|
|
292
|
-
} else {
|
|
293
|
-
newObj[fieldName] = columns[index][i];
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
data.push(newObj);
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
for (var i = 0; i < columns[0].length; i += 1) {
|
|
300
|
-
_loop(i);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return data;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
exports.convertToArrOfObjects = convertToArrOfObjects; // LTTB algorithm which can be used to downsample time series data while striving to maintain
|
|
307
|
-
// the spikes and overall shape of the chart
|
|
308
|
-
// Copied from https://github.com/sveinn-steinarsson/flot-downsample/blob/0815010016fc94b1bbc6a010afb8aad13ada6d0d/jquery.flot.downsample.js
|
|
309
|
-
// Modifications include:
|
|
310
|
-
// 1) Convert to modern JavaScript(use const, let, and use array.push to push to last element of array)
|
|
311
|
-
// 2) Convert to camel case
|
|
312
|
-
// 3) Convert to TS and also return the indices of the points that are in the downsampled result.
|
|
313
|
-
// 4) Add a new parameter preferredDownsampleIndices that correspond to the indices of points
|
|
314
|
-
// that should be used in case of a tie of the max area in a bucket
|
|
315
|
-
|
|
316
|
-
var largestTriangleThreeBuckets = function largestTriangleThreeBuckets(data, threshold, preferredDownsampleIndices) {
|
|
317
|
-
var dataLength = data.length;
|
|
318
|
-
var downsampledIndices = [];
|
|
319
|
-
|
|
320
|
-
if (threshold >= dataLength || threshold === 0) {
|
|
321
|
-
var allIndices = data.map(function (values, index) {
|
|
322
|
-
return index;
|
|
323
|
-
});
|
|
324
|
-
return {
|
|
325
|
-
downsampledData: data,
|
|
326
|
-
downsampledIndices: allIndices
|
|
327
|
-
}; // Nothing to do
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
var sampled = [];
|
|
331
|
-
var sampledIndex = 0; // Bucket size. Leave room for start and end data points
|
|
332
|
-
|
|
333
|
-
var every = (dataLength - 2) / (threshold - 2);
|
|
334
|
-
var a = 0; // Initially a is the first point in the triangle
|
|
335
|
-
|
|
336
|
-
var maxAreaPoint;
|
|
337
|
-
var maxArea;
|
|
338
|
-
var area;
|
|
339
|
-
var nextA;
|
|
340
|
-
sampled.push(data[a]); // Always add the first point
|
|
341
|
-
|
|
342
|
-
downsampledIndices.push(0); // eslint-disable-next-line no-plusplus
|
|
343
|
-
|
|
344
|
-
for (var i = 0; i < threshold - 2; i++) {
|
|
345
|
-
// Calculate point average for next bucket (containing c)
|
|
346
|
-
var avgX = 0;
|
|
347
|
-
var avgY = 0;
|
|
348
|
-
var avgRangeStart = Math.floor((i + 1) * every) + 1;
|
|
349
|
-
var avgRangeEnd = Math.floor((i + 2) * every) + 1;
|
|
350
|
-
avgRangeEnd = avgRangeEnd < dataLength ? avgRangeEnd : dataLength;
|
|
351
|
-
var avgRangeLength = avgRangeEnd - avgRangeStart; // eslint-disable-next-line no-plusplus
|
|
352
|
-
|
|
353
|
-
for (; avgRangeStart < avgRangeEnd; avgRangeStart++) {
|
|
354
|
-
avgX += Number(data[avgRangeStart][0]); // * 1 enforces Number (value may be Date)
|
|
355
|
-
|
|
356
|
-
avgY += data[avgRangeStart][1] * 1;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
avgX /= avgRangeLength;
|
|
360
|
-
avgY /= avgRangeLength; // Get the range for this bucket
|
|
361
|
-
|
|
362
|
-
var rangeOffs = Math.floor((i + 0) * every) + 1;
|
|
363
|
-
var rangeTo = Math.floor((i + 1) * every) + 1; // Point a
|
|
364
|
-
|
|
365
|
-
var pointAX = Number(data[a][0]); // Enforce Number (value may be Date)
|
|
366
|
-
|
|
367
|
-
var pointAY = data[a][1] * 1; // eslint-disable-next-line no-multi-assign
|
|
368
|
-
|
|
369
|
-
maxArea = area = -1;
|
|
370
|
-
var maxAreaIndex = rangeOffs; // eslint-disable-next-line no-plusplus
|
|
371
|
-
|
|
372
|
-
for (; rangeOffs < rangeTo; rangeOffs++) {
|
|
373
|
-
// Calculate triangle area over three buckets
|
|
374
|
-
area = Math.abs((pointAX - avgX) * (data[rangeOffs][1] - pointAY) - (pointAX - Number(data[rangeOffs][0])) * (avgY - pointAY)) * 0.5; // Modification: try to downsample the least amount of points possible when there are multiple series
|
|
375
|
-
// If all points in a bucket have the same area, prioritize the one with an x index
|
|
376
|
-
// that also existed from another series so we don't add another point unnecessarily.
|
|
377
|
-
// By default LTTB picks the leftmost point in the bucket
|
|
378
|
-
|
|
379
|
-
if (area > maxArea || area === maxArea && preferredDownsampleIndices.has(rangeOffs)) {
|
|
380
|
-
maxArea = area;
|
|
381
|
-
maxAreaPoint = data[rangeOffs];
|
|
382
|
-
nextA = rangeOffs; // Next a is this b
|
|
383
|
-
// Modification: save the index of the point with the most area
|
|
384
|
-
|
|
385
|
-
maxAreaIndex = rangeOffs;
|
|
386
|
-
}
|
|
387
|
-
} // eslint-disable-next-line no-plusplus
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
sampled[sampledIndex++] = maxAreaPoint; // Pick this point from the bucket
|
|
391
|
-
|
|
392
|
-
downsampledIndices.push(maxAreaIndex);
|
|
393
|
-
a = nextA; // This a is the next a (chosen b)
|
|
394
|
-
} // eslint-disable-next-line no-plusplus
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
sampled[sampledIndex++] = data[dataLength - 1]; // Always add last
|
|
398
|
-
|
|
399
|
-
downsampledIndices.push(dataLength - 1);
|
|
400
|
-
return {
|
|
401
|
-
downsampledData: sampled,
|
|
402
|
-
downsampledIndices: downsampledIndices
|
|
403
|
-
};
|
|
404
|
-
};
|
|
405
|
-
/**
|
|
406
|
-
* Strictly coerces the entire column to numbers if it only consists of numeric strings or numbers. Also determines
|
|
407
|
-
* if at least one of the values in the column can be loosely coerced to a number.
|
|
408
|
-
* If the column cannot be strictly downsampled (if it contains nulls or non-numeric strings), returns an empty array and
|
|
409
|
-
* returns that it cannot downsample the column.
|
|
410
|
-
*/
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
var strictlyCoerceYColumn = function strictlyCoerceYColumn(column, options) {
|
|
414
|
-
var isNullCoercionEnabled = options.nullValueDisplay === 'zero'; // Splunk charting allows for numbers in formats such as negative hex that
|
|
415
|
-
// Number() does not support and also allows loose coercion of hex numbers (but not other formats)
|
|
416
|
-
// We want to identify columns which contain at least one value that can be loosely coerced
|
|
417
|
-
|
|
418
|
-
var canLooselyCoerceSomeValues = column.findIndex(function (value) {
|
|
419
|
-
return (0, numberUtils_1.startsWithNumber)("".concat(value)) || isNullCoercionEnabled && value === null;
|
|
420
|
-
}) >= 0; // If not all values in column can be strictly coerced to a number, we do not downsample
|
|
421
|
-
|
|
422
|
-
var coercedColumn = [];
|
|
423
|
-
var canDownsampleColumn = !column.some(function (value) {
|
|
424
|
-
var coercedValue = Number(value);
|
|
425
|
-
var coerceValueToZero = isNullCoercionEnabled && value === null; // if it can't be parsed or isn't safe, fail
|
|
426
|
-
|
|
427
|
-
if (Number.isNaN(coercedValue) || coercedValue <= Number.MIN_SAFE_INTEGER || coercedValue >= Number.MAX_SAFE_INTEGER || typeof value !== 'string' && typeof value !== 'number' && !coerceValueToZero) {
|
|
428
|
-
return true;
|
|
429
|
-
} // save value and continue to next
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
coercedColumn.push(coercedValue);
|
|
433
|
-
return false;
|
|
434
|
-
});
|
|
435
|
-
return {
|
|
436
|
-
canDownsampleColumn: canDownsampleColumn,
|
|
437
|
-
canLooselyCoerceSomeValues: canLooselyCoerceSomeValues,
|
|
438
|
-
coercedColumn: canDownsampleColumn ? coercedColumn : []
|
|
439
|
-
};
|
|
440
|
-
};
|
|
441
|
-
/**
|
|
442
|
-
* Tries to coerce the x-column to numbers or dates, if it is eligible for downsampling.
|
|
443
|
-
* Only strictly increasing x-columns are eligible for downsampling.
|
|
444
|
-
* If the column is not eligible for downsampling, returns an empty array.
|
|
445
|
-
*/
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
var strictlyCoerceXColumn = function strictlyCoerceXColumn(column, fieldType) {
|
|
449
|
-
if (fieldType === 'number') {
|
|
450
|
-
var coercedXColumn = column.map(function (xValue) {
|
|
451
|
-
return Number(xValue);
|
|
452
|
-
});
|
|
453
|
-
|
|
454
|
-
if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {
|
|
455
|
-
return coercedXColumn;
|
|
456
|
-
}
|
|
457
|
-
} else if (fieldType === 'time') {
|
|
458
|
-
var _coercedXColumn = column.map(function (xValue) {
|
|
459
|
-
return new Date(xValue);
|
|
460
|
-
});
|
|
461
|
-
|
|
462
|
-
if (isColumnStrictlyIncreasing(_coercedXColumn, fieldType)) {
|
|
463
|
-
return _coercedXColumn;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
return [];
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
var isDownsamplingEnabledForViz = function isDownsamplingEnabledForViz(_ref) {
|
|
471
|
-
var vizConfig = _ref.vizConfig;
|
|
472
|
-
|
|
473
|
-
var _a;
|
|
474
|
-
|
|
475
|
-
return (_a = vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(interfaces_1.VizBehavior.DOWNSAMPLING);
|
|
476
|
-
};
|
|
477
|
-
|
|
478
|
-
exports.isDownsamplingEnabledForViz = isDownsamplingEnabledForViz;
|
|
479
|
-
|
|
480
|
-
var calculateThresholdOnRangeSelect = function calculateThresholdOnRangeSelect(_ref2) {
|
|
481
|
-
var firstIndex = _ref2.firstIndex,
|
|
482
|
-
lastIndex = _ref2.lastIndex,
|
|
483
|
-
dataSources = _ref2.dataSources,
|
|
484
|
-
width = _ref2.width;
|
|
485
|
-
|
|
486
|
-
var _a, _b, _c;
|
|
487
|
-
|
|
488
|
-
var window = lastIndex - firstIndex + 1;
|
|
489
|
-
var ratio = Math.round(Number(((_c = (_b = (_a = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.columns[0]) === null || _c === void 0 ? void 0 : _c.length) / window) * 10) / 10;
|
|
490
|
-
return Math.round(ratio * Number(width));
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
exports.calculateThresholdOnRangeSelect = calculateThresholdOnRangeSelect;
|
|
494
|
-
/**
|
|
495
|
-
* Calculates the downsampling threshold based on the range selection. If search zoom is enabled or there is no selection,
|
|
496
|
-
* then returns the width of the visualization.
|
|
497
|
-
*
|
|
498
|
-
* Otherwise calculates the threshold based on the ratio of the window selected compared to the size of the non-downsampled
|
|
499
|
-
* data sources. Returns null if the chart event's dataset does not match the passed in primary data source or if the chart is zoomed
|
|
500
|
-
* in for a categorical chart.
|
|
501
|
-
*/
|
|
502
|
-
|
|
503
|
-
var calculateDownsamplingThreshold = function calculateDownsamplingThreshold(_ref3) {
|
|
504
|
-
var enableSearchZoom = _ref3.enableSearchZoom,
|
|
505
|
-
dataSources = _ref3.dataSources,
|
|
506
|
-
selectChartEvent = _ref3.selectChartEvent,
|
|
507
|
-
width = _ref3.width,
|
|
508
|
-
xField = _ref3.xField;
|
|
509
|
-
|
|
510
|
-
var _a, _b, _c;
|
|
511
|
-
|
|
512
|
-
if (enableSearchZoom || !selectChartEvent) {
|
|
513
|
-
return Number(width);
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
var primaryDataSource = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary;
|
|
517
|
-
|
|
518
|
-
if (!primaryDataSource) {
|
|
519
|
-
return null;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
var startXIndex = selectChartEvent.startXIndex,
|
|
523
|
-
endXIndex = selectChartEvent.endXIndex,
|
|
524
|
-
currentTarget = selectChartEvent.currentTarget;
|
|
525
|
-
|
|
526
|
-
try {
|
|
527
|
-
var xFieldIndex = (_a = primaryDataSource === null || primaryDataSource === void 0 ? void 0 : primaryDataSource.data) === null || _a === void 0 ? void 0 : _a.fields.findIndex(function (field) {
|
|
528
|
-
return field.name === xField;
|
|
529
|
-
});
|
|
530
|
-
var downsampledXFieldIndex = (_b = currentTarget.dataSet) === null || _b === void 0 ? void 0 : _b.fields.findIndex(function (field) {
|
|
531
|
-
return field === xField;
|
|
532
|
-
});
|
|
533
|
-
|
|
534
|
-
if (xFieldIndex === -1 || downsampledXFieldIndex === -1) {
|
|
535
|
-
return null;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
var fullSeries = (_c = primaryDataSource === null || primaryDataSource === void 0 ? void 0 : primaryDataSource.data) === null || _c === void 0 ? void 0 : _c.columns[xFieldIndex];
|
|
539
|
-
var downsampledSeries = currentTarget.dataSet.seriesList[downsampledXFieldIndex];
|
|
540
|
-
var firstIndex = fullSeries.findIndex(function (x) {
|
|
541
|
-
return downsampledSeries[startXIndex] === x;
|
|
542
|
-
});
|
|
543
|
-
var lastIndex = fullSeries.findIndex(function (x) {
|
|
544
|
-
return downsampledSeries[endXIndex] === x;
|
|
545
|
-
});
|
|
546
|
-
|
|
547
|
-
if (firstIndex >= 0 && lastIndex >= 0 && firstIndex <= lastIndex) {
|
|
548
|
-
return (0, exports.calculateThresholdOnRangeSelect)({
|
|
549
|
-
firstIndex: firstIndex,
|
|
550
|
-
lastIndex: lastIndex,
|
|
551
|
-
dataSources: dataSources,
|
|
552
|
-
width: width
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
} catch (e) {
|
|
556
|
-
// eslint-disable-next-line no-console
|
|
557
|
-
console.error('Error occurred while setting downsample threshold on range select event', e);
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
return null;
|
|
561
|
-
};
|
|
562
|
-
|
|
563
|
-
exports.calculateDownsamplingThreshold = calculateDownsamplingThreshold;
|
|
564
|
-
|
|
565
|
-
var isColumnStrictlyIncreasing = function isColumnStrictlyIncreasing(column, fieldType) {
|
|
566
|
-
return column.every(function (value, index) {
|
|
567
|
-
if (fieldType === 'number') {
|
|
568
|
-
if (Number.isNaN(value)) {
|
|
569
|
-
return false;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
if (fieldType === 'time') {
|
|
574
|
-
if (Number.isNaN(value.getTime())) {
|
|
575
|
-
return false;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
if (index === 0) {
|
|
580
|
-
return true;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
return value > column[index - 1];
|
|
584
|
-
});
|
|
585
|
-
};
|
|
586
|
-
/**
|
|
587
|
-
* Verifies that all of the columns that are displayed in a chart can be downsampled. Valid columns that can be
|
|
588
|
-
* displayed are those that contain at least one number. We can only downsample columns that only consist of numbers.
|
|
589
|
-
*
|
|
590
|
-
* If all columns can be downsampled, returns the x column coerced to time/number and y columns coerced to numbers.
|
|
591
|
-
* If not all columns can be downsampled, then returns empty arrays for both x and y
|
|
592
|
-
*/
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
var tryToCoerceAllDisplayedFields = function tryToCoerceAllDisplayedFields(ds, xField, yFields, fieldTypes, options) {
|
|
596
|
-
var xColumn = [];
|
|
597
|
-
var yColumns = [];
|
|
598
|
-
var canDownsample = !ds.data.fields.some(function (field, index) {
|
|
599
|
-
var _a, _b;
|
|
600
|
-
|
|
601
|
-
var fieldName = (_a = field.name) !== null && _a !== void 0 ? _a : field;
|
|
602
|
-
var fieldType = (_b = fieldTypes[index]) !== null && _b !== void 0 ? _b : 'unknown';
|
|
603
|
-
var column = ds.data.columns[index];
|
|
604
|
-
var hasDisplayedColumnThatCantBeDownsampled = false;
|
|
605
|
-
|
|
606
|
-
if (fieldName === xField) {
|
|
607
|
-
xColumn = strictlyCoerceXColumn(column, fieldType);
|
|
608
|
-
} else if (yFields.has(fieldName)) {
|
|
609
|
-
var _strictlyCoerceYColum = strictlyCoerceYColumn(ds.data.columns[index], options),
|
|
610
|
-
coercedColumn = _strictlyCoerceYColum.coercedColumn,
|
|
611
|
-
canLooselyCoerceSomeValues = _strictlyCoerceYColum.canLooselyCoerceSomeValues,
|
|
612
|
-
canDownsampleColumn = _strictlyCoerceYColum.canDownsampleColumn; // do not perform downsampling if a column can possibly be displayed but cannot
|
|
613
|
-
// be downsampled using LTTB
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
hasDisplayedColumnThatCantBeDownsampled = canLooselyCoerceSomeValues && !canDownsampleColumn;
|
|
617
|
-
|
|
618
|
-
if (hasDisplayedColumnThatCantBeDownsampled) {
|
|
619
|
-
return true;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
if (canDownsampleColumn) {
|
|
623
|
-
yColumns.push(coercedColumn);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
return false;
|
|
628
|
-
});
|
|
629
|
-
|
|
630
|
-
if (canDownsample) {
|
|
631
|
-
return {
|
|
632
|
-
xColumn: xColumn,
|
|
633
|
-
yColumns: yColumns
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
return {
|
|
638
|
-
xColumn: [],
|
|
639
|
-
yColumns: []
|
|
640
|
-
};
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
var pickIndicesFromDataSource = function pickIndicesFromDataSource(ds, indices) {
|
|
644
|
-
var sortedIndices = Array.from(indices).sort(function (a, b) {
|
|
645
|
-
return a - b;
|
|
646
|
-
});
|
|
647
|
-
var slicedColumns = [];
|
|
648
|
-
ds.data.columns.forEach(function (column) {
|
|
649
|
-
var slicedColumn = [];
|
|
650
|
-
sortedIndices.forEach(function (index) {
|
|
651
|
-
slicedColumn.push(column[index]);
|
|
652
|
-
});
|
|
653
|
-
slicedColumns.push(slicedColumn);
|
|
654
|
-
}); // update data columns with downsampled columns
|
|
655
|
-
|
|
656
|
-
return Object.assign(Object.assign({}, ds), {
|
|
657
|
-
data: Object.assign(Object.assign({}, ds.data), {
|
|
658
|
-
columns: slicedColumns
|
|
659
|
-
})
|
|
660
|
-
});
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
var downsampleDataSources = function downsampleDataSources(_ref4) {
|
|
664
|
-
var dataSources = _ref4.dataSources,
|
|
665
|
-
threshold = _ref4.threshold,
|
|
666
|
-
options = _ref4.options;
|
|
667
|
-
|
|
668
|
-
var _a, _b, _c;
|
|
669
|
-
|
|
670
|
-
var primaryDS = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary; // only downsample time series when number of data points are over threshold
|
|
671
|
-
|
|
672
|
-
var numPoints = (_c = (_b = (_a = primaryDS === null || primaryDS === void 0 ? void 0 : primaryDS.data) === null || _a === void 0 ? void 0 : _a.columns[0]) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
|
|
673
|
-
|
|
674
|
-
if (Number.isNaN(threshold) || numPoints <= threshold || threshold < 2) {
|
|
675
|
-
return dataSources;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
var xField = options.xField,
|
|
679
|
-
yFields = options.yFields,
|
|
680
|
-
fieldTypes = options.fieldTypes;
|
|
681
|
-
|
|
682
|
-
if (!xField || !(yFields === null || yFields === void 0 ? void 0 : yFields.length) || !(fieldTypes === null || fieldTypes === void 0 ? void 0 : fieldTypes.length)) {
|
|
683
|
-
return dataSources;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
var nonInternalYFields = new Set(yFields.filter(function (yField) {
|
|
687
|
-
return !yField.startsWith('_');
|
|
688
|
-
}));
|
|
689
|
-
var maxPointsInDownsample = Math.min(nonInternalYFields.size * threshold, numPoints); // Do not try to downsample if there are too many downsampled pts
|
|
690
|
-
// At the worst case, each series has non-overlapping downsampled pts
|
|
691
|
-
// which will mean that all points will be included in the downsampled result
|
|
692
|
-
// This will just lead to additional overhead due to coercing each
|
|
693
|
-
// x and y field to number
|
|
694
|
-
|
|
695
|
-
if (maxPointsInDownsample >= numPoints) {
|
|
696
|
-
return dataSources;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
var _tryToCoerceAllDispla = tryToCoerceAllDisplayedFields(primaryDS, xField, nonInternalYFields, fieldTypes, options),
|
|
700
|
-
xColumn = _tryToCoerceAllDispla.xColumn,
|
|
701
|
-
yColumns = _tryToCoerceAllDispla.yColumns;
|
|
702
|
-
|
|
703
|
-
if (!yColumns.length || !xColumn.length) {
|
|
704
|
-
return dataSources;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
var downsampledDataSources = Object.assign({}, dataSources);
|
|
708
|
-
var downsampledIndices = new Set();
|
|
709
|
-
yColumns.forEach(function (yColumn, columnIndex) {
|
|
710
|
-
// perform LTTB downsampling for current series, LTTB takes an [x, y] pair
|
|
711
|
-
var xyPair = yColumn.map(function (yValue, index) {
|
|
712
|
-
return [xColumn[index], yValue];
|
|
713
|
-
});
|
|
714
|
-
|
|
715
|
-
try {
|
|
716
|
-
var _largestTriangleThree = largestTriangleThreeBuckets(xyPair, threshold, downsampledIndices),
|
|
717
|
-
downsampledIndicesForSeries = _largestTriangleThree.downsampledIndices;
|
|
718
|
-
|
|
719
|
-
downsampledIndicesForSeries.forEach(function (downsampleIndex) {
|
|
720
|
-
return downsampledIndices.add(downsampleIndex);
|
|
721
|
-
});
|
|
722
|
-
} catch (e) {
|
|
723
|
-
// eslint-disable-next-line no-console
|
|
724
|
-
console.error("Error occurred while downsampling column ".concat(columnIndex), e);
|
|
725
|
-
}
|
|
726
|
-
}); // update data columns with downsampled columns
|
|
727
|
-
|
|
728
|
-
downsampledDataSources.primary = pickIndicesFromDataSource(primaryDS, downsampledIndices);
|
|
729
|
-
return downsampledDataSources;
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
exports.downsampleDataSources = downsampleDataSources;
|
|
733
|
-
|
|
734
|
-
/***/ }),
|
|
735
|
-
/* 26 */
|
|
736
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
737
|
-
|
|
738
|
-
"use strict";
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
Object.defineProperty(exports, "__esModule", {
|
|
742
|
-
value: true
|
|
743
|
-
});
|
|
744
|
-
exports.validOutputModes = exports.validSortDirs = void 0;
|
|
745
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
746
|
-
exports.validOutputModes = ['json_cols', 'json'];
|
|
747
|
-
|
|
748
|
-
/***/ }),
|
|
749
|
-
/* 27 */,
|
|
750
|
-
/* 28 */
|
|
751
|
-
/***/ (function(module, exports) {
|
|
752
|
-
|
|
753
|
-
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
754
|
-
|
|
755
|
-
/***/ }),
|
|
756
|
-
/* 29 */
|
|
757
|
-
/***/ (function(module, exports) {
|
|
758
|
-
|
|
759
|
-
module.exports = require("@splunk/visualizations-shared/style");
|
|
760
|
-
|
|
761
|
-
/***/ }),
|
|
762
|
-
/* 30 */
|
|
763
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
764
|
-
|
|
765
|
-
"use strict";
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
var _classCallCheck = __webpack_require__(4);
|
|
769
|
-
|
|
770
|
-
var _createClass = __webpack_require__(7);
|
|
771
|
-
|
|
772
|
-
Object.defineProperty(exports, "__esModule", {
|
|
773
|
-
value: true
|
|
774
|
-
});
|
|
775
|
-
exports.ChartingApiFunctional = void 0;
|
|
776
|
-
|
|
777
|
-
var ChartingApiFunctional = /*#__PURE__*/function () {
|
|
778
|
-
// eslint-disable-next-line no-useless-constructor
|
|
779
|
-
function ChartingApiFunctional(chartRef) {
|
|
780
|
-
_classCallCheck(this, ChartingApiFunctional);
|
|
781
|
-
|
|
782
|
-
this.chartRef = chartRef;
|
|
783
|
-
}
|
|
784
|
-
/**
|
|
785
|
-
* Allows users to programmatically highlight a point on the chart
|
|
786
|
-
*
|
|
787
|
-
* @memberof ChartingApiFunctional
|
|
788
|
-
*/
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
_createClass(ChartingApiFunctional, [{
|
|
792
|
-
key: "highlight",
|
|
793
|
-
value: function highlight() {
|
|
794
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
795
|
-
xValue: '',
|
|
796
|
-
seriesName: ''
|
|
797
|
-
},
|
|
798
|
-
xValue = _ref.xValue,
|
|
799
|
-
seriesName = _ref.seriesName;
|
|
800
|
-
|
|
801
|
-
this.getChart().highlight(xValue, seriesName);
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* Allows users to programmatically unhighlight all points on the chart
|
|
805
|
-
*
|
|
806
|
-
* @memberof ChartingApiFunctional
|
|
807
|
-
*/
|
|
808
|
-
|
|
809
|
-
}, {
|
|
810
|
-
key: "unHighlight",
|
|
811
|
-
value: function unHighlight() {
|
|
812
|
-
this.getChart().unHighlight();
|
|
813
|
-
} // returns chart object
|
|
814
|
-
|
|
815
|
-
}, {
|
|
816
|
-
key: "getChart",
|
|
817
|
-
value: function getChart() {
|
|
818
|
-
var _a;
|
|
819
|
-
|
|
820
|
-
return (_a = this.chartRef) === null || _a === void 0 ? void 0 : _a.current;
|
|
821
|
-
}
|
|
822
|
-
}]);
|
|
823
|
-
|
|
824
|
-
return ChartingApiFunctional;
|
|
825
|
-
}();
|
|
826
|
-
|
|
827
|
-
exports.ChartingApiFunctional = ChartingApiFunctional;
|
|
828
|
-
|
|
829
|
-
/***/ }),
|
|
830
|
-
/* 31 */
|
|
831
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
832
|
-
|
|
833
|
-
"use strict";
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
Object.defineProperty(exports, "__esModule", {
|
|
837
|
-
value: true
|
|
838
|
-
});
|
|
839
|
-
|
|
840
|
-
var react_1 = __webpack_require__(0);
|
|
841
|
-
|
|
842
|
-
function usePrevious(value) {
|
|
843
|
-
var ref = (0, react_1.useRef)();
|
|
844
|
-
(0, react_1.useEffect)(function () {
|
|
845
|
-
ref.current = value;
|
|
846
|
-
});
|
|
847
|
-
return ref.current;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
exports.default = usePrevious;
|
|
851
|
-
|
|
852
|
-
/***/ }),
|
|
853
|
-
/* 32 */
|
|
854
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
855
|
-
|
|
856
|
-
"use strict";
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
860
|
-
if (k2 === undefined) k2 = k;
|
|
861
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
862
|
-
|
|
863
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
864
|
-
desc = {
|
|
865
|
-
enumerable: true,
|
|
866
|
-
get: function get() {
|
|
867
|
-
return m[k];
|
|
868
|
-
}
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
Object.defineProperty(o, k2, desc);
|
|
873
|
-
} : function (o, m, k, k2) {
|
|
874
|
-
if (k2 === undefined) k2 = k;
|
|
875
|
-
o[k2] = m[k];
|
|
876
|
-
});
|
|
877
|
-
|
|
878
|
-
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
879
|
-
for (var p in m) {
|
|
880
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
881
|
-
}
|
|
882
|
-
};
|
|
883
|
-
|
|
884
|
-
Object.defineProperty(exports, "__esModule", {
|
|
885
|
-
value: true
|
|
886
|
-
});
|
|
887
|
-
|
|
888
|
-
__exportStar(__webpack_require__(33), exports);
|
|
889
|
-
|
|
890
|
-
__exportStar(__webpack_require__(34), exports);
|
|
891
|
-
|
|
892
|
-
__exportStar(__webpack_require__(26), exports);
|
|
893
|
-
|
|
894
|
-
__exportStar(__webpack_require__(35), exports);
|
|
895
|
-
|
|
896
|
-
__exportStar(__webpack_require__(36), exports);
|
|
897
|
-
|
|
898
|
-
__exportStar(__webpack_require__(37), exports);
|
|
899
|
-
|
|
900
|
-
__exportStar(__webpack_require__(38), exports);
|
|
901
|
-
|
|
902
|
-
__exportStar(__webpack_require__(39), exports);
|
|
903
|
-
|
|
904
|
-
__exportStar(__webpack_require__(40), exports);
|
|
905
|
-
|
|
906
|
-
__exportStar(__webpack_require__(14), exports);
|
|
907
|
-
|
|
908
|
-
__exportStar(__webpack_require__(18), exports);
|
|
909
|
-
|
|
910
|
-
__exportStar(__webpack_require__(19), exports);
|
|
911
|
-
|
|
912
|
-
__exportStar(__webpack_require__(41), exports);
|
|
913
|
-
|
|
914
|
-
__exportStar(__webpack_require__(42), exports);
|
|
915
|
-
|
|
916
|
-
__exportStar(__webpack_require__(43), exports);
|
|
917
|
-
|
|
918
|
-
__exportStar(__webpack_require__(44), exports);
|
|
919
|
-
|
|
920
|
-
__exportStar(__webpack_require__(45), exports);
|
|
921
|
-
|
|
922
|
-
__exportStar(__webpack_require__(46), exports);
|
|
923
|
-
|
|
924
|
-
/***/ }),
|
|
925
|
-
/* 33 */
|
|
926
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
927
|
-
|
|
928
|
-
"use strict";
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
Object.defineProperty(exports, "__esModule", {
|
|
932
|
-
value: true
|
|
1
|
+
/* Copyright © 2020 Splunk Inc.
|
|
2
|
+
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
|
+
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
+
var __export = (target, all) => {
|
|
28
|
+
for (var name in all)
|
|
29
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
30
|
+
};
|
|
31
|
+
var __copyProps = (to, from, except, desc) => {
|
|
32
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
33
|
+
for (let key of __getOwnPropNames(from))
|
|
34
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
35
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
36
|
+
}
|
|
37
|
+
return to;
|
|
38
|
+
};
|
|
39
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
40
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
41
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
42
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
43
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
44
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
45
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
46
|
+
mod
|
|
47
|
+
));
|
|
48
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
49
|
+
|
|
50
|
+
// src/common/Charting.tsx
|
|
51
|
+
var Charting_exports = {};
|
|
52
|
+
__export(Charting_exports, {
|
|
53
|
+
NO_INPLACE_PROPS: () => NO_INPLACE_PROPS,
|
|
54
|
+
appendTrellisToPayload: () => appendTrellisToPayload,
|
|
55
|
+
canUpdateInPlace: () => canUpdateInPlace,
|
|
56
|
+
changedOptions: () => changedOptions,
|
|
57
|
+
default: () => Charting_default,
|
|
58
|
+
updateRowPayload: () => updateRowPayload
|
|
933
59
|
});
|
|
60
|
+
module.exports = __toCommonJS(Charting_exports);
|
|
934
61
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
"use strict";
|
|
940
|
-
|
|
941
|
-
/**
|
|
942
|
-
* A data structure used at runtime to wire up a visualization.
|
|
943
|
-
*/
|
|
944
|
-
|
|
945
|
-
Object.defineProperty(exports, "__esModule", {
|
|
946
|
-
value: true
|
|
62
|
+
// esm-externals:lodash
|
|
63
|
+
var lodash_exports = {};
|
|
64
|
+
__export(lodash_exports, {
|
|
65
|
+
default: () => lodash_default
|
|
947
66
|
});
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
Object.defineProperty(exports, "__esModule", {
|
|
957
|
-
value: true
|
|
67
|
+
var defaultImport = __toESM(require("lodash"));
|
|
68
|
+
__reExport(lodash_exports, require("lodash"));
|
|
69
|
+
var lodash_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
70
|
+
|
|
71
|
+
// esm-externals:@splunk/ui-utils/i18n
|
|
72
|
+
var i18n_exports = {};
|
|
73
|
+
__export(i18n_exports, {
|
|
74
|
+
default: () => i18n_default
|
|
958
75
|
});
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
Object.defineProperty(exports, "__esModule", {
|
|
968
|
-
value: true
|
|
76
|
+
var defaultImport2 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
77
|
+
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
78
|
+
var i18n_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
79
|
+
|
|
80
|
+
// esm-externals:@splunk/visualization-color-palettes
|
|
81
|
+
var visualization_color_palettes_exports = {};
|
|
82
|
+
__export(visualization_color_palettes_exports, {
|
|
83
|
+
default: () => visualization_color_palettes_default
|
|
969
84
|
});
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
Object.defineProperty(exports, "__esModule", {
|
|
979
|
-
value: true
|
|
85
|
+
var defaultImport3 = __toESM(require("@splunk/visualization-color-palettes"));
|
|
86
|
+
__reExport(visualization_color_palettes_exports, require("@splunk/visualization-color-palettes"));
|
|
87
|
+
var visualization_color_palettes_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
88
|
+
|
|
89
|
+
// esm-externals:react
|
|
90
|
+
var react_exports = {};
|
|
91
|
+
__export(react_exports, {
|
|
92
|
+
default: () => react_default
|
|
980
93
|
});
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
Object.defineProperty(exports, "__esModule", {
|
|
990
|
-
value: true
|
|
94
|
+
var defaultImport4 = __toESM(require("react"));
|
|
95
|
+
__reExport(react_exports, require("react"));
|
|
96
|
+
var react_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
97
|
+
|
|
98
|
+
// esm-externals:prop-types
|
|
99
|
+
var prop_types_exports = {};
|
|
100
|
+
__export(prop_types_exports, {
|
|
101
|
+
default: () => prop_types_default
|
|
991
102
|
});
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1001
|
-
value: true
|
|
103
|
+
var defaultImport5 = __toESM(require("prop-types"));
|
|
104
|
+
__reExport(prop_types_exports, require("prop-types"));
|
|
105
|
+
var prop_types_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
106
|
+
|
|
107
|
+
// esm-externals:react-event-listener
|
|
108
|
+
var react_event_listener_exports = {};
|
|
109
|
+
__export(react_event_listener_exports, {
|
|
110
|
+
default: () => react_event_listener_default
|
|
1002
111
|
});
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1012
|
-
value: true
|
|
112
|
+
var defaultImport6 = __toESM(require("react-event-listener"));
|
|
113
|
+
__reExport(react_event_listener_exports, require("react-event-listener"));
|
|
114
|
+
var react_event_listener_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
115
|
+
|
|
116
|
+
// esm-externals:@splunk/visualizations-shared/i18n
|
|
117
|
+
var i18n_exports2 = {};
|
|
118
|
+
__export(i18n_exports2, {
|
|
119
|
+
default: () => i18n_default2
|
|
1013
120
|
});
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1023
|
-
value: true
|
|
121
|
+
var defaultImport7 = __toESM(require("@splunk/visualizations-shared/i18n"));
|
|
122
|
+
__reExport(i18n_exports2, require("@splunk/visualizations-shared/i18n"));
|
|
123
|
+
var i18n_default2 = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
124
|
+
|
|
125
|
+
// esm-externals:@splunk/charting-bundle
|
|
126
|
+
var charting_bundle_exports = {};
|
|
127
|
+
__export(charting_bundle_exports, {
|
|
128
|
+
default: () => charting_bundle_default
|
|
1024
129
|
});
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1034
|
-
value: true
|
|
130
|
+
var defaultImport8 = __toESM(require("@splunk/charting-bundle"));
|
|
131
|
+
__reExport(charting_bundle_exports, require("@splunk/charting-bundle"));
|
|
132
|
+
var charting_bundle_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
133
|
+
|
|
134
|
+
// esm-externals:@splunk/visualization-context/TimezoneContext
|
|
135
|
+
var TimezoneContext_exports = {};
|
|
136
|
+
__export(TimezoneContext_exports, {
|
|
137
|
+
default: () => TimezoneContext_default
|
|
1035
138
|
});
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1045
|
-
value: true
|
|
139
|
+
var defaultImport9 = __toESM(require("@splunk/visualization-context/TimezoneContext"));
|
|
140
|
+
__reExport(TimezoneContext_exports, require("@splunk/visualization-context/TimezoneContext"));
|
|
141
|
+
var TimezoneContext_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
142
|
+
|
|
143
|
+
// esm-externals:@splunk/visualizations-shared/style
|
|
144
|
+
var style_exports = {};
|
|
145
|
+
__export(style_exports, {
|
|
146
|
+
default: () => style_default
|
|
1046
147
|
});
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1056
|
-
value: true
|
|
148
|
+
var defaultImport10 = __toESM(require("@splunk/visualizations-shared/style"));
|
|
149
|
+
__reExport(style_exports, require("@splunk/visualizations-shared/style"));
|
|
150
|
+
var style_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
|
|
151
|
+
|
|
152
|
+
// esm-externals:styled-components
|
|
153
|
+
var styled_components_exports = {};
|
|
154
|
+
__export(styled_components_exports, {
|
|
155
|
+
default: () => styled_components_default
|
|
1057
156
|
});
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1067
|
-
value: true
|
|
157
|
+
var defaultImport11 = __toESM(require("styled-components"));
|
|
158
|
+
__reExport(styled_components_exports, require("styled-components"));
|
|
159
|
+
var styled_components_default = "default" in defaultImport11 ? defaultImport11.default : defaultImport11;
|
|
160
|
+
|
|
161
|
+
// esm-externals:@splunk/visualizations-shared/Message
|
|
162
|
+
var Message_exports = {};
|
|
163
|
+
__export(Message_exports, {
|
|
164
|
+
default: () => Message_default
|
|
1068
165
|
});
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1078
|
-
value: true
|
|
166
|
+
var defaultImport12 = __toESM(require("@splunk/visualizations-shared/Message"));
|
|
167
|
+
__reExport(Message_exports, require("@splunk/visualizations-shared/Message"));
|
|
168
|
+
var Message_default = "default" in defaultImport12 ? defaultImport12.default : defaultImport12;
|
|
169
|
+
|
|
170
|
+
// esm-externals:@splunk/themes/useSplunkTheme
|
|
171
|
+
var useSplunkTheme_exports = {};
|
|
172
|
+
__export(useSplunkTheme_exports, {
|
|
173
|
+
default: () => useSplunkTheme_default
|
|
1079
174
|
});
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
/* 53 */,
|
|
1089
|
-
/* 54 */,
|
|
1090
|
-
/* 55 */,
|
|
1091
|
-
/* 56 */,
|
|
1092
|
-
/* 57 */,
|
|
1093
|
-
/* 58 */,
|
|
1094
|
-
/* 59 */,
|
|
1095
|
-
/* 60 */,
|
|
1096
|
-
/* 61 */,
|
|
1097
|
-
/* 62 */,
|
|
1098
|
-
/* 63 */,
|
|
1099
|
-
/* 64 */,
|
|
1100
|
-
/* 65 */,
|
|
1101
|
-
/* 66 */,
|
|
1102
|
-
/* 67 */,
|
|
1103
|
-
/* 68 */,
|
|
1104
|
-
/* 69 */,
|
|
1105
|
-
/* 70 */,
|
|
1106
|
-
/* 71 */,
|
|
1107
|
-
/* 72 */,
|
|
1108
|
-
/* 73 */
|
|
1109
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1110
|
-
|
|
1111
|
-
"use strict";
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1115
|
-
value: true
|
|
175
|
+
var defaultImport13 = __toESM(require("@splunk/themes/useSplunkTheme"));
|
|
176
|
+
__reExport(useSplunkTheme_exports, require("@splunk/themes/useSplunkTheme"));
|
|
177
|
+
var useSplunkTheme_default = "default" in defaultImport13 ? defaultImport13.default : defaultImport13;
|
|
178
|
+
|
|
179
|
+
// esm-externals:@splunk/visualizations-shared/themeUtils
|
|
180
|
+
var themeUtils_exports = {};
|
|
181
|
+
__export(themeUtils_exports, {
|
|
182
|
+
default: () => themeUtils_default
|
|
1116
183
|
});
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
var
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
var
|
|
1127
|
-
|
|
1128
|
-
var
|
|
1129
|
-
|
|
1130
|
-
var T = __webpack_require__(1);
|
|
1131
|
-
|
|
1132
|
-
var react_event_listener_1 = __webpack_require__(75);
|
|
1133
|
-
|
|
1134
|
-
__webpack_require__(76); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
var charting_bundle_1 = __webpack_require__(77);
|
|
1138
|
-
|
|
1139
|
-
var TimezoneContext_1 = __webpack_require__(28);
|
|
1140
|
-
|
|
1141
|
-
var style_1 = __webpack_require__(29);
|
|
1142
|
-
|
|
1143
|
-
var styled_components_1 = __webpack_require__(2);
|
|
1144
|
-
|
|
1145
|
-
var Message_1 = __webpack_require__(24);
|
|
1146
|
-
|
|
1147
|
-
var useSplunkTheme_1 = __webpack_require__(78);
|
|
1148
|
-
|
|
1149
|
-
var themeUtils_1 = __webpack_require__(79);
|
|
1150
|
-
|
|
1151
|
-
var ChartingApi_1 = __webpack_require__(30);
|
|
184
|
+
var defaultImport14 = __toESM(require("@splunk/visualizations-shared/themeUtils"));
|
|
185
|
+
__reExport(themeUtils_exports, require("@splunk/visualizations-shared/themeUtils"));
|
|
186
|
+
var themeUtils_default = "default" in defaultImport14 ? defaultImport14.default : defaultImport14;
|
|
187
|
+
|
|
188
|
+
// esm-externals:@splunk/visualization-schemas
|
|
189
|
+
var visualization_schemas_exports = {};
|
|
190
|
+
__export(visualization_schemas_exports, {
|
|
191
|
+
default: () => visualization_schemas_default
|
|
192
|
+
});
|
|
193
|
+
var defaultImport15 = __toESM(require("@splunk/visualization-schemas"));
|
|
194
|
+
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
195
|
+
var visualization_schemas_default = "default" in defaultImport15 ? defaultImport15.default : defaultImport15;
|
|
1152
196
|
|
|
1153
|
-
|
|
197
|
+
// src/common/ChartingApi.ts
|
|
198
|
+
var ChartingApiFunctional = class {
|
|
199
|
+
// eslint-disable-next-line no-useless-constructor
|
|
200
|
+
constructor(chartRef) {
|
|
201
|
+
this.chartRef = chartRef;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Allows users to programmatically highlight a point on the chart
|
|
205
|
+
*
|
|
206
|
+
* @memberof ChartingApiFunctional
|
|
207
|
+
*/
|
|
208
|
+
highlight({ xValue, seriesName } = { xValue: "", seriesName: "" }) {
|
|
209
|
+
this.getChart().highlight(xValue, seriesName);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Allows users to programmatically unhighlight all points on the chart
|
|
213
|
+
*
|
|
214
|
+
* @memberof ChartingApiFunctional
|
|
215
|
+
*/
|
|
216
|
+
unHighlight() {
|
|
217
|
+
this.getChart().unHighlight();
|
|
218
|
+
}
|
|
219
|
+
// returns chart object
|
|
220
|
+
getChart() {
|
|
221
|
+
var _a;
|
|
222
|
+
return (_a = this.chartRef) == null ? void 0 : _a.current;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
1154
225
|
|
|
1155
|
-
|
|
226
|
+
// src/common/hooks/usePrevious.ts
|
|
227
|
+
function usePrevious(value) {
|
|
228
|
+
const ref = (0, react_exports.useRef)();
|
|
229
|
+
(0, react_exports.useEffect)(() => {
|
|
230
|
+
ref.current = value;
|
|
231
|
+
});
|
|
232
|
+
return ref.current;
|
|
233
|
+
}
|
|
1156
234
|
|
|
1157
|
-
|
|
235
|
+
// src/common/hooks/useEventCallback.tsx
|
|
236
|
+
var useEventCallback = (fn) => {
|
|
237
|
+
const ref = (0, react_exports.useRef)(fn);
|
|
238
|
+
(0, react_exports.useLayoutEffect)(() => {
|
|
239
|
+
ref.current = fn;
|
|
240
|
+
});
|
|
241
|
+
return (0, react_exports.useCallback)((...args) => ref.current(...args), []);
|
|
242
|
+
};
|
|
243
|
+
var useEventCallback_default = useEventCallback;
|
|
1158
244
|
|
|
1159
|
-
|
|
245
|
+
// esm-externals:@splunk/visualizations-shared/numberUtils
|
|
246
|
+
var numberUtils_exports = {};
|
|
247
|
+
__export(numberUtils_exports, {
|
|
248
|
+
default: () => numberUtils_default
|
|
249
|
+
});
|
|
250
|
+
var defaultImport16 = __toESM(require("@splunk/visualizations-shared/numberUtils"));
|
|
251
|
+
__reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUtils"));
|
|
252
|
+
var numberUtils_default = "default" in defaultImport16 ? defaultImport16.default : defaultImport16;
|
|
253
|
+
|
|
254
|
+
// src/common/utils/dataUtils.ts
|
|
255
|
+
var calculateThresholdOnRangeSelect = ({
|
|
256
|
+
firstIndex,
|
|
257
|
+
lastIndex,
|
|
258
|
+
dataSources,
|
|
259
|
+
width
|
|
260
|
+
}) => {
|
|
261
|
+
var _a, _b, _c;
|
|
262
|
+
const window2 = lastIndex - firstIndex + 1;
|
|
263
|
+
const ratio = Math.round(Number(((_c = (_b = (_a = dataSources == null ? void 0 : dataSources.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.columns[0]) == null ? void 0 : _c.length) / window2) * 10) / 10;
|
|
264
|
+
return Math.round(ratio * Number(width));
|
|
265
|
+
};
|
|
266
|
+
var calculateDownsamplingThreshold = ({
|
|
267
|
+
enableSearchZoom,
|
|
268
|
+
dataSources,
|
|
269
|
+
selectChartEvent,
|
|
270
|
+
width,
|
|
271
|
+
xField
|
|
272
|
+
}) => {
|
|
273
|
+
var _a, _b, _c;
|
|
274
|
+
if (enableSearchZoom || !selectChartEvent) {
|
|
275
|
+
return Number(width);
|
|
276
|
+
}
|
|
277
|
+
const primaryDataSource = dataSources == null ? void 0 : dataSources.primary;
|
|
278
|
+
if (!primaryDataSource) {
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
const { startXIndex, endXIndex, currentTarget } = selectChartEvent;
|
|
282
|
+
try {
|
|
283
|
+
const xFieldIndex = (_a = primaryDataSource == null ? void 0 : primaryDataSource.data) == null ? void 0 : _a.fields.findIndex((field) => {
|
|
284
|
+
return field.name === xField;
|
|
285
|
+
});
|
|
286
|
+
const downsampledXFieldIndex = (_b = currentTarget.dataSet) == null ? void 0 : _b.fields.findIndex((field) => field === xField);
|
|
287
|
+
if (xFieldIndex === -1 || downsampledXFieldIndex === -1) {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
const fullSeries = (_c = primaryDataSource == null ? void 0 : primaryDataSource.data) == null ? void 0 : _c.columns[xFieldIndex];
|
|
291
|
+
const downsampledSeries = currentTarget.dataSet.seriesList[downsampledXFieldIndex];
|
|
292
|
+
const firstIndex = fullSeries.findIndex((x) => {
|
|
293
|
+
return downsampledSeries[startXIndex] === x;
|
|
294
|
+
});
|
|
295
|
+
const lastIndex = fullSeries.findIndex((x) => {
|
|
296
|
+
return downsampledSeries[endXIndex] === x;
|
|
297
|
+
});
|
|
298
|
+
if (firstIndex >= 0 && lastIndex >= 0 && firstIndex <= lastIndex) {
|
|
299
|
+
return calculateThresholdOnRangeSelect({
|
|
300
|
+
firstIndex,
|
|
301
|
+
lastIndex,
|
|
302
|
+
dataSources,
|
|
303
|
+
width
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
} catch (e) {
|
|
307
|
+
console.error("Error occurred while setting downsample threshold on range select event", e);
|
|
308
|
+
}
|
|
309
|
+
return null;
|
|
310
|
+
};
|
|
1160
311
|
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
312
|
+
// esm-externals:@splunk/visualization-context/FeatureFlagContext
|
|
313
|
+
var FeatureFlagContext_exports = {};
|
|
314
|
+
__export(FeatureFlagContext_exports, {
|
|
315
|
+
default: () => FeatureFlagContext_default
|
|
316
|
+
});
|
|
317
|
+
var defaultImport17 = __toESM(require("@splunk/visualization-context/FeatureFlagContext"));
|
|
318
|
+
__reExport(FeatureFlagContext_exports, require("@splunk/visualization-context/FeatureFlagContext"));
|
|
319
|
+
var FeatureFlagContext_default = "default" in defaultImport17 ? defaultImport17.default : defaultImport17;
|
|
320
|
+
|
|
321
|
+
// src/common/hooks/useTrellisEnabled.ts
|
|
322
|
+
var useTrellisFeatureFlagOn = () => {
|
|
323
|
+
const context = (0, react_exports.useContext)(FeatureFlagContext_default);
|
|
324
|
+
return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
|
|
325
|
+
};
|
|
326
|
+
var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
|
|
327
|
+
const trellisFeatureEnabled = useTrellisFeatureFlagOn();
|
|
328
|
+
return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
1167
329
|
};
|
|
1168
330
|
|
|
1169
|
-
|
|
331
|
+
// src/common/components/TrellisTitle.tsx
|
|
332
|
+
var TRELLIS_TITLE_HEIGHT = 28;
|
|
333
|
+
var TrellisTitleText = styled_components_default.div`
|
|
334
|
+
margin-left: 10px;
|
|
335
|
+
margin-right: 10px;
|
|
336
|
+
padding-top: 8px;
|
|
337
|
+
text-overflow: ellipsis;
|
|
338
|
+
white-space: nowrap;
|
|
339
|
+
overflow: hidden;
|
|
340
|
+
`;
|
|
341
|
+
var TrellisTitleDiv = styled_components_default.div`
|
|
342
|
+
height: ${TRELLIS_TITLE_HEIGHT}px;
|
|
343
|
+
font-size: 14px;
|
|
344
|
+
font-weight: 700;
|
|
345
|
+
color: ${(props) => props.fontColor};
|
|
346
|
+
background-color: ${(props) => props.backgroundColor};
|
|
347
|
+
box-shadow: 0 1px ${(props) => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.
|
|
348
|
+
`;
|
|
349
|
+
var TrellisTitle = (props) => {
|
|
350
|
+
const titleText = String(props.trellisKey).toString();
|
|
351
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
352
|
+
TrellisTitleDiv,
|
|
353
|
+
{
|
|
354
|
+
fontColor: props.fontColor,
|
|
355
|
+
backgroundColor: props.backgroundColor,
|
|
356
|
+
"data-test": "trellis-title",
|
|
357
|
+
title: titleText
|
|
358
|
+
},
|
|
359
|
+
/* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
|
|
360
|
+
);
|
|
361
|
+
};
|
|
1170
362
|
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
363
|
+
// src/common/Charting.tsx
|
|
364
|
+
var NO_INPLACE_PROPS = [
|
|
365
|
+
"chart",
|
|
366
|
+
"chart.orientation",
|
|
367
|
+
"layout.splitSeries",
|
|
368
|
+
"chart.style",
|
|
369
|
+
"legend.placement"
|
|
370
|
+
];
|
|
371
|
+
var appendTrellisToPayload = (props, payload) => {
|
|
372
|
+
if (props.trellisSplitBy) {
|
|
373
|
+
payload["trellis.name"] = props.trellisSplitBy;
|
|
374
|
+
}
|
|
375
|
+
if (props.trellisKey) {
|
|
376
|
+
payload["trellis.value"] = props.trellisKey;
|
|
377
|
+
}
|
|
378
|
+
return payload;
|
|
379
|
+
};
|
|
380
|
+
var changedOptions = (curOptions, nextOptions) => Object.keys(curOptions).filter((key) => !(key in nextOptions)).concat(
|
|
381
|
+
Object.keys(nextOptions).filter(
|
|
382
|
+
(key) => !(key in curOptions) || curOptions[key] !== nextOptions[key]
|
|
383
|
+
)
|
|
384
|
+
);
|
|
385
|
+
var canUpdateInPlace = (curOptions, nextOptions) => {
|
|
1174
386
|
if (!curOptions || !nextOptions) {
|
|
1175
387
|
return false;
|
|
1176
388
|
}
|
|
1177
|
-
|
|
1178
|
-
return !exports.NO_INPLACE_PROPS.some(function (p) {
|
|
1179
|
-
return curOptions[p] !== nextOptions[p];
|
|
1180
|
-
}) && !(0, exports.changedOptions)(curOptions, nextOptions).some(function (p) {
|
|
1181
|
-
return p.toLowerCase().endsWith('color');
|
|
1182
|
-
});
|
|
389
|
+
return !NO_INPLACE_PROPS.some((p) => curOptions[p] !== nextOptions[p]) && !changedOptions(curOptions, nextOptions).some((p) => p.toLowerCase().endsWith("color"));
|
|
1183
390
|
};
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
var updateRowPayload = function updateRowPayload(chartEventRowContext, payload) {
|
|
1189
|
-
Object.keys(chartEventRowContext || {}).forEach(function (key) {
|
|
1190
|
-
// eslint-disable-next-line no-param-reassign
|
|
1191
|
-
payload["".concat(key, ".value")] = chartEventRowContext[key];
|
|
391
|
+
var updateRowPayload = (chartEventRowContext, payload) => {
|
|
392
|
+
Object.keys(chartEventRowContext || {}).forEach((key) => {
|
|
393
|
+
payload[`${key}.value`] = chartEventRowContext[key];
|
|
1192
394
|
});
|
|
1193
395
|
return payload;
|
|
1194
396
|
};
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
// https://github.com/highcharts/highcharts/issues/12883
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
var ChartingContainer = styled_components_1.default.div.attrs(function (props) {
|
|
1211
|
-
return {
|
|
1212
|
-
'data-test': 'charting-container',
|
|
1213
|
-
width: props.width,
|
|
1214
|
-
height: props.height
|
|
1215
|
-
};
|
|
1216
|
-
}).withConfig({
|
|
1217
|
-
displayName: "Charting__ChartingContainer",
|
|
1218
|
-
componentId: "sc-3wbgm0-0"
|
|
1219
|
-
})(["& .highcharts-a11y-proxy-container{pointer-events:none;}overflow:hidden;position:relative;", ";"], function (props) {
|
|
1220
|
-
return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
|
|
1221
|
-
});
|
|
397
|
+
var ChartingContainer = styled_components_default.div.attrs((props) => ({
|
|
398
|
+
"data-test": "charting-container",
|
|
399
|
+
width: props.width,
|
|
400
|
+
height: props.height
|
|
401
|
+
}))`
|
|
402
|
+
& .highcharts-a11y-proxy-container {
|
|
403
|
+
pointer-events: none;
|
|
404
|
+
}
|
|
405
|
+
overflow: hidden;
|
|
406
|
+
position: relative;
|
|
407
|
+
${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
|
|
408
|
+
`;
|
|
1222
409
|
var propTypes = {
|
|
1223
|
-
width:
|
|
1224
|
-
height:
|
|
1225
|
-
options:
|
|
1226
|
-
chartData:
|
|
1227
|
-
onEventTrigger:
|
|
1228
|
-
onClick:
|
|
1229
|
-
onSelect:
|
|
1230
|
-
onPointMouseOver:
|
|
1231
|
-
onPointMouseOut:
|
|
1232
|
-
style:
|
|
1233
|
-
colorPalette:
|
|
1234
|
-
visualizationApiRef:
|
|
1235
|
-
themeKey:
|
|
1236
|
-
originalDataSources:
|
|
1237
|
-
onDownsamplingThresholdChange:
|
|
1238
|
-
xField:
|
|
1239
|
-
y2Fields:
|
|
410
|
+
width: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
|
|
411
|
+
height: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
|
|
412
|
+
options: prop_types_exports.object,
|
|
413
|
+
chartData: prop_types_exports.object,
|
|
414
|
+
onEventTrigger: prop_types_exports.func,
|
|
415
|
+
onClick: prop_types_exports.func,
|
|
416
|
+
onSelect: prop_types_exports.func,
|
|
417
|
+
onPointMouseOver: prop_types_exports.func,
|
|
418
|
+
onPointMouseOut: prop_types_exports.func,
|
|
419
|
+
style: prop_types_exports.object,
|
|
420
|
+
colorPalette: prop_types_exports.array,
|
|
421
|
+
visualizationApiRef: prop_types_exports.func,
|
|
422
|
+
themeKey: prop_types_exports.string,
|
|
423
|
+
originalDataSources: prop_types_exports.object,
|
|
424
|
+
onDownsamplingThresholdChange: prop_types_exports.func,
|
|
425
|
+
xField: prop_types_exports.string,
|
|
426
|
+
y2Fields: prop_types_exports.array,
|
|
427
|
+
splitByLayout: prop_types_exports.oneOf(Object.values(visualization_schemas_exports.LAYOUT_TYPE)),
|
|
428
|
+
trellisKey: prop_types_exports.string,
|
|
429
|
+
trellisSplitBy: prop_types_exports.string,
|
|
430
|
+
backgroundColor: prop_types_exports.string,
|
|
431
|
+
defaultFontColor: prop_types_exports.string
|
|
1240
432
|
};
|
|
1241
|
-
|
|
1242
|
-
var Charting = function Charting(props) {
|
|
433
|
+
var Charting = (props) => {
|
|
1243
434
|
var _a, _b;
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
var computeChartingSize = function computeChartingSize() {
|
|
435
|
+
const container = (0, react_exports.useRef)(null);
|
|
436
|
+
const needsInit = (0, react_exports.useRef)(true);
|
|
437
|
+
const chart = (0, react_exports.useRef)();
|
|
438
|
+
const needsRedraw = (0, react_exports.useRef)(true);
|
|
439
|
+
const api = (0, react_exports.useRef)(new ChartingApiFunctional(chart));
|
|
440
|
+
const timezone = (0, react_exports.useContext)(TimezoneContext_default);
|
|
441
|
+
const selectChartEvent = (0, react_exports.useRef)(null);
|
|
442
|
+
const trellisEnabled = useTrellisEnabled(props.splitByLayout);
|
|
443
|
+
const computeChartingSize = () => {
|
|
1254
444
|
if (container.current) {
|
|
1255
|
-
|
|
445
|
+
const rect = container.current.getBoundingClientRect();
|
|
1256
446
|
return {
|
|
1257
447
|
height: rect.height,
|
|
1258
448
|
width: rect.width
|
|
1259
449
|
};
|
|
1260
450
|
}
|
|
1261
|
-
|
|
1262
451
|
return {};
|
|
1263
452
|
};
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
453
|
+
const splunkTheme = useSplunkTheme_default();
|
|
454
|
+
const themeKey = props.themeKey ? props.themeKey : (0, themeUtils_exports.getChartingThemeKey)({ splunkThemeV1: splunkTheme });
|
|
455
|
+
const {
|
|
456
|
+
width,
|
|
457
|
+
height,
|
|
458
|
+
style,
|
|
459
|
+
chartData,
|
|
460
|
+
options,
|
|
461
|
+
colorPalette,
|
|
462
|
+
onClick,
|
|
463
|
+
onSelect,
|
|
464
|
+
onPointMouseOut,
|
|
465
|
+
onPointMouseOver,
|
|
466
|
+
onEventTrigger,
|
|
467
|
+
originalDataSources,
|
|
468
|
+
onDownsamplingThresholdChange,
|
|
469
|
+
xField,
|
|
470
|
+
backgroundColor,
|
|
471
|
+
defaultFontColor,
|
|
472
|
+
trellisKey
|
|
473
|
+
} = props;
|
|
474
|
+
const prevOptions = usePrevious(options);
|
|
475
|
+
const prevTimezone = usePrevious(timezone);
|
|
476
|
+
const handleClick = (chartEvent, type) => {
|
|
477
|
+
let payload = (0, lodash_exports.pick)(
|
|
478
|
+
chartEvent,
|
|
479
|
+
"name2",
|
|
480
|
+
"value2",
|
|
481
|
+
"_span",
|
|
482
|
+
"modifierKey"
|
|
483
|
+
);
|
|
1288
484
|
payload.name = payload.name2;
|
|
1289
485
|
delete payload.name2;
|
|
1290
|
-
|
|
1291
|
-
if (type === VizChartEventType.POINT_CLICK) {
|
|
486
|
+
if (type === "point.click" /* POINT_CLICK */) {
|
|
1292
487
|
payload.value = payload.value2;
|
|
1293
488
|
delete payload.value2;
|
|
1294
|
-
payload =
|
|
489
|
+
payload = updateRowPayload(chartEvent.rowContext, payload);
|
|
1295
490
|
}
|
|
1296
|
-
|
|
491
|
+
payload = appendTrellisToPayload(props, payload);
|
|
1297
492
|
onClick({
|
|
1298
|
-
type
|
|
493
|
+
type,
|
|
1299
494
|
originalEvent: chartEvent,
|
|
1300
|
-
payload
|
|
495
|
+
payload
|
|
1301
496
|
});
|
|
1302
497
|
};
|
|
1303
|
-
|
|
1304
|
-
var destroyChart = function destroyChart() {
|
|
498
|
+
const destroyChart = () => {
|
|
1305
499
|
if (chart.current) {
|
|
1306
500
|
chart.current.destroy();
|
|
1307
501
|
chart.current = null;
|
|
1308
502
|
}
|
|
1309
|
-
|
|
1310
503
|
needsRedraw.current = true;
|
|
1311
504
|
needsInit.current = true;
|
|
1312
505
|
};
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
var recalculateDownsamplingThreshold = React.useCallback(function () {
|
|
506
|
+
const enableSearchZoom = (_b = (_a = chartData == null ? void 0 : chartData.chartDataOptions) == null ? void 0 : _a.enableSearchZoom) != null ? _b : false;
|
|
507
|
+
const recalculateDownsamplingThreshold = react_exports.useCallback(() => {
|
|
1316
508
|
if (!onDownsamplingThresholdChange || !xField) {
|
|
1317
509
|
return;
|
|
1318
510
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
enableSearchZoom: enableSearchZoom,
|
|
511
|
+
const newThreshold = calculateDownsamplingThreshold({
|
|
512
|
+
enableSearchZoom,
|
|
1322
513
|
dataSources: originalDataSources,
|
|
1323
514
|
width: Number(width),
|
|
1324
515
|
selectChartEvent: selectChartEvent.current,
|
|
1325
|
-
xField
|
|
516
|
+
xField
|
|
1326
517
|
});
|
|
1327
|
-
|
|
1328
518
|
if (Number.isFinite(newThreshold)) {
|
|
1329
519
|
onDownsamplingThresholdChange(newThreshold);
|
|
1330
520
|
}
|
|
1331
521
|
}, [enableSearchZoom, originalDataSources, onDownsamplingThresholdChange, width, xField]);
|
|
1332
|
-
|
|
522
|
+
react_exports.useEffect(() => {
|
|
1333
523
|
recalculateDownsamplingThreshold();
|
|
1334
|
-
}, [recalculateDownsamplingThreshold]);
|
|
1335
|
-
|
|
1336
|
-
// Since chart drawing is debounced, there is a race condition where a stale callback may be called
|
|
1337
|
-
// if a prop changes and the event handler is called before the chart redraws. This means that
|
|
1338
|
-
// it will use the old callback rather than the newer one, which can lead to inaccurate results
|
|
1339
|
-
|
|
1340
|
-
var handleSelect = (0, useEventCallback_1.default)(function (chartEvent) {
|
|
524
|
+
}, [recalculateDownsamplingThreshold]);
|
|
525
|
+
const handleSelect = useEventCallback_default((chartEvent) => {
|
|
1341
526
|
selectChartEvent.current = chartEvent;
|
|
1342
|
-
recalculateDownsamplingThreshold();
|
|
1343
|
-
|
|
1344
|
-
|
|
527
|
+
recalculateDownsamplingThreshold();
|
|
528
|
+
const payload = appendTrellisToPayload(
|
|
529
|
+
props,
|
|
530
|
+
(0, lodash_exports.pick)(chartEvent, "startXIndex", "endXIndex", "startXValue", "endXValue")
|
|
531
|
+
);
|
|
532
|
+
if (onSelect && typeof onSelect === "function") {
|
|
1345
533
|
onSelect({
|
|
1346
|
-
type:
|
|
534
|
+
type: "range.select",
|
|
1347
535
|
originalEvent: chartEvent,
|
|
1348
|
-
payload
|
|
536
|
+
payload
|
|
1349
537
|
});
|
|
1350
538
|
return;
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
|
|
539
|
+
}
|
|
1354
540
|
onEventTrigger({
|
|
1355
|
-
type:
|
|
1356
|
-
originalEvent: chartEvent,
|
|
1357
|
-
payload: (0, lodash_1.pick)(chartEvent, 'startXIndex', 'endXIndex', 'startXValue', 'endXValue')
|
|
1358
|
-
});
|
|
1359
|
-
});
|
|
1360
|
-
var handlePointMouseOut = (0, useEventCallback_1.default)(function (chartEvent, type) {
|
|
1361
|
-
var payload = (0, lodash_1.pick)(chartEvent, 'name2', 'value2', '_span', 'modifierKey', 'tooltipContext');
|
|
1362
|
-
payload.name = payload.name2;
|
|
1363
|
-
delete payload.name2;
|
|
1364
|
-
payload.value = payload.value2;
|
|
1365
|
-
delete payload.value2;
|
|
1366
|
-
payload = (0, exports.updateRowPayload)(chartEvent.rowContext, payload);
|
|
1367
|
-
onPointMouseOut({
|
|
1368
|
-
type: type,
|
|
1369
|
-
originalEvent: chartEvent,
|
|
1370
|
-
payload: payload
|
|
1371
|
-
});
|
|
1372
|
-
});
|
|
1373
|
-
var handlePointMouseOver = (0, useEventCallback_1.default)(function (chartEvent, type) {
|
|
1374
|
-
var payload = (0, lodash_1.pick)(chartEvent, 'name2', 'value2', '_span', 'modifierKey', 'tooltipContext');
|
|
1375
|
-
payload.name = payload.name2;
|
|
1376
|
-
delete payload.name2;
|
|
1377
|
-
payload.value = payload.value2;
|
|
1378
|
-
delete payload.value2;
|
|
1379
|
-
payload = (0, exports.updateRowPayload)(chartEvent.rowContext, payload);
|
|
1380
|
-
onPointMouseOver({
|
|
1381
|
-
type: type,
|
|
541
|
+
type: "range.select",
|
|
1382
542
|
originalEvent: chartEvent,
|
|
1383
|
-
payload
|
|
543
|
+
payload
|
|
1384
544
|
});
|
|
1385
545
|
});
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
546
|
+
const handlePointMouseOut = useEventCallback_default(
|
|
547
|
+
(chartEvent, type) => {
|
|
548
|
+
let payload = (0, lodash_exports.pick)(
|
|
549
|
+
chartEvent,
|
|
550
|
+
"name2",
|
|
551
|
+
"value2",
|
|
552
|
+
"_span",
|
|
553
|
+
"modifierKey",
|
|
554
|
+
"tooltipContext"
|
|
555
|
+
);
|
|
556
|
+
payload.name = payload.name2;
|
|
557
|
+
delete payload.name2;
|
|
558
|
+
payload.value = payload.value2;
|
|
559
|
+
delete payload.value2;
|
|
560
|
+
payload = appendTrellisToPayload(props, updateRowPayload(chartEvent.rowContext, payload));
|
|
561
|
+
onPointMouseOut({
|
|
562
|
+
type,
|
|
563
|
+
originalEvent: chartEvent,
|
|
564
|
+
payload
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
const handlePointMouseOver = useEventCallback_default(
|
|
569
|
+
(chartEvent, type) => {
|
|
570
|
+
let payload = (0, lodash_exports.pick)(
|
|
571
|
+
chartEvent,
|
|
572
|
+
"name2",
|
|
573
|
+
"value2",
|
|
574
|
+
"_span",
|
|
575
|
+
"modifierKey",
|
|
576
|
+
"tooltipContext"
|
|
577
|
+
);
|
|
578
|
+
payload.name = payload.name2;
|
|
579
|
+
delete payload.name2;
|
|
580
|
+
payload.value = payload.value2;
|
|
581
|
+
delete payload.value2;
|
|
582
|
+
payload = appendTrellisToPayload(props, updateRowPayload(chartEvent.rowContext, payload));
|
|
583
|
+
onPointMouseOver({
|
|
584
|
+
type,
|
|
585
|
+
originalEvent: chartEvent,
|
|
586
|
+
payload
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
);
|
|
590
|
+
const drawChart = () => {
|
|
591
|
+
const updatedOptions = __spreadProps(__spreadValues({}, options), { shouldColorizeTooltipData: false });
|
|
592
|
+
const computedChartSize = computeChartingSize();
|
|
593
|
+
const computedWidth = computedChartSize.width;
|
|
594
|
+
const computedHeight = computedChartSize.height;
|
|
595
|
+
const serializedTimezone = timezone == null ? void 0 : timezone.serializedTimezone;
|
|
596
|
+
const ianaTimezone = timezone == null ? void 0 : timezone.ianaTimezone;
|
|
597
|
+
const utcOffset = timezone == null ? void 0 : timezone.utcOffset;
|
|
1398
598
|
if (!computedWidth || !computedHeight) {
|
|
1399
599
|
return;
|
|
1400
600
|
}
|
|
1401
|
-
|
|
1402
601
|
if (!chartData || !Object.keys(chartData).length) {
|
|
1403
602
|
return;
|
|
1404
|
-
}
|
|
1405
|
-
// when an option is removed it needs to be set to an empty string
|
|
1406
|
-
// to override the previous configuration
|
|
1407
|
-
|
|
1408
|
-
|
|
603
|
+
}
|
|
1409
604
|
if (prevOptions) {
|
|
1410
|
-
Object.keys(prevOptions).forEach(
|
|
1411
|
-
if (prevOptions[key] && updatedOptions[key] ===
|
|
1412
|
-
updatedOptions[key] =
|
|
605
|
+
Object.keys(prevOptions).forEach((key) => {
|
|
606
|
+
if (prevOptions[key] && updatedOptions[key] === void 0) {
|
|
607
|
+
updatedOptions[key] = "";
|
|
1413
608
|
}
|
|
1414
609
|
});
|
|
1415
610
|
}
|
|
1416
|
-
|
|
1417
611
|
try {
|
|
1418
612
|
if (needsInit.current) {
|
|
1419
613
|
destroyChart();
|
|
1420
|
-
|
|
1421
|
-
|
|
614
|
+
charting_bundle_default.setTheme(themeKey);
|
|
1422
615
|
if (colorPalette.length > 0) {
|
|
1423
|
-
|
|
616
|
+
charting_bundle_default.setColorPalette(colorPalette);
|
|
1424
617
|
}
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
chart.current.on('pointClick', function (e) {
|
|
1437
|
-
handleClick(e, VizChartEventType.POINT_CLICK);
|
|
618
|
+
chart.current = charting_bundle_default.createChart(container.current, __spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, updatedOptions), {
|
|
619
|
+
drilldown: "all"
|
|
620
|
+
}), typeof serializedTimezone === "string" && {
|
|
621
|
+
"time.serializedTz": serializedTimezone
|
|
622
|
+
}), typeof ianaTimezone === "string" && {
|
|
623
|
+
"time.ianaTimezone": ianaTimezone
|
|
624
|
+
}), typeof utcOffset === "number" && {
|
|
625
|
+
"time.timezoneOffset": utcOffset
|
|
626
|
+
}));
|
|
627
|
+
chart.current.on("pointClick", (e) => {
|
|
628
|
+
handleClick(e, "point.click" /* POINT_CLICK */);
|
|
1438
629
|
});
|
|
1439
|
-
chart.current.on(
|
|
1440
|
-
handlePointMouseOver(e,
|
|
630
|
+
chart.current.on("pointMouseOver", (e) => {
|
|
631
|
+
handlePointMouseOver(e, "point.mouseover" /* POINT_MOUSE_OVER */);
|
|
1441
632
|
});
|
|
1442
|
-
chart.current.on(
|
|
1443
|
-
handlePointMouseOut(e,
|
|
633
|
+
chart.current.on("pointMouseOut", (e) => {
|
|
634
|
+
handlePointMouseOut(e, "point.mouseout" /* POINT_MOUSE_OUT */);
|
|
1444
635
|
});
|
|
1445
|
-
chart.current.on(
|
|
1446
|
-
handleClick(e,
|
|
636
|
+
chart.current.on("legendClick", (e) => {
|
|
637
|
+
handleClick(e, "legend.click" /* LEGEND_CLICK */);
|
|
1447
638
|
});
|
|
1448
|
-
chart.current.on(
|
|
639
|
+
chart.current.on("chartRangeSelect", handleSelect);
|
|
1449
640
|
}
|
|
1450
|
-
|
|
1451
641
|
if (needsRedraw.current) {
|
|
1452
|
-
|
|
1453
|
-
|
|
642
|
+
charting_bundle_default.setTheme(themeKey);
|
|
1454
643
|
if (colorPalette.length > 0) {
|
|
1455
|
-
|
|
644
|
+
charting_bundle_default.setColorPalette(colorPalette);
|
|
1456
645
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
646
|
+
const payload = appendTrellisToPayload(props, {
|
|
647
|
+
width,
|
|
648
|
+
height,
|
|
649
|
+
currentTime: (/* @__PURE__ */ new Date()).getTime()
|
|
650
|
+
});
|
|
651
|
+
chart.current.prepareAndDraw(chartData, updatedOptions, () => {
|
|
1459
652
|
onEventTrigger({
|
|
1460
|
-
type:
|
|
1461
|
-
payload
|
|
1462
|
-
width: width,
|
|
1463
|
-
height: height,
|
|
1464
|
-
currentTime: new Date().getTime()
|
|
1465
|
-
}
|
|
653
|
+
type: "viz.renderedWithData",
|
|
654
|
+
payload
|
|
1466
655
|
});
|
|
1467
656
|
});
|
|
1468
657
|
}
|
|
1469
|
-
|
|
1470
658
|
if (chart.current) {
|
|
1471
659
|
if (Math.round(chart.current.height) !== Math.round(computedHeight) || Math.round(chart.current.width) !== Math.round(computedWidth)) {
|
|
1472
660
|
chart.current.resize(computedWidth, computedHeight);
|
|
1473
661
|
}
|
|
1474
662
|
}
|
|
1475
|
-
|
|
1476
663
|
needsInit.current = false;
|
|
1477
664
|
needsRedraw.current = false;
|
|
1478
665
|
} catch (e) {
|
|
1479
|
-
window.console.error(
|
|
666
|
+
window.console.error("Caught error rendering chart:", e);
|
|
1480
667
|
}
|
|
1481
668
|
};
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
var onContainerMount = function onContainerMount(chartingContainer) {
|
|
669
|
+
const debouncedDrawChart = (0, lodash_exports.debounce)(drawChart, 5);
|
|
670
|
+
const onContainerMount = (chartingContainer) => {
|
|
1486
671
|
container.current = chartingContainer;
|
|
1487
672
|
debouncedDrawChart();
|
|
1488
673
|
};
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
(0, react_1.useEffect)(function () {
|
|
674
|
+
const prevTheme = usePrevious(themeKey);
|
|
675
|
+
const prevOnClick = usePrevious(onClick);
|
|
676
|
+
(0, react_exports.useEffect)(() => {
|
|
1493
677
|
debouncedDrawChart();
|
|
1494
678
|
props.visualizationApiRef(api.current);
|
|
1495
|
-
return
|
|
679
|
+
return () => {
|
|
1496
680
|
props.visualizationApiRef(null);
|
|
1497
681
|
destroyChart();
|
|
1498
682
|
};
|
|
1499
683
|
}, []);
|
|
1500
|
-
(0,
|
|
1501
|
-
|
|
1502
|
-
// seems like redraw doesn't suffice to update the background colors
|
|
1503
|
-
if (!chart.current || !(0, exports.canUpdateInPlace)(prevOptions, options) || // timezone is a simple object so this comparison should be fast
|
|
684
|
+
(0, react_exports.useEffect)(() => {
|
|
685
|
+
if (!chart.current || !canUpdateInPlace(prevOptions, options) || // timezone is a simple object so this comparison should be fast
|
|
1504
686
|
JSON.stringify(prevTimezone) !== JSON.stringify(timezone) || !props.themeKey && prevTheme !== themeKey || prevOnClick !== onClick) {
|
|
1505
687
|
needsInit.current = true;
|
|
1506
|
-
}
|
|
1507
|
-
// otherwise a noop would occur if the onContainerMount drawChart is re-invoked when dimensions change
|
|
1508
|
-
|
|
1509
|
-
|
|
688
|
+
}
|
|
1510
689
|
needsRedraw.current = true;
|
|
1511
690
|
drawChart();
|
|
1512
|
-
}, [
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
691
|
+
}, [
|
|
692
|
+
JSON.stringify(options),
|
|
693
|
+
JSON.stringify(chartData.toJSON()),
|
|
694
|
+
JSON.stringify(chartData.annotations),
|
|
695
|
+
timezone == null ? void 0 : timezone.ianaTimezone,
|
|
696
|
+
timezone == null ? void 0 : timezone.utcOffset,
|
|
697
|
+
timezone == null ? void 0 : timezone.serializedTimezone,
|
|
698
|
+
themeKey,
|
|
699
|
+
onClick
|
|
700
|
+
]);
|
|
701
|
+
return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
|
|
702
|
+
TrellisTitle,
|
|
703
|
+
{
|
|
704
|
+
trellisKey,
|
|
705
|
+
backgroundColor,
|
|
706
|
+
fontColor: defaultFontColor
|
|
707
|
+
}
|
|
708
|
+
), /* @__PURE__ */ react_exports.createElement(
|
|
709
|
+
ChartingContainer,
|
|
710
|
+
{
|
|
711
|
+
style,
|
|
712
|
+
ref: onContainerMount,
|
|
713
|
+
width,
|
|
714
|
+
height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height
|
|
715
|
+
},
|
|
716
|
+
/* @__PURE__ */ react_exports.createElement(react_event_listener_default, { target: window, onResize: debouncedDrawChart })
|
|
717
|
+
));
|
|
1522
718
|
};
|
|
1523
|
-
|
|
1524
719
|
var defaultProps = {
|
|
1525
|
-
width:
|
|
720
|
+
width: "100%",
|
|
1526
721
|
height: 250,
|
|
1527
722
|
options: {},
|
|
1528
723
|
style: {},
|
|
1529
724
|
// todo: need remove it
|
|
1530
|
-
onEventTrigger:
|
|
1531
|
-
onClick:
|
|
1532
|
-
onSelect:
|
|
1533
|
-
onPointMouseOver:
|
|
1534
|
-
onPointMouseOut:
|
|
1535
|
-
colorPalette:
|
|
1536
|
-
visualizationApiRef:
|
|
725
|
+
onEventTrigger: lodash_exports.noop,
|
|
726
|
+
onClick: lodash_exports.noop,
|
|
727
|
+
onSelect: lodash_exports.noop,
|
|
728
|
+
onPointMouseOver: lodash_exports.noop,
|
|
729
|
+
onPointMouseOut: lodash_exports.noop,
|
|
730
|
+
colorPalette: visualization_color_palettes_exports.VIZ_CATEGORICAL,
|
|
731
|
+
visualizationApiRef: lodash_exports.noop,
|
|
1537
732
|
chartData: null,
|
|
1538
733
|
themeKey: null,
|
|
1539
734
|
onDownsamplingThresholdChange: null,
|
|
1540
735
|
originalDataSources: null,
|
|
1541
736
|
xField: null,
|
|
1542
|
-
y2Fields: []
|
|
737
|
+
y2Fields: [],
|
|
738
|
+
splitByLayout: void 0,
|
|
739
|
+
trellisKey: void 0,
|
|
740
|
+
trellisSplitBy: void 0,
|
|
741
|
+
backgroundColor: "",
|
|
742
|
+
defaultFontColor: ""
|
|
1543
743
|
};
|
|
1544
744
|
Charting.propTypes = propTypes;
|
|
1545
|
-
Charting.defaultProps = defaultProps;
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
});
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
if (chartData && !Object.keys(chartData).length) {
|
|
1559
|
-
return React.createElement(Message_1.default, {
|
|
1560
|
-
message: (0, i18n_1._)('No Result'),
|
|
1561
|
-
level: "info"
|
|
1562
|
-
});
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
return React.createElement(Chart, Object.assign({}, props));
|
|
1566
|
-
};
|
|
1567
|
-
|
|
1568
|
-
Wrapper.displayName = 'ChartingWrapper';
|
|
1569
|
-
Wrapper.propTypes = propTypes;
|
|
1570
|
-
Wrapper.defaultProps = defaultProps;
|
|
1571
|
-
return Wrapper;
|
|
1572
|
-
}; // export default Charting;
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
exports.default = withEmptyChartMessage(Charting);
|
|
1576
|
-
|
|
1577
|
-
/***/ }),
|
|
1578
|
-
/* 74 */
|
|
1579
|
-
/***/ (function(module, exports) {
|
|
1580
|
-
|
|
1581
|
-
module.exports = require("@splunk/visualization-color-palettes");
|
|
1582
|
-
|
|
1583
|
-
/***/ }),
|
|
1584
|
-
/* 75 */
|
|
1585
|
-
/***/ (function(module, exports) {
|
|
1586
|
-
|
|
1587
|
-
module.exports = require("react-event-listener");
|
|
1588
|
-
|
|
1589
|
-
/***/ }),
|
|
1590
|
-
/* 76 */
|
|
1591
|
-
/***/ (function(module, exports) {
|
|
1592
|
-
|
|
1593
|
-
module.exports = require("@splunk/visualizations-shared/i18n");
|
|
1594
|
-
|
|
1595
|
-
/***/ }),
|
|
1596
|
-
/* 77 */
|
|
1597
|
-
/***/ (function(module, exports) {
|
|
1598
|
-
|
|
1599
|
-
module.exports = require("@splunk/charting-bundle");
|
|
1600
|
-
|
|
1601
|
-
/***/ }),
|
|
1602
|
-
/* 78 */
|
|
1603
|
-
/***/ (function(module, exports) {
|
|
1604
|
-
|
|
1605
|
-
module.exports = require("@splunk/themes/useSplunkTheme");
|
|
1606
|
-
|
|
1607
|
-
/***/ }),
|
|
1608
|
-
/* 79 */
|
|
1609
|
-
/***/ (function(module, exports) {
|
|
1610
|
-
|
|
1611
|
-
module.exports = require("@splunk/visualizations-shared/themeUtils");
|
|
1612
|
-
|
|
1613
|
-
/***/ }),
|
|
1614
|
-
/* 80 */
|
|
1615
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1616
|
-
|
|
1617
|
-
"use strict";
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1621
|
-
value: true
|
|
1622
|
-
});
|
|
1623
|
-
|
|
1624
|
-
var react_1 = __webpack_require__(0);
|
|
1625
|
-
|
|
1626
|
-
var useEventCallback = function useEventCallback(fn) {
|
|
1627
|
-
var ref = (0, react_1.useRef)(fn);
|
|
1628
|
-
(0, react_1.useLayoutEffect)(function () {
|
|
1629
|
-
ref.current = fn;
|
|
1630
|
-
});
|
|
1631
|
-
return (0, react_1.useCallback)(function () {
|
|
1632
|
-
return ref.current.apply(ref, arguments);
|
|
1633
|
-
}, []);
|
|
745
|
+
Charting.defaultProps = defaultProps;
|
|
746
|
+
var ChartingWrapper = (props) => {
|
|
747
|
+
const { chartData } = props;
|
|
748
|
+
if (!chartData) {
|
|
749
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No DataSource"), level: "warning" });
|
|
750
|
+
}
|
|
751
|
+
if (!Object.keys(chartData).length) {
|
|
752
|
+
return /* @__PURE__ */ react_exports.createElement(Message_default, { message: (0, i18n_exports._)("No Result"), level: "info" });
|
|
753
|
+
}
|
|
754
|
+
return /* @__PURE__ */ react_exports.createElement(Charting, __spreadValues({}, props));
|
|
1634
755
|
};
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
/******/ ]);
|
|
1640
|
-
//# sourceMappingURL=Charting.js.map
|
|
756
|
+
ChartingWrapper.propTypes = propTypes;
|
|
757
|
+
ChartingWrapper.defaultProps = defaultProps;
|
|
758
|
+
var Charting_default = ChartingWrapper;
|
|
759
|
+
//# sourceMappingURL=Charting.js.map
|