autoql-fe-utils 1.0.13 → 1.0.15
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/dist/index.d.ts +22 -7
- package/dist/index.global.js +241 -85
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +107 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
|
40
40
|
}(exports, function() {
|
|
41
41
|
"use strict";
|
|
42
|
-
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week",
|
|
42
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
43
43
|
var e3 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
44
44
|
return "[" + t2 + (e3[(n2 - 20) % 10] || e3[n2] || e3[0]) + "]";
|
|
45
45
|
} }, m = function(t2, e3, n2) {
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
}, m: function t2(e3, n2) {
|
|
52
52
|
if (e3.date() < n2.date())
|
|
53
53
|
return -t2(n2, e3);
|
|
54
|
-
var r2 = 12 * (n2.year() - e3.year()) + (n2.month() - e3.month()), i2 = e3.clone().add(r2,
|
|
54
|
+
var r2 = 12 * (n2.year() - e3.year()) + (n2.month() - e3.month()), i2 = e3.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e3.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
55
55
|
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
56
56
|
}, a: function(t2) {
|
|
57
57
|
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
58
58
|
}, p: function(t2) {
|
|
59
|
-
return { M:
|
|
59
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
60
60
|
}, u: function(t2) {
|
|
61
61
|
return void 0 === t2;
|
|
62
62
|
} }, g = "en", D = {};
|
|
63
63
|
D[g] = M;
|
|
64
64
|
var p = function(t2) {
|
|
65
|
-
return t2 instanceof
|
|
65
|
+
return t2 instanceof b;
|
|
66
66
|
}, S = function t2(e3, n2, r2) {
|
|
67
67
|
var i2;
|
|
68
68
|
if (!e3)
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
if (p(t2))
|
|
83
83
|
return t2.clone();
|
|
84
84
|
var n2 = "object" == typeof e3 ? e3 : {};
|
|
85
|
-
return n2.date = t2, n2.args = arguments, new
|
|
85
|
+
return n2.date = t2, n2.args = arguments, new b(n2);
|
|
86
86
|
}, O = v;
|
|
87
87
|
O.l = S, O.i = p, O.w = function(t2, e3) {
|
|
88
88
|
return w(t2, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
|
|
89
89
|
};
|
|
90
|
-
var
|
|
90
|
+
var b = function() {
|
|
91
91
|
function M2(t2) {
|
|
92
92
|
this.$L = S(t2.locale, null, true), this.parse(t2);
|
|
93
93
|
}
|
|
@@ -131,16 +131,16 @@
|
|
|
131
131
|
}, m2.valueOf = function() {
|
|
132
132
|
return this.$d.getTime();
|
|
133
133
|
}, m2.startOf = function(t2, e3) {
|
|
134
|
-
var n2 = this, r2 = !!O.u(e3) || e3,
|
|
134
|
+
var n2 = this, r2 = !!O.u(e3) || e3, f2 = O.p(t2), l2 = function(t3, e4) {
|
|
135
135
|
var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e4, t3) : new Date(n2.$y, e4, t3), n2);
|
|
136
136
|
return r2 ? i2 : i2.endOf(a);
|
|
137
137
|
}, $2 = function(t3, e4) {
|
|
138
138
|
return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n2);
|
|
139
139
|
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
140
|
-
switch (
|
|
141
|
-
case
|
|
140
|
+
switch (f2) {
|
|
141
|
+
case h:
|
|
142
142
|
return r2 ? l2(1, 0) : l2(31, 11);
|
|
143
|
-
case
|
|
143
|
+
case c:
|
|
144
144
|
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
145
145
|
case o:
|
|
146
146
|
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
@@ -160,8 +160,8 @@
|
|
|
160
160
|
}, m2.endOf = function(t2) {
|
|
161
161
|
return this.startOf(t2, false);
|
|
162
162
|
}, m2.$set = function(t2, e3) {
|
|
163
|
-
var n2, o2 = O.p(t2),
|
|
164
|
-
if (o2 ===
|
|
163
|
+
var n2, o2 = O.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e3 - this.$W) : e3;
|
|
164
|
+
if (o2 === c || o2 === h) {
|
|
165
165
|
var y2 = this.clone().set(d, 1);
|
|
166
166
|
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
167
167
|
} else
|
|
@@ -171,17 +171,17 @@
|
|
|
171
171
|
return this.clone().$set(t2, e3);
|
|
172
172
|
}, m2.get = function(t2) {
|
|
173
173
|
return this[O.p(t2)]();
|
|
174
|
-
}, m2.add = function(r2,
|
|
174
|
+
}, m2.add = function(r2, f2) {
|
|
175
175
|
var d2, l2 = this;
|
|
176
176
|
r2 = Number(r2);
|
|
177
|
-
var $2 = O.p(
|
|
177
|
+
var $2 = O.p(f2), y2 = function(t2) {
|
|
178
178
|
var e3 = w(l2);
|
|
179
179
|
return O.w(e3.date(e3.date() + Math.round(t2 * r2)), l2);
|
|
180
180
|
};
|
|
181
|
-
if ($2 === f)
|
|
182
|
-
return this.set(f, this.$M + r2);
|
|
183
181
|
if ($2 === c)
|
|
184
|
-
return this.set(c, this.$
|
|
182
|
+
return this.set(c, this.$M + r2);
|
|
183
|
+
if ($2 === h)
|
|
184
|
+
return this.set(h, this.$y + r2);
|
|
185
185
|
if ($2 === a)
|
|
186
186
|
return y2(1);
|
|
187
187
|
if ($2 === o)
|
|
@@ -194,24 +194,106 @@
|
|
|
194
194
|
var e3 = this, n2 = this.$locale();
|
|
195
195
|
if (!this.isValid())
|
|
196
196
|
return n2.invalidDate || l;
|
|
197
|
-
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays,
|
|
197
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
198
198
|
return t3 && (t3[n3] || t3(e3, r2)) || i3[n3].slice(0, s3);
|
|
199
|
-
},
|
|
199
|
+
}, d2 = function(t3) {
|
|
200
200
|
return O.s(s2 % 12 || 12, t3, "0");
|
|
201
|
-
},
|
|
201
|
+
}, $2 = f2 || function(t3, e4, n3) {
|
|
202
202
|
var r3 = t3 < 12 ? "AM" : "PM";
|
|
203
203
|
return n3 ? r3.toLowerCase() : r3;
|
|
204
|
-
}
|
|
205
|
-
return r2.replace(y, function(t3,
|
|
206
|
-
return
|
|
204
|
+
};
|
|
205
|
+
return r2.replace(y, function(t3, r3) {
|
|
206
|
+
return r3 || function(t4) {
|
|
207
|
+
switch (t4) {
|
|
208
|
+
case "YY":
|
|
209
|
+
return String(e3.$y).slice(-2);
|
|
210
|
+
case "YYYY":
|
|
211
|
+
return O.s(e3.$y, 4, "0");
|
|
212
|
+
case "M":
|
|
213
|
+
return a2 + 1;
|
|
214
|
+
case "MM":
|
|
215
|
+
return O.s(a2 + 1, 2, "0");
|
|
216
|
+
case "MMM":
|
|
217
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
218
|
+
case "MMMM":
|
|
219
|
+
return h2(c2, a2);
|
|
220
|
+
case "D":
|
|
221
|
+
return e3.$D;
|
|
222
|
+
case "DD":
|
|
223
|
+
return O.s(e3.$D, 2, "0");
|
|
224
|
+
case "d":
|
|
225
|
+
return String(e3.$W);
|
|
226
|
+
case "dd":
|
|
227
|
+
return h2(n2.weekdaysMin, e3.$W, o2, 2);
|
|
228
|
+
case "ddd":
|
|
229
|
+
return h2(n2.weekdaysShort, e3.$W, o2, 3);
|
|
230
|
+
case "dddd":
|
|
231
|
+
return o2[e3.$W];
|
|
232
|
+
case "H":
|
|
233
|
+
return String(s2);
|
|
234
|
+
case "HH":
|
|
235
|
+
return O.s(s2, 2, "0");
|
|
236
|
+
case "h":
|
|
237
|
+
return d2(1);
|
|
238
|
+
case "hh":
|
|
239
|
+
return d2(2);
|
|
240
|
+
case "a":
|
|
241
|
+
return $2(s2, u2, true);
|
|
242
|
+
case "A":
|
|
243
|
+
return $2(s2, u2, false);
|
|
244
|
+
case "m":
|
|
245
|
+
return String(u2);
|
|
246
|
+
case "mm":
|
|
247
|
+
return O.s(u2, 2, "0");
|
|
248
|
+
case "s":
|
|
249
|
+
return String(e3.$s);
|
|
250
|
+
case "ss":
|
|
251
|
+
return O.s(e3.$s, 2, "0");
|
|
252
|
+
case "SSS":
|
|
253
|
+
return O.s(e3.$ms, 3, "0");
|
|
254
|
+
case "Z":
|
|
255
|
+
return i2;
|
|
256
|
+
}
|
|
257
|
+
return null;
|
|
258
|
+
}(t3) || i2.replace(":", "");
|
|
207
259
|
});
|
|
208
260
|
}, m2.utcOffset = function() {
|
|
209
261
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
210
262
|
}, m2.diff = function(r2, d2, l2) {
|
|
211
|
-
var $2, y2 = O.p(d2),
|
|
212
|
-
|
|
263
|
+
var $2, y2 = this, M3 = O.p(d2), m3 = w(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
264
|
+
return O.m(y2, m3);
|
|
265
|
+
};
|
|
266
|
+
switch (M3) {
|
|
267
|
+
case h:
|
|
268
|
+
$2 = D2() / 12;
|
|
269
|
+
break;
|
|
270
|
+
case c:
|
|
271
|
+
$2 = D2();
|
|
272
|
+
break;
|
|
273
|
+
case f:
|
|
274
|
+
$2 = D2() / 3;
|
|
275
|
+
break;
|
|
276
|
+
case o:
|
|
277
|
+
$2 = (g2 - v2) / 6048e5;
|
|
278
|
+
break;
|
|
279
|
+
case a:
|
|
280
|
+
$2 = (g2 - v2) / 864e5;
|
|
281
|
+
break;
|
|
282
|
+
case u:
|
|
283
|
+
$2 = g2 / n;
|
|
284
|
+
break;
|
|
285
|
+
case s:
|
|
286
|
+
$2 = g2 / e;
|
|
287
|
+
break;
|
|
288
|
+
case i:
|
|
289
|
+
$2 = g2 / t;
|
|
290
|
+
break;
|
|
291
|
+
default:
|
|
292
|
+
$2 = g2;
|
|
293
|
+
}
|
|
294
|
+
return l2 ? $2 : O.a($2);
|
|
213
295
|
}, m2.daysInMonth = function() {
|
|
214
|
-
return this.endOf(
|
|
296
|
+
return this.endOf(c).$D;
|
|
215
297
|
}, m2.$locale = function() {
|
|
216
298
|
return D[this.$L];
|
|
217
299
|
}, m2.locale = function(t2, e3) {
|
|
@@ -230,13 +312,13 @@
|
|
|
230
312
|
}, m2.toString = function() {
|
|
231
313
|
return this.$d.toUTCString();
|
|
232
314
|
}, M2;
|
|
233
|
-
}(),
|
|
234
|
-
return w.prototype =
|
|
235
|
-
|
|
315
|
+
}(), _ = b.prototype;
|
|
316
|
+
return w.prototype = _, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
317
|
+
_[t2[1]] = function(e3) {
|
|
236
318
|
return this.$g(e3, t2[0], t2[1]);
|
|
237
319
|
};
|
|
238
320
|
}), w.extend = function(t2, e3) {
|
|
239
|
-
return t2.$i || (t2(e3,
|
|
321
|
+
return t2.$i || (t2(e3, b, w), t2.$i = true), w;
|
|
240
322
|
}, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
|
|
241
323
|
return w(1e3 * t2);
|
|
242
324
|
}, w.en = D[g], w.Ls = D, w.p = {}, w;
|
|
@@ -16559,14 +16641,25 @@
|
|
|
16559
16641
|
}
|
|
16560
16642
|
};
|
|
16561
16643
|
var getNumberFormatConfig = (d, scale) => {
|
|
16562
|
-
var _a, _b;
|
|
16644
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16645
|
+
const dNumber = typeof d === "string" ? parseFloat(d) : d;
|
|
16563
16646
|
let minimumFractionDigits = 0;
|
|
16564
16647
|
let maximumFractionDigits = 0;
|
|
16565
16648
|
let notation;
|
|
16566
|
-
const
|
|
16567
|
-
const
|
|
16568
|
-
const
|
|
16569
|
-
|
|
16649
|
+
const domain = scale == null ? void 0 : scale.domain();
|
|
16650
|
+
const minValue = scale == null ? void 0 : scale.minValue;
|
|
16651
|
+
const maxValue = scale == null ? void 0 : scale.maxValue;
|
|
16652
|
+
let domainRange = 0;
|
|
16653
|
+
if (domain) {
|
|
16654
|
+
domainRange = Math.abs(((_a = domain[1]) != null ? _a : 0) - ((_b = domain[0]) != null ? _b : 0));
|
|
16655
|
+
} else if (!isNaN(maxValue) && !isNaN(minValue)) {
|
|
16656
|
+
domainRange = Math.abs(maxValue - minValue);
|
|
16657
|
+
}
|
|
16658
|
+
const tickRange = Math.abs(((_d = (_c = scale == null ? void 0 : scale.tickLabels) == null ? void 0 : _c[1]) != null ? _d : 0) - ((_f = (_e = scale == null ? void 0 : scale.tickLabels) == null ? void 0 : _e[0]) != null ? _f : 0));
|
|
16659
|
+
const smallDomain = !isNaN(domainRange) && domainRange >= 0 && domainRange < 10;
|
|
16660
|
+
const absValue = Math.abs(dNumber);
|
|
16661
|
+
if (smallDomain && (!tickRange || tickRange >= 1)) {
|
|
16662
|
+
} else if (smallDomain) {
|
|
16570
16663
|
minimumFractionDigits = 2;
|
|
16571
16664
|
maximumFractionDigits = 2;
|
|
16572
16665
|
} else if (absValue >= 1e3) {
|
|
@@ -16623,7 +16716,7 @@
|
|
|
16623
16716
|
minimumFractionDigits = sigDigits;
|
|
16624
16717
|
maximumFractionDigits = sigDigits;
|
|
16625
16718
|
} else {
|
|
16626
|
-
const numberFormatConfig = getNumberFormatConfig(
|
|
16719
|
+
const numberFormatConfig = getNumberFormatConfig(d, scale);
|
|
16627
16720
|
minimumFractionDigits = numberFormatConfig.minimumFractionDigits;
|
|
16628
16721
|
maximumFractionDigits = numberFormatConfig.maximumFractionDigits;
|
|
16629
16722
|
notation = numberFormatConfig.notation;
|
|
@@ -22095,11 +22188,11 @@
|
|
|
22095
22188
|
aggregated = false,
|
|
22096
22189
|
colorScale
|
|
22097
22190
|
}) => {
|
|
22098
|
-
var _a, _b;
|
|
22191
|
+
var _a, _b, _c, _d;
|
|
22099
22192
|
let domainFinal = domain;
|
|
22100
22193
|
if (!domain) {
|
|
22101
|
-
let min2 = minValue != null ? minValue : tickValues == null ? void 0 : tickValues[0];
|
|
22102
|
-
let max2 = maxValue != null ? maxValue : tickValues == null ? void 0 : tickValues[(tickValues == null ? void 0 : tickValues.length) - 1];
|
|
22194
|
+
let min2 = (_a = minValue != null ? minValue : tickValues == null ? void 0 : tickValues[0]) != null ? _a : 0;
|
|
22195
|
+
let max2 = (_b = maxValue != null ? maxValue : tickValues == null ? void 0 : tickValues[(tickValues == null ? void 0 : tickValues.length) - 1]) != null ? _b : 0;
|
|
22103
22196
|
if (isNaN(min2)) {
|
|
22104
22197
|
min2 = 0;
|
|
22105
22198
|
}
|
|
@@ -22111,7 +22204,7 @@
|
|
|
22111
22204
|
const config = getDataFormatting(dataFormatting);
|
|
22112
22205
|
const colIndices = columnIndices != null ? columnIndices : [columnIndex];
|
|
22113
22206
|
const scaleRange = range2 != null ? range2 : getRangeForAxis({ axis: axis2, height, width });
|
|
22114
|
-
const axisColumns = (
|
|
22207
|
+
const axisColumns = (_c = colIndices == null ? void 0 : colIndices.map((index) => columns == null ? void 0 : columns[index])) != null ? _c : [];
|
|
22115
22208
|
const axisTitle = title != null ? title : getLinearAxisTitle({
|
|
22116
22209
|
numberColumns: axisColumns,
|
|
22117
22210
|
aggregated
|
|
@@ -22123,7 +22216,7 @@
|
|
|
22123
22216
|
scale.columnIndex = columnIndex;
|
|
22124
22217
|
scale.column = columns == null ? void 0 : columns[columnIndex];
|
|
22125
22218
|
scale.fields = axisColumns;
|
|
22126
|
-
scale.allFields = (
|
|
22219
|
+
scale.allFields = (_d = getNumberColumnIndices(columns)) == null ? void 0 : _d.allNumberColumnIndices;
|
|
22127
22220
|
scale.dataFormatting = config;
|
|
22128
22221
|
scale.hasDropdown = hasDropdown != null ? hasDropdown : enableAxisDropdown;
|
|
22129
22222
|
scale.stacked = !!stacked;
|
|
@@ -22144,7 +22237,7 @@
|
|
|
22144
22237
|
scale.getValue = (value) => {
|
|
22145
22238
|
return scale(value);
|
|
22146
22239
|
};
|
|
22147
|
-
scale.tickLabels = tickValues
|
|
22240
|
+
scale.tickLabels = (tickValues == null ? void 0 : tickValues.length) ? tickValues : getTickValues({
|
|
22148
22241
|
scale,
|
|
22149
22242
|
numTicks
|
|
22150
22243
|
});
|
|
@@ -22188,28 +22281,23 @@
|
|
|
22188
22281
|
aggregated,
|
|
22189
22282
|
changeAggConfig
|
|
22190
22283
|
};
|
|
22284
|
+
const minMax = getMinAndMaxValues(data, columnIndices1, isScaled, stacked, stringColumnIndex);
|
|
22285
|
+
const minValue = minMax.minValue;
|
|
22286
|
+
const maxValue = minMax.maxValue;
|
|
22191
22287
|
const scaleColumnConfig = {
|
|
22192
22288
|
columnIndex: columnIndices1[0],
|
|
22193
22289
|
columnIndices: columnIndices1,
|
|
22194
22290
|
colorScale: colorScales == null ? void 0 : colorScales.colorScale,
|
|
22195
|
-
changeNumberColumnIndices
|
|
22291
|
+
changeColumnIndices: (indices, columns2) => changeNumberColumnIndices(indices, void 0, columns2)
|
|
22196
22292
|
};
|
|
22197
|
-
const
|
|
22198
|
-
columnIndex: columnIndices2[0],
|
|
22199
|
-
columnIndices: columnIndices2,
|
|
22200
|
-
colorScale: colorScales == null ? void 0 : colorScales.colorScale2,
|
|
22201
|
-
changeNumberColumnIndices: (indices, columns2) => changeNumberColumnIndices(void 0, indices, columns2)
|
|
22202
|
-
};
|
|
22203
|
-
const minMax = getMinAndMaxValues(data, columnIndices1, isScaled, stacked, stringColumnIndex);
|
|
22204
|
-
const minValue = minMax.minValue;
|
|
22205
|
-
const maxValue = minMax.maxValue;
|
|
22293
|
+
const hasSecondAxis = !!(columnIndices2 == null ? void 0 : columnIndices2.length);
|
|
22206
22294
|
const tempScale1 = getLinearScale({
|
|
22207
22295
|
minValue,
|
|
22208
22296
|
maxValue,
|
|
22209
22297
|
...scaleColumnConfig,
|
|
22210
22298
|
...commonParams
|
|
22211
22299
|
});
|
|
22212
|
-
if (!
|
|
22300
|
+
if (!hasSecondAxis) {
|
|
22213
22301
|
return {
|
|
22214
22302
|
scale: tempScale1
|
|
22215
22303
|
};
|
|
@@ -22217,6 +22305,12 @@
|
|
|
22217
22305
|
const minMax2 = getMinAndMaxValues(data, columnIndices2, isScaled, stacked, stringColumnIndex);
|
|
22218
22306
|
const minValue2 = minMax2.minValue;
|
|
22219
22307
|
const maxValue2 = minMax2.maxValue;
|
|
22308
|
+
const scaleColumnConfig2 = {
|
|
22309
|
+
columnIndex: columnIndices2[0],
|
|
22310
|
+
columnIndices: columnIndices2,
|
|
22311
|
+
colorScale: colorScales == null ? void 0 : colorScales.colorScale2,
|
|
22312
|
+
changeColumnIndices: (indices, columns2) => changeNumberColumnIndices(void 0, indices, columns2)
|
|
22313
|
+
};
|
|
22220
22314
|
const tempScale2 = getLinearScale({
|
|
22221
22315
|
minValue: minValue2,
|
|
22222
22316
|
maxValue: maxValue2,
|
|
@@ -22336,12 +22430,12 @@
|
|
|
22336
22430
|
}
|
|
22337
22431
|
const newTickValues = [...tickValues];
|
|
22338
22432
|
try {
|
|
22339
|
-
|
|
22340
|
-
|
|
22433
|
+
let minTickValue = tickValues[0];
|
|
22434
|
+
let maxTickValue = tickValues[tickValues.length - 1];
|
|
22341
22435
|
const tickRange = Math.abs(tickValues[1] - tickValues[0]);
|
|
22342
22436
|
let newMinTickValue = minTickValue;
|
|
22343
22437
|
let newMaxTickValue = maxTickValue;
|
|
22344
|
-
if (minValue
|
|
22438
|
+
if (minValue <= minTickValue) {
|
|
22345
22439
|
newMinTickValue = minTickValue - tickRange;
|
|
22346
22440
|
newTickValues.unshift(newMinTickValue);
|
|
22347
22441
|
}
|
|
@@ -22381,7 +22475,7 @@
|
|
|
22381
22475
|
innerPadding = DEFAULT_INNER_PADDING,
|
|
22382
22476
|
outerPadding = DEFAULT_OUTER_PADDING
|
|
22383
22477
|
}) => {
|
|
22384
|
-
var _a, _b, _c;
|
|
22478
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
22385
22479
|
try {
|
|
22386
22480
|
let tickValues = scale.tickLabels;
|
|
22387
22481
|
if (initialTicks) {
|
|
@@ -22389,6 +22483,12 @@
|
|
|
22389
22483
|
} else if (typeof (scale == null ? void 0 : scale.ticks) === "function") {
|
|
22390
22484
|
tickValues = scale.ticks(numTicks);
|
|
22391
22485
|
}
|
|
22486
|
+
if (scale.type === "LINEAR") {
|
|
22487
|
+
const domainRange = ((_c = (_b = scale == null ? void 0 : scale.maxValue) != null ? _b : (_a = scale == null ? void 0 : scale.domain) == null ? void 0 : _a[1]) != null ? _c : 0) - ((_f = (_e = scale == null ? void 0 : scale.minValue) != null ? _e : (_d = scale == null ? void 0 : scale.domain) == null ? void 0 : _d[0]) != null ? _f : 0);
|
|
22488
|
+
if (domainRange >= 2 && tickValues.length > domainRange) {
|
|
22489
|
+
tickValues = scale.ticks(domainRange);
|
|
22490
|
+
}
|
|
22491
|
+
}
|
|
22392
22492
|
const tickSize = getTickSizeFromNumTicks({ scale, numTicks: tickValues == null ? void 0 : tickValues.length, innerPadding, outerPadding });
|
|
22393
22493
|
if (!tickValues) {
|
|
22394
22494
|
console.error("Unable to set tick labels for scale. tickValues is undefined");
|
|
@@ -22396,7 +22496,7 @@
|
|
|
22396
22496
|
}
|
|
22397
22497
|
const fontSize = 12;
|
|
22398
22498
|
const minimumTickSize = 20;
|
|
22399
|
-
const fullSize = ((
|
|
22499
|
+
const fullSize = ((_i = Math.abs(((_g = scale == null ? void 0 : scale.range()) == null ? void 0 : _g[1]) - ((_h = scale == null ? void 0 : scale.range()) == null ? void 0 : _h[0]))) != null ? _i : 1) + fontSize;
|
|
22400
22500
|
const interval = Math.ceil(tickValues.length * minimumTickSize / fullSize);
|
|
22401
22501
|
let newTickValues = [...tickValues];
|
|
22402
22502
|
if (tickSize < minimumTickSize) {
|
|
@@ -22408,12 +22508,12 @@
|
|
|
22408
22508
|
});
|
|
22409
22509
|
}
|
|
22410
22510
|
if ((scale == null ? void 0 : scale.type) === "LINEAR" || (scale == null ? void 0 : scale.type) === "BIN") {
|
|
22411
|
-
|
|
22511
|
+
newTickValues = getNiceTickValues({
|
|
22412
22512
|
tickValues: newTickValues,
|
|
22413
22513
|
scale
|
|
22414
22514
|
});
|
|
22415
22515
|
} else if ((scale == null ? void 0 : scale.type) === "TIME") {
|
|
22416
|
-
|
|
22516
|
+
newTickValues = getNiceDateTickValues({
|
|
22417
22517
|
tickValues: newTickValues,
|
|
22418
22518
|
scale
|
|
22419
22519
|
});
|
|
@@ -23892,8 +23992,9 @@
|
|
|
23892
23992
|
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
23893
23993
|
const reducedDescriptors = {};
|
|
23894
23994
|
forEach(descriptors2, (descriptor, name) => {
|
|
23895
|
-
|
|
23896
|
-
|
|
23995
|
+
let ret;
|
|
23996
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
23997
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
23897
23998
|
}
|
|
23898
23999
|
});
|
|
23899
24000
|
Object.defineProperties(obj, reducedDescriptors);
|
|
@@ -24433,9 +24534,6 @@
|
|
|
24433
24534
|
var formDataToJSON_default = formDataToJSON;
|
|
24434
24535
|
|
|
24435
24536
|
// node_modules/axios/lib/defaults/index.js
|
|
24436
|
-
var DEFAULT_CONTENT_TYPE = {
|
|
24437
|
-
"Content-Type": void 0
|
|
24438
|
-
};
|
|
24439
24537
|
function stringifySafely(rawValue, parser, encoder) {
|
|
24440
24538
|
if (utils_default.isString(rawValue)) {
|
|
24441
24539
|
try {
|
|
@@ -24451,7 +24549,7 @@
|
|
|
24451
24549
|
}
|
|
24452
24550
|
var defaults = {
|
|
24453
24551
|
transitional: transitional_default,
|
|
24454
|
-
adapter:
|
|
24552
|
+
adapter: node_default2.isNode ? "http" : "xhr",
|
|
24455
24553
|
transformRequest: [function transformRequest(data, headers) {
|
|
24456
24554
|
const contentType = headers.getContentType() || "";
|
|
24457
24555
|
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
@@ -24534,16 +24632,14 @@
|
|
|
24534
24632
|
},
|
|
24535
24633
|
headers: {
|
|
24536
24634
|
common: {
|
|
24537
|
-
"Accept": "application/json, text/plain, */*"
|
|
24635
|
+
"Accept": "application/json, text/plain, */*",
|
|
24636
|
+
"Content-Type": void 0
|
|
24538
24637
|
}
|
|
24539
24638
|
}
|
|
24540
24639
|
};
|
|
24541
|
-
utils_default.forEach(["delete", "get", "head"],
|
|
24640
|
+
utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
24542
24641
|
defaults.headers[method] = {};
|
|
24543
24642
|
});
|
|
24544
|
-
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
24545
|
-
defaults.headers[method] = utils_default.merge(DEFAULT_CONTENT_TYPE);
|
|
24546
|
-
});
|
|
24547
24643
|
var defaults_default = defaults;
|
|
24548
24644
|
|
|
24549
24645
|
// node_modules/axios/lib/helpers/parseHeaders.js
|
|
@@ -24797,7 +24893,15 @@
|
|
|
24797
24893
|
}
|
|
24798
24894
|
};
|
|
24799
24895
|
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
24800
|
-
utils_default.
|
|
24896
|
+
utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
24897
|
+
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
24898
|
+
return {
|
|
24899
|
+
get: () => value,
|
|
24900
|
+
set(headerValue) {
|
|
24901
|
+
this[mapped] = headerValue;
|
|
24902
|
+
}
|
|
24903
|
+
};
|
|
24904
|
+
});
|
|
24801
24905
|
utils_default.freezeMethods(AxiosHeaders);
|
|
24802
24906
|
var AxiosHeaders_default = AxiosHeaders;
|
|
24803
24907
|
|
|
@@ -24872,7 +24976,7 @@
|
|
|
24872
24976
|
var import_zlib = __toESM(__require("zlib"), 1);
|
|
24873
24977
|
|
|
24874
24978
|
// node_modules/axios/lib/env/data.js
|
|
24875
|
-
var VERSION = "1.
|
|
24979
|
+
var VERSION = "1.5.0";
|
|
24876
24980
|
|
|
24877
24981
|
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
24878
24982
|
function parseProtocol(url2) {
|
|
@@ -25541,10 +25645,10 @@
|
|
|
25541
25645
|
auth,
|
|
25542
25646
|
protocol,
|
|
25543
25647
|
family,
|
|
25544
|
-
lookup,
|
|
25545
25648
|
beforeRedirect: dispatchBeforeRedirect,
|
|
25546
25649
|
beforeRedirects: {}
|
|
25547
25650
|
};
|
|
25651
|
+
!utils_default.isUndefined(lookup) && (options.lookup = lookup);
|
|
25548
25652
|
if (config.socketPath) {
|
|
25549
25653
|
options.socketPath = config.socketPath;
|
|
25550
25654
|
} else {
|
|
@@ -26278,12 +26382,11 @@
|
|
|
26278
26382
|
}
|
|
26279
26383
|
}
|
|
26280
26384
|
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
26281
|
-
let contextHeaders
|
|
26282
|
-
contextHeaders = headers && utils_default.merge(
|
|
26385
|
+
let contextHeaders = headers && utils_default.merge(
|
|
26283
26386
|
headers.common,
|
|
26284
26387
|
headers[config.method]
|
|
26285
26388
|
);
|
|
26286
|
-
|
|
26389
|
+
headers && utils_default.forEach(
|
|
26287
26390
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
26288
26391
|
(method) => {
|
|
26289
26392
|
delete headers[method];
|
|
@@ -26348,7 +26451,7 @@
|
|
|
26348
26451
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
26349
26452
|
}
|
|
26350
26453
|
};
|
|
26351
|
-
utils_default.forEach(["delete", "get", "head", "options"], function
|
|
26454
|
+
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
26352
26455
|
Axios.prototype[method] = function(url2, config) {
|
|
26353
26456
|
return this.request(mergeConfig(config || {}, {
|
|
26354
26457
|
method,
|
|
@@ -26357,7 +26460,7 @@
|
|
|
26357
26460
|
}));
|
|
26358
26461
|
};
|
|
26359
26462
|
});
|
|
26360
|
-
utils_default.forEach(["post", "put", "patch"], function
|
|
26463
|
+
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
26361
26464
|
function generateHTTPMethod(isForm) {
|
|
26362
26465
|
return function httpMethod(url2, data, config) {
|
|
26363
26466
|
return this.request(mergeConfig(config || {}, {
|
|
@@ -26576,6 +26679,7 @@
|
|
|
26576
26679
|
axios.mergeConfig = mergeConfig;
|
|
26577
26680
|
axios.AxiosHeaders = AxiosHeaders_default;
|
|
26578
26681
|
axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
26682
|
+
axios.getAdapter = adapters_default.getAdapter;
|
|
26579
26683
|
axios.HttpStatusCode = HttpStatusCode_default;
|
|
26580
26684
|
axios.default = axios;
|
|
26581
26685
|
var axios_default = axios;
|
|
@@ -26596,19 +26700,71 @@
|
|
|
26596
26700
|
AxiosHeaders: AxiosHeaders2,
|
|
26597
26701
|
HttpStatusCode: HttpStatusCode2,
|
|
26598
26702
|
formToJSON,
|
|
26703
|
+
getAdapter,
|
|
26599
26704
|
mergeConfig: mergeConfig2
|
|
26600
26705
|
} = axios_default;
|
|
26601
26706
|
|
|
26602
26707
|
// src/Api/transforms.ts
|
|
26603
|
-
var
|
|
26708
|
+
var import_lodash8 = __toESM(require_lodash());
|
|
26709
|
+
var getQueryFn = (response) => {
|
|
26710
|
+
return ({
|
|
26711
|
+
authentication = {},
|
|
26712
|
+
autoQLConfig = {},
|
|
26713
|
+
originalQueryID,
|
|
26714
|
+
formattedTableParams,
|
|
26715
|
+
clickedFilter,
|
|
26716
|
+
...args
|
|
26717
|
+
}) => {
|
|
26718
|
+
var _a, _b;
|
|
26719
|
+
try {
|
|
26720
|
+
const queryRequestData = (_b = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) == null ? void 0 : _b.fe_req;
|
|
26721
|
+
const allFilters = getCombinedFilters(clickedFilter, response, formattedTableParams);
|
|
26722
|
+
const queryParams = {
|
|
26723
|
+
...authentication,
|
|
26724
|
+
...autoQLConfig,
|
|
26725
|
+
source: queryRequestData.source,
|
|
26726
|
+
scope: queryRequestData.scope,
|
|
26727
|
+
debug: (queryRequestData == null ? void 0 : queryRequestData.translation) === "include",
|
|
26728
|
+
filters: queryRequestData == null ? void 0 : queryRequestData.session_filter_locks,
|
|
26729
|
+
pageSize: queryRequestData == null ? void 0 : queryRequestData.page_size,
|
|
26730
|
+
groupBys: queryRequestData == null ? void 0 : queryRequestData.columns,
|
|
26731
|
+
orders: formattedTableParams == null ? void 0 : formattedTableParams.sorters,
|
|
26732
|
+
tableFilters: allFilters,
|
|
26733
|
+
...args
|
|
26734
|
+
};
|
|
26735
|
+
if (isDrilldown(response)) {
|
|
26736
|
+
return runDrilldown({
|
|
26737
|
+
...queryParams,
|
|
26738
|
+
queryID: originalQueryID != null ? originalQueryID : response.data.data.query_id
|
|
26739
|
+
});
|
|
26740
|
+
}
|
|
26741
|
+
return runQueryOnly({
|
|
26742
|
+
...queryParams,
|
|
26743
|
+
query: queryRequestData == null ? void 0 : queryRequestData.text,
|
|
26744
|
+
userSelection: queryRequestData == null ? void 0 : queryRequestData.disambiguation
|
|
26745
|
+
});
|
|
26746
|
+
} catch (error) {
|
|
26747
|
+
console.error(error);
|
|
26748
|
+
return error;
|
|
26749
|
+
}
|
|
26750
|
+
};
|
|
26751
|
+
};
|
|
26752
|
+
var transformQueryResponse = (response, originalQueryID) => {
|
|
26604
26753
|
var _a, _b;
|
|
26605
|
-
|
|
26606
|
-
|
|
26754
|
+
const transformedResponse = (0, import_lodash8.default)(response);
|
|
26755
|
+
if ((_b = (_a = transformedResponse == null ? void 0 : transformedResponse.data) == null ? void 0 : _a.data) == null ? void 0 : _b.columns) {
|
|
26756
|
+
const transformedColumns = transformQueryResponseColumns(transformedResponse);
|
|
26607
26757
|
if (transformedColumns) {
|
|
26608
|
-
|
|
26758
|
+
transformedResponse.data.data.columns = transformedColumns;
|
|
26759
|
+
}
|
|
26760
|
+
if (transformedResponse == null ? void 0 : transformedResponse.data) {
|
|
26761
|
+
transformedResponse.data.queryFn = getQueryFn(transformedResponse);
|
|
26762
|
+
}
|
|
26763
|
+
if (originalQueryID) {
|
|
26764
|
+
transformedResponse.data.originalQueryID = originalQueryID;
|
|
26609
26765
|
}
|
|
26610
26766
|
}
|
|
26611
|
-
return
|
|
26767
|
+
return transformedResponse;
|
|
26612
26768
|
};
|
|
26613
26769
|
var transformQueryResponseColumns = (response) => {
|
|
26614
26770
|
var _a, _b;
|
|
@@ -26996,7 +27152,7 @@
|
|
|
26996
27152
|
cancelToken
|
|
26997
27153
|
};
|
|
26998
27154
|
const url2 = `${domain}/autoql/api/v1/query/${queryID}/drilldown?key=${apiKey}`;
|
|
26999
|
-
return axios_default.post(url2, requestData, config).then((response) => transformQueryResponse(response)).catch(formatErrorResponse);
|
|
27155
|
+
return axios_default.post(url2, requestData, config).then((response) => transformQueryResponse(response, queryID)).catch(formatErrorResponse);
|
|
27000
27156
|
};
|
|
27001
27157
|
var fetchTopics = ({
|
|
27002
27158
|
domain,
|