gephi/gephi

Cannot import Graphviz DOT file: zero nodes or edges

Paul-van-Klaveren opened this issue · 2 comments

Expected Behavior

Gephi opens the Graphviz DOT file .gv and shows the nodes and edges.

Current Behavior

Gephi shows the loading screen with the file without errors or warnings.

No issue found during import

However, even though it has parsed the graph type (directed) correctly, it states that the file contains zero nodes and edges — this is incorrect.
As a result, no graph is shown after closing the loading screen.

Possible Solution

Preferred: Update the DOT file parser. I can open the same file in most online Graphviz viewers, so the file itself doesn't seem to be corrupt.

Alternative: It appears as if the parser silently fails or skips parts of the file, and doesn't report back to the loading UI. If the latter would indicate what's wrong, then at least the user could attempt to fix the graph file, and try to open it again.

Steps to Reproduce

  1. Open a file with .gv extension, e.g.
digraph Podfile {
	graph [bb="0,0,297.96,180"];
	node [label="\N"];
	Podfile	[height=0.5,
		label=Podfile,
		pos="165.29,162",
		width=1.0426];
	PSPDFKit	[height=0.5,
		label=PSPDFKit,
		pos="70.288,90",
		width=1.3838];
	Podfile -> PSPDFKit	[pos="e,91.599,106.7 145.6,146.5 132.68,136.97 115.5,124.32 100.82,113.5"];
	Zip	[height=0.5,
		label=Zip,
		pos="165.29,90",
		width=0.75];
	Podfile -> Zip	[pos="e,165.29,108.1 165.29,143.7 165.29,136.41 165.29,127.73 165.29,119.54"];
	Resolver	[height=0.5,
		label=Resolver,
		pos="254.29,90",
		width=1.2132];
	Podfile -> Resolver	[pos="e,234.83,106.31 184.16,146.15 196.27,136.63 212.21,124.09 225.84,113.38"];
	"PSPDFKit/Core"	[height=0.5,
		label="PSPDFKit/Core",
		pos="70.288,18",
		width=1.9525];
	PSPDFKit -> "PSPDFKit/Core"	[pos="e,70.288,36.104 70.288,71.697 70.288,64.407 70.288,55.726 70.288,47.536"];
}
  1. Observe that the loading screen indicates that zero nodes and edges have been found.

Context

I generated a dependency graph of our iOS project using a tool called cocoapods-dependencies: this captures the pod dependencies in a Graphviz file. Due to the amount of nodes and edges inside the graph, simply viewing the graph as a static vector image is too cluttered. Instead, I need to be able to focus on certain nodes, change the layouting of the graph etc.
In the past, I have used Gephi in my PhD research to visualize and analyse large networks with great results. Unfortunately, with this seemingly trivially sized graph it can't even open the file.

Your Environment

  • Version used: Gephi 0.10.1
  • Operating System: macOS Sonoma 14.1

I can open your graph if I remove the lines:

	graph [bb="0,0,297.96,180"];
	node [label="\N"];

Gephi isn't interested in these lines, but it seems like a bug that it can't skip them. As a workaround you should be able to open dot files in Gephi by removing anything other than nodes and edges.

Looks like a duplicate of this issue: #2780