diff --git a/.gitignore b/.gitignore index 3e4aca03..7b9579f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ __pycache__ -public +public/*.svg github_schema.json github_schema.py diff --git a/public/zcash-dag.css b/public/zcash-dag.css new file mode 100644 index 00000000..9307af37 --- /dev/null +++ b/public/zcash-dag.css @@ -0,0 +1,30 @@ +@media (prefers-color-scheme: dark) { + svg .graph > polygon { + fill: #0d1117; + } + svg .node polygon { + stroke: #c9d1d9; + } + svg .node.open polygon { + fill: #057715; + } + svg .node.committed polygon { + fill: #1862b9; + } + svg .node.closed polygon { + fill: #b93b1e; + } + svg .node polyline { + stroke: #c9d1d9; + } + svg .edge path { + stroke: #c9d1d9; + } + svg .edge polygon { + fill: #c9d1d9; + stroke: #c9d1d9; + } + svg text { + fill: #c9d1d9; + } +} diff --git a/zcash-issue-dag.py b/zcash-issue-dag.py index e27cbd3e..88ec9db6 100755 --- a/zcash-issue-dag.py +++ b/zcash-issue-dag.py @@ -234,10 +234,13 @@ def main(): if n.title: attrs['label'] = '\n'.join(['%s' % n] + wrap(n.title, 25)) if n.state == 'closed': + attrs['class'] = 'closed' attrs['fillcolor'] = '#fad8c7' elif n.is_committed: + attrs['class'] = 'committed' attrs['fillcolor'] = '#a6cfff' else: + attrs['class'] = 'open' attrs['fillcolor'] = '#c2e0c6' attrs['penwidth'] = 2 if n in do_next else 1 attrs['shape'] = 'component' if n.is_pr else 'box' @@ -259,6 +262,7 @@ def main(): # Draw the result! ag.graph_attr['rankdir'] = 'LR' + ag.graph_attr['stylesheet'] = 'zcash-dag.css' ag.layout(prog='dot') os.makedirs('public', exist_ok=True) ag.draw('public/zcash-%s-dag.svg' % DAG_VIEW)