Skip to content

Commit

Permalink
Actualiza artículo
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Mar 18, 2024
1 parent d81ef16 commit 1d8c2d4
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 17 deletions.
13 changes: 12 additions & 1 deletion inst/pkgdown/assets/BS5/rostemplate.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ code a {
font-weight: bold;
}

.template-reference-topic dt code {
font-weight: 700;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
padding: 0;
border-radius: 0;
}

/* Section: Syntax highlighter emacs (como en la web de rOpenSpain) */
pre {
display: block;
Expand Down Expand Up @@ -443,4 +454,4 @@ blockquote {
padding: 10px 20px;
margin: 0 0 20px;
border-left: 5px solid #986dbd;
}
}
2 changes: 1 addition & 1 deletion inst/pkgdown/assets/BS5/rostemplate.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 87 additions & 15 deletions vignettes/articles/descargas.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ dwn_w %>%

```{r datos, echo=FALSE}
library(reactable)
library(htmltools)
lastyear <- dwn %>%
filter(date >= (Sys.Date() - 365)) %>%
Expand Down Expand Up @@ -198,25 +199,79 @@ end <-
names(end) <- c(
"paquete",
"en CRAN desde",
"última version en CRAN",
"media descargas diarias", "ultimo dia",
"ultima semana", "ultimo mes", "ultimo año"
"Versión en CRAN",
"media diaria", "último dia",
"última semana", "último mes", "último año"
)
react_es <- reactableLang(
sortLabel = "Ordena {name}",
filterPlaceholder = "",
filterLabel = "Filtro {name}",
searchPlaceholder = "Búsqueda",
searchLabel = "Búsqueda",
noData = "Sin resultados",
pageNext = "Siguiente",
pagePrevious = "Anterior",
pageNumbers = "{page} de {pages}",
pageInfo = "{rowStart}\u2013{rowEnd} de {rows} registros",
pageSizeOptions = "Mostrando {rows}",
pageNextLabel = "Siguiente página",
pagePreviousLabel = "Página anterior",
pageNumberLabel = "Página {page}",
pageJumpLabel = "Ir a página",
pageSizeOptionsLabel = "Registros por página"
)
options(reactable.language = react_es)
reactable(
end,
filterable = TRUE,
searchable = TRUE,
showPageSizeOptions = TRUE,
striped = TRUE,
defaultColDef = colDef(
minWidth = 150, vAlign = "center", footerStyle = list(fontWeight = "bold"),
footer = function(values) {
if (!is.numeric(values)) {
return()
}
prettyNum(sum(values), big.mark = ".", decimal.mark = ",")
}
),
paginationType = "jump",
elementId = "cran-dwn",
defaultPageSize = 25,
columns = list(paquete = colDef(cell = function(value) {
# Render as a link
url <- paste0("https://CRAN.R-project.org/package=", value)
htmltools::tags$a(href = url, target = "_blank", as.character(value))
}))
columns <- list(
paquete = colDef(
cell = function(value) {
# Render as a link
url <- paste0("https://CRAN.R-project.org/package=", value)
badge <- paste0("https://badges.cranchecks.info/worst/", value, ".svg")
link <- htmltools::a(href = url, target = "_blank", as.character(value))
div(
div(link, style = list(fontWeight = "bold")),
div(htmltools::img(src = badge, alt = as.character(value)),
style = list(fontSize = "75%")
)
)
},
align = "left",
sticky = "left",
rowHeader = TRUE
),
"media diaria" = colDef(
format = colFormat(separators = TRUE),
footer = function(values) {
p <- round(mean(values), 2)
prettyNum(p, big.mark = ".", decimal.mark = ",")
}
),
"último dia" = colDef(format = colFormat(separators = TRUE)),
"última semana" = colDef(format = colFormat(separators = TRUE)),
"último mes" = colDef(format = colFormat(separators = TRUE)),
"último año" = colDef(format = colFormat(separators = TRUE))
)
)
```

Expand Down Expand Up @@ -277,13 +332,30 @@ reactable(
searchable = TRUE,
showPageSizeOptions = TRUE,
striped = TRUE,
defaultColDef = colDef(
minWidth = 150, vAlign = "center", footerStyle = list(fontWeight = "bold"),
footer = function(values) {
if (!is.numeric(values)) {
return()
}
prettyNum(sum(values), big.mark = ".", decimal.mark = ",")
}
),
paginationType = "jump",
elementId = "posit-dwn",
defaultPageSize = 25,
columns = list(paquete = colDef(cell = function(value) {
# Render as a link
url <- paste0("https://CRAN.R-project.org/package=", value)
htmltools::tags$a(href = url, target = "_blank", as.character(value))
}))
columns = list(
paquete = colDef(
cell = function(value) {
# Render as a link
url <- paste0("https://CRAN.R-project.org/package=", value)
link <- htmltools::a(href = url, target = "_blank", as.character(value))
div(link, style = list(fontWeight = "bold"))
},
align = "left",
sticky = "left",
rowHeader = TRUE
),
"Descargas (último mes)" = colDef(format = colFormat(separators = TRUE))
)
)
```

0 comments on commit 1d8c2d4

Please sign in to comment.