Raj Aditya

Greenhorn
+ Follow
since Oct 20, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Raj Aditya

Yes but there was no reply, though I fixed the problem. The solution is to use layout.weight() to add repulsion between the nodes
6 years ago
I am new to java GraphStream library.I am creating a graph with 30 nodes and size of every node is different. The problem here is that when the node sizes are big, the edge between the 2 nodes is not visible  though it is present. So is there anyway to set minimum distance between 2 nodes?
6 years ago

Raj Aditya wrote:Is it possible to label inside a node of a graph in GraphStream? Currently when I am using node.addattribute("ui.label","node A") , it is labeling "node A" but outside the node. I even tried CSS properties like text-alignment. I also tried sprite manager but nothing worked. Could Someone please help me in labeling inside a graph? Its urgent! Thank you

6 years ago


6 years ago
Is it possible to label inside a node of a graph in GraphStream? Currently when I am using node.addattribute("ui.label","node A") , it is labeling "node A" but outside the node. I even tried CSS properties like text-alignment. I also tried sprite manager but nothing worked. Could Someone please help me in labeling inside a graph? Its urgent! Thank you
6 years ago

package p1;
import org.graphstream.graph.*;
import org.graphstream.graph.implementations.*;
import org.graphstream.ui.spriteManager.Sprite;
import org.graphstream.ui.spriteManager.SpriteManager;

public class Use
{
public static void main(String args[])
{
SingleGraph graph = new SingleGraph("Use");
graph.addNode("A");
graph.addNode("B");
graph.addNode("C");
graph.addNode("D");
graph.addNode("E");
graph.addNode("F");
graph.addNode(1+"");
graph.addNode(2+"");
graph.addEdge("AB", "A", "B",true);
graph.addEdge(1+""+2+"", 1+"", 2+"",true);
graph.addEdge("BC", "B", "C",true);
graph.addEdge("CA", "C", "A",true);
graph.addEdge("CD", "C", "D",true);
graph.addEdge("DF", "D", "F",true);
graph.addEdge("EF", "E", "F",true);
graph.addEdge("DE", "D", "E",true);
Node e1=graph.getNode("A");
e1.addAttribute("ui.style", "shape:circle;fill-color: grey;size: 90px;");
e1.addAttribute("ui.label", "node A");
graph.display();
}
}

This code labels a  node outside it but I want it to be inside. I tried using sprite manager but did not help. Could someone please help?
6 years ago
Also there is a small problem with insertvertex function. That is the syntax for node of any shape.
6 years ago
Here I added the statements Object parent = graph.getDefaultParent();
                      mxCircleLayout layout = new mxCircleLayout(graph,100);
                       layout.execute(parent);
Basically last 2 statements were missing before. So I thought that the default layout would be a rectangular one but by adding the second one it would change to a circle of radius 100.

I followed the link https://jgraph.github.io/mxgraph/docs/js-api/files/layout/mxCircleLayout-js.html and http://www.massapi.com/method/com/mxgraph/layout/mxCircleLayout.execute.html
6 years ago
Using the link you provided and from the understanding gained, I made the changes in the code but output is still the same.Code is shown below

6 years ago
Sorry a small edit in my post. It is rectangular nodes not edges
6 years ago
Hello Guys I am new to Advanced java. I am working with mxGraphs to plot a big graph . The code which I am posting below plots a graph with rectangular edges but I want to plot a graph with circular edges. Can Someone please help?

             
6 years ago
So is it necessary to add the classpath even if the java file and the jar file are in the same directory?
6 years ago
Thanks a lot. It finally worked after putting .; in the start.
Can you also please explain why is it necessary to prepend it with that?
6 years ago