Page 1 of 1
SVG export generates Null Pointer exception
Posted: 06 Dec 2013 02:21
by monarchi
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
Re: SVG export generates Null Pointer exception
Posted: 07 Dec 2013 15:29
by seinecle
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
Re: SVG export generates Null Pointer exception
Posted: 07 Dec 2013 21:35
by monarchi
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
Re: SVG export generates Null Pointer exception
Posted: 08 Jan 2014 23:05
by eduramiba
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