feat: taux de géoloc réel par frame + DU + périodeSélecteur + autoplay anim
ci/woodpecker/push/woodpecker Pipeline was successful

- Affiche l'équivalent en DU pour le volume total et la moyenne par tx
- Taux de géolocalisation réel par frame d'animation (via allTimestamps)
- Sélecteur de période personnalisée inline à côté des boutons 24h/7j/30j
- Clic sur Animer lance la lecture automatique à vitesse ×1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
syoul
2026-03-23 23:41:59 +01:00
parent 42286a8c0d
commit b9bcfa8518
4 changed files with 33 additions and 25 deletions
+6 -3
View File
@@ -18,8 +18,9 @@ export default function App() {
const [lastUpdate, setLastUpdate] = useState<Date | null>(null);
const [source, setSource] = useState<'live' | 'mock'>('mock');
const [currentUD, setCurrentUD] = useState<number>(11.78);
const [allTimestamps, setAllTimestamps] = useState<number[]>([]);
const animation = useAnimation(transactions, periodDays);
const animation = useAnimation(transactions, periodDays, allTimestamps);
const handlePeriodChange = (days: number) => {
animation.deactivate();
@@ -33,12 +34,13 @@ export default function App() {
if (showLoading) setLoading(true);
else setRefreshing(true);
fetchData(periodDays)
.then(({ transactions, stats, source, currentUD }) => {
.then(({ transactions, stats, source, currentUD, allTimestamps }) => {
if (!cancelled) {
setTransactions(transactions);
setStats(stats);
setSource(source);
setCurrentUD(currentUD);
setAllTimestamps(allTimestamps);
setLastUpdate(new Date());
}
})
@@ -59,6 +61,8 @@ export default function App() {
? {
...computeStats(animation.visibleTransactions),
geoCount: animation.visibleTransactions.length,
// frameTotalCount = total réel (géo + non-géo) dans cette frame
transactionCount: animation.frameTotalCount ?? animation.visibleTransactions.length,
}
: stats;
@@ -72,7 +76,6 @@ export default function App() {
source={source}
currentUD={currentUD}
animationLabel={animation.active ? (animation.currentFrame?.label ?? undefined) : undefined}
globalGeoStats={animation.active && stats ? { geoCount: stats.geoCount, transactionCount: stats.transactionCount } : undefined}
/>
{/* Map area */}