summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Peter Christen <mc@yacy.net>2012-02-25 15:42:29 +0100
committerMichael Peter Christen <mc@yacy.net>2012-02-25 15:42:29 +0100
commit8c06925984d07761f9cf2c8c0baf05c60ae38559 (patch)
treec49152d5e8b1f5acbe5870dfbff6464d1b589bf5
parent898fa7c3f394535251f2548acac9d26befe3b4b9 (diff)
animation of the web structure picture
-rw-r--r--htroot/WatchWebStructure_p.html17
-rw-r--r--htroot/WatchWebStructure_p.java12
-rw-r--r--htroot/WebStructurePicture_p.java2
-rw-r--r--htroot/env/templates/header.template2
-rw-r--r--source/net/yacy/peers/graphics/WebStructureGraph.java16
5 files changed, 40 insertions, 9 deletions
diff --git a/htroot/WatchWebStructure_p.html b/htroot/WatchWebStructure_p.html
index 270f7e52f..da1a47d8d 100644
--- a/htroot/WatchWebStructure_p.html
+++ b/htroot/WatchWebStructure_p.html
@@ -18,6 +18,21 @@
text-align:right;
}
</style>
+ <script type="text/javascript">
+ <!--
+ imagestub = "WebStructurePicture_p.png?host=#[besthost]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#";
+ idx = 0;
+ setTimeout("doanimation()", 3000);
+ function doanimation() {
+ var accessPicture = document.getElementById("WebPicture");
+ if (accessPicture != null) {
+ idx++;
+ accessPicture.src = imagestub + "&idx=" + idx;
+ setTimeout("doanimation()", 3000);
+ }
+ }
+ -->
+ </script>
</head>
<body id="WebStructure" style="margin:0px;">
#%env/templates/header.template%#
@@ -93,7 +108,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</form>
</div><br />
<div style="text-align:right;">
- <img src="WebStructurePicture_p.png?host=#[besthost]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#" alt="WebStructurePicture"/>
+ <img id="WebPicture" src="WebStructurePicture_p.png?host=#[besthost]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#" alt="WebStructurePicture"/>
</div>
#%env/templates/footer.template%#
</body>
diff --git a/htroot/WatchWebStructure_p.java b/htroot/WatchWebStructure_p.java
index abf7e2f23..7ce0b2006 100644
--- a/htroot/WatchWebStructure_p.java
+++ b/htroot/WatchWebStructure_p.java
@@ -64,11 +64,19 @@ public class WatchWebStructure_p {
}
}
+ // fix start point if a "www."-prefix would be better
+ if (host != null && !host.startsWith("www")) {
+ if (sb.webStructure.referencesCount(DigestURI.hosthash6("www." + host)) > sb.webStructure.referencesCount(DigestURI.hosthash6(host))) {
+ host = "www." + host;
+ }
+ }
+
// find start point
if (host == null ||
host.length() == 0 ||
- host.equals("auto") ||
- sb.webStructure.referencesCount(DigestURI.hosthash6(host)) == 0) {
+ host.equals("auto")
+ // || sb.webStructure.referencesCount(DigestURI.hosthash6(host)) == 0
+ ) {
// find domain with most references
besthost = sb.webStructure.hostWithMaxReferences();
if (besthost == null) besthost = host;
diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.java
index 6579a3865..bff661a28 100644
--- a/htroot/WebStructurePicture_p.java
+++ b/htroot/WebStructurePicture_p.java
@@ -155,7 +155,7 @@ public class WebStructurePicture_p {
int maxtargetrefs = 8, maxthisrefs = 8;
int targetrefs, thisrefs;
double rr, re;
- while ((i.hasNext()) && (maxnodes > 0) && (System.currentTimeMillis() < timeout)) {
+ while (i.hasNext() && maxnodes > 0 && System.currentTimeMillis() < timeout) {
entry = i.next();
targethash = entry.getKey();
targethost = structure.hostHash2hostName(targethash);
diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template
index 1551752b6..8ed8538c0 100644
--- a/htroot/env/templates/header.template
+++ b/htroot/env/templates/header.template
@@ -35,7 +35,7 @@
<h3>Monitoring</h3>
<ul class="menu">
<li><a href="/Network.html" accesskey="w" class="MenuItemLink">YaCy Network</a></li>
- <li><a href="/WatchWebStructure_p.html?host=auto&amp;depth=2&amp;time=1000" class="MenuItemLink lock">Web Visualization</a></li>
+ <li><a href="/WatchWebStructure_p.html?host=auto&amp;depth=3&amp;time=1000" class="MenuItemLink lock">Web Visualization</a></li>
<li><a href="/AccessGrid_p.html" class="MenuItemLink lock">Network Access</a></li>
<li><a href="/ViewLog_p.html" class="MenuItemLink lock">Computation</a></li>
<li><a href="/terminal_p.html" accesskey="t" class="MenuItemLink lock">Terminal</a></li>
diff --git a/source/net/yacy/peers/graphics/WebStructureGraph.java b/source/net/yacy/peers/graphics/WebStructureGraph.java
index cc03c987a..ef466eee6 100644
--- a/source/net/yacy/peers/graphics/WebStructureGraph.java
+++ b/source/net/yacy/peers/graphics/WebStructureGraph.java
@@ -130,12 +130,12 @@ public class WebStructureGraph
delcount--;
}
}
+
this.publicRefDNSResolvingWorker = new PublicRefDNSResolvingProcess();
this.publicRefDNSResolvingWorker.start();
}
- private class PublicRefDNSResolvingProcess extends Thread
- {
+ private class PublicRefDNSResolvingProcess extends Thread {
private PublicRefDNSResolvingProcess() {
}
@@ -664,8 +664,7 @@ public class WebStructureGraph
// find host with most references
String maxhost = null;
int refsize, maxref = 0;
- joinOldNew();
- synchronized ( this.structure_new ) {
+ synchronized ( this.structure_old ) {
for ( final Map.Entry<String, String> entry : this.structure_old.entrySet() ) {
refsize = entry.getValue().length();
if ( refsize > maxref ) {
@@ -674,6 +673,15 @@ public class WebStructureGraph
}
}
}
+ synchronized ( this.structure_new ) {
+ for ( final Map.Entry<String, String> entry : this.structure_new.entrySet() ) {
+ refsize = entry.getValue().length();
+ if ( refsize > maxref ) {
+ maxref = refsize;
+ maxhost = entry.getKey().substring(7);
+ }
+ }
+ }
return maxhost;
}