mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-26 03:50:31 +00:00
* feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
115 lines
3.6 KiB
TypeScript
115 lines
3.6 KiB
TypeScript
/* eslint-disable radix */
|
|
/* eslint-disable guard-for-in */
|
|
/* eslint-disable no-restricted-syntax */
|
|
/* eslint-disable no-var */
|
|
/* eslint-disable vars-on-top */
|
|
/* eslint-disable func-style */
|
|
/* eslint-disable no-void */
|
|
/* eslint-disable sonarjs/cognitive-complexity */
|
|
/* eslint-disable func-names */
|
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
/* eslint-disable no-param-reassign */
|
|
/* eslint-disable no-sequences */
|
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
// @ts-nocheck
|
|
|
|
// https://tobyzerner.github.io/placement.js/dist/index.js
|
|
|
|
export const placement = (function () {
|
|
const e = {
|
|
size: ['height', 'width'],
|
|
clientSize: ['clientHeight', 'clientWidth'],
|
|
offsetSize: ['offsetHeight', 'offsetWidth'],
|
|
maxSize: ['maxHeight', 'maxWidth'],
|
|
before: ['top', 'left'],
|
|
marginBefore: ['marginTop', 'marginLeft'],
|
|
after: ['bottom', 'right'],
|
|
marginAfter: ['marginBottom', 'marginRight'],
|
|
scrollOffset: ['pageYOffset', 'pageXOffset'],
|
|
};
|
|
function t(e) {
|
|
return { top: e.top, bottom: e.bottom, left: e.left, right: e.right };
|
|
}
|
|
return function (o, r, f, a, i) {
|
|
void 0 === f && (f = 'bottom'),
|
|
void 0 === a && (a = 'center'),
|
|
void 0 === i && (i = {}),
|
|
(r instanceof Element || r instanceof Range) &&
|
|
(r = t(r.getBoundingClientRect()));
|
|
const n = {
|
|
top: r.bottom,
|
|
bottom: r.top,
|
|
left: r.right,
|
|
right: r.left,
|
|
...r,
|
|
};
|
|
const s = {
|
|
top: 0,
|
|
left: 0,
|
|
bottom: window.innerHeight,
|
|
right: window.innerWidth,
|
|
};
|
|
i.bound &&
|
|
((i.bound instanceof Element || i.bound instanceof Range) &&
|
|
(i.bound = t(i.bound.getBoundingClientRect())),
|
|
Object.assign(s, i.bound));
|
|
const l = getComputedStyle(o);
|
|
const m = {};
|
|
const b = {};
|
|
for (const g in e)
|
|
(m[g] = e[g][f === 'top' || f === 'bottom' ? 0 : 1]),
|
|
(b[g] = e[g][f === 'top' || f === 'bottom' ? 1 : 0]);
|
|
(o.style.position = 'absolute'),
|
|
(o.style.maxWidth = ''),
|
|
(o.style.maxHeight = '');
|
|
const d = parseInt(l[b.marginBefore]);
|
|
const c = parseInt(l[b.marginAfter]);
|
|
const u = d + c;
|
|
const p = s[b.after] - s[b.before] - u;
|
|
const h = parseInt(l[b.maxSize]);
|
|
(!h || p < h) && (o.style[b.maxSize] = `${p}px`);
|
|
const x = parseInt(l[m.marginBefore]) + parseInt(l[m.marginAfter]);
|
|
const y = n[m.before] - s[m.before] - x;
|
|
const z = s[m.after] - n[m.after] - x;
|
|
((f === m.before && o[m.offsetSize] > y) ||
|
|
(f === m.after && o[m.offsetSize] > z)) &&
|
|
(f = y > z ? m.before : m.after);
|
|
const S = f === m.before ? y : z;
|
|
const v = parseInt(l[m.maxSize]);
|
|
(!v || S < v) && (o.style[m.maxSize] = `${S}px`);
|
|
const w = window[m.scrollOffset];
|
|
const O = function (e) {
|
|
return Math.max(s[m.before], Math.min(e, s[m.after] - o[m.offsetSize] - x));
|
|
};
|
|
f === m.before
|
|
? ((o.style[m.before] = `${w + O(n[m.before] - o[m.offsetSize] - x)}px`),
|
|
(o.style[m.after] = 'auto'))
|
|
: ((o.style[m.before] = `${w + O(n[m.after])}px`),
|
|
(o.style[m.after] = 'auto'));
|
|
const B = window[b.scrollOffset];
|
|
const I = function (e) {
|
|
return Math.max(s[b.before], Math.min(e, s[b.after] - o[b.offsetSize] - u));
|
|
};
|
|
switch (a) {
|
|
case 'start':
|
|
(o.style[b.before] = `${B + I(n[b.before] - d)}px`),
|
|
(o.style[b.after] = 'auto');
|
|
break;
|
|
case 'end':
|
|
(o.style[b.before] = 'auto'),
|
|
(o.style[b.after] = `${
|
|
B + I(document.documentElement[b.clientSize] - n[b.after] - c)
|
|
}px`);
|
|
break;
|
|
default:
|
|
var H = n[b.after] - n[b.before];
|
|
(o.style[b.before] = `${
|
|
B + I(n[b.before] + H / 2 - o[b.offsetSize] / 2 - d)
|
|
}px`),
|
|
(o.style[b.after] = 'auto');
|
|
}
|
|
(o.dataset.side = f), (o.dataset.align = a);
|
|
};
|
|
})();
|