forked from gephi/gephi-plugins
-
Notifications
You must be signed in to change notification settings - Fork 28
SigmajsExporter with Gephi Toolkit
Scott Hale edited this page Oct 21, 2015
·
1 revision
The exporter does three basic things:
-
Extract a zip file of all the standard HTML/JavaScript that doesn't change from one visualization to the next.
-
Write a JSON file (data.json) of all the nodes and edges in the network
-
Write a JSON file (config.json) that gives the titles, options, etc. set in the dialogue box.
In order to do this programmatically, you will have to create a ConfigFile and set the details that would otherwise be set in the GUI options dialogue that appears in Gephi. After this ConfigFile is assigned to the exporter it should then be possible to export the graph.
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
pc.newProject();
Workspace workspace = pc.getCurrentWorkspace();
// do standard things with workspace (build graph)...
SigmaExporter se = new SigmaExporter();
se.setWorkspace(workspace);
ConfigFile cf = new ConfigFile();
cf.setDefaults();
se.setConfigFile(cf, "data/", false);
se.execute();
If you are updating an existing export, you can swap in only the data.json file for new data and/or config.json file for changes in the ConfigFile.