|
197 | 197 | "source": [
|
198 | 198 | "# Base settings for Plotly Treemap\n",
|
199 | 199 | "\n",
|
200 |
| - "plotly_treemap_layout_base_settings = dict(\n", |
| 200 | + "plotly_main_layout_base_settings = dict(\n", |
201 | 201 | " margin=dict(t=50, l=15, r=15, b=15),\n",
|
202 | 202 | ")\n",
|
| 203 | + "plotly_treemap_layout_base_settings = dict(\n", |
| 204 | + " **plotly_main_layout_base_settings\n", |
| 205 | + ")\n", |
| 206 | + "plotly_bar_layout_base_settings = dict(\n", |
| 207 | + " **plotly_main_layout_base_settings\n", |
| 208 | + ")\n", |
203 | 209 | "plotly_treemap_figure_show_settings = dict(\n",
|
204 | 210 | " renderer=\"svg\" if is_command_line_execution() else None,\n",
|
205 | 211 | " width=1000,\n",
|
|
512 | 518 | "id": "dc0c2d06",
|
513 | 519 | "metadata": {},
|
514 | 520 | "outputs": [],
|
| 521 | + "source": [ |
| 522 | + "git_files_with_commit_statistics.describe()" |
| 523 | + ] |
| 524 | + }, |
| 525 | + { |
| 526 | + "cell_type": "code", |
| 527 | + "execution_count": null, |
| 528 | + "id": "053b448d", |
| 529 | + "metadata": {}, |
| 530 | + "outputs": [], |
515 | 531 | "source": [
|
516 | 532 | "git_files_with_commit_statistics.head(30)"
|
517 | 533 | ]
|
|
913 | 929 | "figure.show(**plotly_treemap_figure_show_settings)"
|
914 | 930 | ]
|
915 | 931 | },
|
| 932 | + { |
| 933 | + "cell_type": "markdown", |
| 934 | + "id": "d8c6ccee", |
| 935 | + "metadata": {}, |
| 936 | + "source": [ |
| 937 | + "## Filecount per commit\n", |
| 938 | + "\n", |
| 939 | + "Shows how many commits had changed one file, how many had changed two files, and so on.\n", |
| 940 | + "The chart is limited to 30 lines for improved readability.\n", |
| 941 | + "The data preview also includes overall statistics including the number of commits that are filtered out in the chart." |
| 942 | + ] |
| 943 | + }, |
| 944 | + { |
| 945 | + "cell_type": "markdown", |
| 946 | + "id": "ed53b6e5", |
| 947 | + "metadata": {}, |
| 948 | + "source": [ |
| 949 | + "### Preview data" |
| 950 | + ] |
| 951 | + }, |
| 952 | + { |
| 953 | + "cell_type": "code", |
| 954 | + "execution_count": null, |
| 955 | + "id": "5526e458", |
| 956 | + "metadata": {}, |
| 957 | + "outputs": [], |
| 958 | + "source": [ |
| 959 | + "git_file_count_per_commit = query_cypher_to_data_frame(\"../cypher/GitLog/List_git_files_per_commit_distribution.cypher\")\n", |
| 960 | + "\n", |
| 961 | + "print(\"Sum of commits that changed more than 30 files (each) = \" + str(git_file_count_per_commit[git_file_count_per_commit['filesPerCommit'] > 30]['commitCount'].sum()))\n", |
| 962 | + "print(\"Max changed files with one commit = \" + str(git_file_count_per_commit['filesPerCommit'].max()))\n", |
| 963 | + "display(git_file_count_per_commit.describe())\n", |
| 964 | + "display(git_file_count_per_commit.head(30))" |
| 965 | + ] |
| 966 | + }, |
| 967 | + { |
| 968 | + "cell_type": "markdown", |
| 969 | + "id": "dcea826e", |
| 970 | + "metadata": {}, |
| 971 | + "source": [ |
| 972 | + "### Bar chart with the number of files per commit distribution" |
| 973 | + ] |
| 974 | + }, |
| 975 | + { |
| 976 | + "cell_type": "code", |
| 977 | + "execution_count": null, |
| 978 | + "id": "9e9dbc57", |
| 979 | + "metadata": {}, |
| 980 | + "outputs": [], |
| 981 | + "source": [ |
| 982 | + "if git_file_count_per_commit.empty:\n", |
| 983 | + " print(\"No data to plot\")\n", |
| 984 | + "else:\n", |
| 985 | + " figure = plotly_graph_objects.Figure(plotly_graph_objects.Bar(\n", |
| 986 | + " x=git_file_count_per_commit['filesPerCommit'].head(30), \n", |
| 987 | + " y=git_file_count_per_commit['commitCount'].head(30)),\n", |
| 988 | + " )\n", |
| 989 | + " figure.update_layout(\n", |
| 990 | + " **plotly_bar_layout_base_settings,\n", |
| 991 | + " title='Changed files per commit',\n", |
| 992 | + " xaxis_title='file count',\n", |
| 993 | + " yaxis_title='commit count'\n", |
| 994 | + " )\n", |
| 995 | + " figure.show(**plotly_treemap_figure_show_settings)" |
| 996 | + ] |
| 997 | + }, |
916 | 998 | {
|
917 | 999 | "cell_type": "markdown",
|
918 | 1000 | "id": "14e87aff",
|
|
930 | 1012 | "source": [
|
931 | 1013 | "# Query data from graph database\n",
|
932 | 1014 | "git_author_words_with_frequency = query_cypher_to_data_frame(\"../cypher/Overview/Words_for_git_author_Wordcloud_with_frequency.cypher\")\n",
|
933 |
| - "# Debug \n", |
934 |
| - "# display(git_author_words_with_frequency.head(10))" |
| 1015 | + "\n", |
| 1016 | + "git_author_words_with_frequency.sort_values(by='frequency', ascending=False).reset_index(drop=True).head(10)" |
935 | 1017 | ]
|
936 | 1018 | },
|
937 | 1019 | {
|
|
0 commit comments