@splunk/visualizations 26.4.1 → 27.0.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 +1262 -1600
- package/Area.config.js.map +7 -1
- package/Area.js +3002 -4930
- package/Area.js.map +7 -1
- package/Bar.config.js +1247 -1574
- package/Bar.config.js.map +7 -1
- package/Bar.js +2921 -4843
- package/Bar.js.map +7 -1
- package/Bubble.config.js +896 -1213
- package/Bubble.config.js.map +7 -1
- package/Bubble.js +2517 -4483
- package/Bubble.js.map +7 -1
- package/ChoroplethSvg.config.js +282 -582
- package/ChoroplethSvg.config.js.map +7 -1
- package/ChoroplethSvg.js +2004 -3810
- package/ChoroplethSvg.js.map +7 -1
- package/Column.config.js +1208 -1541
- package/Column.config.js.map +7 -1
- package/Column.js +2930 -4886
- package/Column.js.map +7 -1
- package/Ellipse.config.js +443 -774
- package/Ellipse.config.js.map +7 -1
- package/Ellipse.js +1651 -3341
- package/Ellipse.js.map +7 -1
- package/Events.config.js +207 -492
- package/Events.config.js.map +7 -1
- package/Events.js +2615 -4649
- package/Events.js.map +7 -1
- package/FillerGauge.config.js +420 -775
- package/FillerGauge.config.js.map +7 -1
- package/FillerGauge.js +2137 -4578
- package/FillerGauge.js.map +7 -1
- package/Image.config.js +144 -411
- package/Image.config.js.map +7 -1
- package/Image.js +1395 -3048
- package/Image.js.map +7 -1
- package/Line.config.js +1278 -1625
- package/Line.config.js.map +7 -1
- package/Line.js +2954 -4926
- package/Line.js.map +7 -1
- package/LinkGraph.config.js +390 -632
- package/LinkGraph.config.js.map +7 -1
- package/LinkGraph.js +5243 -6190
- 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 +3369 -5676
- package/Map.js.map +7 -1
- package/Markdown.config.js +232 -528
- package/Markdown.config.js.map +7 -1
- package/Markdown.js +1645 -3216
- package/Markdown.js.map +7 -1
- package/MarkerGauge.config.js +308 -613
- package/MarkerGauge.config.js.map +7 -1
- package/MarkerGauge.js +2189 -4535
- package/MarkerGauge.js.map +7 -1
- package/ParallelCoordinates.config.js +282 -581
- package/ParallelCoordinates.config.js.map +7 -1
- package/ParallelCoordinates.js +2023 -4720
- package/ParallelCoordinates.js.map +7 -1
- package/Pie.config.js +278 -547
- package/Pie.config.js.map +7 -1
- package/Pie.js +1996 -3990
- package/Pie.js.map +7 -1
- package/Punchcard.config.js +291 -578
- package/Punchcard.config.js.map +7 -1
- package/Punchcard.js +2709 -5042
- package/Punchcard.js.map +7 -1
- package/Rectangle.config.js +455 -770
- package/Rectangle.config.js.map +7 -1
- package/Rectangle.js +1638 -3262
- package/Rectangle.js.map +7 -1
- package/Sankey.config.js +291 -626
- package/Sankey.config.js.map +7 -1
- package/Sankey.js +2737 -4909
- package/Sankey.js.map +7 -1
- package/Scatter.config.js +876 -1194
- package/Scatter.config.js.map +7 -1
- package/Scatter.js +2529 -4477
- package/Scatter.js.map +7 -1
- package/SingleValue.config.js +819 -1251
- package/SingleValue.config.js.map +7 -1
- package/SingleValue.js +4203 -7413
- package/SingleValue.js.map +7 -1
- package/SingleValueBasic.js +382 -1527
- package/SingleValueBasic.js.map +7 -1
- package/SingleValueIcon.config.js +781 -1207
- package/SingleValueIcon.config.js.map +7 -1
- package/SingleValueIcon.js +3350 -6285
- package/SingleValueIcon.js.map +7 -1
- package/SingleValueRadial.config.js +708 -1119
- package/SingleValueRadial.config.js.map +7 -1
- package/SingleValueRadial.js +3808 -6965
- package/SingleValueRadial.js.map +7 -1
- package/SparkLine.js +439 -746
- package/SparkLine.js.map +7 -1
- package/Table.config.js +565 -879
- package/Table.config.js.map +7 -1
- package/Table.js +3277 -5381
- package/Table.js.map +7 -1
- package/common/Charting.js +481 -1468
- 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 +347 -912
- 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 +462 -1010
- 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 +237 -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 +1168 -2438
- package/common/withDashboardViz.js.map +7 -1
- package/package.json +52 -43
|
@@ -1,944 +1,349 @@
|
|
|
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
|
-
/******/ // mode & 1: value is a module id, require it
|
|
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 = 15);
|
|
91
|
-
/******/ })
|
|
92
|
-
/************************************************************************/
|
|
93
|
-
/******/ ([
|
|
94
|
-
/* 0 */,
|
|
95
|
-
/* 1 */
|
|
96
|
-
/***/ (function(module, exports) {
|
|
97
|
-
|
|
98
|
-
module.exports = require("@splunk/visualizations-shared/numberUtils");
|
|
99
|
-
|
|
100
|
-
/***/ }),
|
|
101
|
-
/* 2 */,
|
|
102
|
-
/* 3 */,
|
|
103
|
-
/* 4 */,
|
|
104
|
-
/* 5 */,
|
|
105
|
-
/* 6 */,
|
|
106
|
-
/* 7 */,
|
|
107
|
-
/* 8 */,
|
|
108
|
-
/* 9 */,
|
|
109
|
-
/* 10 */,
|
|
110
|
-
/* 11 */,
|
|
111
|
-
/* 12 */,
|
|
112
|
-
/* 13 */,
|
|
113
|
-
/* 14 */,
|
|
114
|
-
/* 15 */
|
|
115
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
116
|
-
|
|
117
|
-
"use strict";
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Object.defineProperty(exports, "__esModule", {
|
|
121
|
-
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/utils/dataUtils.ts
|
|
51
|
+
var dataUtils_exports = {};
|
|
52
|
+
__export(dataUtils_exports, {
|
|
53
|
+
calculateDownsamplingThreshold: () => calculateDownsamplingThreshold,
|
|
54
|
+
calculateThresholdOnRangeSelect: () => calculateThresholdOnRangeSelect,
|
|
55
|
+
convertToArrOfObjects: () => convertToArrOfObjects,
|
|
56
|
+
downsampleDataSources: () => downsampleDataSources,
|
|
57
|
+
isDownsamplingEnabledForViz: () => isDownsamplingEnabledForViz
|
|
122
58
|
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var numberUtils_1 = __webpack_require__(1);
|
|
126
|
-
|
|
127
|
-
var interfaces_1 = __webpack_require__(16); // TODO: utilize this fn in ParallelCoordinates
|
|
59
|
+
module.exports = __toCommonJS(dataUtils_exports);
|
|
128
60
|
|
|
61
|
+
// esm-externals:@splunk/visualizations-shared/numberUtils
|
|
62
|
+
var numberUtils_exports = {};
|
|
63
|
+
__export(numberUtils_exports, {
|
|
64
|
+
default: () => numberUtils_default
|
|
65
|
+
});
|
|
66
|
+
var defaultImport = __toESM(require("@splunk/visualizations-shared/numberUtils"));
|
|
67
|
+
__reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUtils"));
|
|
68
|
+
var numberUtils_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
129
69
|
|
|
130
|
-
|
|
70
|
+
// src/common/utils/dataUtils.ts
|
|
71
|
+
var convertToArrOfObjects = (columns, fields) => {
|
|
131
72
|
if (!columns || !columns[0] || !columns[0].length) return [];
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (columns[index][i] === '') {
|
|
73
|
+
const data = [];
|
|
74
|
+
for (let i = 0; i < columns[0].length; i += 1) {
|
|
75
|
+
const newObj = {};
|
|
76
|
+
fields.forEach((field, index) => {
|
|
77
|
+
const fieldName = typeof field === "string" ? field : field.name;
|
|
78
|
+
if (columns[index][i] === "") {
|
|
140
79
|
newObj[fieldName] = null;
|
|
141
80
|
} else {
|
|
142
81
|
newObj[fieldName] = columns[index][i];
|
|
143
82
|
}
|
|
144
83
|
});
|
|
145
84
|
data.push(newObj);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
for (var i = 0; i < columns[0].length; i += 1) {
|
|
149
|
-
_loop(i);
|
|
150
85
|
}
|
|
151
|
-
|
|
152
86
|
return data;
|
|
153
87
|
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
// Copied from https://github.com/sveinn-steinarsson/flot-downsample/blob/0815010016fc94b1bbc6a010afb8aad13ada6d0d/jquery.flot.downsample.js
|
|
158
|
-
// Modifications include:
|
|
159
|
-
// 1) Convert to modern JavaScript(use const, let, and use array.push to push to last element of array)
|
|
160
|
-
// 2) Convert to camel case
|
|
161
|
-
// 3) Convert to TS and also return the indices of the points that are in the downsampled result.
|
|
162
|
-
// 4) Add a new parameter preferredDownsampleIndices that correspond to the indices of points
|
|
163
|
-
// that should be used in case of a tie of the max area in a bucket
|
|
164
|
-
|
|
165
|
-
var largestTriangleThreeBuckets = function largestTriangleThreeBuckets(data, threshold, preferredDownsampleIndices) {
|
|
166
|
-
var dataLength = data.length;
|
|
167
|
-
var downsampledIndices = [];
|
|
168
|
-
|
|
88
|
+
var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
|
|
89
|
+
const dataLength = data.length;
|
|
90
|
+
const downsampledIndices = [];
|
|
169
91
|
if (threshold >= dataLength || threshold === 0) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
});
|
|
173
|
-
return {
|
|
174
|
-
downsampledData: data,
|
|
175
|
-
downsampledIndices: allIndices
|
|
176
|
-
}; // Nothing to do
|
|
92
|
+
const allIndices = data.map((values, index) => index);
|
|
93
|
+
return { downsampledData: data, downsampledIndices: allIndices };
|
|
177
94
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
for (var i = 0; i < threshold - 2; i++) {
|
|
194
|
-
// Calculate point average for next bucket (containing c)
|
|
195
|
-
var avgX = 0;
|
|
196
|
-
var avgY = 0;
|
|
197
|
-
var avgRangeStart = Math.floor((i + 1) * every) + 1;
|
|
198
|
-
var avgRangeEnd = Math.floor((i + 2) * every) + 1;
|
|
95
|
+
const sampled = [];
|
|
96
|
+
let sampledIndex = 0;
|
|
97
|
+
const every = (dataLength - 2) / (threshold - 2);
|
|
98
|
+
let a = 0;
|
|
99
|
+
let maxAreaPoint;
|
|
100
|
+
let maxArea;
|
|
101
|
+
let area;
|
|
102
|
+
let nextA;
|
|
103
|
+
sampled.push(data[a]);
|
|
104
|
+
downsampledIndices.push(0);
|
|
105
|
+
for (let i = 0; i < threshold - 2; i++) {
|
|
106
|
+
let avgX = 0;
|
|
107
|
+
let avgY = 0;
|
|
108
|
+
let avgRangeStart = Math.floor((i + 1) * every) + 1;
|
|
109
|
+
let avgRangeEnd = Math.floor((i + 2) * every) + 1;
|
|
199
110
|
avgRangeEnd = avgRangeEnd < dataLength ? avgRangeEnd : dataLength;
|
|
200
|
-
|
|
201
|
-
|
|
111
|
+
const avgRangeLength = avgRangeEnd - avgRangeStart;
|
|
202
112
|
for (; avgRangeStart < avgRangeEnd; avgRangeStart++) {
|
|
203
|
-
avgX += Number(data[avgRangeStart][0]);
|
|
204
|
-
|
|
113
|
+
avgX += Number(data[avgRangeStart][0]);
|
|
205
114
|
avgY += data[avgRangeStart][1] * 1;
|
|
206
115
|
}
|
|
207
|
-
|
|
208
116
|
avgX /= avgRangeLength;
|
|
209
|
-
avgY /= avgRangeLength;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var pointAX = Number(data[a][0]); // Enforce Number (value may be Date)
|
|
215
|
-
|
|
216
|
-
var pointAY = data[a][1] * 1; // eslint-disable-next-line no-multi-assign
|
|
217
|
-
|
|
117
|
+
avgY /= avgRangeLength;
|
|
118
|
+
let rangeOffs = Math.floor((i + 0) * every) + 1;
|
|
119
|
+
const rangeTo = Math.floor((i + 1) * every) + 1;
|
|
120
|
+
const pointAX = Number(data[a][0]);
|
|
121
|
+
const pointAY = data[a][1] * 1;
|
|
218
122
|
maxArea = area = -1;
|
|
219
|
-
|
|
220
|
-
|
|
123
|
+
let maxAreaIndex = rangeOffs;
|
|
221
124
|
for (; rangeOffs < rangeTo; rangeOffs++) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
// that also existed from another series so we don't add another point unnecessarily.
|
|
226
|
-
// By default LTTB picks the leftmost point in the bucket
|
|
227
|
-
|
|
125
|
+
area = Math.abs(
|
|
126
|
+
(pointAX - avgX) * (data[rangeOffs][1] - pointAY) - (pointAX - Number(data[rangeOffs][0])) * (avgY - pointAY)
|
|
127
|
+
) * 0.5;
|
|
228
128
|
if (area > maxArea || area === maxArea && preferredDownsampleIndices.has(rangeOffs)) {
|
|
229
129
|
maxArea = area;
|
|
230
130
|
maxAreaPoint = data[rangeOffs];
|
|
231
|
-
nextA = rangeOffs;
|
|
232
|
-
// Modification: save the index of the point with the most area
|
|
233
|
-
|
|
131
|
+
nextA = rangeOffs;
|
|
234
132
|
maxAreaIndex = rangeOffs;
|
|
235
133
|
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
sampled[sampledIndex++] = maxAreaPoint; // Pick this point from the bucket
|
|
240
|
-
|
|
134
|
+
}
|
|
135
|
+
sampled[sampledIndex++] = maxAreaPoint;
|
|
241
136
|
downsampledIndices.push(maxAreaIndex);
|
|
242
|
-
a = nextA;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
sampled[sampledIndex++] = data[dataLength - 1]; // Always add last
|
|
247
|
-
|
|
137
|
+
a = nextA;
|
|
138
|
+
}
|
|
139
|
+
sampled[sampledIndex++] = data[dataLength - 1];
|
|
248
140
|
downsampledIndices.push(dataLength - 1);
|
|
249
|
-
return {
|
|
250
|
-
downsampledData: sampled,
|
|
251
|
-
downsampledIndices: downsampledIndices
|
|
252
|
-
};
|
|
141
|
+
return { downsampledData: sampled, downsampledIndices };
|
|
253
142
|
};
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
// Number() does not support and also allows loose coercion of hex numbers (but not other formats)
|
|
265
|
-
// We want to identify columns which contain at least one value that can be loosely coerced
|
|
266
|
-
|
|
267
|
-
var canLooselyCoerceSomeValues = column.findIndex(function (value) {
|
|
268
|
-
return (0, numberUtils_1.startsWithNumber)("".concat(value)) || isNullCoercionEnabled && value === null;
|
|
269
|
-
}) >= 0; // If not all values in column can be strictly coerced to a number, we do not downsample
|
|
270
|
-
|
|
271
|
-
var coercedColumn = [];
|
|
272
|
-
var canDownsampleColumn = !column.some(function (value) {
|
|
273
|
-
var coercedValue = Number(value);
|
|
274
|
-
var coerceValueToZero = isNullCoercionEnabled && value === null; // if it can't be parsed or isn't safe, fail
|
|
275
|
-
|
|
276
|
-
if (Number.isNaN(coercedValue) || coercedValue <= Number.MIN_SAFE_INTEGER || coercedValue >= Number.MAX_SAFE_INTEGER || typeof value !== 'string' && typeof value !== 'number' && !coerceValueToZero) {
|
|
143
|
+
var strictlyCoerceYColumn = (column, options) => {
|
|
144
|
+
const isNullCoercionEnabled = options.nullValueDisplay === "zero";
|
|
145
|
+
const canLooselyCoerceSomeValues = column.findIndex(
|
|
146
|
+
(value) => (0, numberUtils_exports.startsWithNumber)(`${value}`) || isNullCoercionEnabled && value === null
|
|
147
|
+
) >= 0;
|
|
148
|
+
const coercedColumn = [];
|
|
149
|
+
const canDownsampleColumn = !column.some((value) => {
|
|
150
|
+
const coercedValue = Number(value);
|
|
151
|
+
const coerceValueToZero = isNullCoercionEnabled && value === null;
|
|
152
|
+
if (Number.isNaN(coercedValue) || coercedValue <= Number.MIN_SAFE_INTEGER || coercedValue >= Number.MAX_SAFE_INTEGER || typeof value !== "string" && typeof value !== "number" && !coerceValueToZero) {
|
|
277
153
|
return true;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
154
|
+
}
|
|
281
155
|
coercedColumn.push(coercedValue);
|
|
282
156
|
return false;
|
|
283
157
|
});
|
|
284
158
|
return {
|
|
285
|
-
canDownsampleColumn
|
|
286
|
-
canLooselyCoerceSomeValues
|
|
159
|
+
canDownsampleColumn,
|
|
160
|
+
canLooselyCoerceSomeValues,
|
|
287
161
|
coercedColumn: canDownsampleColumn ? coercedColumn : []
|
|
288
162
|
};
|
|
289
163
|
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
* If the column is not eligible for downsampling, returns an empty array.
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
var strictlyCoerceXColumn = function strictlyCoerceXColumn(column, fieldType) {
|
|
298
|
-
if (fieldType === 'number') {
|
|
299
|
-
var coercedXColumn = column.map(function (xValue) {
|
|
300
|
-
return Number(xValue);
|
|
301
|
-
});
|
|
302
|
-
|
|
164
|
+
var strictlyCoerceXColumn = (column, fieldType) => {
|
|
165
|
+
if (fieldType === "number") {
|
|
166
|
+
const coercedXColumn = column.map((xValue) => Number(xValue));
|
|
303
167
|
if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {
|
|
304
168
|
return coercedXColumn;
|
|
305
169
|
}
|
|
306
|
-
} else if (fieldType ===
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
if (isColumnStrictlyIncreasing(_coercedXColumn, fieldType)) {
|
|
312
|
-
return _coercedXColumn;
|
|
170
|
+
} else if (fieldType === "time") {
|
|
171
|
+
const coercedXColumn = column.map((xValue) => new Date(xValue));
|
|
172
|
+
if (isColumnStrictlyIncreasing(coercedXColumn, fieldType)) {
|
|
173
|
+
return coercedXColumn;
|
|
313
174
|
}
|
|
314
175
|
}
|
|
315
|
-
|
|
316
176
|
return [];
|
|
317
177
|
};
|
|
318
|
-
|
|
319
|
-
var isDownsamplingEnabledForViz = function isDownsamplingEnabledForViz(_ref) {
|
|
320
|
-
var vizConfig = _ref.vizConfig;
|
|
321
|
-
|
|
178
|
+
var isDownsamplingEnabledForViz = ({ vizConfig }) => {
|
|
322
179
|
var _a;
|
|
323
|
-
|
|
324
|
-
return (_a = vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(interfaces_1.VizBehavior.DOWNSAMPLING);
|
|
180
|
+
return (_a = vizConfig.supports) == null ? void 0 : _a.includes("downsampling" /* DOWNSAMPLING */);
|
|
325
181
|
};
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
dataSources = _ref2.dataSources,
|
|
333
|
-
width = _ref2.width;
|
|
334
|
-
|
|
182
|
+
var calculateThresholdOnRangeSelect = ({
|
|
183
|
+
firstIndex,
|
|
184
|
+
lastIndex,
|
|
185
|
+
dataSources,
|
|
186
|
+
width
|
|
187
|
+
}) => {
|
|
335
188
|
var _a, _b, _c;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
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;
|
|
189
|
+
const window = lastIndex - firstIndex + 1;
|
|
190
|
+
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) / window) * 10) / 10;
|
|
339
191
|
return Math.round(ratio * Number(width));
|
|
340
192
|
};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
* 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
|
|
349
|
-
* in for a categorical chart.
|
|
350
|
-
*/
|
|
351
|
-
|
|
352
|
-
var calculateDownsamplingThreshold = function calculateDownsamplingThreshold(_ref3) {
|
|
353
|
-
var enableSearchZoom = _ref3.enableSearchZoom,
|
|
354
|
-
dataSources = _ref3.dataSources,
|
|
355
|
-
selectChartEvent = _ref3.selectChartEvent,
|
|
356
|
-
width = _ref3.width,
|
|
357
|
-
xField = _ref3.xField;
|
|
358
|
-
|
|
193
|
+
var calculateDownsamplingThreshold = ({
|
|
194
|
+
enableSearchZoom,
|
|
195
|
+
dataSources,
|
|
196
|
+
selectChartEvent,
|
|
197
|
+
width,
|
|
198
|
+
xField
|
|
199
|
+
}) => {
|
|
359
200
|
var _a, _b, _c;
|
|
360
|
-
|
|
361
201
|
if (enableSearchZoom || !selectChartEvent) {
|
|
362
202
|
return Number(width);
|
|
363
203
|
}
|
|
364
|
-
|
|
365
|
-
var primaryDataSource = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary;
|
|
366
|
-
|
|
204
|
+
const primaryDataSource = dataSources == null ? void 0 : dataSources.primary;
|
|
367
205
|
if (!primaryDataSource) {
|
|
368
206
|
return null;
|
|
369
207
|
}
|
|
370
|
-
|
|
371
|
-
var startXIndex = selectChartEvent.startXIndex,
|
|
372
|
-
endXIndex = selectChartEvent.endXIndex,
|
|
373
|
-
currentTarget = selectChartEvent.currentTarget;
|
|
374
|
-
|
|
208
|
+
const { startXIndex, endXIndex, currentTarget } = selectChartEvent;
|
|
375
209
|
try {
|
|
376
|
-
|
|
210
|
+
const xFieldIndex = (_a = primaryDataSource == null ? void 0 : primaryDataSource.data) == null ? void 0 : _a.fields.findIndex((field) => {
|
|
377
211
|
return field.name === xField;
|
|
378
212
|
});
|
|
379
|
-
|
|
380
|
-
return field === xField;
|
|
381
|
-
});
|
|
382
|
-
|
|
213
|
+
const downsampledXFieldIndex = (_b = currentTarget.dataSet) == null ? void 0 : _b.fields.findIndex((field) => field === xField);
|
|
383
214
|
if (xFieldIndex === -1 || downsampledXFieldIndex === -1) {
|
|
384
215
|
return null;
|
|
385
216
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
var firstIndex = fullSeries.findIndex(function (x) {
|
|
217
|
+
const fullSeries = (_c = primaryDataSource == null ? void 0 : primaryDataSource.data) == null ? void 0 : _c.columns[xFieldIndex];
|
|
218
|
+
const downsampledSeries = currentTarget.dataSet.seriesList[downsampledXFieldIndex];
|
|
219
|
+
const firstIndex = fullSeries.findIndex((x) => {
|
|
390
220
|
return downsampledSeries[startXIndex] === x;
|
|
391
221
|
});
|
|
392
|
-
|
|
222
|
+
const lastIndex = fullSeries.findIndex((x) => {
|
|
393
223
|
return downsampledSeries[endXIndex] === x;
|
|
394
224
|
});
|
|
395
|
-
|
|
396
225
|
if (firstIndex >= 0 && lastIndex >= 0 && firstIndex <= lastIndex) {
|
|
397
|
-
return
|
|
398
|
-
firstIndex
|
|
399
|
-
lastIndex
|
|
400
|
-
dataSources
|
|
401
|
-
width
|
|
226
|
+
return calculateThresholdOnRangeSelect({
|
|
227
|
+
firstIndex,
|
|
228
|
+
lastIndex,
|
|
229
|
+
dataSources,
|
|
230
|
+
width
|
|
402
231
|
});
|
|
403
232
|
}
|
|
404
233
|
} catch (e) {
|
|
405
|
-
|
|
406
|
-
console.error('Error occurred while setting downsample threshold on range select event', e);
|
|
234
|
+
console.error("Error occurred while setting downsample threshold on range select event", e);
|
|
407
235
|
}
|
|
408
|
-
|
|
409
236
|
return null;
|
|
410
237
|
};
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
var isColumnStrictlyIncreasing = function isColumnStrictlyIncreasing(column, fieldType) {
|
|
415
|
-
return column.every(function (value, index) {
|
|
416
|
-
if (fieldType === 'number') {
|
|
238
|
+
var isColumnStrictlyIncreasing = (column, fieldType) => {
|
|
239
|
+
return column.every((value, index) => {
|
|
240
|
+
if (fieldType === "number") {
|
|
417
241
|
if (Number.isNaN(value)) {
|
|
418
242
|
return false;
|
|
419
243
|
}
|
|
420
244
|
}
|
|
421
|
-
|
|
422
|
-
if (fieldType === 'time') {
|
|
245
|
+
if (fieldType === "time") {
|
|
423
246
|
if (Number.isNaN(value.getTime())) {
|
|
424
247
|
return false;
|
|
425
248
|
}
|
|
426
249
|
}
|
|
427
|
-
|
|
428
250
|
if (index === 0) {
|
|
429
251
|
return true;
|
|
430
252
|
}
|
|
431
|
-
|
|
432
253
|
return value > column[index - 1];
|
|
433
254
|
});
|
|
434
255
|
};
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
* If all columns can be downsampled, returns the x column coerced to time/number and y columns coerced to numbers.
|
|
440
|
-
* If not all columns can be downsampled, then returns empty arrays for both x and y
|
|
441
|
-
*/
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
var tryToCoerceAllDisplayedFields = function tryToCoerceAllDisplayedFields(ds, xField, yFields, fieldTypes, options) {
|
|
445
|
-
var xColumn = [];
|
|
446
|
-
var yColumns = [];
|
|
447
|
-
var canDownsample = !ds.data.fields.some(function (field, index) {
|
|
256
|
+
var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) => {
|
|
257
|
+
let xColumn = [];
|
|
258
|
+
const yColumns = [];
|
|
259
|
+
const canDownsample = !ds.data.fields.some((field, index) => {
|
|
448
260
|
var _a, _b;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
var hasDisplayedColumnThatCantBeDownsampled = false;
|
|
454
|
-
|
|
261
|
+
const fieldName = (_a = field.name) != null ? _a : field;
|
|
262
|
+
const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
|
|
263
|
+
const column = ds.data.columns[index];
|
|
264
|
+
let hasDisplayedColumnThatCantBeDownsampled = false;
|
|
455
265
|
if (fieldName === xField) {
|
|
456
266
|
xColumn = strictlyCoerceXColumn(column, fieldType);
|
|
457
267
|
} else if (yFields.has(fieldName)) {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
// be downsampled using LTTB
|
|
463
|
-
|
|
464
|
-
|
|
268
|
+
const { coercedColumn, canLooselyCoerceSomeValues, canDownsampleColumn } = strictlyCoerceYColumn(
|
|
269
|
+
ds.data.columns[index],
|
|
270
|
+
options
|
|
271
|
+
);
|
|
465
272
|
hasDisplayedColumnThatCantBeDownsampled = canLooselyCoerceSomeValues && !canDownsampleColumn;
|
|
466
|
-
|
|
467
273
|
if (hasDisplayedColumnThatCantBeDownsampled) {
|
|
468
274
|
return true;
|
|
469
275
|
}
|
|
470
|
-
|
|
471
276
|
if (canDownsampleColumn) {
|
|
472
277
|
yColumns.push(coercedColumn);
|
|
473
278
|
}
|
|
474
279
|
}
|
|
475
|
-
|
|
476
280
|
return false;
|
|
477
281
|
});
|
|
478
|
-
|
|
479
282
|
if (canDownsample) {
|
|
480
|
-
return {
|
|
481
|
-
xColumn: xColumn,
|
|
482
|
-
yColumns: yColumns
|
|
483
|
-
};
|
|
283
|
+
return { xColumn, yColumns };
|
|
484
284
|
}
|
|
485
|
-
|
|
486
|
-
return {
|
|
487
|
-
xColumn: [],
|
|
488
|
-
yColumns: []
|
|
489
|
-
};
|
|
285
|
+
return { xColumn: [], yColumns: [] };
|
|
490
286
|
};
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
ds.data.columns.forEach(function (column) {
|
|
498
|
-
var slicedColumn = [];
|
|
499
|
-
sortedIndices.forEach(function (index) {
|
|
287
|
+
var pickIndicesFromDataSource = (ds, indices) => {
|
|
288
|
+
const sortedIndices = Array.from(indices).sort((a, b) => a - b);
|
|
289
|
+
const slicedColumns = [];
|
|
290
|
+
ds.data.columns.forEach((column) => {
|
|
291
|
+
const slicedColumn = [];
|
|
292
|
+
sortedIndices.forEach((index) => {
|
|
500
293
|
slicedColumn.push(column[index]);
|
|
501
294
|
});
|
|
502
295
|
slicedColumns.push(slicedColumn);
|
|
503
|
-
});
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
data: Object.assign(Object.assign({}, ds.data), {
|
|
296
|
+
});
|
|
297
|
+
return __spreadProps(__spreadValues({}, ds), {
|
|
298
|
+
data: __spreadProps(__spreadValues({}, ds.data), {
|
|
507
299
|
columns: slicedColumns
|
|
508
300
|
})
|
|
509
301
|
});
|
|
510
302
|
};
|
|
511
|
-
|
|
512
|
-
var downsampleDataSources = function downsampleDataSources(_ref4) {
|
|
513
|
-
var dataSources = _ref4.dataSources,
|
|
514
|
-
threshold = _ref4.threshold,
|
|
515
|
-
options = _ref4.options;
|
|
516
|
-
|
|
303
|
+
var downsampleDataSources = ({ dataSources, threshold, options }) => {
|
|
517
304
|
var _a, _b, _c;
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
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;
|
|
522
|
-
|
|
305
|
+
const primaryDS = dataSources == null ? void 0 : dataSources.primary;
|
|
306
|
+
const numPoints = (_c = (_b = (_a = primaryDS == null ? void 0 : primaryDS.data) == null ? void 0 : _a.columns[0]) == null ? void 0 : _b.length) != null ? _c : 0;
|
|
523
307
|
if (Number.isNaN(threshold) || numPoints <= threshold || threshold < 2) {
|
|
524
308
|
return dataSources;
|
|
525
309
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
yFields = options.yFields,
|
|
529
|
-
fieldTypes = options.fieldTypes;
|
|
530
|
-
|
|
531
|
-
if (!xField || !(yFields === null || yFields === void 0 ? void 0 : yFields.length) || !(fieldTypes === null || fieldTypes === void 0 ? void 0 : fieldTypes.length)) {
|
|
310
|
+
const { xField, yFields, fieldTypes } = options;
|
|
311
|
+
if (!xField || !(yFields == null ? void 0 : yFields.length) || !(fieldTypes == null ? void 0 : fieldTypes.length)) {
|
|
532
312
|
return dataSources;
|
|
533
313
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
return !yField.startsWith('_');
|
|
537
|
-
}));
|
|
538
|
-
var maxPointsInDownsample = Math.min(nonInternalYFields.size * threshold, numPoints); // Do not try to downsample if there are too many downsampled pts
|
|
539
|
-
// At the worst case, each series has non-overlapping downsampled pts
|
|
540
|
-
// which will mean that all points will be included in the downsampled result
|
|
541
|
-
// This will just lead to additional overhead due to coercing each
|
|
542
|
-
// x and y field to number
|
|
543
|
-
|
|
314
|
+
const nonInternalYFields = new Set(yFields.filter((yField) => !yField.startsWith("_")));
|
|
315
|
+
const maxPointsInDownsample = Math.min(nonInternalYFields.size * threshold, numPoints);
|
|
544
316
|
if (maxPointsInDownsample >= numPoints) {
|
|
545
317
|
return dataSources;
|
|
546
318
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
319
|
+
const { xColumn, yColumns } = tryToCoerceAllDisplayedFields(
|
|
320
|
+
primaryDS,
|
|
321
|
+
xField,
|
|
322
|
+
nonInternalYFields,
|
|
323
|
+
fieldTypes,
|
|
324
|
+
options
|
|
325
|
+
);
|
|
552
326
|
if (!yColumns.length || !xColumn.length) {
|
|
553
327
|
return dataSources;
|
|
554
328
|
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
// perform LTTB downsampling for current series, LTTB takes an [x, y] pair
|
|
560
|
-
var xyPair = yColumn.map(function (yValue, index) {
|
|
329
|
+
const downsampledDataSources = __spreadValues({}, dataSources);
|
|
330
|
+
const downsampledIndices = /* @__PURE__ */ new Set();
|
|
331
|
+
yColumns.forEach((yColumn, columnIndex) => {
|
|
332
|
+
const xyPair = yColumn.map((yValue, index) => {
|
|
561
333
|
return [xColumn[index], yValue];
|
|
562
334
|
});
|
|
563
|
-
|
|
564
335
|
try {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
336
|
+
const { downsampledIndices: downsampledIndicesForSeries } = largestTriangleThreeBuckets(
|
|
337
|
+
xyPair,
|
|
338
|
+
threshold,
|
|
339
|
+
downsampledIndices
|
|
340
|
+
);
|
|
341
|
+
downsampledIndicesForSeries.forEach((downsampleIndex) => downsampledIndices.add(downsampleIndex));
|
|
571
342
|
} catch (e) {
|
|
572
|
-
|
|
573
|
-
console.error("Error occurred while downsampling column ".concat(columnIndex), e);
|
|
343
|
+
console.error(`Error occurred while downsampling column ${columnIndex}`, e);
|
|
574
344
|
}
|
|
575
|
-
});
|
|
576
|
-
|
|
345
|
+
});
|
|
577
346
|
downsampledDataSources.primary = pickIndicesFromDataSource(primaryDS, downsampledIndices);
|
|
578
347
|
return downsampledDataSources;
|
|
579
348
|
};
|
|
580
|
-
|
|
581
|
-
exports.downsampleDataSources = downsampleDataSources;
|
|
582
|
-
|
|
583
|
-
/***/ }),
|
|
584
|
-
/* 16 */
|
|
585
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
586
|
-
|
|
587
|
-
"use strict";
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
591
|
-
if (k2 === undefined) k2 = k;
|
|
592
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
593
|
-
|
|
594
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
595
|
-
desc = {
|
|
596
|
-
enumerable: true,
|
|
597
|
-
get: function get() {
|
|
598
|
-
return m[k];
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
Object.defineProperty(o, k2, desc);
|
|
604
|
-
} : function (o, m, k, k2) {
|
|
605
|
-
if (k2 === undefined) k2 = k;
|
|
606
|
-
o[k2] = m[k];
|
|
607
|
-
});
|
|
608
|
-
|
|
609
|
-
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
610
|
-
for (var p in m) {
|
|
611
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
Object.defineProperty(exports, "__esModule", {
|
|
616
|
-
value: true
|
|
617
|
-
});
|
|
618
|
-
|
|
619
|
-
__exportStar(__webpack_require__(17), exports);
|
|
620
|
-
|
|
621
|
-
__exportStar(__webpack_require__(18), exports);
|
|
622
|
-
|
|
623
|
-
__exportStar(__webpack_require__(19), exports);
|
|
624
|
-
|
|
625
|
-
__exportStar(__webpack_require__(20), exports);
|
|
626
|
-
|
|
627
|
-
__exportStar(__webpack_require__(21), exports);
|
|
628
|
-
|
|
629
|
-
__exportStar(__webpack_require__(22), exports);
|
|
630
|
-
|
|
631
|
-
__exportStar(__webpack_require__(23), exports);
|
|
632
|
-
|
|
633
|
-
__exportStar(__webpack_require__(24), exports);
|
|
634
|
-
|
|
635
|
-
__exportStar(__webpack_require__(25), exports);
|
|
636
|
-
|
|
637
|
-
__exportStar(__webpack_require__(26), exports);
|
|
638
|
-
|
|
639
|
-
__exportStar(__webpack_require__(29), exports);
|
|
640
|
-
|
|
641
|
-
__exportStar(__webpack_require__(30), exports);
|
|
642
|
-
|
|
643
|
-
__exportStar(__webpack_require__(31), exports);
|
|
644
|
-
|
|
645
|
-
__exportStar(__webpack_require__(32), exports);
|
|
646
|
-
|
|
647
|
-
__exportStar(__webpack_require__(33), exports);
|
|
648
|
-
|
|
649
|
-
__exportStar(__webpack_require__(34), exports);
|
|
650
|
-
|
|
651
|
-
__exportStar(__webpack_require__(35), exports);
|
|
652
|
-
|
|
653
|
-
__exportStar(__webpack_require__(36), exports);
|
|
654
|
-
|
|
655
|
-
/***/ }),
|
|
656
|
-
/* 17 */
|
|
657
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
658
|
-
|
|
659
|
-
"use strict";
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
Object.defineProperty(exports, "__esModule", {
|
|
663
|
-
value: true
|
|
664
|
-
});
|
|
665
|
-
|
|
666
|
-
/***/ }),
|
|
667
|
-
/* 18 */
|
|
668
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
669
|
-
|
|
670
|
-
"use strict";
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* A data structure used at runtime to wire up a visualization.
|
|
674
|
-
*/
|
|
675
|
-
|
|
676
|
-
Object.defineProperty(exports, "__esModule", {
|
|
677
|
-
value: true
|
|
678
|
-
});
|
|
679
|
-
|
|
680
|
-
/***/ }),
|
|
681
|
-
/* 19 */
|
|
682
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
683
|
-
|
|
684
|
-
"use strict";
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
Object.defineProperty(exports, "__esModule", {
|
|
688
|
-
value: true
|
|
689
|
-
});
|
|
690
|
-
exports.validOutputModes = exports.validSortDirs = void 0;
|
|
691
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
692
|
-
exports.validOutputModes = ['json_cols', 'json'];
|
|
693
|
-
|
|
694
|
-
/***/ }),
|
|
695
|
-
/* 20 */
|
|
696
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
697
|
-
|
|
698
|
-
"use strict";
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
Object.defineProperty(exports, "__esModule", {
|
|
702
|
-
value: true
|
|
703
|
-
});
|
|
704
|
-
|
|
705
|
-
/***/ }),
|
|
706
|
-
/* 21 */
|
|
707
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
708
|
-
|
|
709
|
-
"use strict";
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
Object.defineProperty(exports, "__esModule", {
|
|
713
|
-
value: true
|
|
714
|
-
});
|
|
715
|
-
|
|
716
|
-
/***/ }),
|
|
717
|
-
/* 22 */
|
|
718
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
719
|
-
|
|
720
|
-
"use strict";
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
Object.defineProperty(exports, "__esModule", {
|
|
724
|
-
value: true
|
|
725
|
-
});
|
|
726
|
-
|
|
727
|
-
/***/ }),
|
|
728
|
-
/* 23 */
|
|
729
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
730
|
-
|
|
731
|
-
"use strict";
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
Object.defineProperty(exports, "__esModule", {
|
|
735
|
-
value: true
|
|
736
|
-
});
|
|
737
|
-
|
|
738
|
-
/***/ }),
|
|
739
|
-
/* 24 */
|
|
740
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
741
|
-
|
|
742
|
-
"use strict";
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
Object.defineProperty(exports, "__esModule", {
|
|
746
|
-
value: true
|
|
747
|
-
});
|
|
748
|
-
|
|
749
|
-
/***/ }),
|
|
750
|
-
/* 25 */
|
|
751
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
752
|
-
|
|
753
|
-
"use strict";
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
Object.defineProperty(exports, "__esModule", {
|
|
757
|
-
value: true
|
|
758
|
-
});
|
|
759
|
-
|
|
760
|
-
/***/ }),
|
|
761
|
-
/* 26 */
|
|
762
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
763
|
-
|
|
764
|
-
"use strict";
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
var _classCallCheck = __webpack_require__(27);
|
|
768
|
-
|
|
769
|
-
var _createClass = __webpack_require__(28);
|
|
770
|
-
|
|
771
|
-
Object.defineProperty(exports, "__esModule", {
|
|
772
|
-
value: true
|
|
773
|
-
});
|
|
774
|
-
exports.DefaultVizActionHandler = void 0;
|
|
775
|
-
|
|
776
|
-
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
777
|
-
function DefaultVizActionHandler() {
|
|
778
|
-
_classCallCheck(this, DefaultVizActionHandler);
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
_createClass(DefaultVizActionHandler, [{
|
|
782
|
-
key: "focus",
|
|
783
|
-
value: function focus() {// noop
|
|
784
|
-
}
|
|
785
|
-
}, {
|
|
786
|
-
key: "snapshot",
|
|
787
|
-
value: function snapshot() {
|
|
788
|
-
return null; // noop
|
|
789
|
-
}
|
|
790
|
-
}]);
|
|
791
|
-
|
|
792
|
-
return DefaultVizActionHandler;
|
|
793
|
-
}();
|
|
794
|
-
|
|
795
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
796
|
-
|
|
797
|
-
/***/ }),
|
|
798
|
-
/* 27 */
|
|
799
|
-
/***/ (function(module, exports) {
|
|
800
|
-
|
|
801
|
-
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
802
|
-
|
|
803
|
-
/***/ }),
|
|
804
|
-
/* 28 */
|
|
805
|
-
/***/ (function(module, exports) {
|
|
806
|
-
|
|
807
|
-
module.exports = require("@babel/runtime/helpers/createClass");
|
|
808
|
-
|
|
809
|
-
/***/ }),
|
|
810
|
-
/* 29 */
|
|
811
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
812
|
-
|
|
813
|
-
"use strict";
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
Object.defineProperty(exports, "__esModule", {
|
|
817
|
-
value: true
|
|
818
|
-
});
|
|
819
|
-
exports.VizBehavior = void 0;
|
|
820
|
-
var VizBehavior;
|
|
821
|
-
|
|
822
|
-
(function (VizBehavior) {
|
|
823
|
-
/**
|
|
824
|
-
* Dynamic Options Behavior.
|
|
825
|
-
* This allows visualization options to be powered by data
|
|
826
|
-
*
|
|
827
|
-
* **Example**
|
|
828
|
-
*
|
|
829
|
-
* sparklineValues: ">primary|seriesByIndex(0)"
|
|
830
|
-
* would configure sparklineValues with an array of data points
|
|
831
|
-
* coming from the first series in the primary datasource
|
|
832
|
-
*
|
|
833
|
-
*/
|
|
834
|
-
VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
|
|
835
|
-
VizBehavior["EVENTS"] = "events";
|
|
836
|
-
VizBehavior["DOWNSAMPLING"] = "downsampling";
|
|
837
|
-
/**
|
|
838
|
-
* Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
|
|
839
|
-
* missing.
|
|
840
|
-
* @type {string}
|
|
841
|
-
*/
|
|
842
|
-
|
|
843
|
-
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
844
|
-
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
845
|
-
VizBehavior["TRELLIS"] = "trellis";
|
|
846
|
-
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
847
|
-
|
|
848
|
-
/***/ }),
|
|
849
|
-
/* 30 */
|
|
850
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
851
|
-
|
|
852
|
-
"use strict";
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
Object.defineProperty(exports, "__esModule", {
|
|
856
|
-
value: true
|
|
857
|
-
});
|
|
858
|
-
exports.VizCategory = void 0;
|
|
859
|
-
var VizCategory;
|
|
860
|
-
|
|
861
|
-
(function (VizCategory) {
|
|
862
|
-
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
863
|
-
VizCategory["TRENDS"] = "Trends";
|
|
864
|
-
VizCategory["COMPARISONS"] = "Comparisons";
|
|
865
|
-
VizCategory["TABLE"] = "Table";
|
|
866
|
-
VizCategory["GAUGE"] = "Gauge";
|
|
867
|
-
VizCategory["DISTRIBUTIONS"] = "Distributions";
|
|
868
|
-
VizCategory["CHOROPLETH"] = "Choropleth Maps";
|
|
869
|
-
VizCategory["SHAPES"] = "Shapes";
|
|
870
|
-
VizCategory["MISC"] = "misc";
|
|
871
|
-
VizCategory["FLOW"] = "Flow";
|
|
872
|
-
VizCategory["CORRELATION"] = "Correlation";
|
|
873
|
-
VizCategory["SPATIAL"] = "Spatial";
|
|
874
|
-
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
875
|
-
|
|
876
|
-
/***/ }),
|
|
877
|
-
/* 31 */
|
|
878
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
879
|
-
|
|
880
|
-
"use strict";
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
Object.defineProperty(exports, "__esModule", {
|
|
884
|
-
value: true
|
|
885
|
-
});
|
|
886
|
-
|
|
887
|
-
/***/ }),
|
|
888
|
-
/* 32 */
|
|
889
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
890
|
-
|
|
891
|
-
"use strict";
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
Object.defineProperty(exports, "__esModule", {
|
|
895
|
-
value: true
|
|
896
|
-
});
|
|
897
|
-
|
|
898
|
-
/***/ }),
|
|
899
|
-
/* 33 */
|
|
900
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
901
|
-
|
|
902
|
-
"use strict";
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
Object.defineProperty(exports, "__esModule", {
|
|
906
|
-
value: true
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
/***/ }),
|
|
910
|
-
/* 34 */
|
|
911
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
912
|
-
|
|
913
|
-
"use strict";
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
Object.defineProperty(exports, "__esModule", {
|
|
917
|
-
value: true
|
|
918
|
-
});
|
|
919
|
-
|
|
920
|
-
/***/ }),
|
|
921
|
-
/* 35 */
|
|
922
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
923
|
-
|
|
924
|
-
"use strict";
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
Object.defineProperty(exports, "__esModule", {
|
|
928
|
-
value: true
|
|
929
|
-
});
|
|
930
|
-
|
|
931
|
-
/***/ }),
|
|
932
|
-
/* 36 */
|
|
933
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
934
|
-
|
|
935
|
-
"use strict";
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
Object.defineProperty(exports, "__esModule", {
|
|
939
|
-
value: true
|
|
940
|
-
});
|
|
941
|
-
|
|
942
|
-
/***/ })
|
|
943
|
-
/******/ ]);
|
|
944
|
-
//# sourceMappingURL=dataUtils.js.map
|
|
349
|
+
//# sourceMappingURL=dataUtils.js.map
|