mirror of https://github.com/ColorlibHQ/AdminLTE
update plugin files
parent
378a39ea12
commit
1c856b0d8c
|
@ -9759,7 +9759,7 @@ var dropzone_Dropzone = /*#__PURE__*/function (_Emitter) {
|
|||
|
||||
|
||||
dropzone_Dropzone.initClass();
|
||||
dropzone_Dropzone.version = "5.7.4"; // This is a map of options for your different dropzones. Add configurations
|
||||
dropzone_Dropzone.version = "5.7.6"; // This is a map of options for your different dropzones. Add configurations
|
||||
// to this object for your different dropzone elemens.
|
||||
//
|
||||
// Example:
|
||||
|
@ -9867,9 +9867,9 @@ dropzone_Dropzone.discover = function () {
|
|||
|
||||
return result;
|
||||
}();
|
||||
}; // Since the whole Drag'n'Drop API is pretty new, some browsers implement it,
|
||||
// but not correctly.
|
||||
// So I created a blacklist of userAgents. Yes, yes. Browser sniffing, I know.
|
||||
}; // Some browsers support drag and drog functionality, but not correctly.
|
||||
//
|
||||
// So I created a blocklist of userAgents. Yes, yes. Browser sniffing, I know.
|
||||
// But what to do when browsers *theoretically* support an API, but crash
|
||||
// when using it.
|
||||
//
|
||||
|
@ -9877,10 +9877,9 @@ dropzone_Dropzone.discover = function () {
|
|||
//
|
||||
// ** It should only be used on browser that *do* support the API, but
|
||||
// incorrectly **
|
||||
//
|
||||
|
||||
|
||||
dropzone_Dropzone.blacklistedBrowsers = [// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
|
||||
dropzone_Dropzone.blockedBrowsers = [// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
|
||||
/opera.*(Macintosh|Windows Phone).*version\/12/i]; // Checks if the browser is supported
|
||||
|
||||
dropzone_Dropzone.isBrowserSupported = function () {
|
||||
|
@ -9890,8 +9889,14 @@ dropzone_Dropzone.isBrowserSupported = function () {
|
|||
if (!("classList" in document.createElement("a"))) {
|
||||
capableBrowser = false;
|
||||
} else {
|
||||
// The browser supports the API, but may be blacklisted.
|
||||
var _iterator25 = dropzone_createForOfIteratorHelper(dropzone_Dropzone.blacklistedBrowsers, true),
|
||||
if (dropzone_Dropzone.blacklistedBrowsers !== undefined) {
|
||||
// Since this has been renamed, this makes sure we don't break older
|
||||
// configuration.
|
||||
dropzone_Dropzone.blockedBrowsers = dropzone_Dropzone.blacklistedBrowsers;
|
||||
} // The browser supports the API, but may be blocked.
|
||||
|
||||
|
||||
var _iterator25 = dropzone_createForOfIteratorHelper(dropzone_Dropzone.blockedBrowsers, true),
|
||||
_step25;
|
||||
|
||||
try {
|
||||
|
|
|
@ -9759,7 +9759,7 @@ var dropzone_Dropzone = /*#__PURE__*/function (_Emitter) {
|
|||
|
||||
|
||||
dropzone_Dropzone.initClass();
|
||||
dropzone_Dropzone.version = "5.7.4"; // This is a map of options for your different dropzones. Add configurations
|
||||
dropzone_Dropzone.version = "5.7.6"; // This is a map of options for your different dropzones. Add configurations
|
||||
// to this object for your different dropzone elemens.
|
||||
//
|
||||
// Example:
|
||||
|
@ -9867,9 +9867,9 @@ dropzone_Dropzone.discover = function () {
|
|||
|
||||
return result;
|
||||
}();
|
||||
}; // Since the whole Drag'n'Drop API is pretty new, some browsers implement it,
|
||||
// but not correctly.
|
||||
// So I created a blacklist of userAgents. Yes, yes. Browser sniffing, I know.
|
||||
}; // Some browsers support drag and drog functionality, but not correctly.
|
||||
//
|
||||
// So I created a blocklist of userAgents. Yes, yes. Browser sniffing, I know.
|
||||
// But what to do when browsers *theoretically* support an API, but crash
|
||||
// when using it.
|
||||
//
|
||||
|
@ -9877,10 +9877,9 @@ dropzone_Dropzone.discover = function () {
|
|||
//
|
||||
// ** It should only be used on browser that *do* support the API, but
|
||||
// incorrectly **
|
||||
//
|
||||
|
||||
|
||||
dropzone_Dropzone.blacklistedBrowsers = [// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
|
||||
dropzone_Dropzone.blockedBrowsers = [// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
|
||||
/opera.*(Macintosh|Windows Phone).*version\/12/i]; // Checks if the browser is supported
|
||||
|
||||
dropzone_Dropzone.isBrowserSupported = function () {
|
||||
|
@ -9890,8 +9889,14 @@ dropzone_Dropzone.isBrowserSupported = function () {
|
|||
if (!("classList" in document.createElement("a"))) {
|
||||
capableBrowser = false;
|
||||
} else {
|
||||
// The browser supports the API, but may be blacklisted.
|
||||
var _iterator25 = dropzone_createForOfIteratorHelper(dropzone_Dropzone.blacklistedBrowsers, true),
|
||||
if (dropzone_Dropzone.blacklistedBrowsers !== undefined) {
|
||||
// Since this has been renamed, this makes sure we don't break older
|
||||
// configuration.
|
||||
dropzone_Dropzone.blockedBrowsers = dropzone_Dropzone.blacklistedBrowsers;
|
||||
} // The browser supports the API, but may be blocked.
|
||||
|
||||
|
||||
var _iterator25 = dropzone_createForOfIteratorHelper(dropzone_Dropzone.blockedBrowsers, true),
|
||||
_step25;
|
||||
|
||||
try {
|
||||
|
|
|
@ -1 +1 @@
|
|||
.dropzone,.dropzone *{box-sizing:border-box}.dropzone{position:relative}.dropzone .dz-preview{position:relative;display:inline-block;width:120px;margin:0.5em}.dropzone .dz-preview .dz-progress{display:block;height:15px;border:1px solid #aaa}.dropzone .dz-preview .dz-progress .dz-upload{display:block;height:100%;width:0;background:green}.dropzone .dz-preview .dz-error-message{color:red;display:none}.dropzone .dz-preview.dz-error .dz-error-message,.dropzone .dz-preview.dz-error .dz-error-mark{display:block}.dropzone .dz-preview.dz-success .dz-success-mark{display:block}.dropzone .dz-preview .dz-error-mark,.dropzone .dz-preview .dz-success-mark{position:absolute;display:none;left:30px;top:30px;width:54px;height:58px;left:50%;margin-left:-27px}
|
||||
.dropzone,.dropzone *{box-sizing:border-box}.dropzone{position:relative}.dropzone .dz-preview{position:relative;display:inline-block;width:120px;margin:.5em}.dropzone .dz-preview .dz-progress{display:block;height:15px;border:1px solid #aaa}.dropzone .dz-preview .dz-progress .dz-upload{display:block;height:100%;width:0;background:green}.dropzone .dz-preview .dz-error-message{color:red;display:none}.dropzone .dz-preview.dz-error .dz-error-message,.dropzone .dz-preview.dz-error .dz-error-mark{display:block}.dropzone .dz-preview.dz-success .dz-success-mark{display:block}.dropzone .dz-preview .dz-error-mark,.dropzone .dz-preview .dz-success-mark{position:absolute;display:none;left:30px;top:30px;width:54px;height:58px;left:50%;margin-left:-27px}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
11371
plugins/jszip/jszip.js
11371
plugins/jszip/jszip.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* sweetalert2 v10.14.0
|
||||
* sweetalert2 v10.14.1
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
(function (global, factory) {
|
||||
|
@ -363,7 +363,7 @@
|
|||
};
|
||||
var getIcon = function getIcon() {
|
||||
var visibleIcon = getIcons().filter(function (icon) {
|
||||
return isVisible(icon);
|
||||
return icon.style.display !== 'none';
|
||||
});
|
||||
return visibleIcon.length ? visibleIcon[0] : null;
|
||||
};
|
||||
|
@ -3627,7 +3627,7 @@
|
|||
};
|
||||
});
|
||||
SweetAlert.DismissReason = DismissReason;
|
||||
SweetAlert.version = '10.14.0';
|
||||
SweetAlert.version = '10.14.1';
|
||||
|
||||
var Swal = SweetAlert;
|
||||
Swal["default"] = Swal;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* sweetalert2 v10.14.0
|
||||
* sweetalert2 v10.14.1
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
(function (global, factory) {
|
||||
|
@ -363,7 +363,7 @@
|
|||
};
|
||||
var getIcon = function getIcon() {
|
||||
var visibleIcon = getIcons().filter(function (icon) {
|
||||
return isVisible(icon);
|
||||
return icon.style.display !== 'none';
|
||||
});
|
||||
return visibleIcon.length ? visibleIcon[0] : null;
|
||||
};
|
||||
|
@ -3627,7 +3627,7 @@
|
|||
};
|
||||
});
|
||||
SweetAlert.DismissReason = DismissReason;
|
||||
SweetAlert.version = '10.14.0';
|
||||
SweetAlert.version = '10.14.1';
|
||||
|
||||
var Swal = SweetAlert;
|
||||
Swal["default"] = Swal;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* uPlot.js (μPlot)
|
||||
* A small, fast chart for time series, lines, areas, ohlc & bars
|
||||
* https://github.com/leeoniya/uPlot (v1.6.4)
|
||||
* https://github.com/leeoniya/uPlot (v1.6.5)
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
@ -110,6 +110,7 @@ function fixIncr(minIncr, maxIncr, minExp, maxExp) {
|
|||
}
|
||||
|
||||
function rangeLog(min, max, base, fullMags) {
|
||||
|
||||
let logFn = base == 10 ? log10 : log2;
|
||||
|
||||
if (min == max) {
|
||||
|
@ -129,8 +130,8 @@ function rangeLog(min, max, base, fullMags) {
|
|||
max = minMaxIncrs[1];
|
||||
}
|
||||
else {
|
||||
minExp = floor(logFn(min));
|
||||
maxExp = floor(logFn(max));
|
||||
minExp = floor(logFn(abs(min)));
|
||||
maxExp = floor(logFn(abs(max)));
|
||||
|
||||
minMaxIncrs = fixIncr(pow(base, minExp), pow(base, maxExp), minExp, maxExp);
|
||||
|
||||
|
@ -141,6 +142,18 @@ function rangeLog(min, max, base, fullMags) {
|
|||
return [min, max];
|
||||
}
|
||||
|
||||
function rangeAsinh(min, max, base, fullMags) {
|
||||
let minMax = rangeLog(min, max, base, fullMags);
|
||||
|
||||
if (min == 0)
|
||||
minMax[0] = 0;
|
||||
|
||||
if (max == 0)
|
||||
minMax[1] = 0;
|
||||
|
||||
return minMax;
|
||||
}
|
||||
|
||||
const _eqRangePart = {
|
||||
pad: 0,
|
||||
soft: null,
|
||||
|
@ -212,6 +225,7 @@ const fmtNum = new Intl.NumberFormat(navigator.language).format;
|
|||
|
||||
const M = Math;
|
||||
|
||||
const PI = M.PI;
|
||||
const abs = M.abs;
|
||||
const floor = M.floor;
|
||||
const round = M.round;
|
||||
|
@ -222,7 +236,8 @@ const pow = M.pow;
|
|||
const sqrt = M.sqrt;
|
||||
const log10 = M.log10;
|
||||
const log2 = M.log2;
|
||||
const PI = M.PI;
|
||||
const sinh = (v, linthresh = 1) => M.sinh(v / linthresh);
|
||||
const asinh = (v, linthresh = 1) => M.asinh(v / linthresh);
|
||||
|
||||
const inf = Infinity;
|
||||
|
||||
|
@ -1145,6 +1160,7 @@ function numAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace,
|
|||
return splits;
|
||||
}
|
||||
|
||||
// this doesnt work for sin, which needs to come off from 0 independently in pos and neg dirs
|
||||
function logAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace, forceMin) {
|
||||
const splits = [];
|
||||
|
||||
|
@ -1173,6 +1189,18 @@ function logAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace,
|
|||
return splits;
|
||||
}
|
||||
|
||||
function asinhAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace, forceMin) {
|
||||
let sc = self.scales[self.axes[axisIdx].scale];
|
||||
|
||||
let linthresh = sc.asinh;
|
||||
|
||||
let posSplits = scaleMax > linthresh ? logAxisSplits(self, axisIdx, max(linthresh, scaleMin), scaleMax, foundIncr) : [linthresh];
|
||||
let zero = scaleMax >= 0 && scaleMin <= 0 ? [0] : [];
|
||||
let negSplits = scaleMin < -linthresh ? logAxisSplits(self, axisIdx, max(linthresh, -scaleMax), -scaleMin, foundIncr): [linthresh];
|
||||
|
||||
return negSplits.reverse().map(v => -v).concat(zero, posSplits);
|
||||
}
|
||||
|
||||
const RE_ALL = /./;
|
||||
const RE_12357 = /[12357]/;
|
||||
const RE_125 = /[125]/;
|
||||
|
@ -1181,8 +1209,9 @@ const RE_1 = /1/;
|
|||
function logAxisValsFilt(self, splits, axisIdx, foundSpace, foundIncr) {
|
||||
let axis = self.axes[axisIdx];
|
||||
let scaleKey = axis.scale;
|
||||
let sc = self.scales[scaleKey];
|
||||
|
||||
if (self.scales[scaleKey].log == 2)
|
||||
if (sc.distr == 3 && sc.log == 2)
|
||||
return splits;
|
||||
|
||||
let valToPos = self.valToPos;
|
||||
|
@ -1198,7 +1227,7 @@ function logAxisValsFilt(self, splits, axisIdx, foundSpace, foundIncr) {
|
|||
RE_1
|
||||
);
|
||||
|
||||
return splits.map(v => re.test(v) ? v : null);
|
||||
return splits.map(v => ((sc.distr == 4 && v == 0) || re.test(v)) ? v : null);
|
||||
}
|
||||
|
||||
function numSeriesVal(self, val) {
|
||||
|
@ -1292,6 +1321,7 @@ const xScaleOpts = {
|
|||
auto: true,
|
||||
distr: 1,
|
||||
log: 10,
|
||||
asinh: 1,
|
||||
min: null,
|
||||
max: null,
|
||||
dir: 1,
|
||||
|
@ -1305,10 +1335,14 @@ const yScaleOpts = assign({}, xScaleOpts, {
|
|||
|
||||
const syncs = {};
|
||||
|
||||
function _sync(opts) {
|
||||
function _sync(key, opts) {
|
||||
let s = syncs[key];
|
||||
|
||||
if (!s) {
|
||||
let clients = [];
|
||||
|
||||
return {
|
||||
s = {
|
||||
key,
|
||||
sub(client) {
|
||||
clients.push(client);
|
||||
},
|
||||
|
@ -1316,13 +1350,16 @@ function _sync(opts) {
|
|||
clients = clients.filter(c => c != client);
|
||||
},
|
||||
pub(type, self, x, y, w, h, i) {
|
||||
if (clients.length > 1) {
|
||||
clients.forEach(client => {
|
||||
client != self && client.pub(type, self, x, y, w, h, i);
|
||||
});
|
||||
}
|
||||
for (let i = 0; i < clients.length; i++)
|
||||
clients[i] != self && clients[i].pub(type, self, x, y, w, h, i);
|
||||
}
|
||||
};
|
||||
|
||||
if (key != null)
|
||||
syncs[key] = s;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function orient(u, seriesIdx, cb) {
|
||||
|
@ -2012,6 +2049,12 @@ function snapLogY(self, dataMin, dataMax, scale) {
|
|||
|
||||
const snapLogX = snapLogY;
|
||||
|
||||
function snapAsinhY(self, dataMin, dataMax, scale) {
|
||||
return dataMin == null ? nullMinMax : rangeAsinh(dataMin, dataMax, self.scales[scale].log, false);
|
||||
}
|
||||
|
||||
const snapAsinhX = snapAsinhY;
|
||||
|
||||
// dim is logical (getClientBoundingRect) pixels, not canvas pixels
|
||||
function findIncr(min, max, incrs, dim, minSpace) {
|
||||
let pxPerUnit = dim / (max - min);
|
||||
|
@ -2039,12 +2082,15 @@ function pxRatioFont(font) {
|
|||
function uPlot(opts, data, then) {
|
||||
const self = {};
|
||||
|
||||
// TODO: cache denoms & mins scale.cache = {r, min, }
|
||||
function getValPct(val, scale) {
|
||||
return (
|
||||
scale.distr == 3
|
||||
? log10((val > 0 ? val : scale.clamp(self, val, scale.min, scale.max, scale.key)) / scale.min) / log10(scale.max / scale.min)
|
||||
: (val - scale.min) / (scale.max - scale.min)
|
||||
let _val = (
|
||||
scale.distr == 3 ? log10(val > 0 ? val : scale.clamp(self, val, scale.min, scale.max, scale.key)) :
|
||||
scale.distr == 4 ? asinh(val, scale.asinh) :
|
||||
val
|
||||
);
|
||||
|
||||
return (_val - scale._min) / (scale._max - scale._min);
|
||||
}
|
||||
|
||||
function getHPos(val, scale, dim, off) {
|
||||
|
@ -2134,7 +2180,6 @@ function uPlot(opts, data, then) {
|
|||
sc.key = scaleKey;
|
||||
|
||||
let isTime = sc.time;
|
||||
let isLog = sc.distr == 3;
|
||||
|
||||
let rn = sc.range;
|
||||
|
||||
|
@ -2144,11 +2189,17 @@ function uPlot(opts, data, then) {
|
|||
rn = (self, dataMin, dataMax) => dataMin == null ? nullMinMax : rangeNum(dataMin, dataMax, cfg);
|
||||
}
|
||||
|
||||
sc.range = fnOrSelf(rn || (isTime ? snapTimeX : scaleKey == xScaleKey ? (isLog ? snapLogX : snapNumX) : (isLog ? snapLogY : snapNumY)));
|
||||
sc.range = fnOrSelf(rn || (isTime ? snapTimeX : scaleKey == xScaleKey ?
|
||||
(sc.distr == 3 ? snapLogX : sc.distr == 4 ? snapAsinhX : snapNumX) :
|
||||
(sc.distr == 3 ? snapLogY : sc.distr == 4 ? snapAsinhY : snapNumY)
|
||||
));
|
||||
|
||||
sc.auto = fnOrSelf(sc.auto);
|
||||
|
||||
sc.clamp = fnOrSelf(sc.clamp || clampScale);
|
||||
|
||||
// caches for expensive ops like asinh() & log()
|
||||
sc._min = sc._max = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2629,7 +2680,7 @@ function uPlot(opts, data, then) {
|
|||
axis.space = fnOrSelf(axis.space);
|
||||
axis.rotate = fnOrSelf(axis.rotate);
|
||||
axis.incrs = fnOrSelf(axis.incrs || ( sc.distr == 2 ? wholeIncrs : (isTime ? (ms == 1 ? timeIncrsMs : timeIncrsS) : numIncrs)));
|
||||
axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : numAxisSplits));
|
||||
axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : sc.distr == 4 ? asinhAxisSplits : numAxisSplits));
|
||||
|
||||
axis.stroke = fnOrSelf(axis.stroke);
|
||||
axis.grid.stroke = fnOrSelf(axis.grid.stroke);
|
||||
|
@ -2647,7 +2698,7 @@ function uPlot(opts, data, then) {
|
|||
) : av || numAxisVals
|
||||
);
|
||||
|
||||
axis.filter = fnOrSelf(axis.filter || ( sc.distr == 3 ? logAxisValsFilt : retArg1));
|
||||
axis.filter = fnOrSelf(axis.filter || ( sc.distr >= 3 ? logAxisValsFilt : retArg1));
|
||||
|
||||
axis.font = pxRatioFont(axis.font);
|
||||
axis.labelFont = pxRatioFont(axis.labelFont);
|
||||
|
@ -2750,6 +2801,8 @@ function uPlot(opts, data, then) {
|
|||
else if (dataLen == 1) {
|
||||
if (xScaleDistr == 3)
|
||||
[_min, _max] = rangeLog(_min, _min, scaleX.log, false);
|
||||
else if (xScaleDistr == 4)
|
||||
[_min, _max] = rangeAsinh(_min, _min, scaleX.log, false);
|
||||
else if (scaleX.time)
|
||||
_max = _min + 86400 / ms;
|
||||
else
|
||||
|
@ -2881,6 +2934,12 @@ function uPlot(opts, data, then) {
|
|||
if (sc.min != wsc.min || sc.max != wsc.max) {
|
||||
sc.min = wsc.min;
|
||||
sc.max = wsc.max;
|
||||
|
||||
let distr = sc.distr;
|
||||
|
||||
sc._min = distr == 3 ? log10(sc.min) : distr == 4 ? asinh(sc.min, sc.asinh) : sc.min;
|
||||
sc._max = distr == 3 ? log10(sc.max) : distr == 4 ? asinh(sc.max, sc.asinh) : sc.max;
|
||||
|
||||
changed[k] = anyChanged = true;
|
||||
}
|
||||
}
|
||||
|
@ -3700,17 +3759,19 @@ function uPlot(opts, data, then) {
|
|||
if (sc.dir == -1)
|
||||
pos = dim - pos;
|
||||
|
||||
let _min = sc.min,
|
||||
_max = sc.max,
|
||||
let _min = sc._min,
|
||||
_max = sc._max,
|
||||
pct = pos / dim;
|
||||
|
||||
if (sc.distr == 3) {
|
||||
_min = log10(_min);
|
||||
_max = log10(_max);
|
||||
return pow(10, _min + (_max - _min) * pct);
|
||||
}
|
||||
else
|
||||
return _min + (_max - _min) * pct;
|
||||
let sv = _min + (_max - _min) * pct;
|
||||
|
||||
let distr = sc.distr;
|
||||
|
||||
return (
|
||||
distr == 3 ? pow(10, sv) :
|
||||
distr == 4 ? sinh(sv, sc.asinh) :
|
||||
sv
|
||||
);
|
||||
}
|
||||
|
||||
function closestIdxFromXpos(pos) {
|
||||
|
@ -3945,7 +4006,7 @@ function uPlot(opts, data, then) {
|
|||
let uni = drag.uni;
|
||||
|
||||
if (uni != null) {
|
||||
// only calc drag status if they pass the dist thresh
|
||||
// only calc drag status if they pass the dist asinh
|
||||
if (dragX && dragY) {
|
||||
dragX = rawDX >= uni;
|
||||
dragY = rawDY >= uni;
|
||||
|
@ -4319,7 +4380,7 @@ function uPlot(opts, data, then) {
|
|||
|
||||
const syncKey = syncOpts.key;
|
||||
|
||||
const sync = (syncKey != null ? (syncs[syncKey] = syncs[syncKey] || _sync()) : _sync());
|
||||
const sync = _sync(syncKey);
|
||||
|
||||
sync.sub(self);
|
||||
|
||||
|
@ -4372,6 +4433,7 @@ uPlot.assign = assign;
|
|||
uPlot.fmtNum = fmtNum;
|
||||
uPlot.rangeNum = rangeNum;
|
||||
uPlot.rangeLog = rangeLog;
|
||||
uPlot.rangeAsinh = rangeAsinh;
|
||||
uPlot.orient = orient;
|
||||
|
||||
{
|
||||
|
@ -4383,6 +4445,10 @@ uPlot.orient = orient;
|
|||
uPlot.tzDate = tzDate;
|
||||
}
|
||||
|
||||
{
|
||||
uPlot.sync = _sync;
|
||||
}
|
||||
|
||||
{
|
||||
uPlot.addGap = addGap;
|
||||
uPlot.clipGaps = clipGaps;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* uPlot.js (μPlot)
|
||||
* A small, fast chart for time series, lines, areas, ohlc & bars
|
||||
* https://github.com/leeoniya/uPlot (v1.6.4)
|
||||
* https://github.com/leeoniya/uPlot (v1.6.5)
|
||||
*/
|
||||
|
||||
const FEAT_TIME = true;
|
||||
|
@ -108,6 +108,7 @@ function fixIncr(minIncr, maxIncr, minExp, maxExp) {
|
|||
}
|
||||
|
||||
function rangeLog(min, max, base, fullMags) {
|
||||
|
||||
let logFn = base == 10 ? log10 : log2;
|
||||
|
||||
if (min == max) {
|
||||
|
@ -127,8 +128,8 @@ function rangeLog(min, max, base, fullMags) {
|
|||
max = minMaxIncrs[1];
|
||||
}
|
||||
else {
|
||||
minExp = floor(logFn(min));
|
||||
maxExp = floor(logFn(max));
|
||||
minExp = floor(logFn(abs(min)));
|
||||
maxExp = floor(logFn(abs(max)));
|
||||
|
||||
minMaxIncrs = fixIncr(pow(base, minExp), pow(base, maxExp), minExp, maxExp);
|
||||
|
||||
|
@ -139,6 +140,18 @@ function rangeLog(min, max, base, fullMags) {
|
|||
return [min, max];
|
||||
}
|
||||
|
||||
function rangeAsinh(min, max, base, fullMags) {
|
||||
let minMax = rangeLog(min, max, base, fullMags);
|
||||
|
||||
if (min == 0)
|
||||
minMax[0] = 0;
|
||||
|
||||
if (max == 0)
|
||||
minMax[1] = 0;
|
||||
|
||||
return minMax;
|
||||
}
|
||||
|
||||
const _eqRangePart = {
|
||||
pad: 0,
|
||||
soft: null,
|
||||
|
@ -210,6 +223,7 @@ const fmtNum = new Intl.NumberFormat(navigator.language).format;
|
|||
|
||||
const M = Math;
|
||||
|
||||
const PI = M.PI;
|
||||
const abs = M.abs;
|
||||
const floor = M.floor;
|
||||
const round = M.round;
|
||||
|
@ -220,7 +234,8 @@ const pow = M.pow;
|
|||
const sqrt = M.sqrt;
|
||||
const log10 = M.log10;
|
||||
const log2 = M.log2;
|
||||
const PI = M.PI;
|
||||
const sinh = (v, linthresh = 1) => M.sinh(v / linthresh);
|
||||
const asinh = (v, linthresh = 1) => M.asinh(v / linthresh);
|
||||
|
||||
const inf = Infinity;
|
||||
|
||||
|
@ -1143,6 +1158,7 @@ function numAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace,
|
|||
return splits;
|
||||
}
|
||||
|
||||
// this doesnt work for sin, which needs to come off from 0 independently in pos and neg dirs
|
||||
function logAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace, forceMin) {
|
||||
const splits = [];
|
||||
|
||||
|
@ -1171,6 +1187,18 @@ function logAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace,
|
|||
return splits;
|
||||
}
|
||||
|
||||
function asinhAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace, forceMin) {
|
||||
let sc = self.scales[self.axes[axisIdx].scale];
|
||||
|
||||
let linthresh = sc.asinh;
|
||||
|
||||
let posSplits = scaleMax > linthresh ? logAxisSplits(self, axisIdx, max(linthresh, scaleMin), scaleMax, foundIncr) : [linthresh];
|
||||
let zero = scaleMax >= 0 && scaleMin <= 0 ? [0] : [];
|
||||
let negSplits = scaleMin < -linthresh ? logAxisSplits(self, axisIdx, max(linthresh, -scaleMax), -scaleMin, foundIncr): [linthresh];
|
||||
|
||||
return negSplits.reverse().map(v => -v).concat(zero, posSplits);
|
||||
}
|
||||
|
||||
const RE_ALL = /./;
|
||||
const RE_12357 = /[12357]/;
|
||||
const RE_125 = /[125]/;
|
||||
|
@ -1179,8 +1207,9 @@ const RE_1 = /1/;
|
|||
function logAxisValsFilt(self, splits, axisIdx, foundSpace, foundIncr) {
|
||||
let axis = self.axes[axisIdx];
|
||||
let scaleKey = axis.scale;
|
||||
let sc = self.scales[scaleKey];
|
||||
|
||||
if (self.scales[scaleKey].log == 2)
|
||||
if (sc.distr == 3 && sc.log == 2)
|
||||
return splits;
|
||||
|
||||
let valToPos = self.valToPos;
|
||||
|
@ -1196,7 +1225,7 @@ function logAxisValsFilt(self, splits, axisIdx, foundSpace, foundIncr) {
|
|||
RE_1
|
||||
);
|
||||
|
||||
return splits.map(v => re.test(v) ? v : null);
|
||||
return splits.map(v => ((sc.distr == 4 && v == 0) || re.test(v)) ? v : null);
|
||||
}
|
||||
|
||||
function numSeriesVal(self, val) {
|
||||
|
@ -1290,6 +1319,7 @@ const xScaleOpts = {
|
|||
auto: true,
|
||||
distr: 1,
|
||||
log: 10,
|
||||
asinh: 1,
|
||||
min: null,
|
||||
max: null,
|
||||
dir: 1,
|
||||
|
@ -1303,10 +1333,14 @@ const yScaleOpts = assign({}, xScaleOpts, {
|
|||
|
||||
const syncs = {};
|
||||
|
||||
function _sync(opts) {
|
||||
function _sync(key, opts) {
|
||||
let s = syncs[key];
|
||||
|
||||
if (!s) {
|
||||
let clients = [];
|
||||
|
||||
return {
|
||||
s = {
|
||||
key,
|
||||
sub(client) {
|
||||
clients.push(client);
|
||||
},
|
||||
|
@ -1314,13 +1348,16 @@ function _sync(opts) {
|
|||
clients = clients.filter(c => c != client);
|
||||
},
|
||||
pub(type, self, x, y, w, h, i) {
|
||||
if (clients.length > 1) {
|
||||
clients.forEach(client => {
|
||||
client != self && client.pub(type, self, x, y, w, h, i);
|
||||
});
|
||||
}
|
||||
for (let i = 0; i < clients.length; i++)
|
||||
clients[i] != self && clients[i].pub(type, self, x, y, w, h, i);
|
||||
}
|
||||
};
|
||||
|
||||
if (key != null)
|
||||
syncs[key] = s;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function orient(u, seriesIdx, cb) {
|
||||
|
@ -2010,6 +2047,12 @@ function snapLogY(self, dataMin, dataMax, scale) {
|
|||
|
||||
const snapLogX = snapLogY;
|
||||
|
||||
function snapAsinhY(self, dataMin, dataMax, scale) {
|
||||
return dataMin == null ? nullMinMax : rangeAsinh(dataMin, dataMax, self.scales[scale].log, false);
|
||||
}
|
||||
|
||||
const snapAsinhX = snapAsinhY;
|
||||
|
||||
// dim is logical (getClientBoundingRect) pixels, not canvas pixels
|
||||
function findIncr(min, max, incrs, dim, minSpace) {
|
||||
let pxPerUnit = dim / (max - min);
|
||||
|
@ -2037,12 +2080,15 @@ function pxRatioFont(font) {
|
|||
function uPlot(opts, data, then) {
|
||||
const self = {};
|
||||
|
||||
// TODO: cache denoms & mins scale.cache = {r, min, }
|
||||
function getValPct(val, scale) {
|
||||
return (
|
||||
scale.distr == 3
|
||||
? log10((val > 0 ? val : scale.clamp(self, val, scale.min, scale.max, scale.key)) / scale.min) / log10(scale.max / scale.min)
|
||||
: (val - scale.min) / (scale.max - scale.min)
|
||||
let _val = (
|
||||
scale.distr == 3 ? log10(val > 0 ? val : scale.clamp(self, val, scale.min, scale.max, scale.key)) :
|
||||
scale.distr == 4 ? asinh(val, scale.asinh) :
|
||||
val
|
||||
);
|
||||
|
||||
return (_val - scale._min) / (scale._max - scale._min);
|
||||
}
|
||||
|
||||
function getHPos(val, scale, dim, off) {
|
||||
|
@ -2132,7 +2178,6 @@ function uPlot(opts, data, then) {
|
|||
sc.key = scaleKey;
|
||||
|
||||
let isTime = sc.time;
|
||||
let isLog = sc.distr == 3;
|
||||
|
||||
let rn = sc.range;
|
||||
|
||||
|
@ -2142,11 +2187,17 @@ function uPlot(opts, data, then) {
|
|||
rn = (self, dataMin, dataMax) => dataMin == null ? nullMinMax : rangeNum(dataMin, dataMax, cfg);
|
||||
}
|
||||
|
||||
sc.range = fnOrSelf(rn || (isTime ? snapTimeX : scaleKey == xScaleKey ? (isLog ? snapLogX : snapNumX) : (isLog ? snapLogY : snapNumY)));
|
||||
sc.range = fnOrSelf(rn || (isTime ? snapTimeX : scaleKey == xScaleKey ?
|
||||
(sc.distr == 3 ? snapLogX : sc.distr == 4 ? snapAsinhX : snapNumX) :
|
||||
(sc.distr == 3 ? snapLogY : sc.distr == 4 ? snapAsinhY : snapNumY)
|
||||
));
|
||||
|
||||
sc.auto = fnOrSelf(sc.auto);
|
||||
|
||||
sc.clamp = fnOrSelf(sc.clamp || clampScale);
|
||||
|
||||
// caches for expensive ops like asinh() & log()
|
||||
sc._min = sc._max = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2627,7 +2678,7 @@ function uPlot(opts, data, then) {
|
|||
axis.space = fnOrSelf(axis.space);
|
||||
axis.rotate = fnOrSelf(axis.rotate);
|
||||
axis.incrs = fnOrSelf(axis.incrs || ( sc.distr == 2 ? wholeIncrs : (isTime ? (ms == 1 ? timeIncrsMs : timeIncrsS) : numIncrs)));
|
||||
axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : numAxisSplits));
|
||||
axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : sc.distr == 4 ? asinhAxisSplits : numAxisSplits));
|
||||
|
||||
axis.stroke = fnOrSelf(axis.stroke);
|
||||
axis.grid.stroke = fnOrSelf(axis.grid.stroke);
|
||||
|
@ -2645,7 +2696,7 @@ function uPlot(opts, data, then) {
|
|||
) : av || numAxisVals
|
||||
);
|
||||
|
||||
axis.filter = fnOrSelf(axis.filter || ( sc.distr == 3 ? logAxisValsFilt : retArg1));
|
||||
axis.filter = fnOrSelf(axis.filter || ( sc.distr >= 3 ? logAxisValsFilt : retArg1));
|
||||
|
||||
axis.font = pxRatioFont(axis.font);
|
||||
axis.labelFont = pxRatioFont(axis.labelFont);
|
||||
|
@ -2748,6 +2799,8 @@ function uPlot(opts, data, then) {
|
|||
else if (dataLen == 1) {
|
||||
if (xScaleDistr == 3)
|
||||
[_min, _max] = rangeLog(_min, _min, scaleX.log, false);
|
||||
else if (xScaleDistr == 4)
|
||||
[_min, _max] = rangeAsinh(_min, _min, scaleX.log, false);
|
||||
else if (scaleX.time)
|
||||
_max = _min + 86400 / ms;
|
||||
else
|
||||
|
@ -2879,6 +2932,12 @@ function uPlot(opts, data, then) {
|
|||
if (sc.min != wsc.min || sc.max != wsc.max) {
|
||||
sc.min = wsc.min;
|
||||
sc.max = wsc.max;
|
||||
|
||||
let distr = sc.distr;
|
||||
|
||||
sc._min = distr == 3 ? log10(sc.min) : distr == 4 ? asinh(sc.min, sc.asinh) : sc.min;
|
||||
sc._max = distr == 3 ? log10(sc.max) : distr == 4 ? asinh(sc.max, sc.asinh) : sc.max;
|
||||
|
||||
changed[k] = anyChanged = true;
|
||||
}
|
||||
}
|
||||
|
@ -3698,17 +3757,19 @@ function uPlot(opts, data, then) {
|
|||
if (sc.dir == -1)
|
||||
pos = dim - pos;
|
||||
|
||||
let _min = sc.min,
|
||||
_max = sc.max,
|
||||
let _min = sc._min,
|
||||
_max = sc._max,
|
||||
pct = pos / dim;
|
||||
|
||||
if (sc.distr == 3) {
|
||||
_min = log10(_min);
|
||||
_max = log10(_max);
|
||||
return pow(10, _min + (_max - _min) * pct);
|
||||
}
|
||||
else
|
||||
return _min + (_max - _min) * pct;
|
||||
let sv = _min + (_max - _min) * pct;
|
||||
|
||||
let distr = sc.distr;
|
||||
|
||||
return (
|
||||
distr == 3 ? pow(10, sv) :
|
||||
distr == 4 ? sinh(sv, sc.asinh) :
|
||||
sv
|
||||
);
|
||||
}
|
||||
|
||||
function closestIdxFromXpos(pos) {
|
||||
|
@ -3943,7 +4004,7 @@ function uPlot(opts, data, then) {
|
|||
let uni = drag.uni;
|
||||
|
||||
if (uni != null) {
|
||||
// only calc drag status if they pass the dist thresh
|
||||
// only calc drag status if they pass the dist asinh
|
||||
if (dragX && dragY) {
|
||||
dragX = rawDX >= uni;
|
||||
dragY = rawDY >= uni;
|
||||
|
@ -4317,7 +4378,7 @@ function uPlot(opts, data, then) {
|
|||
|
||||
const syncKey = syncOpts.key;
|
||||
|
||||
const sync = (syncKey != null ? (syncs[syncKey] = syncs[syncKey] || _sync()) : _sync());
|
||||
const sync = _sync(syncKey);
|
||||
|
||||
sync.sub(self);
|
||||
|
||||
|
@ -4370,6 +4431,7 @@ uPlot.assign = assign;
|
|||
uPlot.fmtNum = fmtNum;
|
||||
uPlot.rangeNum = rangeNum;
|
||||
uPlot.rangeLog = rangeLog;
|
||||
uPlot.rangeAsinh = rangeAsinh;
|
||||
uPlot.orient = orient;
|
||||
|
||||
{
|
||||
|
@ -4381,6 +4443,10 @@ uPlot.orient = orient;
|
|||
uPlot.tzDate = tzDate;
|
||||
}
|
||||
|
||||
{
|
||||
uPlot.sync = _sync;
|
||||
}
|
||||
|
||||
{
|
||||
uPlot.addGap = addGap;
|
||||
uPlot.clipGaps = clipGaps;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* uPlot.js (μPlot)
|
||||
* A small, fast chart for time series, lines, areas, ohlc & bars
|
||||
* https://github.com/leeoniya/uPlot (v1.6.4)
|
||||
* https://github.com/leeoniya/uPlot (v1.6.5)
|
||||
*/
|
||||
|
||||
var uPlot = (function () {
|
||||
|
@ -110,6 +110,7 @@ var uPlot = (function () {
|
|||
}
|
||||
|
||||
function rangeLog(min, max, base, fullMags) {
|
||||
|
||||
var logFn = base == 10 ? log10 : log2;
|
||||
|
||||
if (min == max) {
|
||||
|
@ -129,8 +130,8 @@ var uPlot = (function () {
|
|||
max = minMaxIncrs[1];
|
||||
}
|
||||
else {
|
||||
minExp = floor(logFn(min));
|
||||
maxExp = floor(logFn(max));
|
||||
minExp = floor(logFn(abs(min)));
|
||||
maxExp = floor(logFn(abs(max)));
|
||||
|
||||
minMaxIncrs = fixIncr(pow(base, minExp), pow(base, maxExp), minExp, maxExp);
|
||||
|
||||
|
@ -141,6 +142,18 @@ var uPlot = (function () {
|
|||
return [min, max];
|
||||
}
|
||||
|
||||
function rangeAsinh(min, max, base, fullMags) {
|
||||
var minMax = rangeLog(min, max, base, fullMags);
|
||||
|
||||
if (min == 0)
|
||||
{ minMax[0] = 0; }
|
||||
|
||||
if (max == 0)
|
||||
{ minMax[1] = 0; }
|
||||
|
||||
return minMax;
|
||||
}
|
||||
|
||||
var _eqRangePart = {
|
||||
pad: 0,
|
||||
soft: null,
|
||||
|
@ -212,6 +225,7 @@ var uPlot = (function () {
|
|||
|
||||
var M = Math;
|
||||
|
||||
var PI = M.PI;
|
||||
var abs = M.abs;
|
||||
var floor = M.floor;
|
||||
var round = M.round;
|
||||
|
@ -222,7 +236,16 @@ var uPlot = (function () {
|
|||
var sqrt = M.sqrt;
|
||||
var log10 = M.log10;
|
||||
var log2 = M.log2;
|
||||
var PI = M.PI;
|
||||
var sinh = (v, linthresh) => {
|
||||
if ( linthresh === void 0 ) linthresh = 1;
|
||||
|
||||
return M.sinh(v / linthresh);
|
||||
};
|
||||
var asinh = (v, linthresh) => {
|
||||
if ( linthresh === void 0 ) linthresh = 1;
|
||||
|
||||
return M.asinh(v / linthresh);
|
||||
};
|
||||
|
||||
var inf = Infinity;
|
||||
|
||||
|
@ -1146,6 +1169,7 @@ var uPlot = (function () {
|
|||
return splits;
|
||||
}
|
||||
|
||||
// this doesnt work for sin, which needs to come off from 0 independently in pos and neg dirs
|
||||
function logAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace, forceMin) {
|
||||
var splits = [];
|
||||
|
||||
|
@ -1174,6 +1198,18 @@ var uPlot = (function () {
|
|||
return splits;
|
||||
}
|
||||
|
||||
function asinhAxisSplits(self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace, forceMin) {
|
||||
var sc = self.scales[self.axes[axisIdx].scale];
|
||||
|
||||
var linthresh = sc.asinh;
|
||||
|
||||
var posSplits = scaleMax > linthresh ? logAxisSplits(self, axisIdx, max(linthresh, scaleMin), scaleMax, foundIncr) : [linthresh];
|
||||
var zero = scaleMax >= 0 && scaleMin <= 0 ? [0] : [];
|
||||
var negSplits = scaleMin < -linthresh ? logAxisSplits(self, axisIdx, max(linthresh, -scaleMax), -scaleMin, foundIncr): [linthresh];
|
||||
|
||||
return negSplits.reverse().map(v => -v).concat(zero, posSplits);
|
||||
}
|
||||
|
||||
var RE_ALL = /./;
|
||||
var RE_12357 = /[12357]/;
|
||||
var RE_125 = /[125]/;
|
||||
|
@ -1182,8 +1218,9 @@ var uPlot = (function () {
|
|||
function logAxisValsFilt(self, splits, axisIdx, foundSpace, foundIncr) {
|
||||
var axis = self.axes[axisIdx];
|
||||
var scaleKey = axis.scale;
|
||||
var sc = self.scales[scaleKey];
|
||||
|
||||
if (self.scales[scaleKey].log == 2)
|
||||
if (sc.distr == 3 && sc.log == 2)
|
||||
{ return splits; }
|
||||
|
||||
var valToPos = self.valToPos;
|
||||
|
@ -1199,7 +1236,7 @@ var uPlot = (function () {
|
|||
RE_1
|
||||
);
|
||||
|
||||
return splits.map(v => re.test(v) ? v : null);
|
||||
return splits.map(v => ((sc.distr == 4 && v == 0) || re.test(v)) ? v : null);
|
||||
}
|
||||
|
||||
function numSeriesVal(self, val) {
|
||||
|
@ -1293,6 +1330,7 @@ var uPlot = (function () {
|
|||
auto: true,
|
||||
distr: 1,
|
||||
log: 10,
|
||||
asinh: 1,
|
||||
min: null,
|
||||
max: null,
|
||||
dir: 1,
|
||||
|
@ -1306,10 +1344,14 @@ var uPlot = (function () {
|
|||
|
||||
var syncs = {};
|
||||
|
||||
function _sync(opts) {
|
||||
function _sync(key, opts) {
|
||||
var s = syncs[key];
|
||||
|
||||
if (!s) {
|
||||
var clients = [];
|
||||
|
||||
return {
|
||||
s = {
|
||||
key: key,
|
||||
sub: function sub(client) {
|
||||
clients.push(client);
|
||||
},
|
||||
|
@ -1317,13 +1359,16 @@ var uPlot = (function () {
|
|||
clients = clients.filter(c => c != client);
|
||||
},
|
||||
pub: function pub(type, self, x, y, w, h, i) {
|
||||
if (clients.length > 1) {
|
||||
clients.forEach(client => {
|
||||
client != self && client.pub(type, self, x, y, w, h, i);
|
||||
});
|
||||
}
|
||||
for (var i$1 = 0; i$1 < clients.length; i$1++)
|
||||
{ clients[i$1] != self && clients[i$1].pub(type, self, x, y, w, h, i$1); }
|
||||
}
|
||||
};
|
||||
|
||||
if (key != null)
|
||||
{ syncs[key] = s; }
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
function orient(u, seriesIdx, cb) {
|
||||
|
@ -2006,6 +2051,12 @@ var uPlot = (function () {
|
|||
|
||||
var snapLogX = snapLogY;
|
||||
|
||||
function snapAsinhY(self, dataMin, dataMax, scale) {
|
||||
return dataMin == null ? nullMinMax : rangeAsinh(dataMin, dataMax, self.scales[scale].log, false);
|
||||
}
|
||||
|
||||
var snapAsinhX = snapAsinhY;
|
||||
|
||||
// dim is logical (getClientBoundingRect) pixels, not canvas pixels
|
||||
function findIncr(min, max, incrs, dim, minSpace) {
|
||||
var pxPerUnit = dim / (max - min);
|
||||
|
@ -2033,12 +2084,15 @@ var uPlot = (function () {
|
|||
function uPlot(opts, data, then) {
|
||||
var self = {};
|
||||
|
||||
// TODO: cache denoms & mins scale.cache = {r, min, }
|
||||
function getValPct(val, scale) {
|
||||
return (
|
||||
scale.distr == 3
|
||||
? log10((val > 0 ? val : scale.clamp(self, val, scale.min, scale.max, scale.key)) / scale.min) / log10(scale.max / scale.min)
|
||||
: (val - scale.min) / (scale.max - scale.min)
|
||||
var _val = (
|
||||
scale.distr == 3 ? log10(val > 0 ? val : scale.clamp(self, val, scale.min, scale.max, scale.key)) :
|
||||
scale.distr == 4 ? asinh(val, scale.asinh) :
|
||||
val
|
||||
);
|
||||
|
||||
return (_val - scale._min) / (scale._max - scale._min);
|
||||
}
|
||||
|
||||
function getHPos(val, scale, dim, off) {
|
||||
|
@ -2128,7 +2182,6 @@ var uPlot = (function () {
|
|||
sc.key = scaleKey;
|
||||
|
||||
var isTime = sc.time;
|
||||
var isLog = sc.distr == 3;
|
||||
|
||||
var rn = sc.range;
|
||||
|
||||
|
@ -2138,11 +2191,17 @@ var uPlot = (function () {
|
|||
rn = (self, dataMin, dataMax) => dataMin == null ? nullMinMax : rangeNum(dataMin, dataMax, cfg);
|
||||
}
|
||||
|
||||
sc.range = fnOrSelf(rn || (isTime ? snapTimeX : scaleKey == xScaleKey ? (isLog ? snapLogX : snapNumX) : (isLog ? snapLogY : snapNumY)));
|
||||
sc.range = fnOrSelf(rn || (isTime ? snapTimeX : scaleKey == xScaleKey ?
|
||||
(sc.distr == 3 ? snapLogX : sc.distr == 4 ? snapAsinhX : snapNumX) :
|
||||
(sc.distr == 3 ? snapLogY : sc.distr == 4 ? snapAsinhY : snapNumY)
|
||||
));
|
||||
|
||||
sc.auto = fnOrSelf(sc.auto);
|
||||
|
||||
sc.clamp = fnOrSelf(sc.clamp || clampScale);
|
||||
|
||||
// caches for expensive ops like asinh() & log()
|
||||
sc._min = sc._max = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2627,7 +2686,7 @@ var uPlot = (function () {
|
|||
axis.space = fnOrSelf(axis.space);
|
||||
axis.rotate = fnOrSelf(axis.rotate);
|
||||
axis.incrs = fnOrSelf(axis.incrs || ( sc.distr == 2 ? wholeIncrs : (isTime ? (ms == 1 ? timeIncrsMs : timeIncrsS) : numIncrs)));
|
||||
axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : numAxisSplits));
|
||||
axis.splits = fnOrSelf(axis.splits || (isTime && sc.distr == 1 ? _timeAxisSplits : sc.distr == 3 ? logAxisSplits : sc.distr == 4 ? asinhAxisSplits : numAxisSplits));
|
||||
|
||||
axis.stroke = fnOrSelf(axis.stroke);
|
||||
axis.grid.stroke = fnOrSelf(axis.grid.stroke);
|
||||
|
@ -2645,7 +2704,7 @@ var uPlot = (function () {
|
|||
) : av || numAxisVals
|
||||
);
|
||||
|
||||
axis.filter = fnOrSelf(axis.filter || ( sc.distr == 3 ? logAxisValsFilt : retArg1));
|
||||
axis.filter = fnOrSelf(axis.filter || ( sc.distr >= 3 ? logAxisValsFilt : retArg1));
|
||||
|
||||
axis.font = pxRatioFont(axis.font);
|
||||
axis.labelFont = pxRatioFont(axis.labelFont);
|
||||
|
@ -2733,7 +2792,7 @@ var uPlot = (function () {
|
|||
self.setData = setData;
|
||||
|
||||
function autoScaleX() {
|
||||
var assign, assign$1;
|
||||
var assign, assign$1, assign$2;
|
||||
|
||||
viaAutoScaleX = true;
|
||||
|
||||
|
@ -2753,10 +2812,12 @@ var uPlot = (function () {
|
|||
else if (dataLen == 1) {
|
||||
if (xScaleDistr == 3)
|
||||
{ (assign = rangeLog(_min, _min, scaleX.log, false), _min = assign[0], _max = assign[1]); }
|
||||
else if (xScaleDistr == 4)
|
||||
{ (assign$1 = rangeAsinh(_min, _min, scaleX.log, false), _min = assign$1[0], _max = assign$1[1]); }
|
||||
else if (scaleX.time)
|
||||
{ _max = _min + 86400 / ms; }
|
||||
else
|
||||
{ (assign$1 = rangeNum(_min, _max, 0.1, true), _min = assign$1[0], _max = assign$1[1]); }
|
||||
{ (assign$2 = rangeNum(_min, _max, 0.1, true), _min = assign$2[0], _max = assign$2[1]); }
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -2884,6 +2945,12 @@ var uPlot = (function () {
|
|||
if (sc.min != wsc$3.min || sc.max != wsc$3.max) {
|
||||
sc.min = wsc$3.min;
|
||||
sc.max = wsc$3.max;
|
||||
|
||||
var distr = sc.distr;
|
||||
|
||||
sc._min = distr == 3 ? log10(sc.min) : distr == 4 ? asinh(sc.min, sc.asinh) : sc.min;
|
||||
sc._max = distr == 3 ? log10(sc.max) : distr == 4 ? asinh(sc.max, sc.asinh) : sc.max;
|
||||
|
||||
changed[k$3] = anyChanged = true;
|
||||
}
|
||||
}
|
||||
|
@ -3711,17 +3778,19 @@ var uPlot = (function () {
|
|||
if (sc.dir == -1)
|
||||
{ pos = dim - pos; }
|
||||
|
||||
var _min = sc.min,
|
||||
_max = sc.max,
|
||||
var _min = sc._min,
|
||||
_max = sc._max,
|
||||
pct = pos / dim;
|
||||
|
||||
if (sc.distr == 3) {
|
||||
_min = log10(_min);
|
||||
_max = log10(_max);
|
||||
return pow(10, _min + (_max - _min) * pct);
|
||||
}
|
||||
else
|
||||
{ return _min + (_max - _min) * pct; }
|
||||
var sv = _min + (_max - _min) * pct;
|
||||
|
||||
var distr = sc.distr;
|
||||
|
||||
return (
|
||||
distr == 3 ? pow(10, sv) :
|
||||
distr == 4 ? sinh(sv, sc.asinh) :
|
||||
sv
|
||||
);
|
||||
}
|
||||
|
||||
function closestIdxFromXpos(pos) {
|
||||
|
@ -3964,7 +4033,7 @@ var uPlot = (function () {
|
|||
var uni = drag.uni;
|
||||
|
||||
if (uni != null) {
|
||||
// only calc drag status if they pass the dist thresh
|
||||
// only calc drag status if they pass the dist asinh
|
||||
if (dragX && dragY) {
|
||||
dragX = rawDX >= uni;
|
||||
dragY = rawDY >= uni;
|
||||
|
@ -4345,7 +4414,7 @@ var uPlot = (function () {
|
|||
|
||||
var syncKey = syncOpts.key;
|
||||
|
||||
var sync = (syncKey != null ? (syncs[syncKey] = syncs[syncKey] || _sync()) : _sync());
|
||||
var sync = _sync(syncKey);
|
||||
|
||||
sync.sub(self);
|
||||
|
||||
|
@ -4398,6 +4467,7 @@ var uPlot = (function () {
|
|||
uPlot.fmtNum = fmtNum;
|
||||
uPlot.rangeNum = rangeNum;
|
||||
uPlot.rangeLog = rangeLog;
|
||||
uPlot.rangeAsinh = rangeAsinh;
|
||||
uPlot.orient = orient;
|
||||
|
||||
{
|
||||
|
@ -4409,6 +4479,10 @@ var uPlot = (function () {
|
|||
uPlot.tzDate = tzDate;
|
||||
}
|
||||
|
||||
{
|
||||
uPlot.sync = _sync;
|
||||
}
|
||||
|
||||
{
|
||||
uPlot.addGap = addGap;
|
||||
uPlot.clipGaps = clipGaps;
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue