Skip to content
Open

Dev #60

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions R/utils/global_translations.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
library(tidyverse)

# Reading "message_status.csv" and "metadata.csv"
msg_status_df <- read.csv("message_status.csv")
meta_data_df <- read.csv("metadata.csv")
msg_status_df <- read.csv("data/translation_status.csv")
meta_data_df <- read.csv("data/metadata.csv")

# Value Boxes
total_lang <- length(unique(msg_status_df$language))
Expand Down
783 changes: 783 additions & 0 deletions index.html

Large diffs are not rendered by default.

321 changes: 321 additions & 0 deletions index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,321 @@
---
title: "R Translations Status Dashboard"
format:
dashboard:
vertical-layout: scroll
scrolling: true
favicon:
theme: cosmo
---

```{r setup, include=FALSE}

if (!require("pacman")) install.packages("pacman")

pacman::p_load(
crosstalk,
tidyverse,
htmltools,
plotly,
reactable,
glue
)
source("R/utils/global_translations.R")
```

# Home
## Row {height=5%}

### Total Languages

```{r}
#| content: valuebox
#| title: "Total Languages"
#| icon: translate
#| color: primary
list(
value = total_lang
)
```

### Translated Messages

```{r}
#| content: valuebox
#| title: "Translated Messages"
#| icon: chat
#| color: success
list(
value = total_trans_msg
)
```

### Untranslated Messages

```{r}
#| content: valuebox
#| title: "Untranslated Messages"
#| icon: x-circle
#| color: warning
list(
value = total_untrans_msg
)
```

### Fuzzy Messages

```{r}
#| content: valuebox
#| title: "Fuzzy Messages"
#| icon: puzzle
#| color: info
list(
value = total_fuzzy_msg
)
```

## Row {height=5%}

```{r data}
trans_stats <- SharedData$new(final_df)
```

```{r filters}

# Filter Select Input - Language
filter_select(id = "language",
label = "Select Translation Language",
sharedData = trans_stats,
group = ~language)

```

## Row {height=15%}

```{r}
#| title: "Graph of Translated vs Untranslated Messages | Per Package"
trans_stats <- plot_ly(trans_stats, x = ~package, y = ~translated_count, type = 'bar', name = 'Translated Messages')
trans_stats <- trans_stats %>% add_trace(y = ~untranslated_count, name = 'Untranslated Messages')
trans_stats <- trans_stats %>% add_trace(y = ~fuzzy_count, name = 'Fuzzy Messages')
trans_stats <- trans_stats %>% layout(yaxis = list(title = 'Message Count'), xaxis = list(title = "Packages"), barmode = 'group')
trans_stats
```

## Row {height=20%}

### Column

```{r}
#| title: "Count of Translated Messages | Across Packages"
complete_trans_df %>%
reactable(
.,
pagination = TRUE,
showPageSizeOptions = TRUE,
highlight = TRUE,
defaultSorted = "translated_count",
defaultColDef = colDef(headerClass = "header", align = "left"),
columns = list(
package = colDef(
name = "Package Name",
width = 150,
defaultSortOrder = "desc",
filterable = TRUE,
),
language = colDef(
name = "Language",
width = 150,
filterable = TRUE,
),
untranslated_count = colDef(
show = FALSE
),
translated_count = colDef(
name = "Translated Message Count",
defaultSortOrder = "desc",
cell = function(value) {
width <- paste0(value * 100 / max(complete_trans_df$translated_count), "%")
value <- format(value, big.mark = ",")
value <- format(value, width = 9, justify = "right")
bar <- div(
class = "bar-chart",
style = list(marginRight = "6px"),
div(class = "bar", style = list(width = width, backgroundColor = "#fc5185"))
)
div(class = "bar-cell", span(class = "number", value), bar)
}
)),
compact = TRUE,
bordered = TRUE,
class = "categories-tbl"
)
```

### Column

```{r}
#| title: "Count of Untranslated Messages | Across Packages"
complete_untrans_df %>%
reactable(
.,
pagination = TRUE,
showPageSizeOptions = TRUE,
highlight = TRUE,
defaultSorted = "untranslated_count",
defaultColDef = colDef(headerClass = "header", align = "left"),
columns = list(
package = colDef(
name = "Package Name",
width = 150,
defaultSortOrder = "desc",
filterable = TRUE,
),
language = colDef(
name = "Language",
width = 150,
filterable = TRUE,
),
translated_count = colDef(
show = FALSE
),
untranslated_count = colDef(
name = "Untranslated Message Count",
defaultSortOrder = "desc",
cell = function(value) {
width <- paste0(value * 100 / max(complete_untrans_df$untranslated_count), "%")
value <- format(value, big.mark = ",")
value <- format(value, width = 9, justify = "right")
bar <- div(
class = "bar-chart",
style = list(marginRight = "6px"),
div(class = "bar", style = list(width = width, backgroundColor = "#3fc1c9"))
)
div(class = "bar-cell", span(class = "number", value), bar)
}
)),
compact = TRUE,
bordered = TRUE,
class = "categories-tbl"
)
```

## Row {height=20%}

```{r}
#| title: "Percentage Distribution of Message Translation | Across Packages"

final_df %>%
reactable(
.,
pagination = TRUE,
showPageSizeOptions = TRUE,
highlight = TRUE,
defaultColDef = colDef(headerClass = "header", align = "left"),
columns = list(
package = colDef(
name = "Package Name",
width = 150,
defaultSortOrder = "desc",
filterable = TRUE,
),
language = colDef(
name = "Language",
width = 150,
filterable = TRUE,
),
translated_count = colDef(
show = FALSE
),
untranslated_count = colDef(
show = FALSE
),
fuzzy_count = colDef(
show = FALSE
),
pc_trans_count = colDef(
name = "Translated Message",
cell = function(value) {
value <- paste0(format(round(value * 100, 2), nsmall = 1), "%")
value <- format(value, width = 9, justify = "right")
bar <- div(
class = "bar-chart",
style = list(marginRight = "6px"),
div(class = "bar", style = list(width = value, backgroundColor = "#fc5185"))
)
div(class = "bar-cell", span(class = "number", value), bar)
}
),
pc_untrans_count = colDef(
name = "Untranslated Message",
cell = function(value) {
value <- paste0(format(round(value * 100, 2), nsmall = 1), "%")
value <- format(value, width = 9, justify = "right")
bar <- div(
class = "bar-chart",
style = list(marginRight = "6px"),
div(class = "bar", style = list(width = value, backgroundColor = "#3fc1c9"))
)
div(class = "bar-cell", span(class = "number", value), bar)
}
),
pc_fuzzy_count = colDef(
name = "Fuzzy Message",
cell = function(value) {
value <- paste0(format(round(value * 100, 2), nsmall = 1), "%")
value <- format(value, width = 9, justify = "right")
bar <- div(
class = "bar-chart",
style = list(marginRight = "6px"),
div(class = "bar", style = list(width = value, backgroundColor = "#241327"))
)
div(class = "bar-cell", span(class = "number", value), bar)
}
)),
compact = TRUE,
bordered = TRUE,
class = "categories-tbl"
)
```

## Row {height=5%}

```{r}
#| title: "Dashboard Updates"
gh_endpoint <- "https://api.github.com/repos/r-devel/translations-dashboard/commits?path=message_status.csv&page=1&per_page=1"
last_update_date <- get_last_data_update(gh_endpoint)
glue::glue("This page was last updated on: ", {last_update_date})
```


# R Translation Teams

## Row

```{r}
#| title: "R Translation Teams | Contact Details"
translation_teams %>%
reactable(
.,
pagination = TRUE,
showPageSizeOptions = TRUE,
highlight = TRUE,
defaultColDef = colDef(headerClass = "header", align = "left"),
columns = list(
Language = colDef(
name = "Translation Languages",
filterable = TRUE,
),
Members = colDef(
name = "R-Core Lead Maintainers",
filterable = TRUE,
),
Contact = colDef(
name = "Email Contacts",
filterable = TRUE,
)),
compact = TRUE,
bordered = TRUE,
class = "categories-tbl"
)
```

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading