Skip to content

Commit

Permalink
feat: add cobol relationships data grid
Browse files Browse the repository at this point in the history
  • Loading branch information
zieka committed Aug 17, 2023
1 parent 04d4932 commit 7f4d2e8
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 1 deletion.
98 changes: 98 additions & 0 deletions moderne_visualizations_misc/cobol_relationships_data_grid.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "fe0ea925",
"metadata": {
"collapsed": false,
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"filter_resources_related_to: str = \"\"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1934da7b",
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import re\n",
"from code_data_science import data_table as dt, data_grid as moderne_data_grid\n",
"import code_data_science.palette as palette\n",
"\n",
"df = dt.read_csv(\"../samples/cobol_relationships.csv\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "def9e15f-7027-4ca6-88c0-84e67ca9417b",
"metadata": {
"ExecuteTime": {
"end_time": "2023-08-04T16:02:27.603653Z",
"start_time": "2023-08-04T16:02:26.607939Z"
}
},
"outputs": [],
"source": [
"# clean dependent field remove all content up to first slash\n",
"df[\"dependent\"] = df[\"dependent\"].apply(lambda x: re.sub(r\"^.*\\/\", \"\", x))\n",
"\n",
"if filter_resources_related_to:\n",
" df = df[\n",
" (df[\"dependent\"].str.contains(filter_resources_related_to))\n",
" | (df[\"dependency\"].str.contains(filter_resources_related_to))\n",
" ]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c43a13da",
"metadata": {},
"outputs": [],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "68dc890c",
"metadata": {},
"outputs": [],
"source": [
"moderne_data_grid.display(df)"
]
}
],
"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.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
type: specs.moderne.io/v1beta/visualization
name: io.moderne.FindCobolRelationshipsDataGrid
displayName: COBOL relationships data grid
description: >
This data grid contains relational information about COBOL resources.
recipe: org.openrewrite.cobol.search.FindRelationships
dataTable: org.openrewrite.cobol.table.CobolRelationships
options:
- filter_resources_related_to:
displayName: Show only resources related to
description: >
Enter the name of a resource to filter the diagram to only show dependents and dependencies containing that resource.
required: false
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @see https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
[project]
name = "moderne_visualizations_misc"
version = "0.1.32"
version = "0.1.33"
description = "Miscellaneous visualizations for the Moderne platform"
authors = [
{ name = "Jonathan Schneider", email = "jonathan@moderne.io" },
Expand Down

0 comments on commit 7f4d2e8

Please sign in to comment.