Material-er theme on dark graph render.

This commit is contained in:
Sergio Martínez Portela 2023-06-26 23:56:44 +02:00
parent f81673d76a
commit 18f33b29e2
2 changed files with 56 additions and 5 deletions

View file

@ -99,10 +99,10 @@ def gen(headline_id, graph, doc_to_headline_remapping):
# f.write('splines=spline\n') # Not supported with edges to cluster
f.write('node[shape=rect]\n')
def draw_subgraph(node_id):
def draw_subgraph(node_id, depth):
f.write("subgraph cluster_{} {{\n".format(node_id.replace("-", "_")))
f.write(' URL="./{}.node.html"\n'.format(node_id))
f.write(' class="{}"\n'.format('cluster-depth-' + str(depth - 1)))
f.write(" label=\"{}\"\n".format(g[node_id]['title'].replace("\"", "'")))
f.write("\n")
@ -111,14 +111,18 @@ def gen(headline_id, graph, doc_to_headline_remapping):
v = g[k]
if k in in_emacs_tree:
draw_subgraph(k)
draw_subgraph(k, depth=depth + 1)
else:
print(" _" + k.replace("-", "_") + "[label=\"" + v["title"].replace("\"", "'") + "\", URL=\"" + k + ".node.html\"];", file=f)
print(" _" + k.replace("-", "_")
+ "[label=\"" + v["title"].replace("\"", "'") + "\", "
+ "URL=\"" + k + ".node.html\", "
+ "class=\"cluster-depth-" + str(depth) + "\""
+ "];", file=f)
f.write("\n}\n")
draw_subgraph(reference_node)
draw_subgraph(reference_node, 1)
for k, v in g.items():
if k not in in_emacs: