Hi,
Thank you very much for your solution. But still its not
working. Please find the code below and suggest me for the code to place
image within nodes:
<html>
<head>
<title>Force-Directed Layout</title>
<script type="text/javascript" src="protovis.js"></script>
<script type="text/javascript" src="miserables.js"></script>
<style type="text/css">
body {
margin: 0;
}
</style>
</head>
<body>
<script type="text/javascript">
var w = document.body.clientWidth,
h = document.body.clientHeight,
colors = pv.Colors.category19();
var vis = new pv.Panel()
.width(w)
.height(h)
.fillStyle("white")
.event("mousedown", pv.Behavior.pan())
.event("mousewheel", pv.Behavior.zoom());
var force = vis.add(pv.Layout.Force)
.nodes(miserables.nodes)
.links(miserables.links);
force.link.add(pv.Line);
force.node.add(pv.Dot)
.size(function(d) (d.linkDegree + 10) * Math.pow(this.scale, -1.5))
.fillStyle(function(d) d.fix ? "red" : colors(d.group))
.strokeStyle(function() this.fillStyle().darker())
.lineWidth(1)
.title(function(d) d.nodeName)
.event("mousedown", pv.Behavior.drag())
.event("drag", force);
force.node.add(pv.Image)
.url("index.jpg")
.imageWidth(getDefaultSize)
.imageHeight(getDefaultSize);
vis.render();
</script>
</body>
</html>
--