move to window obj

This commit is contained in:
Garry Ing 2021-03-15 20:06:04 -04:00
parent f0e50e2541
commit 44be8dd327
No known key found for this signature in database
GPG Key ID: 3B379B1F2193CC3E
2 changed files with 4 additions and 6 deletions

View File

@ -4,6 +4,6 @@
<div id="zoom" class="absolute code f7 bottom-1 right-1"></div>
<div id="graph-wrapper" class="code f6">
<script>
const graphData = {% include notes_graph.json %}
window.graphData = {% include notes_graph.json %}
</script>
</div>

View File

@ -82,7 +82,7 @@ document.querySelectorAll('#notes-entry-container a').forEach(setupListeners)
const d3 = window.d3
if (typeof graphData !== 'undefined') {
if (typeof window.graphData !== 'undefined') {
const MINIMAL_NODE_SIZE = 10
const MAX_NODE_SIZE = 12
const ACTIVE_RADIUS_FACTOR = 1.5
@ -92,10 +92,8 @@ if (typeof graphData !== 'undefined') {
const FONT_BASELINE = 40
const MAX_LABEL_LENGTH = 50
/* global graphData */
const nodesData = graphData.nodes
const linksData = graphData.edges
const nodesData = window.graphData.nodes
const linksData = window.graphData.edges
const nodeSize = {}