diff --git a/htroot/WatchWebStructure_p.html b/htroot/WatchWebStructure_p.html index b6b29260c..1afd9eea6 100644 --- a/htroot/WatchWebStructure_p.html +++ b/htroot/WatchWebStructure_p.html @@ -22,8 +22,11 @@ #%env/templates/header.template%# #%env/templates/submenuWebStructure.template%# -
-The data that is visualized here can also be retrieved in a XML file. The XM L contains a back-reference of domains. That means you can see the set of domains that all link to the same (other) domain, which could be called a 'reverse domain index'. +
+ +The data that is visualized here can also be retrieved in a XML file, which lists the reference relation between the domains. +With a GET-property 'about' you get only reference relations about the host that you give in the argument field for 'about'. +With a GET-property 'latest' you get a list of references that had been computed during the current run-time of YaCy, and with each next call only an update to the next list of references. Click the API icon to see the XML file. To see a list of all APIs, please visit the API wiki page.
@@ -33,7 +36,8 @@ To see a list of all APIs, please visit the
-
+
+
host
@@ -57,14 +61,15 @@ To see a list of all APIs, please visit the plus
size
-
 x 
+
 x 
 
-
+
+
-
+
-WebStructurePicture +WebStructurePicture #%env/templates/footer.template%# diff --git a/htroot/WatchWebStructure_p.java b/htroot/WatchWebStructure_p.java index a3fbcb9d5..987fd7d9e 100644 --- a/htroot/WatchWebStructure_p.java +++ b/htroot/WatchWebStructure_p.java @@ -20,6 +20,7 @@ public class WatchWebStructure_p { int nodes = 500; // maximum number of host nodes that are painted int time = -1; String host = "auto"; + String besthost; if (post != null) { width = post.getInt("width", 768); @@ -49,7 +50,16 @@ public class WatchWebStructure_p { } } + // find start point + if ((host == null) || (host.length() == 0) || (host.equals("auto"))) { + // find domain with most references + besthost = sb.webStructure.hostWithMaxReferences(); + } else { + besthost = host; + } + prop.putHTML("host", host); + prop.putHTML("besthost", besthost); prop.put("depth", depth); prop.put("depthi", Math.min(8, depth + 1)); prop.put("depthd", Math.max(0, depth - 1)); diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.java index 1d7756677..447a1ad93 100644 --- a/htroot/WebStructurePicture_p.java +++ b/htroot/WebStructurePicture_p.java @@ -65,11 +65,11 @@ public class WebStructurePicture_p { host = post.get("host", null); } - //too small values lead to an error, too big to huge CPU/memory consumption, resulting in possible DOS. + // too small values lead to an error, too big to huge CPU/memory consumption, resulting in possible DOS. if (width < 32 ) width = 32; - if (width > 1920) width = 1920; + if (width > 10000) width = 10000; if (height < 24) height = 24; - if (height > 1920) height = 1920; + if (height > 10000) height = 10000; if (depth > 8) depth = 8; if (depth < 0) depth = 0; diff --git a/source/de/anomic/plasma/plasmaWebStructure.java b/source/de/anomic/plasma/plasmaWebStructure.java index b13a779b8..353ff9400 100644 --- a/source/de/anomic/plasma/plasmaWebStructure.java +++ b/source/de/anomic/plasma/plasmaWebStructure.java @@ -176,7 +176,7 @@ public class plasmaWebStructure { private static int refstr2count(final String refs) { if ((refs == null) || (refs.length() <= 8)) return 0; - assert (refs.length() - 8) % 10 == 0; + assert (refs.length() - 8) % 10 == 0 : "refs = " + refs + ", length = " + refs.length(); return (refs.length() - 8) / 10; } @@ -471,21 +471,20 @@ public class plasmaWebStructure { private void next0() { Map.Entry entry = null; - String dom = null, ref; + String dom = null, ref = ""; while (i.hasNext()) { entry = i.next(); + ref = entry.getValue(); + if ((ref.length() - 8) % 10 != 0) continue; dom = entry.getKey(); if (dom.length() >= 8) break; - if (!i.hasNext()) { - nextentry = null; - return; - } + dom = null; } if ((entry == null) || (dom == null)) { nextentry = null; return; } - ref = entry.getValue(); + assert (ref.length() - 8) % 10 == 0 : "refs = " + ref + ", length = " + ref.length(); nextentry = new structureEntry(dom.substring(0, 6), dom.substring(7), ref.substring(0, 8), refstr2map(ref)); }