Graph with Black background and white edges
Hello,
I am generating a graph using YifanHuLayout by reading .gexf file and wanted to have graph as a black background and white edges. I am generating graph exactly opposite of this as of now. Does anyone know what should I do to get black background and white edges.
Also, I want to change the thickness of edges with weight of edges. Does anyone know how to go about it?
Here is a code that I am using.
public class Headless {
public void getGraph(){
//Init a project - and therefore a workspace
ProjectController pc = Lookup.
pc.newProject();
Workspace workspace = pc.getCurrentWo
//Get models and controllers for this new workspace - will be useful later
AttributeModel attributeModel = Lookup.
GraphModel graphModel = Lookup.
PreviewModel model = Lookup.
ImportController importController = Lookup.
FilterController filterController = Lookup.
RankingController rankingController = Lookup.
//Import file
Container container;
try {
URL url = getClass(
System.
File file = new File(getClass(
container = importControlle
container
} catch (Exception ex) {
ex.
return;
}
//Append imported data to GraphAPI
importControl
//See if graph is well imported
DirectedGraph graph = graphModel.
System.
System.
//See visible graph stats
UndirectedGraph graphVisible = graphModel.
System.
System.
//Run YifanHuLayout for 100 passes - The layout always takes the current visible view
YifanHuLayout layout = new YifanHuLayout(null, new StepDisplacemen
layout.
layout.
layout.
for (int i = 0; i < 1000 && layout.canAlgo(); i++) {
layout.goAlgo();
}
//Get Centrality
GraphDistance distance = new GraphDistance();
distance.
distance.
//Rank color by Degree
NodeRanking degreeRanking = rankingControll
ColorTransformer colorTransformer = rankingControll
colorTransfor
rankingContro
//Rank size by centrality
AttributeColumn centralityColumn = attributeModel.
NodeRanking centralityRanking = rankingControll
SizeTransformer sizeTransformer = rankingControll
sizeTransform
sizeTransform
rankingContro
//Preview
model.
ColorizerFactory colorizerFactory = Lookup.
model.
model.
model.
model.
model.
model.
//Export
ExportController ec = Lookup.
try {
ec.
} catch (IOException ex) {
ex.
return;
}
}
public static void main(String[] args){
Headless headLess = new Headless();
headLess.
}
}
I appreciate your help!
Thanks!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Gephi Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask snehalpatil for more information if necessary.