mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: uPlot v1.6.28 (#79732)
This commit is contained in:
parent
814d62406e
commit
b3387793f1
@ -414,7 +414,7 @@
|
|||||||
"tinycolor2": "1.6.0",
|
"tinycolor2": "1.6.0",
|
||||||
"tslib": "2.6.0",
|
"tslib": "2.6.0",
|
||||||
"tween-functions": "^1.2.0",
|
"tween-functions": "^1.2.0",
|
||||||
"uplot": "1.6.27",
|
"uplot": "1.6.28",
|
||||||
"uuid": "9.0.0",
|
"uuid": "9.0.0",
|
||||||
"vendor": "link:./public/vendor",
|
"vendor": "link:./public/vendor",
|
||||||
"visjs-network": "4.25.0",
|
"visjs-network": "4.25.0",
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
"string-hash": "^1.1.3",
|
"string-hash": "^1.1.3",
|
||||||
"tinycolor2": "1.6.0",
|
"tinycolor2": "1.6.0",
|
||||||
"tslib": "2.6.0",
|
"tslib": "2.6.0",
|
||||||
"uplot": "1.6.27",
|
"uplot": "1.6.28",
|
||||||
"xss": "^1.0.14"
|
"xss": "^1.0.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
"slate-react": "0.22.10",
|
"slate-react": "0.22.10",
|
||||||
"tinycolor2": "1.6.0",
|
"tinycolor2": "1.6.0",
|
||||||
"tslib": "2.6.0",
|
"tslib": "2.6.0",
|
||||||
"uplot": "1.6.27",
|
"uplot": "1.6.28",
|
||||||
"uuid": "9.0.0"
|
"uuid": "9.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -441,6 +441,13 @@ export function getConfig(opts: TimelineCoreOptions) {
|
|||||||
|
|
||||||
return hovered[seriesIdx]?.didx;
|
return hovered[seriesIdx]?.didx;
|
||||||
},
|
},
|
||||||
|
focus: {
|
||||||
|
prox: 30,
|
||||||
|
dist: (u, seriesIdx, dataIdx, valPos, curPos) => {
|
||||||
|
valPos = yMids[seriesIdx - 1] / uPlot.pxRatio;
|
||||||
|
return valPos - curPos;
|
||||||
|
},
|
||||||
|
},
|
||||||
points: {
|
points: {
|
||||||
fill: 'rgba(255,255,255,0.2)',
|
fill: 'rgba(255,255,255,0.2)',
|
||||||
bbox: (u, seriesIdx) => {
|
bbox: (u, seriesIdx) => {
|
||||||
|
@ -15,7 +15,7 @@ import { formatTime } from '@grafana/ui/src/components/uPlot/config/UPlotAxisBui
|
|||||||
import { StackingGroup, preparePlotData2 } from '@grafana/ui/src/components/uPlot/utils';
|
import { StackingGroup, preparePlotData2 } from '@grafana/ui/src/components/uPlot/utils';
|
||||||
|
|
||||||
import { distribute, SPACE_BETWEEN } from './distribute';
|
import { distribute, SPACE_BETWEEN } from './distribute';
|
||||||
import { findRect, intersects, pointWithin, Quadtree, Rect } from './quadtree';
|
import { intersects, pointWithin, Quadtree, Rect } from './quadtree';
|
||||||
|
|
||||||
const groupDistr = SPACE_BETWEEN;
|
const groupDistr = SPACE_BETWEEN;
|
||||||
const barDistr = SPACE_BETWEEN;
|
const barDistr = SPACE_BETWEEN;
|
||||||
@ -470,15 +470,8 @@ export function getConfig(opts: BarsOptions, theme: GrafanaTheme2) {
|
|||||||
|
|
||||||
qt.get(cx, cy, 1, 1, (o) => {
|
qt.get(cx, cy, 1, 1, (o) => {
|
||||||
if (pointWithin(cx, cy, o.x, o.y, o.x + o.w, o.y + o.h)) {
|
if (pointWithin(cx, cy, o.x, o.y, o.x + o.w, o.y + o.h)) {
|
||||||
if (isStacked) {
|
|
||||||
// choose the smallest hovered rect (when stacked bigger ones overlap smaller ones)
|
|
||||||
if (hRect == null || o.h * o.w < hRect.h * hRect.w) {
|
|
||||||
hRect = o;
|
hRect = o;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
hRect = o;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -489,26 +482,11 @@ export function getConfig(opts: BarsOptions, theme: GrafanaTheme2) {
|
|||||||
bbox: (u, seriesIdx) => {
|
bbox: (u, seriesIdx) => {
|
||||||
let isHovered = hRect && seriesIdx === hRect.sidx;
|
let isHovered = hRect && seriesIdx === hRect.sidx;
|
||||||
|
|
||||||
let heightReduce = 0;
|
|
||||||
let widthReduce = 0;
|
|
||||||
|
|
||||||
// get height of bar rect at same index of the series below the hovered one
|
|
||||||
if (isStacked && isHovered) {
|
|
||||||
const rect = hRect && hRect.sidx > 1 && findRect(qt, hRect.sidx - 1, hRect.didx);
|
|
||||||
if (rect) {
|
|
||||||
if (isXHorizontal) {
|
|
||||||
heightReduce = rect.h;
|
|
||||||
} else {
|
|
||||||
widthReduce = rect.w;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
left: isHovered ? (hRect!.x + widthReduce) / uPlot.pxRatio : -10,
|
left: isHovered ? hRect!.x / uPlot.pxRatio : -10,
|
||||||
top: isHovered ? hRect!.y / uPlot.pxRatio : -10,
|
top: isHovered ? hRect!.y / uPlot.pxRatio : -10,
|
||||||
width: isHovered ? (hRect!.w - widthReduce) / uPlot.pxRatio : 0,
|
width: isHovered ? hRect!.w / uPlot.pxRatio : 0,
|
||||||
height: isHovered ? (hRect!.h - heightReduce) / uPlot.pxRatio : 0,
|
height: isHovered ? hRect!.h / uPlot.pxRatio : 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -52,10 +52,9 @@ export const StatusHistoryTooltip2 = ({
|
|||||||
}: StatusHistoryTooltipProps) => {
|
}: StatusHistoryTooltipProps) => {
|
||||||
const styles = useStyles2(getStyles);
|
const styles = useStyles2(getStyles);
|
||||||
|
|
||||||
// @todo: check other dataIdx, it can be undefined or null in array
|
const datapointIdx = seriesIdx != null ? dataIdxs[seriesIdx] : dataIdxs.find((idx) => idx != null);
|
||||||
const datapointIdx = dataIdxs.find((idx) => idx !== undefined);
|
|
||||||
|
|
||||||
if (!data || datapointIdx == null) {
|
if (datapointIdx == null || seriesIdx == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
yarn.lock
14
yarn.lock
@ -2969,7 +2969,7 @@ __metadata:
|
|||||||
tinycolor2: "npm:1.6.0"
|
tinycolor2: "npm:1.6.0"
|
||||||
tslib: "npm:2.6.0"
|
tslib: "npm:2.6.0"
|
||||||
typescript: "npm:5.2.2"
|
typescript: "npm:5.2.2"
|
||||||
uplot: "npm:1.6.27"
|
uplot: "npm:1.6.28"
|
||||||
xss: "npm:^1.0.14"
|
xss: "npm:^1.0.14"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ^17.0.0 || ^18.0.0
|
react: ^17.0.0 || ^18.0.0
|
||||||
@ -3481,7 +3481,7 @@ __metadata:
|
|||||||
tinycolor2: "npm:1.6.0"
|
tinycolor2: "npm:1.6.0"
|
||||||
tslib: "npm:2.6.0"
|
tslib: "npm:2.6.0"
|
||||||
typescript: "npm:5.2.2"
|
typescript: "npm:5.2.2"
|
||||||
uplot: "npm:1.6.27"
|
uplot: "npm:1.6.28"
|
||||||
uuid: "npm:9.0.0"
|
uuid: "npm:9.0.0"
|
||||||
webpack: "npm:5.89.0"
|
webpack: "npm:5.89.0"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -17617,7 +17617,7 @@ __metadata:
|
|||||||
tslib: "npm:2.6.0"
|
tslib: "npm:2.6.0"
|
||||||
tween-functions: "npm:^1.2.0"
|
tween-functions: "npm:^1.2.0"
|
||||||
typescript: "npm:5.2.2"
|
typescript: "npm:5.2.2"
|
||||||
uplot: "npm:1.6.27"
|
uplot: "npm:1.6.28"
|
||||||
uuid: "npm:9.0.0"
|
uuid: "npm:9.0.0"
|
||||||
vendor: "link:./public/vendor"
|
vendor: "link:./public/vendor"
|
||||||
visjs-network: "npm:4.25.0"
|
visjs-network: "npm:4.25.0"
|
||||||
@ -29926,10 +29926,10 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"uplot@npm:1.6.27":
|
"uplot@npm:1.6.28":
|
||||||
version: 1.6.27
|
version: 1.6.28
|
||||||
resolution: "uplot@npm:1.6.27"
|
resolution: "uplot@npm:1.6.28"
|
||||||
checksum: b46de70804fdec2aa62101d8980aa18517a9a84e94fdeac922baa8121140ddae35685002a7cbdc74bbe6ea2306e341628490f5a5e2fa4b8086ff1643dccf2be9
|
checksum: 6771289c45f2b8e8ad5d56abd8c92e7f5687244d75265f80957af857c2034b7b5e3128122262e5a546da2fc4437b600e56a058523eff1435b5bf6728ddc19612
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user