make nodes.json a variable, not a constant
This commit is contained in:
parent
f2bced1fba
commit
a4086da509
|
@ -292,7 +292,7 @@ var data
|
||||||
var visible = {clients: true, vpn: true}
|
var visible = {clients: true, vpn: true}
|
||||||
|
|
||||||
function reload() {
|
function reload() {
|
||||||
d3.json("nodes.json", function(json) {
|
d3.json(nodes_json, function(json) {
|
||||||
// update existing nodes with new info
|
// update existing nodes with new info
|
||||||
// XXX inefficient data structure
|
// XXX inefficient data structure
|
||||||
json.nodes.forEach(function(d, i) {
|
json.nodes.forEach(function(d, i) {
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
<script type="text/javascript" src="geomap.js"></script>
|
<script type="text/javascript" src="geomap.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var nodes_json = "nodes.json"
|
||||||
|
|
||||||
window.onresize = resize
|
window.onresize = resize
|
||||||
|
|
||||||
function getOffset( el ) {
|
function getOffset( el ) {
|
||||||
|
|
|
@ -85,7 +85,7 @@ function kmlLoaded()
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_json(layer, map) {
|
function load_json(layer, map) {
|
||||||
d3.json("nodes.json", function(json) {
|
d3.json(nodes_json, function(json) {
|
||||||
// replace indices with real objects
|
// replace indices with real objects
|
||||||
json.links.forEach( function(d) {
|
json.links.forEach( function(d) {
|
||||||
if (typeof d.source == "number") d.source = json.nodes[d.source]
|
if (typeof d.source == "number") d.source = json.nodes[d.source]
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
<script type="text/javascript" src="pacman.js"></script>
|
<script type="text/javascript" src="pacman.js"></script>
|
||||||
<script src="http://maps.google.com/maps/api/js?sensor=true"></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 src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
|
||||||
|
<script>
|
||||||
|
var nodes_json = "nodes.json"
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
|
Loading…
Reference in a new issue