Skip to content

Commit

Permalink
Merge pull request arrow-maintenance#20 from thisisnic/tweak-ui
Browse files Browse the repository at this point in the history
Update a few UI components
  • Loading branch information
thisisnic authored Aug 2, 2024
2 parents 6c9d838 + 54af0a1 commit 515f3b9
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 48 deletions.
135 changes: 106 additions & 29 deletions _data.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,55 +39,41 @@ last_so_data <- so_data %>% filter(last_activity_date > now()- months(3))

##### Row {height=20%}

```{python}
#| content: valuebox
#| title: "All issues"
dict(
color = "light",
value = len(issues)
)
```

```{python}
#| content: valuebox
#| title: "Open Issues"
dict(
icon = "inboxes",
color = "light",
value = len(issues_open)
)
```

```{python}
#| content: valuebox
#| title: "Pull Requests"
dict(
color = "light",
value = len(prs)
)
```

```{python}
#| content: valuebox
#| title: "Open Pull Requests"
dict(
icon = "diagram-2",
color = "light",
value = len(prs_open)
)
```

```{r}
```{python}
#| content: valuebox
#| title: "Stack Overflow"
list(
#| title: "Stack Overflow Questions"
dict(
color = "light",
value = nrow(last_so_data)
icon = "stack-overflow",
value = len(r.last_so_data)
)
```

```{python}
#| content: valuebox
#| title: "Mailing list"
#| title: "Mailing List Threads"
dict(
icon = "envelope",
color = "light",
value = len(data_ml)
)
Expand All @@ -107,6 +93,38 @@ create_fig(py$x_prs_others, py$y_prs_others, py$y_prs_new)

### Issues

#### Row

```{python}
#| content: valuebox
#| title: "Open Issues"
dict(
color = "light",
icon = "list",
value = len(r.last_so_data) #TODO: update this
)
```

```{python}
#| content: valuebox
#| title: "Issues from New Contributors"
dict(
icon = "egg",
color = "light",
value = len(r.last_so_data[r.last_so_data["accepted_answer"] == "false"]) #TODO: update this
)
```

```{python}
#| content: valuebox
#| title: "Issues with No Replies"
dict(
icon = "hand-index",
color = "warning",
value = len(r.last_so_data[r.last_so_data["answers"] == 0]) #TODO: update this
)
```

#### Row
```{r}
#| title: All open issues, new contributors highlighted
Expand All @@ -115,6 +133,38 @@ dt_show_issues(py$issues_open)

### PRs

#### Row

```{python}
#| content: valuebox
#| title: "Open PRs"
dict(
color = "light",
icon = "diagram-2",
value = len(r.last_so_data) #TODO: update this
)
```

```{python}
#| content: valuebox
#| title: "PRs from New Contributors"
dict(
icon = "emoji-heart-eyes",
color = "success",
value = len(r.last_so_data[r.last_so_data["accepted_answer"] == "false"]) #TODO: update this
)
```

```{python}
#| content: valuebox
#| title: "Unreviewed PRs"
dict(
icon = "hand-index",
color = "warning",
value = len(r.last_so_data[r.last_so_data["answers"] == 0]) #TODO: update this
)
```

#### Row

```{r}
Expand All @@ -124,16 +174,43 @@ dt_show_issues(py$prs_open)

### Stack Overflow

#### Row
#### Row

```{r}
#| title: Unanswered questions
dt_show_unanswered_questions(so_data)
```{python}
#| content: valuebox
#| title: "Questions in last 90 days"
dict(
color = "light",
icon = "question-square",
value = len(r.last_so_data)
)
```

```{python}
#| content: valuebox
#| title: "Questions without accepted answer"
dict(
icon = "question-diamond",
color = "light",
value = len(r.last_so_data[r.last_so_data["accepted_answer"] == "false"])
)
```

```{python}
#| content: valuebox
#| title: "Unanswered questions"
dict(
icon = "question",
color = "warning",
value = len(r.last_so_data[r.last_so_data["answers"] == 0])
)
```

#### Row

```{r}
#| title: Answered questions, highlighted have accepted answer
dt_show_answered_questions(so_data)
#| title: Stack Overflow Questions
dt_show_questions(last_so_data)
```

### Mailing List
Expand Down
25 changes: 6 additions & 19 deletions stack_overflow_data/data_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,28 +133,15 @@ adjust_data <- function(questions_content){
mutate(issue = paste0('<a href="',link,'" target="_blank">', title , '</a>'))
}

dt_show_unanswered_questions <- function(data_adjusted){
dt_show_questions <- function(data_adjusted){

selected_rows <- which(data_adjusted$accepted_answer == FALSE)
data_adjusted %>%
select(issue, answers, accepted_answer, comments, days_since_last_activity) %>%
DT::datatable(
rownames = FALSE,
colnames = c('Question', 'Last activity (in days)'),
escape = FALSE,
data_adjusted %>%
filter(comments == 0 & answers == 0) %>%
select(issue, everything(), -link, -title, -comments, -answers, -accepted_answer, -last_activity_date)
)
}

dt_show_answered_questions <- function(data_adjusted){

selected_rows <- which(data_adjusted$accepted_answer == TRUE)
DT::datatable(
rownames = FALSE,
colnames = c('Question', 'Last activity (in days)'),
escape = FALSE,
data_adjusted %>%
filter(answers != 0) %>%
select(issue, everything(), -link, -title, -comments, -answers, -accepted_answer, -last_activity_date)
colnames = c('Question', 'Answers', 'Accepted Answer?', 'Comments', 'Last activity (in days)'),
escape = FALSE
) %>%
formatStyle("days_since_last_activity", target = "row", backgroundColor = styleRow(selected_rows, '#fbcd9989'))
}

0 comments on commit 515f3b9

Please sign in to comment.