generated from enflujo/enflujo-plantilla-astro
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
124 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1 Byte
(100%)
procesador/Listado de proyectos - 60 años dpto antropología .xlsx
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
import type { ElementoLista } from '@/tipos'; | ||
import { convertirEscala } from '@enflujo/alquimia'; | ||
import { text } from 'stream/consumers'; | ||
interface Props { | ||
tiempo: ElementoLista[]; | ||
decadas: ElementoLista[]; | ||
} | ||
const { decadas, tiempo } = Astro.props; | ||
let datosLinea = ''; | ||
const numeroDecadas = decadas.length; | ||
const anchoDecada = 100 / numeroDecadas; | ||
const altoDecada = (valor: number) => convertirEscala(valor, 0, 58, 0, 30); | ||
const posY = (valor: number) => convertirEscala(valor, 0, 20, 100, 0); | ||
const posX = (valor: number) => convertirEscala(valor, 1966, 2026, 0, 100); | ||
tiempo.forEach((marca, i) => { | ||
const x = posX(+marca.nombre); | ||
const y = posY(marca.conteo); | ||
if (i === 0) { | ||
datosLinea += `M ${0}, ${100} L`; | ||
} else { | ||
} | ||
datosLinea += ` ${x}, ${y}`; | ||
if (i === tiempo.length - 1) { | ||
datosLinea += 'L 100, 100 Z'; | ||
} | ||
}); | ||
--- | ||
|
||
<div id="contenedorGrafica"> | ||
<svg width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none"> | ||
<g id="decadas"> | ||
{ | ||
decadas.map((decada, i) => ( | ||
<rect x={`${i * anchoDecada}%`} y="0" width={`${anchoDecada}%`} height={`${altoDecada(decada.conteo)}px`} /> | ||
)) | ||
} | ||
|
||
<path d={datosLinea}></path> | ||
</g> | ||
</svg> | ||
|
||
<svg id="marcas" width="100%" height="100%"> | ||
{ | ||
tiempo.map((marca) => ( | ||
<text style={`transform:translate(${posX(+marca.nombre)}%, ${posY(marca.conteo)}%)`} x="0" y="0"> | ||
{marca.nombre} | ||
</text> | ||
)) | ||
} | ||
</svg> | ||
</div> | ||
|
||
<style lang="scss"> | ||
#contenedorGrafica { | ||
height: 150px; | ||
position: relative; | ||
background-color: var(--rosaPigmento); | ||
z-index: 3; | ||
} | ||
svg { | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
|
||
path { | ||
fill: rgba(210, 76, 76, 0.679); | ||
} | ||
|
||
text { | ||
font-size: 8px; | ||
fill: white; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -330,6 +330,11 @@ | |
resolved "https://registry.yarnpkg.com/@emmetio/scanner/-/scanner-1.0.4.tgz#e9cdc67194fd91f8b7eb141014be4f2d086c15f1" | ||
integrity sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA== | ||
|
||
"@enflujo/alquimia@^2.0.0": | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/@enflujo/alquimia/-/alquimia-2.0.0.tgz#d0cda3e14c6c0dcdee971e55f1cd515197d66dc8" | ||
integrity sha512-4+j3jL9Kb929z6+nLIlDW+BBxXs81tgNxTiEYONNIEkA4QJDtjEZoyJss7E2QWLM3xpV0YA6j0kKV6tGahqARw== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.18.20" | ||
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" | ||
|