mirror of https://github.com/zcash/developers.git
Render HTML version of DAG with pan-and-zoom
This commit is contained in:
parent
84d5b99258
commit
33aafd211f
|
@ -1,4 +1,5 @@
|
||||||
__pycache__
|
__pycache__
|
||||||
|
public/*.html
|
||||||
public/*.svg
|
public/*.svg
|
||||||
|
|
||||||
github_schema.json
|
github_schema.json
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
<h1>Zcash Developers Hub</h1>
|
<h1>Zcash Developers Hub</h1>
|
||||||
<p>Eventually this will be a common resource for development teams working on Zcash.</p>
|
<p>Eventually this will be a common resource for development teams working on Zcash.</p>
|
||||||
<p>Currently this is just hosting DAGs showing dependencies between issues and PRs, for several Zcash teams.</p>
|
<p>Currently this is just hosting DAGs showing dependencies between issues and PRs, for several Zcash teams.</p>
|
||||||
<p><a href="zcash-core-dag.svg">ECC core team DAG</a></p>
|
<p><a href="/zcash-core-dag">ECC core team DAG</a></p>
|
||||||
<p><a href="zcash-wallet-dag.svg">ECC wallet team DAG</a></p>
|
<p><a href="/zcash-wallet-dag">ECC wallet team DAG</a></p>
|
||||||
<p><a href="zcash-zf-dag.svg">ZF DAG</a></p>
|
<p><a href="/zcash-zf-dag">ZF DAG</a></p>
|
||||||
<p><a href="zcash-halo2-dag.svg">Halo2-focused DAG</a></p>
|
<p><a href="/zcash-halo2-dag">Halo2-focused DAG</a></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -276,6 +276,42 @@ def main():
|
||||||
os.makedirs('public', exist_ok=True)
|
os.makedirs('public', exist_ok=True)
|
||||||
ag.draw('public/zcash-%s-dag.svg' % DAG_VIEW)
|
ag.draw('public/zcash-%s-dag.svg' % DAG_VIEW)
|
||||||
|
|
||||||
|
# Render the HTML version!
|
||||||
|
with open('public/zcash-%s-dag.svg' % DAG_VIEW) as f:
|
||||||
|
svg_data = f.read()
|
||||||
|
svg_start = svg_data.find('<svg')
|
||||||
|
html_data = '''<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Zcash %s DAG</title>
|
||||||
|
|
||||||
|
<!-- Pan/zoom SVGs -->
|
||||||
|
<script src="https://bumbu.me/svg-pan-zoom/dist/svg-pan-zoom.min.js"></script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="zcash-dag.css">
|
||||||
|
<style>
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
body {
|
||||||
|
/* Material dark theme surface colour */
|
||||||
|
background-color: #121212;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="dag">%s</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
svgPanZoom('#dag > svg', {
|
||||||
|
zoomScaleSensitivity: 0.4
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
''' % (DAG_VIEW, svg_data[svg_start:])
|
||||||
|
with open('public/zcash-%s-dag.html' % DAG_VIEW, 'w') as f:
|
||||||
|
f.write(html_data)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if GITHUB_TOKEN and ZENHUB_TOKEN:
|
if GITHUB_TOKEN and ZENHUB_TOKEN:
|
||||||
|
|
Loading…
Reference in New Issue