Feat Widgets 2030

This commit is contained in:
2025-09-02 20:34:49 -03:00
parent 6732a0e826
commit 32e85b9b9d
12 changed files with 196 additions and 157 deletions

View File

@@ -43,6 +43,16 @@
height: 100%; height: 100%;
} }
/* APLICA LA TRANSICIÓN POR DEFECTO A ZOOMABLEGROUP */
.mapa-container .rsm-zoomable-group {
transition: transform 400ms ease-in-out;
}
/* DESACTIVA LA TRANSICIÓN CUANDO SE ESTÁ ARRASTRANDO */
.mapa-container .rsm-zoomable-group.panning {
transition: none;
}
.rsm-geography { .rsm-geography {
transition: opacity 0.3s ease, transform 0.2s ease, filter 0.2s ease, fill 0.3s ease; transition: opacity 0.3s ease, transform 0.2s ease, filter 0.2s ease, fill 0.3s ease;
cursor: pointer; cursor: pointer;

View File

@@ -47,7 +47,7 @@ type PartidoGeography = Feature<Geometry, PartidoProperties> & { rsmKey: string
const API_BASE_URL = 'http://localhost:5217/api'; const API_BASE_URL = 'http://localhost:5217/api';
const MIN_ZOOM = 1; const MIN_ZOOM = 1;
const MAX_ZOOM = 8; const MAX_ZOOM = 8;
const TRANSLATE_EXTENT: [[number, number], [number, number]] = [[-100, -600], [1100, 300]]; const TRANSLATE_EXTENT: [[number, number], [number, number]] = [[-100, -1000], [1100, 800]];
const INITIAL_POSITION = { center: [-60.5, -37.2] as PointTuple, zoom: MIN_ZOOM }; const INITIAL_POSITION = { center: [-60.5, -37.2] as PointTuple, zoom: MIN_ZOOM };
const DEFAULT_MAP_COLOR = '#E0E0E0'; const DEFAULT_MAP_COLOR = '#E0E0E0';
@@ -63,6 +63,7 @@ const MapaBsAs = () => {
const [selectedAmbitoId, setSelectedAmbitoId] = useState<number | null>(null); const [selectedAmbitoId, setSelectedAmbitoId] = useState<number | null>(null);
const [selectedCategoriaId, setSelectedCategoriaId] = useState<number>(6); const [selectedCategoriaId, setSelectedCategoriaId] = useState<number>(6);
const [tooltipContent, setTooltipContent] = useState(''); const [tooltipContent, setTooltipContent] = useState('');
const [isPanning, setIsPanning] = useState(false);
const { data: resultadosData, isLoading: isLoadingResultados } = useQuery<ResultadoMapa[]>({ const { data: resultadosData, isLoading: isLoadingResultados } = useQuery<ResultadoMapa[]>({
queryKey: ['mapaResultadosPorMunicipio', selectedCategoriaId], queryKey: ['mapaResultadosPorMunicipio', selectedCategoriaId],
@@ -121,7 +122,7 @@ const MapaBsAs = () => {
} }
}, [selectedAmbitoId, handleReset, resultadosPorDepartamento]); }, [selectedAmbitoId, handleReset, resultadosPorDepartamento]);
const handleMoveEnd = (newPosition: { coordinates: PointTuple; zoom: number }) => { const handleMoveEnd = (newPosition: { coordinates: PointTuple; zoom: number }) => { // <--- CORRECCIÓN 1
if (newPosition.zoom <= MIN_ZOOM) { if (newPosition.zoom <= MIN_ZOOM) {
if (position.zoom > MIN_ZOOM || selectedAmbitoId !== null) { if (position.zoom > MIN_ZOOM || selectedAmbitoId !== null) {
handleReset(); handleReset();
@@ -189,8 +190,12 @@ const MapaBsAs = () => {
<ZoomableGroup <ZoomableGroup
center={position.center} center={position.center}
zoom={position.zoom} zoom={position.zoom}
onMoveEnd={handleMoveEnd} className={isPanning ? 'panning' : ''}
style={{ transition: "transform 400ms ease-in-out" }} onMoveStart={() => setIsPanning(true)}
onMoveEnd={(newPosition: { coordinates: PointTuple; zoom: number }) => {
setIsPanning(false);
handleMoveEnd(newPosition);
}}
translateExtent={TRANSLATE_EXTENT} translateExtent={TRANSLATE_EXTENT}
minZoom={MIN_ZOOM} minZoom={MIN_ZOOM}
maxZoom={MAX_ZOOM} maxZoom={MAX_ZOOM}

View File

@@ -30,61 +30,59 @@ const DEFAULT_MAP_COLOR = '#E0E0E0';
const CATEGORIAS: Categoria[] = [{ id: 5, nombre: 'Senadores' }, { id: 6, nombre: 'Diputados' }]; const CATEGORIAS: Categoria[] = [{ id: 5, nombre: 'Senadores' }, { id: 6, nombre: 'Diputados' }];
const SECCION_ID_TO_ROMAN: Record<string, string> = { '1': 'I', '2': 'II', '3': 'III', '4': 'IV', '5': 'V', '6': 'VI', '7': 'VII', '8': 'VIII' }; const SECCION_ID_TO_ROMAN: Record<string, string> = { '1': 'I', '2': 'II', '3': 'III', '4': 'IV', '5': 'V', '6': 'VI', '7': 'VII', '8': 'VIII' };
const ROMAN_TO_SECCION_ID: Record<string, string> = { 'I': '1', 'II': '2', 'III': '3', 'IV': '4', 'V': '5', 'VI': '6', 'VII': '7', 'VIII': '8' }; const ROMAN_TO_SECCION_ID: Record<string, string> = { 'I': '1', 'II': '2', 'III': '3', 'IV': '4', 'V': '5', 'VI': '6', 'VII': '7', 'VIII': '8' };
// --- CORRECCIÓN 1: Mover NOMBRES_SECCIONES aquí para que sea global al archivo ---
const NOMBRES_SECCIONES: Record<string, string> = { const NOMBRES_SECCIONES: Record<string, string> = {
'I': 'Sección Primera', 'II': 'Sección Segunda', 'III': 'Sección Tercera', 'IV': 'Sección Cuarta', 'I': 'Sección Primera', 'II': 'Sección Segunda', 'III': 'Sección Tercera', 'IV': 'Sección Cuarta',
'V': 'Sección Quinta', 'VI': 'Sección Sexta', 'VII': 'Sección Séptima', 'VIII': 'Sección Capital' 'V': 'Sección Quinta', 'VI': 'Sección Sexta', 'VII': 'Sección Séptima', 'VIII': 'Sección Capital'
}; };
const MIN_ZOOM = 1; const MIN_ZOOM = 1;
const MAX_ZOOM = 5; const MAX_ZOOM = 5;
const TRANSLATE_EXTENT: [[number, number], [number, number]] = [[-100, -600], [1100, 300]]; const TRANSLATE_EXTENT: [[number, number], [number, number]] = [[-100, -1000], [1100, 800]];
const INITIAL_POSITION = { center: [-60.5, -37.2] as PointTuple, zoom: MIN_ZOOM }; const INITIAL_POSITION = { center: [-60.5, -37.2] as PointTuple, zoom: MIN_ZOOM };
// --- Componente de Detalle --- // --- Componente de Detalle ---
const DetalleSeccion = ({ seccion, categoriaId, onReset }: { seccion: SeccionGeography | null, categoriaId: number, onReset: () => void }) => { const DetalleSeccion = ({ seccion, categoriaId, onReset }: { seccion: SeccionGeography | null, categoriaId: number, onReset: () => void }) => {
const seccionId = seccion ? ROMAN_TO_SECCION_ID[seccion.properties.seccion] : null; const seccionId = seccion ? ROMAN_TO_SECCION_ID[seccion.properties.seccion] : null;
const { data: resultadosDetalle, isLoading, error } = useQuery<ResultadoDetalleSeccion[]>({ const { data: resultadosDetalle, isLoading, error } = useQuery<ResultadoDetalleSeccion[]>({
queryKey: ['detalleSeccion', seccionId, categoriaId], queryKey: ['detalleSeccion', seccionId, categoriaId],
queryFn: () => getDetalleSeccion(seccionId!, categoriaId), queryFn: () => getDetalleSeccion(seccionId!, categoriaId),
enabled: !!seccionId, enabled: !!seccionId,
}); });
if (!seccion) {
return (
<div className="detalle-placeholder">
<h3>Resultados por Sección</h3>
<p>Haga clic en una sección del mapa para ver los resultados detallados.</p>
</div>
);
}
if (isLoading) return (<div className="detalle-loading"><div className="spinner"></div><p>Cargando resultados de la sección...</p></div>);
if (error) return <div className="detalle-error">Error al cargar los datos de la sección.</div>;
const nombreSeccionLegible = NOMBRES_SECCIONES[seccion.properties.seccion] || "Sección Desconocida";
if (!seccion) {
return ( return (
<div className="detalle-placeholder"> <div className="detalle-content">
<h3>Resultados por Sección</h3> <button className="reset-button-panel" onClick={onReset}> VOLVER</button>
<p>Haga clic en una sección del mapa para ver los resultados detallados.</p> <h3>{nombreSeccionLegible}</h3>
</div> <ul className="resultados-lista">
{resultadosDetalle?.map((r) => (
<li key={r.id}>
<div className="resultado-info">
<span className="partido-nombre">{r.nombre}</span>
<span className="partido-votos">{r.votos.toLocaleString('es-AR')} ({r.porcentaje.toFixed(2)}%)</span>
</div>
<div className="progress-bar">
<div className="progress-fill" style={{ width: `${r.porcentaje}%`, backgroundColor: r.color || DEFAULT_MAP_COLOR }}></div>
</div>
</li>
))}
</ul>
</div>
); );
}
if (isLoading) return (<div className="detalle-loading"><div className="spinner"></div><p>Cargando resultados de la sección...</p></div>);
if (error) return <div className="detalle-error">Error al cargar los datos de la sección.</div>;
const nombreSeccionLegible = NOMBRES_SECCIONES[seccion.properties.seccion] || "Sección Desconocida";
return (
<div className="detalle-content">
<button className="reset-button-panel" onClick={onReset}> VOLVER</button>
<h3>{nombreSeccionLegible}</h3>
<ul className="resultados-lista">
{resultadosDetalle?.map((r) => (
<li key={r.id}>
<div className="resultado-info">
<span className="partido-nombre">{r.nombre}</span>
<span className="partido-votos">{r.votos.toLocaleString('es-AR')} ({r.porcentaje.toFixed(2)}%)</span>
</div>
<div className="progress-bar">
{/* --- CORRECCIÓN 2: Usar el color de la API --- */}
<div className="progress-fill" style={{ width: `${r.porcentaje}%`, backgroundColor: r.color || DEFAULT_MAP_COLOR }}></div>
</div>
</li>
))}
</ul>
</div>
);
}; };
// --- Componente de Controles del Mapa --- // --- Componente de Controles del Mapa ---
@@ -100,86 +98,89 @@ const MapaBsAsSecciones = () => {
const [selectedCategoriaId, setSelectedCategoriaId] = useState<number>(6); const [selectedCategoriaId, setSelectedCategoriaId] = useState<number>(6);
const [clickedSeccion, setClickedSeccion] = useState<SeccionGeography | null>(null); const [clickedSeccion, setClickedSeccion] = useState<SeccionGeography | null>(null);
const [tooltipContent, setTooltipContent] = useState(''); const [tooltipContent, setTooltipContent] = useState('');
const [isPanning, setIsPanning] = useState(false);
const { data: geoData, isLoading: isLoadingGeo } = useQuery<any>({ const { data: geoData, isLoading: isLoadingGeo } = useQuery<any>({
queryKey: ['mapaGeoDataSecciones'], queryKey: ['mapaGeoDataSecciones'],
queryFn: async () => (await axios.get('./secciones-electorales-pba.topojson')).data, queryFn: async () => (await axios.get('./secciones-electorales-pba.topojson')).data,
}); });
const { data: resultadosData, isLoading: isLoadingResultados } = useQuery<ResultadoMapaSeccion[]>({ const { data: resultadosData, isLoading: isLoadingResultados } = useQuery<ResultadoMapaSeccion[]>({
queryKey: ['mapaResultadosPorSeccion', selectedCategoriaId], queryKey: ['mapaResultadosPorSeccion', selectedCategoriaId],
queryFn: async () => (await axios.get(`${API_BASE_URL}/Resultados/mapa-por-seccion?categoriaId=${selectedCategoriaId}`)).data, queryFn: async () => (await axios.get(`${API_BASE_URL}/Resultados/mapa-por-seccion?categoriaId=${selectedCategoriaId}`)).data,
}); });
const { data: agrupacionesData, isLoading: isLoadingAgrupaciones } = useQuery<Agrupacion[]>({ const { data: agrupacionesData, isLoading: isLoadingAgrupaciones } = useQuery<Agrupacion[]>({
queryKey: ['catalogoAgrupaciones'], queryKey: ['catalogoAgrupaciones'],
queryFn: async () => (await axios.get(`${API_BASE_URL}/Catalogos/agrupaciones`)).data, queryFn: async () => (await axios.get(`${API_BASE_URL}/Catalogos/agrupaciones`)).data,
}); });
const { nombresAgrupaciones, resultadosPorSeccionRomana } = useMemo<{ const { nombresAgrupaciones, resultadosPorSeccionRomana } = useMemo<{
nombresAgrupaciones: Map<string, string>; nombresAgrupaciones: Map<string, string>;
resultadosPorSeccionRomana: Map<string, ResultadoMapaSeccion>; resultadosPorSeccionRomana: Map<string, ResultadoMapaSeccion>;
}>(() => { }>((
const nombresMap = new Map<string, string>(); ) => {
const resultadosMap = new Map<string, ResultadoMapaSeccion>(); const nombresMap = new Map<string, string>();
const resultadosMap = new Map<string, ResultadoMapaSeccion>();
if (agrupacionesData) { if (agrupacionesData) {
agrupacionesData.forEach(a => nombresMap.set(a.id, a.nombre)); agrupacionesData.forEach(a => nombresMap.set(a.id, a.nombre));
} }
if (resultadosData) { if (resultadosData) {
resultadosData.forEach(r => { resultadosData.forEach(r => {
const roman = SECCION_ID_TO_ROMAN[r.seccionId]; const roman = SECCION_ID_TO_ROMAN[r.seccionId];
if (roman) resultadosMap.set(roman, r); if (roman) resultadosMap.set(roman, r);
}); });
} }
return { nombresAgrupaciones: nombresMap, resultadosPorSeccionRomana: resultadosMap }; return { nombresAgrupaciones: nombresMap, resultadosPorSeccionRomana: resultadosMap };
}, [agrupacionesData, resultadosData]); }, [agrupacionesData, resultadosData]);
const isLoading = isLoadingGeo || isLoadingResultados || isLoadingAgrupaciones; const isLoading = isLoadingGeo || isLoadingResultados || isLoadingAgrupaciones;
const handleReset = useCallback(() => { const handleReset = useCallback(() => {
setClickedSeccion(null); setClickedSeccion(null);
setPosition(INITIAL_POSITION); setPosition(INITIAL_POSITION);
}, []); }, []);
const handleGeographyClick = useCallback((geo: SeccionGeography) => { const handleGeographyClick = useCallback((geo: SeccionGeography) => {
if (clickedSeccion?.rsmKey === geo.rsmKey) { if (clickedSeccion?.rsmKey === geo.rsmKey) {
handleReset();
} else {
const centroid = geoCentroid(geo as any) as PointTuple;
setPosition({ center: centroid, zoom: 2 });
setClickedSeccion(geo);
}
}, [clickedSeccion, handleReset]);
const handleMoveEnd = (newPosition: { coordinates: PointTuple; zoom: number }) => {
if (newPosition.zoom <= MIN_ZOOM) {
if (position.zoom > MIN_ZOOM || clickedSeccion !== null) {
handleReset(); handleReset();
} } else {
return; const centroid = geoCentroid(geo as any) as PointTuple;
} setPosition({ center: centroid, zoom: 2 });
if (newPosition.zoom < position.zoom && clickedSeccion !== null) { setClickedSeccion(geo);
setClickedSeccion(null); }
} }, [clickedSeccion, handleReset]);
setPosition({ center: newPosition.coordinates, zoom: newPosition.zoom });
};
useEffect(() => { const handleMoveEnd = (newPosition: { coordinates: PointTuple; zoom: number }) => {
const handleKeyDown = (e: KeyboardEvent) => e.key === 'Escape' && handleReset(); if (newPosition.zoom <= MIN_ZOOM) {
window.addEventListener('keydown', handleKeyDown); if (position.zoom > MIN_ZOOM || clickedSeccion !== null) {
return () => window.removeEventListener('keydown', handleKeyDown); handleReset();
}, [handleReset]); }
return;
}
if (newPosition.zoom < position.zoom && clickedSeccion !== null) {
setClickedSeccion(null);
}
setPosition({ center: newPosition.coordinates, zoom: newPosition.zoom });
};
const getSectionFillColor = (seccionRomana: string) => { useEffect(() => {
return resultadosPorSeccionRomana.get(seccionRomana)?.colorGanador || DEFAULT_MAP_COLOR; const handleKeyDown = (e: KeyboardEvent) => e.key === 'Escape' && handleReset();
}; window.addEventListener('keydown', handleKeyDown);
return () => window.removeEventListener('keydown', handleKeyDown);
}, [handleReset]);
const getSectionFillColor = (seccionRomana: string) => {
return resultadosPorSeccionRomana.get(seccionRomana)?.colorGanador || DEFAULT_MAP_COLOR;
};
const handleZoomIn = () => {
if (position.zoom < MAX_ZOOM) {
setPosition(p => ({ ...p, zoom: Math.min(p.zoom * 1.5, MAX_ZOOM) }));
}
};
const handleZoomIn = () => {
if (position.zoom < MAX_ZOOM) {
setPosition(p => ({ ...p, zoom: Math.min(p.zoom * 1.5, MAX_ZOOM) }));
}
};
return ( return (
<div className="mapa-wrapper"> <div className="mapa-wrapper">
@@ -195,11 +196,15 @@ const MapaBsAsSecciones = () => {
<ZoomableGroup <ZoomableGroup
center={position.center} center={position.center}
zoom={position.zoom} zoom={position.zoom}
onMoveEnd={handleMoveEnd} onMoveEnd={(newPosition: { coordinates: PointTuple; zoom: number }) => {
setIsPanning(false);
handleMoveEnd(newPosition);
}}
minZoom={MIN_ZOOM} minZoom={MIN_ZOOM}
maxZoom={MAX_ZOOM} maxZoom={MAX_ZOOM}
translateExtent={TRANSLATE_EXTENT} translateExtent={TRANSLATE_EXTENT}
style={{ transition: "transform 400ms ease-in-out" }} className={isPanning ? 'panning' : ''}
onMoveStart={() => setIsPanning(true)}
filterZoomEvent={(e: WheelEvent) => { filterZoomEvent={(e: WheelEvent) => {
if (e.deltaY > 0) { if (e.deltaY > 0) {
handleReset(); handleReset();
@@ -228,7 +233,6 @@ const MapaBsAsSecciones = () => {
onClick={isClickable ? () => handleGeographyClick(geo) : undefined} onClick={isClickable ? () => handleGeographyClick(geo) : undefined}
onMouseEnter={() => { onMouseEnter={() => {
if (isClickable) { if (isClickable) {
// --- CORRECCIÓN 3: Tooltip con nombre de sección ---
const nombreSeccionLegible = NOMBRES_SECCIONES[geo.properties.seccion] || "Sección Desconocida"; const nombreSeccionLegible = NOMBRES_SECCIONES[geo.properties.seccion] || "Sección Desconocida";
setTooltipContent(`${nombreSeccionLegible}: ${nombreGanador}`); setTooltipContent(`${nombreSeccionLegible}: ${nombreGanador}`);
} }
@@ -272,32 +276,32 @@ const MapaBsAsSecciones = () => {
); );
}; };
// --- Sub-componente para la Leyenda --- // --- Sub-componente para la Leyenda (sin cambios) ---
const LegendSecciones = ({ resultados, nombresAgrupaciones }: { resultados: Map<string, ResultadoMapaSeccion>, nombresAgrupaciones: Map<string, string> }) => { const LegendSecciones = ({ resultados, nombresAgrupaciones }: { resultados: Map<string, ResultadoMapaSeccion>, nombresAgrupaciones: Map<string, string> }) => {
const legendItems = useMemo(() => { const legendItems = useMemo(() => {
const ganadoresUnicos = new Map<string, { nombre: string; color: string }>(); const ganadoresUnicos = new Map<string, { nombre: string; color: string }>();
resultados.forEach(resultado => { resultados.forEach(resultado => {
if (resultado.agrupacionGanadoraId && resultado.colorGanador && !ganadoresUnicos.has(resultado.agrupacionGanadoraId)) { if (resultado.agrupacionGanadoraId && resultado.colorGanador && !ganadoresUnicos.has(resultado.agrupacionGanadoraId)) {
ganadoresUnicos.set(resultado.agrupacionGanadoraId, { ganadoresUnicos.set(resultado.agrupacionGanadoraId, {
nombre: nombresAgrupaciones.get(resultado.agrupacionGanadoraId) || 'Desconocido', nombre: nombresAgrupaciones.get(resultado.agrupacionGanadoraId) || 'Desconocido',
color: resultado.colorGanador color: resultado.colorGanador
});
}
}); });
} return Array.from(ganadoresUnicos.values());
}); }, [resultados, nombresAgrupaciones]);
return Array.from(ganadoresUnicos.values());
}, [resultados, nombresAgrupaciones]);
return ( return (
<div className="legend"> <div className="legend">
<h4>Ganadores por Sección</h4> <h4>Ganadores por Sección</h4>
{legendItems.map(item => ( {legendItems.map(item => (
<div key={item.nombre} className="legend-item"> <div key={item.nombre} className="legend-item">
<div className="legend-color-box" style={{ backgroundColor: item.color }} /> <div className="legend-color-box" style={{ backgroundColor: item.color }} />
<span>{item.nombre}</span> <span>{item.nombre}</span>
</div>
))}
</div> </div>
))} );
</div>
);
}; };
export default MapaBsAsSecciones; export default MapaBsAsSecciones;

View File

@@ -83,7 +83,7 @@ export const TelegramaWidget = () => {
setTelegrama(null); setTelegrama(null);
getTelegramaPorId(selectedMesa) getTelegramaPorId(selectedMesa)
.then(setTelegrama) .then(setTelegrama)
.catch(() => setError(`No se encontró el telegrama para la mesa seleccionada.`)) .catch(() => setError(`El telegrama para la mesa seleccionada, aún no se cargó en el sistema.`))
.finally(() => setLoading(false)); .finally(() => setLoading(false));
} }
}, [selectedMesa]); }, [selectedMesa]);

View File

@@ -21,16 +21,17 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-bottom: 1px solid #e0e0e0; /* Borde más claro */ border-bottom: 1px solid #e0e0e0;
padding-bottom: 10px; padding-bottom: 10px;
margin-bottom: 15px; margin-bottom: 15px;
} }
.ticker-header h3 { .ticker-header h3 {
margin: 0; margin: 0;
color: #212529; /* Color de título oscuro */ color: #212529;
font-size: 1.2em; font-size: 1.2em;
font-weight: 700; font-weight: 700;
padding-right: 15px; /* Espacio para que no se pegue al dropdown en escritorio */
} }
.ticker-stats { .ticker-stats {
@@ -41,14 +42,14 @@
} }
.ticker-stats strong { .ticker-stats strong {
color: #0073e6; /* Se usa el azul primario para destacar */ color: #0073e6;
font-size: 1.1em; font-size: 1.1em;
} }
.ticker-results { .ticker-results {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 12px; /* Espacio entre partidos */ gap: 12px;
} }
.ticker-party .party-info { .ticker-party .party-info {
@@ -71,7 +72,7 @@
} }
.party-bar-background { .party-bar-background {
background-color: #e9ecef; /* Fondo de barra claro */ background-color: #e9ecef;
border-radius: 4px; border-radius: 4px;
height: 10px; height: 10px;
overflow: hidden; overflow: hidden;
@@ -81,18 +82,17 @@
height: 100%; height: 100%;
border-radius: 4px; border-radius: 4px;
transition: width 0.5s ease-in-out; transition: width 0.5s ease-in-out;
/* El color de fondo se sigue aplicando desde el componente, esto es correcto */
} }
.ticker-results { .ticker-results {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Aumentamos el tamaño mínimo */ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 20px; gap: 20px;
} }
.ticker-party { .ticker-party {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; /* Espacio entre logo y detalles */ gap: 10px;
} }
.party-logo { .party-logo {
flex-shrink: 0; flex-shrink: 0;
@@ -108,5 +108,29 @@
} }
.party-details { .party-details {
flex-grow: 1; flex-grow: 1;
min-width: 0; /* Previene que el flex item se desborde */ min-width: 0;
}
/* --- ESTILOS PARA RESPONSIVIDAD MÓVIL --- */
@media (max-width: 600px) {
.ticker-header {
flex-direction: column;
/* Centra los elementos hijos horizontalmente */
align-items: center;
gap: 10px;
}
.ticker-header h3 {
font-size: 1.1em;
padding-right: 0; /* Quitamos el padding en móvil */
}
/* Esta regla asegura que el dropdown siga ocupando todo el ancho */
.ticker-header > div {
width: 100%;
}
.ticker-party .party-name {
white-space: normal;
}
} }

View File

@@ -48,7 +48,6 @@ public class ResultadosController : ControllerBase
var resultadosVotos = await _dbContext.ResultadosVotos.AsNoTracking() var resultadosVotos = await _dbContext.ResultadosVotos.AsNoTracking()
.Include(rv => rv.AgrupacionPolitica) .Include(rv => rv.AgrupacionPolitica)
// --- CORRECCIÓN: Usamos la 'categoriaId' que viene como parámetro ---
.Where(rv => rv.AmbitoGeograficoId == ambito.Id && rv.CategoriaId == categoriaId) .Where(rv => rv.AmbitoGeograficoId == ambito.Id && rv.CategoriaId == categoriaId)
.ToListAsync(); .ToListAsync();
@@ -270,7 +269,7 @@ public class ResultadosController : ControllerBase
// Mapeamos los resultados de los partidos // Mapeamos los resultados de los partidos
var resultadosPartidosDto = resultadosVotos var resultadosPartidosDto = resultadosVotos
.OrderByDescending(r => r.CantidadVotos) .OrderByDescending(r => r.CantidadVotos)
.Select(rv => new AgrupacionResultadoDto // Assuming AgrupacionResultadoDto is the correct DTO for individual party results .Select(rv => new AgrupacionResultadoDto
{ {
Id = rv.AgrupacionPolitica.Id, Id = rv.AgrupacionPolitica.Id,
Nombre = rv.AgrupacionPolitica.NombreCorto ?? rv.AgrupacionPolitica.Nombre, Nombre = rv.AgrupacionPolitica.NombreCorto ?? rv.AgrupacionPolitica.Nombre,
@@ -360,8 +359,6 @@ public class ResultadosController : ControllerBase
}) })
.ToList(); .ToList();
// --- FIN DE LA CORRECCIÓN CLAVE ---
var presidenteDiputados = bancasPorAgrupacion var presidenteDiputados = bancasPorAgrupacion
.Where(b => b.Camara == Core.Enums.TipoCamara.Diputados) .Where(b => b.Camara == Core.Enums.TipoCamara.Diputados)
.OrderByDescending(b => b.BancasTotales) .OrderByDescending(b => b.BancasTotales)
@@ -579,7 +576,6 @@ public class ResultadosController : ControllerBase
r.Agrupacion.Color, r.Agrupacion.Color,
LogoUrl = logosConcejales.GetValueOrDefault(r.Agrupacion.Id)?.LogoUrl, LogoUrl = logosConcejales.GetValueOrDefault(r.Agrupacion.Id)?.LogoUrl,
Votos = r.Votos, Votos = r.Votos,
// --- CORRECCIÓN CLAVE ---
// 3. Usamos el nombre de propiedad correcto que el frontend espera: 'votosPorcentaje' // 3. Usamos el nombre de propiedad correcto que el frontend espera: 'votosPorcentaje'
VotosPorcentaje = totalVotosSeccion > 0 ? ((decimal)r.Votos * 100 / totalVotosSeccion) : 0 VotosPorcentaje = totalVotosSeccion > 0 ? ((decimal)r.Votos * 100 / totalVotosSeccion) : 0
}) })

View File

@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Api")] [assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Api")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9393d2bc05f1fda0ad9e78d988aa3fc088cfc2d7")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6732a0e826a402495269212729673ebf1ff01916")]
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Api")] [assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Api")]
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Api")] [assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Api")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
{"GlobalPropertiesHash":"b5T/+ta4fUd8qpIzUTm3KyEwAYYUsU5ASo+CSFM3ByE=","FingerprintPatternsHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["h1yBBcAgq4jIQ1vINVvluRQMeuJlGA3/Zciq/j5c0AM=","t631p0kaOa0gMRIcaPzz1ZVPZ1kuq4pq4kYPWQgoPcM=","PA/Beu9jJpOBY5r5Y1CiSyqrARA2j7LHeWYUnEZpQO8=","E2ODTAlJxzsXY1iP1eB/02NIUK\u002BnQveGlWAOHY1cpgA=","6WTvWQ72AaZBYOVSmaxaci9tc1dW5p7IK9Kscjj2cb0=","vAy46VJ9Gp8QqG/Px4J1mj8jL6ws4/A01UKRmMYfYek=","cdgbHR/E4DJsddPc\u002BTpzoUMOVNaFJZm33Pw7AxU9Ees=","4r4JGR4hS5m4rsLfuCSZxzrknTBxKFkLQDXc\u002B2KbqTU=","yVoZ4UnBcSOapsJIi046hnn7ylD3jAcEBUxQ\u002Brkvj/4=","/GfbpJthEWmsuz0uFx1QLHM7gyM1wLLeQgAIl4SzUD4=","i5\u002B5LcfxQD8meRAkQbVf4wMvjxSE4\u002BjCd2/FdPtMpms=","AvSkxVPIg0GjnB1RJ4hDNyo9p9GONrzDs8uVuixH\u002BOE=","IgT9pOgRnK37qfILj2QcjFoBZ180HMt\u002BScgje2iYOo4=","ezUlOMzNZmyKDIe1wwXqvX\u002BvhwfB992xNVts7r2zcTc=","y2BV4WpkQuLfqQhfOQBtmuzh940c3s4LAopGKfztfTE=","lHTUEsMkDu8nqXtfTwl7FRfgocyyc7RI5O/edTHN1\u002B0=","A7nz7qgOtQ1CwZZLvNnr0b5QZB3fTi3y4i6y7rBIcxQ=","znnuRi2tsk7AACuYo4WSgj7NcLriG4PKVaF4L35SvDk=","GelE32odx/vTului267wqi6zL3abBnF9yvwC2Q66LoM=","KaNgYB2ifCIE3p/Tay5fVAWfGAbZ/FRwD44afnqRoKI=","6CAjHexjcmVc1caYyfNvMfhJRU6qtmi57Siv1ysirg0=","P8JRhYPpULTLMAydvl3Ky\u002B92/tYDIjui0l66En4aXuQ=","iL0B6pwfSYZpOYzq7AuHcEbBAAVseMon4HovdUC\u002BTcU="],"CachedAssets":{},"CachedCopyCandidates":{}} {"GlobalPropertiesHash":"b5T/+ta4fUd8qpIzUTm3KyEwAYYUsU5ASo+CSFM3ByE=","FingerprintPatternsHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["h1yBBcAgq4jIQ1vINVvluRQMeuJlGA3/Zciq/j5c0AM=","t631p0kaOa0gMRIcaPzz1ZVPZ1kuq4pq4kYPWQgoPcM=","PA/Beu9jJpOBY5r5Y1CiSyqrARA2j7LHeWYUnEZpQO8=","E2ODTAlJxzsXY1iP1eB/02NIUK\u002BnQveGlWAOHY1cpgA=","6WTvWQ72AaZBYOVSmaxaci9tc1dW5p7IK9Kscjj2cb0=","vAy46VJ9Gp8QqG/Px4J1mj8jL6ws4/A01UKRmMYfYek=","cdgbHR/E4DJsddPc\u002BTpzoUMOVNaFJZm33Pw7AxU9Ees=","4r4JGR4hS5m4rsLfuCSZxzrknTBxKFkLQDXc\u002B2KbqTU=","yVoZ4UnBcSOapsJIi046hnn7ylD3jAcEBUxQ\u002Brkvj/4=","/GfbpJthEWmsuz0uFx1QLHM7gyM1wLLeQgAIl4SzUD4=","i5\u002B5LcfxQD8meRAkQbVf4wMvjxSE4\u002BjCd2/FdPtMpms=","AvSkxVPIg0GjnB1RJ4hDNyo9p9GONrzDs8uVuixH\u002BOE=","IgT9pOgRnK37qfILj2QcjFoBZ180HMt\u002BScgje2iYOo4=","ezUlOMzNZmyKDIe1wwXqvX\u002BvhwfB992xNVts7r2zcTc=","y2BV4WpkQuLfqQhfOQBtmuzh940c3s4LAopGKfztfTE=","lHTUEsMkDu8nqXtfTwl7FRfgocyyc7RI5O/edTHN1\u002B0=","A7nz7qgOtQ1CwZZLvNnr0b5QZB3fTi3y4i6y7rBIcxQ=","znnuRi2tsk7AACuYo4WSgj7NcLriG4PKVaF4L35SvDk=","GelE32odx/vTului267wqi6zL3abBnF9yvwC2Q66LoM=","FktDKOD55tGexuQTZYqJXFJKcfFUYha2UUveJ7i4d\u002B0=","6CAjHexjcmVc1caYyfNvMfhJRU6qtmi57Siv1ysirg0=","P8JRhYPpULTLMAydvl3Ky\u002B92/tYDIjui0l66En4aXuQ=","yfarYtFn36AY3Hcf8kh\u002BwBS7wI/HSaScE\u002BTOvW5GoAM="],"CachedAssets":{},"CachedCopyCandidates":{}}

View File

@@ -1 +1 @@
{"GlobalPropertiesHash":"tJTBjV/i0Ihkc6XuOu69wxL8PBac9c9Kak6srMso4pU=","FingerprintPatternsHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["h1yBBcAgq4jIQ1vINVvluRQMeuJlGA3/Zciq/j5c0AM=","t631p0kaOa0gMRIcaPzz1ZVPZ1kuq4pq4kYPWQgoPcM=","PA/Beu9jJpOBY5r5Y1CiSyqrARA2j7LHeWYUnEZpQO8=","E2ODTAlJxzsXY1iP1eB/02NIUK\u002BnQveGlWAOHY1cpgA=","6WTvWQ72AaZBYOVSmaxaci9tc1dW5p7IK9Kscjj2cb0=","vAy46VJ9Gp8QqG/Px4J1mj8jL6ws4/A01UKRmMYfYek=","cdgbHR/E4DJsddPc\u002BTpzoUMOVNaFJZm33Pw7AxU9Ees=","4r4JGR4hS5m4rsLfuCSZxzrknTBxKFkLQDXc\u002B2KbqTU=","yVoZ4UnBcSOapsJIi046hnn7ylD3jAcEBUxQ\u002Brkvj/4=","/GfbpJthEWmsuz0uFx1QLHM7gyM1wLLeQgAIl4SzUD4=","i5\u002B5LcfxQD8meRAkQbVf4wMvjxSE4\u002BjCd2/FdPtMpms=","AvSkxVPIg0GjnB1RJ4hDNyo9p9GONrzDs8uVuixH\u002BOE=","IgT9pOgRnK37qfILj2QcjFoBZ180HMt\u002BScgje2iYOo4=","ezUlOMzNZmyKDIe1wwXqvX\u002BvhwfB992xNVts7r2zcTc=","y2BV4WpkQuLfqQhfOQBtmuzh940c3s4LAopGKfztfTE=","lHTUEsMkDu8nqXtfTwl7FRfgocyyc7RI5O/edTHN1\u002B0=","A7nz7qgOtQ1CwZZLvNnr0b5QZB3fTi3y4i6y7rBIcxQ=","znnuRi2tsk7AACuYo4WSgj7NcLriG4PKVaF4L35SvDk=","GelE32odx/vTului267wqi6zL3abBnF9yvwC2Q66LoM=","KaNgYB2ifCIE3p/Tay5fVAWfGAbZ/FRwD44afnqRoKI=","6CAjHexjcmVc1caYyfNvMfhJRU6qtmi57Siv1ysirg0=","P8JRhYPpULTLMAydvl3Ky\u002B92/tYDIjui0l66En4aXuQ=","iL0B6pwfSYZpOYzq7AuHcEbBAAVseMon4HovdUC\u002BTcU="],"CachedAssets":{},"CachedCopyCandidates":{}} {"GlobalPropertiesHash":"tJTBjV/i0Ihkc6XuOu69wxL8PBac9c9Kak6srMso4pU=","FingerprintPatternsHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["h1yBBcAgq4jIQ1vINVvluRQMeuJlGA3/Zciq/j5c0AM=","t631p0kaOa0gMRIcaPzz1ZVPZ1kuq4pq4kYPWQgoPcM=","PA/Beu9jJpOBY5r5Y1CiSyqrARA2j7LHeWYUnEZpQO8=","E2ODTAlJxzsXY1iP1eB/02NIUK\u002BnQveGlWAOHY1cpgA=","6WTvWQ72AaZBYOVSmaxaci9tc1dW5p7IK9Kscjj2cb0=","vAy46VJ9Gp8QqG/Px4J1mj8jL6ws4/A01UKRmMYfYek=","cdgbHR/E4DJsddPc\u002BTpzoUMOVNaFJZm33Pw7AxU9Ees=","4r4JGR4hS5m4rsLfuCSZxzrknTBxKFkLQDXc\u002B2KbqTU=","yVoZ4UnBcSOapsJIi046hnn7ylD3jAcEBUxQ\u002Brkvj/4=","/GfbpJthEWmsuz0uFx1QLHM7gyM1wLLeQgAIl4SzUD4=","i5\u002B5LcfxQD8meRAkQbVf4wMvjxSE4\u002BjCd2/FdPtMpms=","AvSkxVPIg0GjnB1RJ4hDNyo9p9GONrzDs8uVuixH\u002BOE=","IgT9pOgRnK37qfILj2QcjFoBZ180HMt\u002BScgje2iYOo4=","ezUlOMzNZmyKDIe1wwXqvX\u002BvhwfB992xNVts7r2zcTc=","y2BV4WpkQuLfqQhfOQBtmuzh940c3s4LAopGKfztfTE=","lHTUEsMkDu8nqXtfTwl7FRfgocyyc7RI5O/edTHN1\u002B0=","A7nz7qgOtQ1CwZZLvNnr0b5QZB3fTi3y4i6y7rBIcxQ=","znnuRi2tsk7AACuYo4WSgj7NcLriG4PKVaF4L35SvDk=","GelE32odx/vTului267wqi6zL3abBnF9yvwC2Q66LoM=","FktDKOD55tGexuQTZYqJXFJKcfFUYha2UUveJ7i4d\u002B0=","6CAjHexjcmVc1caYyfNvMfhJRU6qtmi57Siv1ysirg0=","P8JRhYPpULTLMAydvl3Ky\u002B92/tYDIjui0l66En4aXuQ=","yfarYtFn36AY3Hcf8kh\u002BwBS7wI/HSaScE\u002BTOvW5GoAM="],"CachedAssets":{},"CachedCopyCandidates":{}}

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Core")] [assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Core")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9393d2bc05f1fda0ad9e78d988aa3fc088cfc2d7")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6732a0e826a402495269212729673ebf1ff01916")]
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Core")] [assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Core")]
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Core")] [assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Core")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Database")] [assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9393d2bc05f1fda0ad9e78d988aa3fc088cfc2d7")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6732a0e826a402495269212729673ebf1ff01916")]
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Database")] [assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Database")] [assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Database")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Infrastructure")] [assembly: System.Reflection.AssemblyCompanyAttribute("Elecciones.Infrastructure")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9393d2bc05f1fda0ad9e78d988aa3fc088cfc2d7")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6732a0e826a402495269212729673ebf1ff01916")]
[assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Infrastructure")] [assembly: System.Reflection.AssemblyProductAttribute("Elecciones.Infrastructure")]
[assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Infrastructure")] [assembly: System.Reflection.AssemblyTitleAttribute("Elecciones.Infrastructure")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]