2 Commits

Author SHA1 Message Date
syoul 136571ed53 chore: bump version 1.1.0
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 00:32:26 +01:00
syoul b884884a04 fix: heatmap overlay — masque les snapshots pendant zoom/pan, resync après
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 00:28:31 +01:00
2 changed files with 34 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "g1flux",
"private": true,
"version": "1.0.0",
"version": "1.1.0",
"type": "module",
"scripts": {
"dev": "vite",
+33
View File
@@ -63,7 +63,40 @@ export function HeatMap({ transactions }: HeatMapProps) {
mapRef.current = map;
heatRef.current = heat;
// Pendant zoom/pan : cache les overlays → le canvas live est visible directement.
// Après zoom/pan : resynchronise le snapshot sur le canvas redesssiné.
const hideOverlays = () => {
const prev = prevRef.current;
const next = nextRef.current;
if (prev) { prev.style.transition = 'none'; prev.style.opacity = '0'; }
if (next) { next.style.transition = 'none'; next.style.opacity = '0'; }
currentSrcRef.current = '';
};
const syncAfterMove = () => {
const canvas = (heat as unknown as { _canvas?: HTMLCanvasElement })._canvas;
const next = nextRef.current;
if (!canvas || !next) return;
// Double RAF : leaflet.heat redessine en interne après l'événement
requestAnimationFrame(() => {
requestAnimationFrame(() => {
try {
const src = canvas.toDataURL();
currentSrcRef.current = src;
next.src = src;
next.style.transition = 'none';
next.style.opacity = '1';
} catch { /* map torn down */ }
});
});
};
map.on('zoomstart movestart', hideOverlays);
map.on('zoomend moveend', syncAfterMove);
return () => {
map.off('zoomstart movestart', hideOverlays);
map.off('zoomend moveend', syncAfterMove);
map.remove();
mapRef.current = null;
heatRef.current = null;