diff options
| author | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2007-05-24 15:28:03 +0000 |
|---|---|---|
| committer | orbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2007-05-24 15:28:03 +0000 |
| commit | 0ae6664ad8d319dc0bd1c0d58f2f53372325a200 (patch) | |
| tree | 61cf92eb4a40df118c3f3542155b50fd7299e3e1 /htroot | |
| parent | 2f34f32ce3275a8fcf72adfbceff80122f998246 (diff) | |
enhanced web structure picture
- hand-over of get properties from web front-end to graphics generation
- added depth-control buttons
- added marking of anchor-points to highlight relation order
- enhanced ymage graphics library
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3757 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
| -rw-r--r-- | htroot/WatchWebStructure_p.html | 21 | ||||
| -rw-r--r-- | htroot/WatchWebStructure_p.java | 23 | ||||
| -rw-r--r-- | htroot/WebStructurePicture_p.java | 12 |
3 files changed, 46 insertions, 10 deletions
diff --git a/htroot/WatchWebStructure_p.html b/htroot/WatchWebStructure_p.html index f262a6a4f..921107414 100644 --- a/htroot/WatchWebStructure_p.html +++ b/htroot/WatchWebStructure_p.html @@ -4,12 +4,29 @@ <title>YaCy '#[clientname]#': Web Structure</title> #%env/templates/metas.template%# </head> -<body id="WebStructure"> +<body id="WebStructure" style="margin:0px;"> #%env/templates/header.template%# #%env/templates/submenuCrawler.template%# <h2>Web Structure</h2> -<img src="WebStructurePicture_p.png"> +<table> +<tr> +<td valign="top"> +<dl> +<dt>host</dt><dd>#[host]#</dd> +<dt>depth</dt><dd>#[depth]#<br/> + <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> +</dd> +</dl> +</td> +<td> + <img src="WebStructurePicture_p.png?host=#[host]#&depth=#[depth]#&width=#[width]#&height=#[height]#" /> +</td> +<td> +</td> +</tr> +</table> #%env/templates/footer.template%# </body> </html> diff --git a/htroot/WatchWebStructure_p.java b/htroot/WatchWebStructure_p.java index b86c2a581..15c0bfde5 100644 --- a/htroot/WatchWebStructure_p.java +++ b/htroot/WatchWebStructure_p.java @@ -1,14 +1,33 @@ import de.anomic.http.httpHeader; -import de.anomic.plasma.plasmaSwitchboard; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; public class WatchWebStructure_p { public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { - plasmaSwitchboard sb = (plasmaSwitchboard) env; + //plasmaSwitchboard sb = (plasmaSwitchboard) env; serverObjects prop = new serverObjects(); + + int width = 768; + int height = 576; + int depth = 3; + String host = "auto"; + + if (post != null) { + width = post.getInt("width", 768); + height = post.getInt("height", 576); + depth = post.getInt("depth", 3); + host = post.get("host", "auto"); + } + + prop.put("host", host); + prop.put("depth", depth); + prop.put("depthi", Math.min(8, depth + 1)); + prop.put("depthd", Math.max(0, depth - 1)); + prop.put("width", width); + prop.put("height", height); + return prop; } } diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.java index 6b3a41c66..6f7ee0b43 100644 --- a/htroot/WebStructurePicture_p.java +++ b/htroot/WebStructurePicture_p.java @@ -60,15 +60,15 @@ public class WebStructurePicture_p { } //too small values lead to an error, too big to huge CPU/memory consumption, resulting in possible DOS. - if (width < 320 ) width = 320; + if (width < 32 ) width = 32; if (width > 1920) width = 1920; - if (height < 240) height = 240; + if (height < 24) height = 24; if (height > 1920) height = 1920; if (depth > 8) depth = 8; - if (depth < 1) depth = 1; + if (depth < 0) depth = 0; // find start point - if (host == null) { + if ((host == null) || (host.length() == 0) || (host.equals("auto"))) { // find domain with most references host = sb.webStructure.hostWithMaxReferences(); } @@ -84,7 +84,7 @@ public class WebStructurePicture_p { if (host != null) place(graph, sb.webStructure, hash, host, 0.0, 0.0, 0, depth); //graph.print(); - return graph.draw(width, height, 20, 20, 20, 20); + return graph.draw(width, height, 40, 40, 5, 15); } @@ -110,7 +110,7 @@ public class WebStructurePicture_p { if (graph.getPoint(targethost) != null) continue; // set a new point. It is placed on a circle around the host point double angle = ((double) kelondroBase64Order.enhancedCoder.cardinal((targethash + "____").getBytes())) / maxlongd * 2 * Math.PI; - System.out.println("ANGLE = " + angle); + //System.out.println("ANGLE = " + angle); double radius = 1.0 / ((double) (1 << nextlayer)); graph.addPoint(targethost, x + radius * Math.cos(angle), y + radius * Math.sin(angle), nextlayer); } |
