[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
Gephi forumsPlease post new questions on facebook group too (https://www.facebook.com/groups/gephi) 2013-11-29T17:15:34+01:00 https://www.forum-gephi.org/app.php/feed/topic/2839 2013-11-29T17:15:34+01:002013-11-29T17:15:34+01:00 https://www.forum-gephi.org/viewtopic.php?t=2839&p=9733#p9733 <![CDATA[Re: Rendering a new graph]]>
I have the same problem,
did you find a solution?

thanks

Statistics:Posted by imenMegd — 29 Nov 2013 17:15


]]>
2013-07-24T18:47:22+01:002013-07-24T18:47:22+01:00 https://www.forum-gephi.org/viewtopic.php?t=2839&p=9050#p9050 <![CDATA[Re: Rendering a new graph]]> Are you able to see other graphs?
Does the graph show in Preview?
If it only does not work in Overview,you can try to update your graphic drivers.

Eduardo

Statistics:Posted by eduramiba — 24 Jul 2013 18:47


]]>
2013-07-15T01:29:43+01:002013-07-15T01:29:43+01:00 https://www.forum-gephi.org/viewtopic.php?t=2839&p=8973#p8973 <![CDATA[Re: Rendering a new graph]]> Statistics:Posted by lmhunter7907 — 15 Jul 2013 01:29


]]>
2013-07-15T00:53:08+01:002013-07-15T00:53:08+01:00 https://www.forum-gephi.org/viewtopic.php?t=2839&p=8972#p8972 <![CDATA[Rendering a new graph]]>

CODE:

public class GephiBuilder {      ProjectController pc;    Workspace ws;    GraphModel gm;    DirectedGraph directedGraph;    DynamicGraph dynamicGraph;        static Logger logger = Logger.getLogger(GephiBuilder.class);    /**     *     */    public GephiBuilder() { }        /**     *     */    public void newGraph() {                logger.info("Creating new gephi objects.");                pc = Lookup.getDefault().lookup(ProjectController.class);        pc.newProject();                ws = pc.getCurrentWorkspace();        gm = Lookup.getDefault().lookup(GraphController.class).getModel();                logger.info("Creating a directed graph.");        directedGraph = gm.getDirectedGraph();            }        /**     *     */    public void addNode(String id, String label) {                logger.info("Adding a node.  Id:  " + id + "  Label:  " + label);        Node n = gm.factory().newNode(id);        n.getNodeData().setLabel(label);        n.getNodeData().setSize((float) 2.5);                directedGraph.addNode(n);    }        public void AddEdge(String startNodeId,             String endNodeId, float weight,             boolean directed) throws MissingGephiNodeExcpetion {                //Check to make sure that nodes have been created.  Error if true        if(!nodeExists(startNodeId)) {            throw new                     MissingGephiNodeExcpetion("Node " + startNodeId + " was not found in the graph.");        }                if(!nodeExists(endNodeId)) {            throw new                     MissingGephiNodeExcpetion("Node " + endNodeId + " was not found in the graph.");        }                Node start = directedGraph.getNode(startNodeId);        Node end = directedGraph.getNode(endNodeId);                logger.info("Adding an edge.");        logger.info("Edge start: " + start.getId() + " end: " + end.getId());        addEdge(start, end, weight, directed);    }        /**     *     */    public void addEdge(Node start, Node end, float weight, boolean directed) {                        Edge e = gm.factory().newEdge(start, end, weight, directed);        directedGraph.addEdge(e);                }        /**     *     */    public void buildGraph() {               //DynamicModel dynamicModel = Lookup.getDefault().lookup(DynamicController.class).getModel();       //dynamicGraph = new DynamicGraph();            }        public File exportGraph() {        File retvalue = new File("io_gexf.gexf");        ExportController ec = Lookup.getDefault().lookup(ExportController.class);        GraphExporter exporter = (GraphExporter) ec.getExporter("gexf");                 try {            ec.exportFile(retvalue);            return retvalue;                    } catch (IOException ex) {            return null;        }    }         /**     *     */    public void renderGraph() {                ImportController ic = Lookup.getDefault().lookup(ImportController.class);        Container container = null;                try{            container = ic.importFile(exportGraph());        }        catch(Exception ex) {            return;        }                ic.process(container, new DefaultProcessor(), ws);        //Preview configuration        PreviewController previewController = Lookup.getDefault().lookup(PreviewController.class);        PreviewModel previewModel = previewController.getModel();        previewModel.getProperties().putValue(PreviewProperty.SHOW_NODE_LABELS, Boolean.TRUE);        previewModel.getProperties().putValue(PreviewProperty.NODE_LABEL_COLOR, new DependantOriginalColor(Color.WHITE));        previewModel.getProperties().putValue(PreviewProperty.EDGE_CURVED, Boolean.FALSE);        previewModel.getProperties().putValue(PreviewProperty.EDGE_OPACITY, 50);        previewModel.getProperties().putValue(PreviewProperty.EDGE_RADIUS, 10f);        previewModel.getProperties().putValue(PreviewProperty.BACKGROUND_COLOR, Color.BLACK);        previewController.refreshPreview();        //New Processing target, get the PApplet        ProcessingTarget target = (ProcessingTarget) previewController.getRenderTarget(RenderTarget.PROCESSING_TARGET);        PApplet applet = target.getApplet();        applet.init();        //Refresh the preview and reset the zoom        previewController.render(target);        target.refresh();        target.resetZoom();        //Add the applet to a JFrame and display        JFrame frame = new JFrame("Test Preview");        frame.setLayout(new BorderLayout());                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        frame.add(applet, BorderLayout.CENTER);                frame.pack();        frame.setVisible(true);            }        private boolean nodeExists(String nodeId) {                if(directedGraph.getNode(nodeId) != null)            return true;        else            return false;            }}
Once all of the nodes and edges have been added, the graph is exported to a gexf file which is then loaded into a container and displayed in a preview window. I checked the output file by attempting to open in gephi but the nodes and edges didn't appear there either. So, I'm left with no idea as why I can't seem the graph. I'm hoping that someone here will be able to provide me with some insight into what is going on. I've put the output file below.

CODE:

<?xml version="1.0" encoding="UTF-8"?><gexf xmlns="http://www.gexf.net/1.2draft" version="1.2" xmlns:viz="http://www.gexf.net/1.2draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd">  <meta lastmodifieddate="2013-07-14">    <creator>Gephi 0.8.1</creator>    <description></description>  </meta>  <graph defaultedgetype="directed" mode="static">    <nodes>      <node id="1.2.1" label="Test 2.1">        <attvalues></attvalues>        <viz:size value="2.5"></viz:size>        <viz:position x="221.06403" y="311.56934" z="0.0"></viz:position>        <viz:color r="153" g="153" b="153"></viz:color>      </node>      <node id="1.2.2" label="Test 2.2">        <attvalues></attvalues>        <viz:size value="2.5"></viz:size>        <viz:position x="332.10828" y="243.84601" z="0.0"></viz:position>        <viz:color r="153" g="153" b="153"></viz:color>      </node>      <node id="1.0" label="Test">        <attvalues></attvalues>        <viz:size value="2.5"></viz:size>        <viz:position x="-259.47906" y="159.45837" z="0.0"></viz:position>        <viz:color r="153" g="153" b="153"></viz:color>      </node>      <node id="1.4" label="Test 4">        <attvalues></attvalues>        <viz:size value="2.5"></viz:size>        <viz:position x="-308.87735" y="-52.75769" z="0.0"></viz:position>        <viz:color r="153" g="153" b="153"></viz:color>      </node>      <node id="1.3" label="Test 3">        <attvalues></attvalues>        <viz:size value="2.5"></viz:size>        <viz:position x="397.72437" y="129.328" z="0.0"></viz:position>        <viz:color r="153" g="153" b="153"></viz:color>      </node>      <node id="1.2" label="Test 2">        <attvalues></attvalues>        <viz:size value="2.5"></viz:size>        <viz:position x="-208.681" y="-37.868225" z="0.0"></viz:position>        <viz:color r="153" g="153" b="153"></viz:color>      </node>      <node id="1.1" label="Test 1">        <attvalues></attvalues>        <viz:size value="2.5"></viz:size>        <viz:position x="505.15796" y="54.056763" z="0.0"></viz:position>        <viz:color r="153" g="153" b="153"></viz:color>      </node>    </nodes>    <edges>      <edge source="1.0" target="1.4">        <attvalues></attvalues>      </edge>      <edge source="1.0" target="1.3">        <attvalues></attvalues>      </edge>      <edge source="1.0" target="1.2">        <attvalues></attvalues>      </edge>      <edge source="1.0" target="1.1">        <attvalues></attvalues>      </edge>      <edge source="1.2" target="1.2.1">        <attvalues></attvalues>      </edge>      <edge source="1.2" target="1.2.2">        <attvalues></attvalues>      </edge>    </edges>  </graph></gexf>

Statistics:Posted by lmhunter7907 — 15 Jul 2013 00:53


]]>