- Gephi Lite version : 1.0.2
- Operating system: Windows 11
- Web browser: Edge 152.0.4191.66
Gephi Lite v1.0.2 rejects a minimal valid Graphology JSON file during Workspace > Open.
Reproduction:
{
"attributes": { "name": "Test" },
"nodes": [
{ "key": "a" },
{ "key": "b" }
],
"edges": [
{
"key": "a-b",
"source": "a",
"target": "b",
"attributes": { "weight": 1 }
}
]
}
Actual result:
Graph.import: invalid nodes. Expecting an array
The same error occurs with the canonical Graphology JSON structure and without graph options.
Suspected cause: gephiLiteParse() uses a JSON reviver that converts the root object into a Graphology instance when it sees nodes and edges. The importer then checks jsonContent.nodes && jsonContent.edges and calls Graph.from(jsonContent) again. At that point nodes is a method rather than the serialized nodes array.
Expected result: the JSON should be passed to Graph.from() before, or instead of, the reviver converting it into a Graphology instance.
Gephi Lite v1.0.2 rejects a minimal valid Graphology JSON file during Workspace > Open.
Reproduction:
Actual result:
Graph.import: invalid nodes. Expecting an arrayThe same error occurs with the canonical Graphology JSON structure and without graph options.
Suspected cause: gephiLiteParse() uses a JSON reviver that converts the root object into a Graphology instance when it sees nodes and edges. The importer then checks jsonContent.nodes && jsonContent.edges and calls Graph.from(jsonContent) again. At that point nodes is a method rather than the serialized nodes array.
Expected result: the JSON should be passed to Graph.from() before, or instead of, the reviver converting it into a Graphology instance.