Skip to content

Commit

Permalink
Visualize Java versions in use as well (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored Aug 14, 2024
1 parent 764fb6f commit 4b2e11c
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"from code_data_science import data_table as dt\n",
"\n",
"df = dt.read_csv(\"../samples/java_versions.csv\")\n",
"df = dt.read_csv(\"../samples/java_versions_by_sourceset.csv\")\n",
"df.head()"
]
},
Expand Down
88 changes: 88 additions & 0 deletions moderne_visualizations_misc/java_versions_in_use.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "63746256-381d-43ab-a2f7-1acc9e891e8b",
"metadata": {},
"outputs": [],
"source": [
"from code_data_science import data_table as dt\n",
"\n",
"df = dt.read_csv(\"../samples/java_versions_in_use.csv\")\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "701147ab-62bd-490f-8a26-8ad1dd80f4d7",
"metadata": {},
"outputs": [],
"source": [
"data = df.drop(\n",
" columns=[\n",
" \"repositoryOrigin\",\n",
" \"repositoryPath\",\n",
" \"repositoryBranch\",\n",
" \"scmType\",\n",
" \"repositoryLink\",\n",
" \"targetVersion\",\n",
" ]\n",
")\n",
"data"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5e2e8d84-4b3e-4374-ab5d-9fd14f9a22fc",
"metadata": {},
"outputs": [],
"source": [
"versions = (\n",
" data.groupby([\"sourceVersion\"], as_index=True)\n",
" .value_counts()\n",
" .fillna(0)\n",
")\n",
"versions"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2cf3f3f6-2d72-4cdd-8243-50a37be78cfb",
"metadata": {},
"outputs": [],
"source": [
"import code_data_science.palette as palette\n",
"import matplotlib.pyplot as plt\n",
"\n",
"colors = palette.qualitative()[:3]\n",
"\n",
"ax = versions.plot.bar(colormap=plt.cm.colors.ListedColormap(colors))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.17"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
7 changes: 7 additions & 0 deletions moderne_visualizations_misc/specs/java_versions_in_use.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: specs.moderne.io/v1beta/visualization
name: io.moderne.JavaVersionsInUse
displayName: Java versions in use
description: This report shows the distribution of Java versions in use.
recipe: org.openrewrite.java.migrate.search.FindJavaVersion
dataTable: org.openrewrite.java.migrate.table.JavaVersionTable
File renamed without changes.
38 changes: 38 additions & 0 deletions samples/java_versions_in_use.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
repositoryOrigin,repositoryPath,repositoryBranch,scmType,repositoryLink,sourceVersion,targetVersion
github.com,"openrewrite/rewrite-cucumber-jvm",main,GITHUB,"https://github.com/openrewrite/rewrite-cucumber-jvm/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-cucumber-jvm",main,GITHUB,"https://github.com/openrewrite/rewrite-cucumber-jvm/blob/main",17,17
github.com,"openrewrite/rewrite-kubernetes",main,GITHUB,"https://github.com/openrewrite/rewrite-kubernetes/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-third-party",main,GITHUB,"https://github.com/openrewrite/rewrite-third-party/blob/main",17,17
github.com,"openrewrite/rewrite-concourse",main,GITHUB,"https://github.com/openrewrite/rewrite-concourse/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-concourse",main,GITHUB,"https://github.com/openrewrite/rewrite-concourse/blob/main",17,17
github.com,"openrewrite/rewrite-liberty",main,GITHUB,"https://github.com/openrewrite/rewrite-liberty/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-liberty",main,GITHUB,"https://github.com/openrewrite/rewrite-liberty/blob/main",17,17
github.com,"openrewrite/rewrite-polyglot",main,GITHUB,"https://github.com/openrewrite/rewrite-polyglot/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-polyglot",main,GITHUB,"https://github.com/openrewrite/rewrite-polyglot/blob/main",17,17
github.com,"openrewrite/rewrite-templating",main,GITHUB,"https://github.com/openrewrite/rewrite-templating/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-kotlin",main,GITHUB,"https://github.com/openrewrite/rewrite-kotlin/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-kotlin",main,GITHUB,"https://github.com/openrewrite/rewrite-kotlin/blob/main",17,17
github.com,"openrewrite/rewrite-maven-plugin",main,GITHUB,"https://github.com/openrewrite/rewrite-maven-plugin/blob/main",8,8
github.com,"openrewrite/rewrite-maven-plugin",main,GITHUB,"https://github.com/openrewrite/rewrite-maven-plugin/blob/main",17,17
github.com,"openrewrite/rewrite-generative-ai",main,GITHUB,"https://github.com/openrewrite/rewrite-generative-ai/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-generative-ai",main,GITHUB,"https://github.com/openrewrite/rewrite-generative-ai/blob/main",17,17
github.com,openrewrite/rewrite-sql,main,GITHUB,"https://github.com/openrewrite/rewrite-sql/blob/main",1.8,1.8
github.com,openrewrite/rewrite-sql,main,GITHUB,"https://github.com/openrewrite/rewrite-sql/blob/main",17,17
github.com,"openrewrite/rewrite-micrometer",main,GITHUB,"https://github.com/openrewrite/rewrite-micrometer/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-micrometer",main,GITHUB,"https://github.com/openrewrite/rewrite-micrometer/blob/main",17,17
github.com,"openrewrite/rewrite-static-analysis",main,GITHUB,"https://github.com/openrewrite/rewrite-static-analysis/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-static-analysis",main,GITHUB,"https://github.com/openrewrite/rewrite-static-analysis/blob/main",17,17
github.com,"openrewrite/rewrite-javascript",main,GITHUB,"https://github.com/openrewrite/rewrite-javascript/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-javascript",main,GITHUB,"https://github.com/openrewrite/rewrite-javascript/blob/main",17,17
github.com,"openrewrite/rewrite-gradle-plugin",main,GITHUB,"https://github.com/openrewrite/rewrite-gradle-plugin/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-gradle-plugin",main,GITHUB,"https://github.com/openrewrite/rewrite-gradle-plugin/blob/main",17,17
github.com,"openrewrite/rewrite-gradle-tooling-model",main,GITHUB,"https://github.com/openrewrite/rewrite-gradle-tooling-model/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-gradle-tooling-model",main,GITHUB,"https://github.com/openrewrite/rewrite-gradle-tooling-model/blob/main",17,17
github.com,"openrewrite/rewrite-openapi",main,GITHUB,"https://github.com/openrewrite/rewrite-openapi/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-openapi",main,GITHUB,"https://github.com/openrewrite/rewrite-openapi/blob/main",17,17
github.com,openrewrite/rewrite,main,GITHUB,"https://github.com/openrewrite/rewrite/blob/main",21,21
github.com,openrewrite/rewrite,main,GITHUB,"https://github.com/openrewrite/rewrite/blob/main",11,11
github.com,"openrewrite/rewrite-okhttp",main,GITHUB,"https://github.com/openrewrite/rewrite-okhttp/blob/main",17,17
github.com,"openrewrite/rewrite-migrate-java",main,GITHUB,"https://github.com/openrewrite/rewrite-migrate-java/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-ai-search",main,GITHUB,"https://github.com/openrewrite/rewrite-ai-search/blob/main",1.8,1.8
github.com,"openrewrite/rewrite-ai-search",main,GITHUB,"https://github.com/openrewrite/rewrite-ai-search/blob/main",17,17

0 comments on commit 4b2e11c

Please sign in to comment.