-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cobol relationships data grid
- Loading branch information
Showing
3 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
98 changes: 98 additions & 0 deletions
98
moderne_visualizations_misc/cobol_relationships_data_grid.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
14 changes: 14 additions & 0 deletions
14
moderne_visualizations_misc/specs/cobol_relationships_data_grid.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters