[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) 2018-03-13T00:25:32+01:00 https://forum-gephi.org/app.php/feed/topic/6476 2018-03-13T00:25:32+01:002018-03-13T00:25:32+01:00 https://forum-gephi.org/viewtopic.php?t=6476&p=15076#p15076 <![CDATA[Re: GEXF and node size]]> Image
Gephi9Nodes.png

Statistics:Posted by Crispy — 13 Mar 2018 00:25


]]>
2018-03-12T23:57:52+01:002018-03-12T23:57:52+01:00 https://forum-gephi.org/viewtopic.php?t=6476&p=15074#p15074 <![CDATA[Re: GEXF and node size]]> Statistics:Posted by Crispy — 12 Mar 2018 23:57


]]>
2018-03-12T23:48:16+01:002018-03-12T23:48:16+01:00 https://forum-gephi.org/viewtopic.php?t=6476&p=15073#p15073 <![CDATA[Re: GEXF and node size]]>

CODE:

package nodesizegephi;import java.util.ArrayList;import java.util.List;public class NodeSizeGephi{    private static float sizeMinimum, sizeMaximum;    private static void setDefaults() {        sizeMaximum = 100f;        sizeMinimum = 4f;    }        public static void main(String[] args)    {        setDefaults();                //... Inject my two nodes        List<Node> nodes = new ArrayList<>();        nodes.add(new Node(20.0f));        nodes.add(new Node(21.0f));        float sizeMin = Float.POSITIVE_INFINITY;        float sizeMax = Float.NEGATIVE_INFINITY;        float sizeRatio = 0f;        //Measure        for( Node node : nodes )        {            sizeMin = Math.min(node.getSize(), sizeMin);            sizeMax = Math.max(node.getSize(), sizeMax);        }        if (sizeMin != 0 && sizeMax != 0)        {            if (sizeMin == sizeMax) {                sizeRatio = sizeMinimum / sizeMin;            } else {                sizeRatio = (sizeMaximum - sizeMinimum) / (sizeMax - sizeMin);            }            //Scale node size            for( Node node : nodes )            {                float size = (node.getSize() - sizeMin) * sizeRatio + sizeMinimum;                node.setSize(size);            }        }                nodes.forEach((node)->System.out.println("Node size: " +node.getSize()));    }}class Node{    private float size;    public Node(float size)    {        this.size = size;    }    public float getSize() {        return size;    }    public void setSize(float size) {        this.size = size;    }}
Running this I get returned:
Node size: 4.0
Node size: 100.0

Which are the max and min sizes. The centroid stuff in the original code will not change things I believe as nodeSize will only be 1 (with two nodes). So my node sizes, originally marginally different become wildly altered.

Seeing this, I tried with a GEXF with just one node (size 21.0) to see what would happen (nodeSize would be zero).
:
<node id="3" label="NodeSize:21.0">
<viz:color r="255" g="0" b="0"/>
<viz:size value="21.0"/>
</node>
:

It produced this (without me having adjusted anything):

Image
GephiOneNode.png

Statistics:Posted by Crispy — 12 Mar 2018 23:48


]]>
2018-03-12T17:31:19+01:002018-03-12T17:31:19+01:00 https://forum-gephi.org/viewtopic.php?t=6476&p=15069#p15069 <![CDATA[Re: GEXF and node size]]>
This is the scaler https://github.com/gephi/gephi/blob/mas ... caler.java But I think you can disable it during import report.

Statistics:Posted by eduramiba — 12 Mar 2018 17:31


]]>
2018-03-12T15:41:15+01:002018-03-12T15:41:15+01:00 https://forum-gephi.org/viewtopic.php?t=6476&p=15067#p15067 <![CDATA[GEXF and node size]]>

CODE:

<?xml version='1.0' encoding='UTF-8'?><gexf xmlns="http://www.gexf.net/1.2draft" xmlns:viz="http://www.gexf.net/1.2draft/viz" version="1.2"> <meta lastmodifieddate="2018-03-12">  <creator>Tester</creator>  <description>Node size test</description> </meta> <graph defaultedgetype="undirected" idtype="string" mode="static">  <nodes count="2">   <node id="3" label="NodeSize:21.0">    <viz:color r="255" g="0" b="0"/>    <viz:size value="21.0"/>   </node>   <node id="4" label="NodeSize:20.0">    <viz:color r="204" g="204" b="255"/>    <viz:size value="20.0"/>   </node>  </nodes>  <edges count="0">  </edges> </graph></gexf>
They generate vastly different size nodes as shown below. The smaller node (20.0) is just visible on the top left of the 'z'. The larger (red) node is significantly larger. What is the size ratio algorithm? I see someone asked a similar question nearly two years ago but without reply.
GEXFNodeSizes.png

Statistics:Posted by Crispy — 12 Mar 2018 15:41


]]>