[SOLVED] Dynamic position of nodes
-
- Posts:8
- Joined:06 Oct 2011 14:36 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Hi, I am new...and i'm studing Gephi for my thesis.
I'm doing a plugin for import data from my file, but before I want to understand if i can build a graph where the position of nodes can change over time and if i can use the timeline to see the movement of nodes.
I hope that it can do in some way.
very thanks, Luca.
I'm doing a plugin for import data from my file, but before I want to understand if i can build a graph where the position of nodes can change over time and if i can use the timeline to see the movement of nodes.
I hope that it can do in some way.
very thanks, Luca.
-
- Gephi Community Manager
- Posts:964
- Joined:09 Dec 2009 14:41 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Dynamic position of nodes
Hi,
Of course it's possible
Of course it's possible
-
- Posts:8
- Joined:06 Oct 2011 14:36 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Dynamic position of nodes
can you give me some link for learn it please?
thanks
thanks
- mbastian
- Gephi Architect
- Posts:728
- Joined:10 Dec 2009 10:11
- Location:San Francisco, CA [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Dynamic position of nodes
Yes you can do that using Dynamic objects and Ranking.
What you need to do first is create DynamicFloat objects for your nodes with the position + time. If you encode your data in the GEXF format you can set dynamic types and already import your data. Once you have a dynamic X and Y column, which you can browse in the Data Laboratory you'll need to use it to set nodes' position in a loop.
This is the code to basically get the float value from a DynamicFloat for the current interval defined in the Timeline. Attributable is either a node or an edge.
What you need to do first is create DynamicFloat objects for your nodes with the position + time. If you encode your data in the GEXF format you can set dynamic types and already import your data. Once you have a dynamic X and Y column, which you can browse in the Data Laboratory you'll need to use it to set nodes' position in a loop.
This is the code to basically get the float value from a DynamicFloat for the current interval defined in the Timeline. Attributable is either a node or an edge.
Code: Select all
AttributeColumn myDynamicXColumn = ...;
Attributable attributable = ...
DynamicController dynamicController = Lookup.getDefault().lookup(DynamicController.class);
DynamicModel dynamicModel = dynamicController.getModel();
TimeInterval visibleInterval = dynamicModel.getVisibleInterval();
Estimator = dynamicModel.getNumberEstimator();
DynamicType<? extends Number> dynamicType = (DynamicType<? extends Number>) attributable.getAttributes().getValue(myDynamicXColumn.getIndex());
if (dynamicType != null) {
return (Number) dynamicType.getValue(timeInterval == null ? Double.NEGATIVE_INFINITY : timeInterval.getLow(),
timeInterval == null ? Double.POSITIVE_INFINITY : timeInterval.getHigh(), estimator);
}
-
- Posts:8
- Joined:06 Oct 2011 14:36 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Dynamic position of nodes
very thanks..
now i'm studing your code..
now i'm studing your code..
-
- Posts:8
- Joined:06 Oct 2011 14:36 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Dynamic position of nodes
Sorry me, but have three days that I try to understand how i can create DynamicFloat objects for my nodes with the position + time.
Can you post the code in GEXF format of a simple graph with only one node but that it change the position over the time with the use of timeline? please.
For instance: I want build a simple graph where a node change the position:
x = 0 in the time [0,100],
x position = 10 in [101,200],
and x position = 20 in [202,300].
How can i do it?
For instance i have this declaration of a colunm in my container:
now my container have e new column, but how can i collegate the dynamicPosX with the property Position X?
and i don't understand how to pratically make when you say"the Data Laboratory you'll need to use it to set nodes' position in a loop"
..sorry for my bad english and thanks a lot for the help
Can you post the code in GEXF format of a simple graph with only one node but that it change the position over the time with the use of timeline? please.
For instance: I want build a simple graph where a node change the position:
x = 0 in the time [0,100],
x position = 10 in [101,200],
and x position = 20 in [202,300].
How can i do it?
For instance i have this declaration of a colunm in my container:
Code: Select all
AttributeColumn dynamicPosX = container.getAttributeModel().getNodeTable().addColumn("DynPosX", AttributeType.DYNAMIC_DOUBLE);
and i don't understand how to pratically make when you say"the Data Laboratory you'll need to use it to set nodes' position in a loop"
..sorry for my bad english and thanks a lot for the help
-
- Posts:8
- Joined:06 Oct 2011 14:36 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Dynamic position of nodes
I think that i have understand what you want tell me now..
But can you tell me in which part of code of gephi i put this loop for take the current interval defined in the Timeline and modify the position of nodes?
But can you tell me in which part of code of gephi i put this loop for take the current interval defined in the Timeline and modify the position of nodes?
- eduramiba
- Gephi Code Manager
- Posts:1064
- Joined:22 Mar 2010 15:30
- Location:Madrid, Spain [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Dynamic position of nodes
Hi,
If you are creating a plugin, I think you would have a loop that uses dynamic columns (x, y, z(optional?)) values at different time intervals and manually sets nodes positions.
Also, I think this could be a Layout plugin that uses the current time interval filtering.
Eduardo
If you are creating a plugin, I think you would have a loop that uses dynamic columns (x, y, z(optional?)) values at different time intervals and manually sets nodes positions.
Also, I think this could be a Layout plugin that uses the current time interval filtering.
Eduardo
-
- Posts:8
- Joined:06 Oct 2011 14:36 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: Dynamic position of nodes
Thanks for the answear..
I'll try to do a layout plugin.
hope it works
I'll try to do a layout plugin.
hope it works
-
- Posts:8
- Joined:06 Oct 2011 14:36 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: [SOLVED] Dynamic position of nodes
I need to know two more things and I think I'm done. (finally)
1) How can I capture the scroll and enlargement event of the timeline in my layout plugin? This will allow me to change the position of the nodes while i scroll the timeline.
2) can I set a background to my workspace in gephi? I would like to put the image of a map (the map of my university)
if necessary i can open two separate tread
thanks again and I hope that i don't have tired you.
Luca.
1) How can I capture the scroll and enlargement event of the timeline in my layout plugin? This will allow me to change the position of the nodes while i scroll the timeline.
2) can I set a background to my workspace in gephi? I would like to put the image of a map (the map of my university)
if necessary i can open two separate tread
thanks again and I hope that i don't have tired you.
Luca.