better clustering

This commit is contained in:
Primrose 2025-06-23 17:23:04 +02:00
parent f2cdc96007
commit 6dba1aaca8
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
3 changed files with 128 additions and 38 deletions

41
toDot.py Executable file
View file

@ -0,0 +1,41 @@
#!/usr/bin/env python3
import json
def group_by_prefix(x, y):
# sections = []
# with open("asList.json", "r") as generatedFile:
# data = json.load(generatedFile)
#
# # list of all groups of entries that are in the same file
#
# by_file = {}
# for entry in data:
# by_file[entry["declaredAt"][0]] = entry
#
# for file, entry in by_file.items():
# def as_cluster(content):
# return f"""
# subgraph \"{file}\" {{
# {content}
# }}
# """
#
# buffer = []
# for arc in entry["definedBy"]:
# for defsite in entry["declaredAt"]:
# if arc != defsite:
#
# buffer += [
# f"\"{arc}\" -> \"{".".join(entry["optionPath"])}\";"
# ]
#
# if len(buffer) > 0:
# sections += [ as_cluster("\n".join(buffer)) ]
#
# content = "\n".join(sections)
# print("digraph {\n compound=true;\n" + content + "\n}")