Enabling node label visibility from a plugin?

Extensions and customization
Post Reply [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
User avatar
phreakocious
Gephi Plugin Developer
Posts:25
Joined:03 Aug 2010 15:15
Contact:
Enabling node label visibility from a plugin?

Post by phreakocious » 13 Mar 2012 22:43

Can anyone point me in the right direction for ensuring that node labels are visible in the UI from a plugin? I set the LabelVisible parameter to true for the nodes, but that only affects which are visible when toggled in the UI.

Thanks!

User avatar
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: Enabling node label visibility from a plugin?

Post by eduramiba » 13 Mar 2012 23:51

Hi,
You will need to include Visualization Module as a dependency in your module.
Then use some code like this:

Code: Select all

VizController.getInstance().getTextManager().getModel().setShowNodeLabels(true);
Eduardo

User avatar
phreakocious
Gephi Plugin Developer
Posts:25
Joined:03 Aug 2010 15:15
Contact:

Re: Enabling node label visibility from a plugin?

Post by phreakocious » 14 Mar 2012 00:01

Wow.. I was soooo close. :) Should I use Lookup to get the instance of VizController, or is that raw version enough?

Thanks a bunch for the quick reply.

User avatar
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: Enabling node label visibility from a plugin?

Post by eduramiba » 14 Mar 2012 00:18

Well the method itself uses Lookup and inits some objects.
You probably can get it with Lookup because Gephi will have initialized it before.

Eduardo

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Enabling node label visibility from a plugin?

Post by seinecle » 04 Jun 2013 10:56

Wow I would put +1000 if I could. This part of the API gives full control on so many stuff! Love it!

Post Reply
[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
[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