feat: afficher le % géolocalisé dans la barre de contrôles
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
Ajoute un badge "XX% géo" à droite du bouton Flux/Heatmap dans PeriodSelector, mis à jour à chaque frame d'animation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -138,6 +138,9 @@ export default function App() {
|
|||||||
onAnimate={() => animation.active ? animation.deactivate() : animation.activate()}
|
onAnimate={() => animation.active ? animation.deactivate() : animation.activate()}
|
||||||
viewMode={viewMode}
|
viewMode={viewMode}
|
||||||
onViewModeChange={handleViewModeChange}
|
onViewModeChange={handleViewModeChange}
|
||||||
|
geoPercent={visibleStats && visibleStats.transactionCount > 0
|
||||||
|
? Math.round((visibleStats.geoCount / visibleStats.transactionCount) * 100)
|
||||||
|
: null}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ interface PeriodSelectorProps {
|
|||||||
onAnimate: () => void;
|
onAnimate: () => void;
|
||||||
viewMode: 'heatmap' | 'flow';
|
viewMode: 'heatmap' | 'flow';
|
||||||
onViewModeChange: (mode: 'heatmap' | 'flow') => void;
|
onViewModeChange: (mode: 'heatmap' | 'flow') => void;
|
||||||
|
geoPercent?: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PERIODS = [
|
const PERIODS = [
|
||||||
@@ -17,7 +18,7 @@ const PERIODS = [
|
|||||||
|
|
||||||
const PRESET_DAYS = new Set([1, 7, 30]);
|
const PRESET_DAYS = new Set([1, 7, 30]);
|
||||||
|
|
||||||
export function PeriodSelector({ value, onChange, animationActive, onAnimate, viewMode, onViewModeChange }: PeriodSelectorProps) {
|
export function PeriodSelector({ value, onChange, animationActive, onAnimate, viewMode, onViewModeChange, geoPercent }: PeriodSelectorProps) {
|
||||||
const [customOpen, setCustomOpen] = useState(false);
|
const [customOpen, setCustomOpen] = useState(false);
|
||||||
const [inputVal, setInputVal] = useState('');
|
const [inputVal, setInputVal] = useState('');
|
||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
@@ -124,6 +125,11 @@ export function PeriodSelector({ value, onChange, animationActive, onAnimate, vi
|
|||||||
>
|
>
|
||||||
{viewMode === 'flow' ? '⊙ Heatmap' : '◉ Flux'}
|
{viewMode === 'flow' ? '⊙ Heatmap' : '◉ Flux'}
|
||||||
</button>
|
</button>
|
||||||
|
{geoPercent != null && (
|
||||||
|
<span className="text-[10px] font-mono text-[#4b5563] px-1 shrink-0">
|
||||||
|
{geoPercent}%<span className="hidden sm:inline"> géo</span>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user