Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

the web structure image shows the pivot dot in a different color

Michael Peter Christen906e51214a19
diff --git a/htroot/Crawler_p.html b/htroot/Crawler_p.html
index b8d8d1b8a..402c5a4fc 100644
--- a/htroot/Crawler_p.html
+++ b/htroot/Crawler_p.html
@@ -181,7 +181,7 @@
#(linkstructure)#::
<script type="text/javascript">
<!--
- imagestub = "WebStructurePicture_p.png?host=#[hosts]#&depth=3&width=1024&height=512&nodes=300&time=1000&colortext=888888&colorback=FFFFFF&colordot=11BB11&colorline=222222&colorlineend=333333";
+ imagestub = "WebStructurePicture_p.png?host=#[hosts]#&depth=4&width=1024&height=512&nodes=600&time=1000&colortext=888888&colorback=FFFFFF&colordot0=1111BB&colordota=11BB11&colorline=222222&colorlineend=333333";
idx = 0;
setTimeout("doanimation(500)", 500);
function doanimation(nexttimeout) {
diff --git a/htroot/HostBrowser.html b/htroot/HostBrowser.html
index b4c7e9a5c..0bf14ab83 100644
--- a/htroot/HostBrowser.html
+++ b/htroot/HostBrowser.html
@@ -130,7 +130,7 @@ function updatepage(str) {
</div>
#{/list}#
<p style="clear:both"><br/>
- <img src="/WebStructurePicture_p.png?host=#[host]#&depth=3&width=1024&height=576&nodes=300&time=1000&colortext=888888&colorback=FFFFFF&colordot=11BB11&colorline=222222&colorlineend=333333">
+ <img src="/WebStructurePicture_p.png?host=#[host]#&depth=3&width=1024&height=576&nodes=200&time=1000&colortext=888888&colorback=FFFFFF&colordot0=1111BB&colordota=11BB11&colorline=222222&colorlineend=333333">
</p>
</fieldset>
#(/outbound)#
diff --git a/htroot/WatchWebStructure_p.html b/htroot/WatchWebStructure_p.html
index ad1573473..a1dfd53a1 100644
--- a/htroot/WatchWebStructure_p.html
+++ b/htroot/WatchWebStructure_p.html
@@ -26,7 +26,7 @@
<script type="text/javascript" src="/yacy/ui/js/jquery.colorpicker.js"></script>
<script type="text/javascript">
$(document).ready(function(){
- $('#colorback, #colortext, #colorline, #colordot, #colorlineend').ColorPicker({
+ $('#colorback, #colortext, #colorline, #colordot0, #colordota, #colorlineend').ColorPicker({
onSubmit: function(hsb, hex, rgb, el) {
$(el).val(hex);
$(el).ColorPickerHide();
@@ -71,28 +71,29 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</dd>
<dt>depth</dt>
<dd>
- <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depthd]#&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]#"><img src="env/grafics/minus.gif" width="11" height="11" alt="minus"/></a>
+ <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depthd]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot0=#[colordot0]#&amp;colordota=#[colordota]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/minus.gif" width="11" height="11" alt="minus"/></a>
<input type="text" name="depth" value="#[depth]#" size="1" maxlength="1" />
- <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depthi]#&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]#"><img src="env/grafics/plus.gif" width="11" height="11" alt="plus" /></a>
+ <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depthi]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot0=#[colordot0]#&amp;colordota=#[colordota]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/plus.gif" width="11" height="11" alt="plus" /></a>
</dd>
<dt>nodes</dt>
<dd>
- <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodesd]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/minus.gif" width="11" height="11" alt="minus"/></a>
+ <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodesd]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot0=#[colordot0]#&amp;colordota=#[colordota]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/minus.gif" width="11" height="11" alt="minus"/></a>
<input type="text" name="nodes" value="#[nodes]#" size="4" maxlength="4" />
- <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodesi]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/plus.gif" width="11" height="11" alt="plus"/></a>
+ <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodesi]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot0=#[colordot0]#&amp;colordota=#[colordota]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/plus.gif" width="11" height="11" alt="plus"/></a>
</dd>
<dt>time</dt>
<dd>
- <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[timed]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/minus.gif" width="11" height="11" alt="minus"/></a>
+ <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[timed]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot0=#[colordot0]#&amp;colordota=#[colordota]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/minus.gif" width="11" height="11" alt="minus"/></a>
<input type="text" name="time" value="#[time]#" size="4" maxlength="4" />
- <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[timei]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/plus.gif" width="11" height="11" alt="plus"/></a>
+ <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[timei]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot0=#[colordot0]#&amp;colordota=#[colordota]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#"><img src="env/grafics/plus.gif" width="11" height="11" alt="plus"/></a>
</dd>
<dt>size</dt>
<dd><input type="text" name="width" value="#[width]#" size="5" maxlength="5" />&nbsp;x&nbsp;<input type="text" name="height" value="#[height]#" size="5" maxlength="5" /></dd>
<dt>Background</dt><dd>Color <input type="text" name="colorback" id="colorback" value="#[colorback]#" size="6" maxlength="6" /></dd>
<dt>Text</dt><dd>Color <input type="text" name="colortext" id="colortext" value="#[colortext]#" size="6" maxlength="6" /></dd>
<dt>Line</dt><dd>Color <input type="text" name="colorline" id="colorline" value="#[colorline]#" size="6" maxlength="6" /></dd>
- <dt>Dot</dt><dd>Color <input type="text" name="colordot" id="colordot" value="#[colordot]#" size="6" maxlength="6" /></dd>
+ <dt>Pivot Dot</dt><dd>Color <input type="text" name="colordot0" id="colordot0" value="#[colordot0]#" size="6" maxlength="6" /></dd>
+ <dt>Other Dot</dt><dd>Color <input type="text" name="colordota" id="colordota" value="#[colordota]#" size="6" maxlength="6" /></dd>
<dt>Dot-end</dt><dd>Color <input type="text" name="colorlineend" id="colorlineend" value="#[colorlineend]#" size="6" maxlength="6" /></dd>
<dt>&nbsp;</dt>
<dd><input type="submit" value="change" /></dd>
@@ -101,7 +102,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:left;">
- <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"/>
+ <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;colordot0=#[colordot0]#&amp;colordota=#[colordota]#&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 0a6c7c195..83fe658ae 100644
--- a/htroot/WatchWebStructure_p.java
+++ b/htroot/WatchWebStructure_p.java
@@ -23,7 +23,8 @@ public class WatchWebStructure_p {
String color_text = "888888";
String color_back = "FFFFFF";
- String color_dot = "11BB11";
+ String color_dot0 = "1111BB";
+ String color_dota = "11BB11";
String color_line = "222222";
String color_lineend = "333333";
@@ -44,7 +45,8 @@ public class WatchWebStructure_p {
host = post.get("host", "auto");
color_text = post.get("colortext", color_text);
color_back = post.get("colorback", color_back);
- color_dot = post.get("colordot", color_dot);
+ color_dot0 = post.get("colordot0", color_dot0);
+ color_dota = post.get("colordota", color_dota);
color_line = post.get("colorline", color_line);
color_lineend = post.get("colorlineend", color_lineend);
}
@@ -119,7 +121,8 @@ public class WatchWebStructure_p {
prop.put("colortext", color_text);
prop.put("colorback", color_back);
- prop.put("colordot", color_dot);
+ prop.put("colordot0", color_dot0);
+ prop.put("colordota", color_dota);
prop.put("colorline", color_line);
prop.put("colorlineend", color_lineend);
return prop;
diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.java
index 1d0aa457a..275177058 100644
--- a/htroot/WebStructurePicture_p.java
+++ b/htroot/WebStructurePicture_p.java
@@ -57,7 +57,8 @@ public class WebStructurePicture_p {
String color_text = "888888";
String color_back = "FFFFFF";
- String color_dot = "11BB11";
+ String color_dot0 = "1111BB";
+ String color_dota = "11BB11";
String color_line = "222222";
String color_lineend = "333333";
@@ -86,7 +87,8 @@ public class WebStructurePicture_p {
hosts = post.get("host", null);
color_text = post.get("colortext", color_text);
color_back = post.get("colorback", color_back);
- color_dot = post.get("colordot", color_dot);
+ color_dot0 = post.get("colordot0", color_dot0);
+ color_dota = post.get("colordota", color_dota);
color_line = post.get("colorline", color_line);
color_lineend = post.get("colorlineend", color_lineend);
cyc = post.getInt("cyc", 0);
@@ -134,7 +136,7 @@ public class WebStructurePicture_p {
// draw the graph
graph.normalize();
- graphPicture = graph.draw(width, height, 40, 40, 16, 16, 12, 6, color_back, color_dot, color_line, color_lineend, color_text);
+ graphPicture = graph.draw(width, height, 40, 40, 16, 16, 12, 6, color_back, color_dot0, color_dota, color_line, color_lineend, color_text);
}
// print headline
graphPicture.setColor(color_text);
diff --git a/source/net/yacy/visualization/GraphPlotter.java b/source/net/yacy/visualization/GraphPlotter.java
index 0c7afa693..3af2de7aa 100644
--- a/source/net/yacy/visualization/GraphPlotter.java
+++ b/source/net/yacy/visualization/GraphPlotter.java
@@ -238,17 +238,17 @@ public class GraphPlotter implements Cloneable {
normalizeHorizontal();
}
- public Point addNode(final String node, Point p) {
- this.nodes.put(node, p);
+ public void addNode(final String node, Point p) {
+ Point op = this.nodes.get(node);
+ if (op == null) this.nodes.put(node, p); else op.layer = Math.min(op.layer, p.layer);
if (p.x > this.rightmost) this.rightmost = p.x;
if (p.x < this.leftmost) this.leftmost = p.x;
if (p.y > this.topmost) this.topmost = p.y;
if (p.y < this.bottommost) this.bottommost = p.y;
- return p;
}
- public Point addNode(final String node, final double x, final double y, final int layer) {
- return addNode(node, new Point(x, y, layer));
+ public void addNode(final String node, final double x, final double y, final int layer) {
+ addNode(node, new Point(x, y, layer));
}
public boolean hasEdge(final String fromNode, final String toNode) {
@@ -302,7 +302,8 @@ public class GraphPlotter implements Cloneable {
final int leftborder, final int rightborder,
final int topborder, final int bottomborder,
final int xraster, final int yraster,
- final String color_back, final String color_dot,
+ final String color_back,
+ final String color_dot0, final String color_dota,
final String color_line, final String color_lineend,
final String color_text
) {
@@ -324,7 +325,7 @@ public class GraphPlotter implements Cloneable {
c = entry.getValue();
x = (xfactor == 0.0) ? raster(width / 2, xraster) : leftborder + raster((c.x - this.leftmost) * xfactor, xraster);
y = (yfactor == 0.0) ? raster(height / 2, yraster) : height - bottomborder - raster((c.y - this.bottommost) * yfactor, yraster);
- image.setColor(color_dot);
+ image.setColor(c.layer == 0 ? color_dot0 : color_dota);
image.dot(x, y, 6, true, 100);
image.setColor(color_text);
PrintTool.print(image, x, y + 10, 0, name.toUpperCase(), 0 /*x < 2 * width / 5 ? 1 : x > 3 * width / 5 ? -1 : 0*/);
diff --git a/source/net/yacy/visualization/PngEncoder.java b/source/net/yacy/visualization/PngEncoder.java
index 2b4b99103..5b8954e31 100644
--- a/source/net/yacy/visualization/PngEncoder.java
+++ b/source/net/yacy/visualization/PngEncoder.java
@@ -81,20 +81,19 @@ public class PngEncoder extends Object {
final int width = image.getWidth(null);
final int height = image.getHeight(null);
- // prepare an input list for concurrent PixelGrabber computation
- final BlockingQueue<int[]> grabberInput = new LinkedBlockingQueue<int[]>();
- int startRow = 0; // starting row to process this time through
- int rowsLeft = height; // number of rows remaining to write
- while (rowsLeft > 0) {
- int nRows = Math.max(Math.min(32767 / (width * 4), rowsLeft), 1); // how many rows to grab at a time
- grabberInput.add(new int[]{startRow, nRows});
- startRow += nRows;
- rowsLeft -= nRows;
- }
-
- // do the PixelGrabber computation and allocate the result in the right order
final TreeMap<Integer, ScanLines> scan = new TreeMap<Integer, ScanLines>();
- if (grabberInput.size() > 80) {
+ if (height > 80) {
+ // prepare an input list for concurrent PixelGrabber computation
+ final BlockingQueue<int[]> grabberInput = new LinkedBlockingQueue<int[]>();
+ int startRow = 0; // starting row to process this time through
+ int rowsLeft = height; // number of rows remaining to write
+ while (rowsLeft > 0) {
+ int nRows = Math.max(Math.min(32767 / (width * 4), rowsLeft), 1); // how many rows to grab at a time
+ grabberInput.add(new int[]{startRow, nRows});
+ startRow += nRows;
+ rowsLeft -= nRows;
+ }
+ // do the PixelGrabber computation and allocate the result in the right order
ArrayList<Thread> ts = new ArrayList<Thread>();
int tc = Math.min(grabberInput.size() / 40, Runtime.getRuntime().availableProcessors());
for (int i = 0; i < tc; i++) {
@@ -113,7 +112,14 @@ public class PngEncoder extends Object {
}
for (Thread t: ts) try {t.join();} catch (InterruptedException e) {}
} else {
- for (int[] gi: grabberInput) pixelGrabber(image, width, gi[0], gi[1], scan);
+ int startRow = 0; // starting row to process this time through
+ int rowsLeft = height; // number of rows remaining to write
+ while (rowsLeft > 0) {
+ int nRows = Math.max(Math.min(32767 / (width * 4), rowsLeft), 1); // how many rows to grab at a time
+ pixelGrabber(image, width, startRow, nRows, scan);
+ startRow += nRows;
+ rowsLeft -= nRows;
+ }
}
// finally write the result of the concurrent calculation into an DeflaterOutputStream to compress the png