make tooltipPlugin more generic for further use
This commit is contained in:
parent
1ff9478988
commit
9987434fea
@ -80,9 +80,9 @@ export class ServerRegistration {
|
||||
// eslint-disable-next-line new-cap
|
||||
this._plotInstance = new uPlot({
|
||||
plugins: [
|
||||
uPlotTooltipPlugin((pos, point) => {
|
||||
uPlotTooltipPlugin((pos, id, plot) => {
|
||||
if (pos) {
|
||||
const text = formatNumber(point.y) + ' Players<br>' + formatTimestamp(point.x * 1000)
|
||||
const text = formatNumber(plot.data[1][id]) + ' Players<br>' + formatTimestamp(plot.data[0][id] * 1000)
|
||||
|
||||
this._app.tooltip.set(pos.left, pos.top, 10, 10, text)
|
||||
} else {
|
||||
|
@ -20,11 +20,7 @@ export function uPlotTooltipPlugin (onHover) {
|
||||
onHover({
|
||||
left: bounds.left + left + window.pageXOffset,
|
||||
top: bounds.top + top + window.pageYOffset
|
||||
}, {
|
||||
idx,
|
||||
x: u.data[0][idx],
|
||||
y: u.data[1][idx]
|
||||
})
|
||||
}, idx, u)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
"connectTimeout": 2500
|
||||
},
|
||||
"performance": {
|
||||
"skipUnfurlSrv": false,
|
||||
"skipUnfurlSrv": true,
|
||||
"unfurlSrvCacheTtl": 120000
|
||||
},
|
||||
"logToDatabase": true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user