Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
changes to web structure page - added catos idea: hosts that have more connections are closer - design update to page - added +/- again
orbiter25a54c872220
diff --git a/htroot/WatchWebStructure_p.html b/htroot/WatchWebStructure_p.htmlindex e5cf4b191..cdd611dff 100644--- a/htroot/WatchWebStructure_p.html+++ b/htroot/WatchWebStructure_p.html@@ -4,40 +4,51 @@<title>YaCy '#[clientname]#': Web Structure</title>#%env/templates/metas.template%#<script type="text/javascript" src="/js/WatchWebStructure.js"></script>+<style type="text/css">+ #left {+ float: left;+ width: 240px;+ }+ form dt {+ width: 60px;+ }+ form dd {+ width: 140px;+ text-align:right;+ }+</style></head><body id="WebStructure" style="margin:0px;">#%env/templates/header.template%##%env/templates/submenuCrawler.template%#<h2>Web Structure</h2>+<div id="left"><form action="/WatchWebStructure_p.html">-<table>-<tr>-<td valign="top"><dl><dt>host</dt><dd>- <input type="text" value="#[host]#" name="host" id="host" />+ <input type="text" value="#[host]#" name="host" id="host" size="20" maxlength="80" /></dd><dt>depth</dt>- <dd><input type="text" name="depth" value="#[depth]#" /></dd>+ <dd>+ <a href="WatchWebStructure_p.html?host=#[host]#&depth=#[depthd]#&width=#[width]#&height=#[height]#"><img src="env/grafics/minus.gif" /></a>+ <a href="WatchWebStructure_p.html?host=#[host]#&depth=#[depthi]#&width=#[width]#&height=#[height]#"><img src="env/grafics/plus.gif" /></a>+ <input type="text" name="depth" value="#[depth]#" size="1" maxlength="1" />+ </dd><dt>width</dt>- <dd><input type="text" name="width" value="#[width]#" /></dd>+ <dd><input type="text" name="width" value="#[width]#" size="4" maxlength="4" /></dd><dt>depth</dt>- <dd><input type="text" name="height" value="#[height]#" /></dd>+ <dd><input type="text" name="height" value="#[height]#" size="4" maxlength="4" /></dd><dt><input type="submit" value="change" /></dt></dl>-</td>-<td>- <img src="WebStructurePicture_p.png?host=#[host]#&depth=#[depth]#&width=#[width]#&height=#[height]#" />-</td>-<td>-</td>-</tr>-</table></form>+</div>++<img src="WebStructurePicture_p.png?host=#[host]#&depth=#[depth]#&width=#[width]#&height=#[height]#" />+#%env/templates/footer.template%#</body></html>diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.javaindex 028dca4da..73df275d2 100644--- a/htroot/WebStructurePicture_p.java+++ b/htroot/WebStructurePicture_p.java@@ -102,23 +102,26 @@ public class WebStructurePicture_p {// first set points to next hostsIterator i = next.entrySet().iterator();ArrayList targets = new ArrayList();- int maxrefs = 8;- int refcount;- double rr;+ int maxtargetrefs = 8, maxthisrefs = 8;+ int targetrefs, thisrefs;+ double rr, re;while (i.hasNext()) {entry = (Map.Entry) i.next();targethash = (String) entry.getKey();targethost = structure.resolveDomHash2DomString(targethash);if (targethost == null) continue;- refcount = structure.referencesCount(targethash);- maxrefs = Math.max(refcount, maxrefs);+ thisrefs = ((Integer) entry.getValue()).intValue();+ targetrefs = structure.referencesCount(targethash); // can be cpu/time-critical+ maxtargetrefs = Math.max(targetrefs, maxtargetrefs);+ maxthisrefs = Math.max(thisrefs, maxthisrefs);targets.add(new String[] {targethash, targethost});if (graph.getPoint(targethost) != null) continue;// set a new point. It is placed on a circle around the host pointdouble angle = ((double) kelondroBase64Order.enhancedCoder.cardinal((targethash + "____").getBytes())) / maxlongd * 2 * Math.PI;//System.out.println("ANGLE = " + angle);- rr = radius / 4 * (1 - refcount / maxrefs);- graph.addPoint(targethost, x + (radius - rr) * Math.cos(angle), y + (radius - rr) * Math.sin(angle), nextlayer);+ rr = radius * 0.25 * (1 - targetrefs / maxtargetrefs);+ re = radius * 0.5 * (thisrefs / maxthisrefs);+ graph.addPoint(targethost, x + (radius - rr - re) * Math.cos(angle), y + (radius - rr - re) * Math.sin(angle), nextlayer);}// recursively set next hostsi = targets.iterator();