Skip to content

Commit

Permalink
Component specific charts (#4)
Browse files Browse the repository at this point in the history
* add charts viewer html app

* add monthly issues viewer

* add component specific stats page

* update base charts

* update base charts
  • Loading branch information
tudorpopams authored Jul 23, 2024
1 parent a7d4151 commit d473e39
Show file tree
Hide file tree
Showing 67 changed files with 939 additions and 18 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ poetry run jupyter notebook

## Current stats

For individual component charts, check the [Components doc](./docs/components.md).

![Top 10 labels](./images/stats-01.png)

![Components issues](./images/stats-02.png)
Expand Down
11 changes: 9 additions & 2 deletions charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ def get_charts_data(issues):
issue["labels"] for issue in issues_minimal if issue["state"] == "open"
]

return all_issues, issues_minimal, df_issues, df_issues_closed, issue_labels
all_labels = set()

for labels in issue_labels:
all_labels = all_labels.union(labels)

component_names = set([label.replace("Component: ", "") for label in all_labels if label.startswith("Component:")])

return all_issues, issues_minimal, df_issues, df_issues_closed, issue_labels, component_names


def plot_labels_pie(issue_labels):
Expand Down Expand Up @@ -374,7 +381,7 @@ def plot_triage_issues_line(df_issues):


def _generate_and_save_plots(issues):
_, issues_minimal, df_issues, df_issues_closed, issue_labels = get_charts_data(
_, issues_minimal, df_issues, df_issues_closed, issue_labels, component_names = get_charts_data(
issues)

with alive_bar(6, title="Generating and saving charts", unit=" charts") as bar:
Expand Down
79 changes: 79 additions & 0 deletions component-charts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import json
import matplotlib.pyplot as plt

from alive_progress import alive_bar

from charts import (
get_charts_data,
)

used_months = ["2024-04", "2024-05", "2024-06", "2024-07"]
components_charts_folder = "images/components/"


def read_months_data(months=["2024-07"]):
all_issues = {}
components = set()

for month in months:
json_file = open(f"data/{month}/issues.json")
issues = json.load(json_file)

(
_,
issues_minimal,
_df_issues,
_df_issues_closed,
_issue_labels,
component_names,
) = get_charts_data(issues)

all_issues[month] = issues_minimal
components = components | component_names

return all_issues, components


if __name__ == "__main__":
all_issues, component_names = read_months_data(used_months)

component_stats = {}

for component in sorted(component_names):
component_stats[component] = {month: 0 for month in used_months}

for month, issues in all_issues.items():
open_issues = [issue for issue in issues if issue["state"] == "open"]

for issue in open_issues:
for label in issue["labels"]:
if not label.startswith("Component: "):
continue

component_name = label.replace("Component: ", "")

component_stats[component_name][month] += 1

with alive_bar(
len(component_names), title="Generating and saving charts", unit=" charts"
) as bar:
for component, stats in component_stats.items():
_, ax = plt.subplots(figsize=(10, 6))
component_values = list(stats.values())

for i, txt in enumerate(component_values):
ax.annotate(
txt,
(used_months[i], component_values[i]),
textcoords="offset points",
xytext=(0, 7),
ha="center",
)

ax.set_title(f"Component issues in the past months: {component}")
plt.xticks(rotation=45)
plt.plot(used_months, component_values, label=component)
plt.savefig(f"{components_charts_folder}{component}.png")
plt.close()

bar()
165 changes: 165 additions & 0 deletions docs/components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Fluent UI React v9 component specific charts

## Avatar

![Avatar stats](../images/components/Avatar.png)

## Menu

![Menu stats](../images/components/Menu.png)

## Badge

![Badge stats](../images/components/Badge.png)

## Dialog

![Dialog stats](../images/components/Dialog.png)

## Carousel

![Carousel stats](../images/components/Carousel.png)

## List

![List stats](../images/components/List.png)

## Toolbar

![Toolbar stats](../images/components/Toolbar.png)

## Popup

![Popup stats](../images/components/Popup.png)

## Nav

![Nav stats](../images/components/Nav.png)

## Table

![Table stats](../images/components/Table.png)

## Button

![Button stats](../images/components/Button.png)

## SplitButton

![SplitButton stats](../images/components/SplitButton.png)

## SearchBox

![SearchBox stats](../images/components/SearchBox.png)

## InfoLabel

![InfoLabel stats](../images/components/InfoLabel.png)

## Tooltip

![Tooltip stats](../images/components/Tooltip.png)

## Checkbox

![Checkbox stats](../images/components/Checkbox.png)

## ComboBox

![ComboBox stats](../images/components/ComboBox.png)

## Drawer

![Drawer stats](../images/components/Drawer.png)

## Switch

![Switch stats](../images/components/Switch.png)

## Calendar

![Calendar stats](../images/components/Calendar.png)

## Slider

![Slider stats](../images/components/Slider.png)

## ColorPicker

![ColorPicker stats](../images/components/ColorPicker.png)

## Virtualizer

![Virtualizer stats](../images/components/Virtualizer.png)

## Coachmark

![Coachmark stats](../images/components/Coachmark.png)

## Popover

![Popover stats](../images/components/Popover.png)

## TeachingPopover

![TeachingPopover stats](../images/components/TeachingPopover.png)

## Skeleton

![Skeleton stats](../images/components/Skeleton.png)

## Dropdown

![Dropdown stats](../images/components/Dropdown.png)

## Tabs

![Tabs stats](../images/components/Tabs.png)

## MessageBar

![MessageBar stats](../images/components/MessageBar.png)

## Card

![Card stats](../images/components/Card.png)

## Pickers

![Pickers stats](../images/components/Pickers.png)

## DataGrid

![DataGrid stats](../images/components/DataGrid.png)

## Tree

![Tree stats](../images/components/Tree.png)

## MenuItem

![MenuItem stats](../images/components/MenuItem.png)

## Input

![Input stats](../images/components/Input.png)

## TagPicker

![TagPicker stats](../images/components/TagPicker.png)

## Portal

![Portal stats](../images/components/Portal.png)

## FocusTrapZone

![FocusTrapZone stats](../images/components/FocusTrapZone.png)

## Keytip

![Keytip stats](../images/components/Keytip.png)

## Toast

![Toast stats](../images/components/Toast.png)
668 changes: 668 additions & 0 deletions fluent-issues-monthly.ipynb

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions fluent-issues.ipynb

Large diffs are not rendered by default.

Binary file added images/components/Accordion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/ActivityItem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Carousel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Checkbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Coachmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/ColorPicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/ComboBox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/DataGrid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/DatePickerCompat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/DocumentCard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Drawer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Dropdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/FocusTrapZone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/FocusZone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/HoverCard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/InfoLabel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/Keytip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/components/List.png
Binary file added images/components/MarqueeSelection.png
Binary file added images/components/Menu.png
Binary file added images/components/MenuItem.png
Binary file added images/components/MessageBar.png
Binary file added images/components/Nav.png
Binary file added images/components/PeoplePicker.png
Binary file added images/components/Persona.png
Binary file added images/components/Pickers.png
Binary file added images/components/Popover.png
Binary file added images/components/Popup.png
Binary file added images/components/Portal.png
Binary file added images/components/Radio.png
Binary file added images/components/RadioGroup.png
Binary file added images/components/SearchBox.png
Binary file added images/components/Skeleton.png
Binary file added images/components/Slider.png
Binary file added images/components/Spinner.png
Binary file added images/components/SplitButton.png
Binary file added images/components/SwatchColorPicker.png
Binary file added images/components/Switch.png
Binary file added images/components/Table.png
Binary file added images/components/Tabs.png
Binary file added images/components/TagPicker.png
Binary file added images/components/TeachingPopover.png
Binary file added images/components/Textarea.png
Binary file added images/components/TimePickerCompat.png
Binary file added images/components/Toast.png
Binary file added images/components/Toolbar.png
Binary file added images/components/Tooltip.png
Binary file added images/components/Tree.png
Binary file added images/components/Virtualizer.png
Binary file modified images/stats-01.png
Binary file modified images/stats-02.png
Binary file modified images/stats-03.png
Binary file modified images/stats-06.png

0 comments on commit d473e39

Please sign in to comment.