dashboard tooltip update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vibefinance-frontend",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -214,11 +214,17 @@ function MiniLineChart({ vData, fiatData, darkMode }) {
|
||||
|
||||
const h = hovered;
|
||||
const tipW = 150, tipH = 76;
|
||||
const tipX = h !== null ? Math.min(Math.max(xs[h] - tipW / 2, pl), W - tipW - 4) : 0;
|
||||
// Ankeren op de hoogste van de twee punten, zodat de tooltip nooit over de
|
||||
// andere lijn heen valt.
|
||||
const tipAnker = h !== null ? Math.min(ys[h], fYs[h]) : 0;
|
||||
const tipY = h !== null ? (tipAnker - tipH - 14 < pt ? Math.max(ys[h], fYs[h]) + 14 : tipAnker - tipH - 14) : 0;
|
||||
// Náást de hoverlijn, niet erboven of eronder. Zodra de twee punten ver uit
|
||||
// elkaar liggen is er verticaal geen ruimte voor een kaart van 76px: dan
|
||||
// klapte hij naar onderen tot buiten de tekening, over de datumlabels heen en
|
||||
// half afgekapt. Zijwaarts past hij altijd; de klemmen houden hem binnen het
|
||||
// tekenvlak.
|
||||
const naarRechts = h !== null && xs[h] < pl + iW / 2;
|
||||
const tipX = h === null ? 0 : naarRechts
|
||||
? Math.min(xs[h] + 16, W - pr - tipW)
|
||||
: Math.max(xs[h] - tipW - 16, pl);
|
||||
const tipY = h === null ? 0
|
||||
: Math.max(pt, Math.min((ys[h] + fYs[h]) / 2 - tipH / 2, pt + iH - tipH));
|
||||
const resultaat = h !== null ? vals[h] - fVals[h] : 0;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user