Skip to content

Commit

Permalink
📌 que se vea más claro cuando no hay datos en zona mapa y esperar la …
Browse files Browse the repository at this point in the history
…creación de ejeY cuando hay datos
  • Loading branch information
1cgonza committed Nov 13, 2024
1 parent a8942e3 commit d2e75a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions aplicaciones/www/src/componentes/LineaTiempo.astro
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const { alto, meta, umbral } = Astro.props;
}

function escalar() {
if (!datosNal.value.maxNal) return;
const marcasY = contenedorEjeY.querySelectorAll<SVGGElement>('.marcaEjeY');
const marcasX = contenedorEjeX.querySelectorAll<SVGGElement>('.marcaEjeX');
const areaUmbral = contenedorEjeY.querySelector<SVGGElement>('.umbral');
Expand Down Expand Up @@ -233,6 +234,8 @@ const { alto, meta, umbral } = Astro.props;
lineas.forEach((linea) => {
linea.actualizar(posicionX, posicionY);
});

if (!ejeYCreado) crearEjeY();
}

function crearEjeY() {
Expand Down Expand Up @@ -387,7 +390,6 @@ const { alto, meta, umbral } = Astro.props;
});

escalar();
if (!ejeYCreado) crearEjeY();
return;
}

Expand All @@ -396,7 +398,6 @@ const { alto, meta, umbral } = Astro.props;
linea.eliminar();
});
escalar();
if (!ejeYCreado) crearEjeY();
return;
}

Expand Down Expand Up @@ -431,7 +432,6 @@ const { alto, meta, umbral } = Astro.props;
});

escalar();
if (!ejeYCreado) crearEjeY();
});

añoSeleccionado.subscribe((añoActual) => {
Expand Down
3 changes: 2 additions & 1 deletion aplicaciones/www/src/componentes/Mapa.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const { ancho, alto } = Astro.props;
<defs>
<pattern id="sinInfo" patternUnits="userSpaceOnUse" width="3.5" height="3.5" patternTransform="rotate(45)">
<line x1="0" y1="0" x2="0" y2="3.5" stroke="#46484A" stroke-width="1"></line>
<line x1="3.5" y1="3.5" x2="0" y2="3.5" stroke="#46484A" stroke-width="1"></line>
</pattern>
</defs>

Expand Down Expand Up @@ -109,7 +110,7 @@ const { ancho, alto } = Astro.props;
let datosParaPintar: FeatureCollection; // Esto puede ser departamentos o municipios

mapa.onmousemove = (evento) => {
const { top, height } = informacion.getBoundingClientRect();
const { height } = informacion.getBoundingClientRect();
const x = evento.clientX;
const y = evento.clientY;

Expand Down

0 comments on commit d2e75a3

Please sign in to comment.