|
175 | 175 | " **plotly_main_layout_base_settings\n", |
176 | 176 | ")\n", |
177 | 177 | "plotly_treemap_figure_show_settings = dict(\n", |
178 | | - " renderer=\"svg\" if is_command_line_execution() else None,\n", |
179 | | - " width=680 if is_command_line_execution() else 1080,\n", |
180 | | - " height=680 if is_command_line_execution() else 1080,\n", |
181 | | - " config={'scrollZoom': False, 'displaylogo': False, 'displayModeBar': False} if is_command_line_execution() else {}\n", |
| 178 | + " renderer=None,\n", |
| 179 | + " width=1080,\n", |
| 180 | + " height=1080,\n", |
| 181 | + " config={}\n", |
182 | 182 | ")\n", |
183 | 183 | "\n", |
184 | 184 | "plotly_treemap_marker_base_style = dict(\n", |
|
191 | 191 | ")" |
192 | 192 | ] |
193 | 193 | }, |
194 | | - { |
195 | | - "cell_type": "code", |
196 | | - "execution_count": null, |
197 | | - "id": "03ee42af", |
198 | | - "metadata": {}, |
199 | | - "outputs": [], |
200 | | - "source": [ |
201 | | - "def get_plotly_figure_write_image_settings(name: str):\n", |
202 | | - " \"\"\"\n", |
203 | | - " Returns the settings for the plotly figure write_image method\n", |
204 | | - " :param name: Name of the figure\n", |
205 | | - " :return: Dictionary with settings for the write_image method\n", |
206 | | - " \"\"\"\n", |
207 | | - " return dict(\n", |
208 | | - " file=get_offline_path() + \"/\" + name + \".svg\", \n", |
209 | | - " format=\"svg\", \n", |
210 | | - " width=1080, \n", |
211 | | - " height=1080\n", |
212 | | - " )" |
213 | | - ] |
214 | | - }, |
215 | 194 | { |
216 | 195 | "cell_type": "code", |
217 | 196 | "execution_count": null, |
|
601 | 580 | "git_files_with_commit_statistics = add_directory_name_column(git_files_with_commit_statistics, 'directoryPath', 'directoryName')\n", |
602 | 581 | "git_files_with_commit_statistics = add_parent_directory_column(git_files_with_commit_statistics, 'directoryPath', 'directoryParentPath')\n", |
603 | 582 | "\n", |
| 583 | + "# Convert date columns to strings for JSON serialization in Plotly\n", |
| 584 | + "git_files_with_commit_statistics['lastCommitDate'] = git_files_with_commit_statistics['lastCommitDate'].astype(str)\n", |
| 585 | + "git_files_with_commit_statistics['lastCreationDate'] = git_files_with_commit_statistics['lastCreationDate'].astype(str)\n", |
| 586 | + "git_files_with_commit_statistics['lastModificationDate'] = git_files_with_commit_statistics['lastModificationDate'].astype(str)\n", |
| 587 | + "\n", |
604 | 588 | "# Debug\n", |
605 | 589 | "# display(\"5. added parent and name columns ------------\")\n", |
606 | 590 | "# display(git_files_with_commit_statistics)\n", |
|
683 | 667 | " **plotly_treemap_layout_base_settings,\n", |
684 | 668 | " title='Directories and their file count'\n", |
685 | 669 | ")\n", |
686 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
687 | | - "if is_command_line_execution():\n", |
688 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"NumberOfFilesPerDirectory\"))" |
| 670 | + "figure.show(**plotly_treemap_figure_show_settings)" |
689 | 671 | ] |
690 | 672 | }, |
691 | 673 | { |
|
721 | 703 | " **plotly_treemap_layout_base_settings,\n", |
722 | 704 | " title='Most frequent file extension per directory'\n", |
723 | 705 | ")\n", |
724 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
725 | | - "if is_command_line_execution():\n", |
726 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"MostFrequentFileExtensionPerDirectory\"))" |
| 706 | + "figure.show(**plotly_treemap_figure_show_settings)" |
727 | 707 | ] |
728 | 708 | }, |
729 | 709 | { |
|
757 | 737 | " **plotly_treemap_layout_base_settings,\n", |
758 | 738 | " title='Number of git commits',\n", |
759 | 739 | ")\n", |
760 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
761 | | - "if is_command_line_execution():\n", |
762 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"NumberOfGitCommits\"))" |
| 740 | + "figure.show(**plotly_treemap_figure_show_settings)" |
763 | 741 | ] |
764 | 742 | }, |
765 | 743 | { |
|
793 | 771 | " **plotly_treemap_layout_base_settings,\n", |
794 | 772 | " title='Number of distinct commit authors',\n", |
795 | 773 | ")\n", |
796 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
797 | | - "if is_command_line_execution():\n", |
798 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"NumberOfDistinctCommitAuthors\"))" |
| 774 | + "figure.show(**plotly_treemap_figure_show_settings)" |
799 | 775 | ] |
800 | 776 | }, |
801 | 777 | { |
|
837 | 813 | " title='Number of distinct commit authors (red/black = only one or very few authors)',\n", |
838 | 814 | ")\n", |
839 | 815 | "\n", |
840 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
841 | | - "if is_command_line_execution():\n", |
842 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"NumberOfDistinctCommitAuthorsLowFocus\"))" |
| 816 | + "figure.show(**plotly_treemap_figure_show_settings)" |
843 | 817 | ] |
844 | 818 | }, |
845 | 819 | { |
|
875 | 849 | " **plotly_treemap_layout_base_settings,\n", |
876 | 850 | " title='Main authors with highest number of commits'\n", |
877 | 851 | ")\n", |
878 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
879 | | - "if is_command_line_execution():\n", |
880 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"MainAuthorsWithHighestNumberOfCommits\"))" |
| 852 | + "figure.show(**plotly_treemap_figure_show_settings)" |
881 | 853 | ] |
882 | 854 | }, |
883 | 855 | { |
|
914 | 886 | " **plotly_treemap_layout_base_settings,\n", |
915 | 887 | " title='Second author with the second highest number of commits'\n", |
916 | 888 | ")\n", |
917 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
918 | | - "if is_command_line_execution():\n", |
919 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"SecondAuthorWithTheSecondHighestNumberOfCommits\"))" |
| 889 | + "figure.show(**plotly_treemap_figure_show_settings)" |
920 | 890 | ] |
921 | 891 | }, |
922 | 892 | { |
|
951 | 921 | " **plotly_treemap_layout_base_settings,\n", |
952 | 922 | " title='Days since last commit',\n", |
953 | 923 | ")\n", |
954 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
955 | | - "if is_command_line_execution():\n", |
956 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"DaysSinceLastCommit\"))" |
| 924 | + "figure.show(**plotly_treemap_figure_show_settings)" |
957 | 925 | ] |
958 | 926 | }, |
959 | 927 | { |
|
988 | 956 | " **plotly_treemap_layout_base_settings,\n", |
989 | 957 | " title='Rank of days since last commit',\n", |
990 | 958 | ")\n", |
991 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
992 | | - "if is_command_line_execution():\n", |
993 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"DaysSinceLastCommitRanked\"))" |
| 959 | + "figure.show(**plotly_treemap_figure_show_settings)" |
994 | 960 | ] |
995 | 961 | }, |
996 | 962 | { |
|
1024 | 990 | " **plotly_treemap_layout_base_settings,\n", |
1025 | 991 | " title='Days since last file creation',\n", |
1026 | 992 | ")\n", |
1027 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
1028 | | - "if is_command_line_execution():\n", |
1029 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"DaysSinceLastFileCreation\"))" |
| 993 | + "figure.show(**plotly_treemap_figure_show_settings)" |
1030 | 994 | ] |
1031 | 995 | }, |
1032 | 996 | { |
|
1060 | 1024 | " **plotly_treemap_layout_base_settings,\n", |
1061 | 1025 | " title='Rank of days since last file creation',\n", |
1062 | 1026 | ")\n", |
1063 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
1064 | | - "if is_command_line_execution():\n", |
1065 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"DaysSinceLastFileCreationRanked\"))" |
| 1027 | + "figure.show(**plotly_treemap_figure_show_settings)" |
1066 | 1028 | ] |
1067 | 1029 | }, |
1068 | 1030 | { |
|
1096 | 1058 | " **plotly_treemap_layout_base_settings,\n", |
1097 | 1059 | " title='Days since last file modification',\n", |
1098 | 1060 | ")\n", |
1099 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
1100 | | - "if is_command_line_execution():\n", |
1101 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"DaysSinceLastFileModification\"))" |
| 1061 | + "figure.show(**plotly_treemap_figure_show_settings)" |
1102 | 1062 | ] |
1103 | 1063 | }, |
1104 | 1064 | { |
|
1132 | 1092 | " **plotly_treemap_layout_base_settings,\n", |
1133 | 1093 | " title='Rank of days since last file modification',\n", |
1134 | 1094 | ")\n", |
1135 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
1136 | | - "if is_command_line_execution():\n", |
1137 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"DaysSinceLastFileModificationRanked\"))" |
| 1095 | + "figure.show(**plotly_treemap_figure_show_settings)" |
1138 | 1096 | ] |
1139 | 1097 | }, |
1140 | 1098 | { |
|
1200 | 1158 | " xaxis_title='file count',\n", |
1201 | 1159 | " yaxis_title='commit count'\n", |
1202 | 1160 | " )\n", |
1203 | | - " figure.show(**plotly_treemap_figure_show_settings)\n", |
1204 | | - " if is_command_line_execution():\n", |
1205 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"ChangedFilesPerCommit\"))" |
| 1161 | + " figure.show(**plotly_treemap_figure_show_settings)" |
1206 | 1162 | ] |
1207 | 1163 | }, |
1208 | 1164 | { |
|
1312 | 1268 | " **plotly_treemap_layout_base_settings,\n", |
1313 | 1269 | " title='Files that likely co-change with others in update commits',\n", |
1314 | 1270 | ")\n", |
1315 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
1316 | | - "if is_command_line_execution():\n", |
1317 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"CoChangingFiles\"))" |
| 1271 | + "figure.show(**plotly_treemap_figure_show_settings)" |
1318 | 1272 | ] |
1319 | 1273 | }, |
1320 | 1274 | { |
|
1340 | 1294 | " **plotly_treemap_layout_base_settings,\n", |
1341 | 1295 | " title='Co-Changing files in update commits max lift (1=random, >1=more than random, <1=less than random)',\n", |
1342 | 1296 | ")\n", |
1343 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
1344 | | - "if is_command_line_execution():\n", |
1345 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"CoChangingFilesMaxLift\"))" |
| 1297 | + "figure.show(**plotly_treemap_figure_show_settings)" |
1346 | 1298 | ] |
1347 | 1299 | }, |
1348 | 1300 | { |
|
1368 | 1320 | " **plotly_treemap_layout_base_settings,\n", |
1369 | 1321 | " title='Co-Changing files in update commits average lift (1=random, >1=more than random, <1=less than random)',\n", |
1370 | 1322 | ")\n", |
1371 | | - "figure.show(**plotly_treemap_figure_show_settings)\n", |
1372 | | - "if is_command_line_execution():\n", |
1373 | | - " figure.write_image(**get_plotly_figure_write_image_settings(\"CoChangingFilesAverageLift\"))" |
| 1323 | + "figure.show(**plotly_treemap_figure_show_settings)" |
1374 | 1324 | ] |
1375 | 1325 | }, |
1376 | 1326 | { |
|
1577 | 1527 | " showlegend=False\n", |
1578 | 1528 | " )\n", |
1579 | 1529 | "\n", |
1580 | | - " figure.show(**plotly_treemap_figure_show_settings)\n", |
1581 | | - " if is_command_line_execution():\n", |
1582 | | - " figure.write_image(**get_plotly_figure_write_image_settings(output_file_name))" |
| 1530 | + " figure.show(**plotly_treemap_figure_show_settings)" |
1583 | 1531 | ] |
1584 | 1532 | }, |
1585 | 1533 | { |
|
1935 | 1883 | } |
1936 | 1884 | ], |
1937 | 1885 | "kernelspec": { |
1938 | | - "display_name": "codegraph", |
| 1886 | + "display_name": "code-graph-analysis-pipeline (3.12.8)", |
1939 | 1887 | "language": "python", |
1940 | 1888 | "name": "python3" |
1941 | 1889 | }, |
|
1949 | 1897 | "name": "python", |
1950 | 1898 | "nbconvert_exporter": "python", |
1951 | 1899 | "pygments_lexer": "ipython3", |
1952 | | - "version": "3.12.9" |
| 1900 | + "version": "3.12.8" |
1953 | 1901 | }, |
1954 | 1902 | "title": "Git History General Exploration" |
1955 | 1903 | }, |
|
0 commit comments