SVG export generates Null Pointer exception

Screenshots, Vectorial Preview and printable exports
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
monarchi
Posts:16
Joined:20 May 2011 01:28
[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
SVG export generates Null Pointer exception

Post by monarchi » 06 Dec 2013 02:21

Hello all -

I apologize in advance if this has been asked & answered, but I couldn't find it with a search.

System: Win 7 Pro x64
Gephi 0.8.2 beta


I am trying to export the Preview as an SVG file. When I do so, I get a null pointer exception about 30% through the process. PDF and PNG formats export fine, but I need the zoom capabilities of an SVG file. Is there something I need to do to make this work?

Thank you for any help/suggestions.

Best,
David

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

Re: SVG export generates Null Pointer exception

Post by seinecle » 07 Dec 2013 15:29

Hi,

Really strange I've never seen that. Could it be due to a strange thing in your data? (weird characters in node names, or... ??)

Best,

Clement

monarchi
Posts:16
Joined:20 May 2011 01:28
[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: SVG export generates Null Pointer exception

Post by monarchi » 07 Dec 2013 21:35

Thanks for the quick reply, Clement, and the suggestion that I examine the node names. The problem was being caused by blanks in some of the labels. I apologize for missing that restriction; I thought I had read the documentation carefully. The work I'm doing involves adjacency matrices of words and phrases in text, hence the blanks. I simply replaced the blanks with underscores and the export proceeded without any problems.

I hope you don't mind, but I have a related question.
While trying to solve the problem, I explored using Jython via the console in Gephi. I began by creating a file handle using
f = open("aFileName", "w")
and an exportController with
ec = Lookup.getDefault().lookup(ExportController.class)
But I couldn't get the following statement to work
ec.exportFile(f)
The error I got was
TypeError: exportFile(): 1st arg can't be coerced to java.io.File

I suspect I missing something as obvious as the problem I started with, but if you could give me any insights/suggestions, I would be very grateful.

Thanks again.

Best,
David

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: SVG export generates Null Pointer exception

Post by eduramiba » 08 Jan 2014 23:05

I think that the problem is your code is creating a "Python" file, which can't be converted to a Java file.
Try to create your file with

Code: Select all

from java.io import File
f = File(".")
Eduardo

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