make nodes.json a variable, not a constant

This commit is contained in:
Nils Schneider 2012-06-21 01:19:34 +02:00
parent f2bced1fba
commit a4086da509
4 changed files with 7 additions and 2 deletions

View file

@ -292,7 +292,7 @@ var data
var visible = {clients: true, vpn: true}
function reload() {
d3.json("nodes.json", function(json) {
d3.json(nodes_json, function(json) {
// update existing nodes with new info
// XXX inefficient data structure
json.nodes.forEach(function(d, i) {

View file

@ -23,6 +23,8 @@
<script type="text/javascript" src="geomap.js"></script>
<script type="text/javascript">
var nodes_json = "nodes.json"
window.onresize = resize
function getOffset( el ) {

View file

@ -85,7 +85,7 @@ function kmlLoaded()
}
function load_json(layer, map) {
d3.json("nodes.json", function(json) {
d3.json(nodes_json, function(json) {
// replace indices with real objects
json.links.forEach( function(d) {
if (typeof d.source == "number") d.source = json.nodes[d.source]

View file

@ -12,6 +12,9 @@
<script type="text/javascript" src="pacman.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
<script>
var nodes_json = "nodes.json"
</script>
</head>
<body>
<header>