Supported file formats
| Format | Extension | Open | Export | Carries |
|---|---|---|---|---|
| Garphield project | .gph |
✓ | Save | Graph, visual workspace, sets, history, story |
| GEXF | .gexf |
✓ | ✓ | Graph type and attributes |
| GraphML | .graphml |
✓ | ✓ | Graph type and scalar attributes |
| GML | .gml |
✓ | ✓ | Graph data in a plain-text format |
| Graphviz DOT | .dot, .gv |
✓ | — | Graph topology and scalar attributes |
| Node-link JSON | .json |
✓ | ✓ | NetworkX-shaped graph data |
| Compact JSON | .compact.json, .gf.json, or sniffed .json |
✓ | — | Indexed graph with node/link attributes |
| graph6 | .g6 |
✓ | — | Simple undirected topology only |
| sparse6 | .s6 |
✓ | — | Sparse undirected topology, including loops/parallel links |
| digraph6 | .d6 |
✓ | — | Directed topology, including loops |
| CSV, TSV, text table | .csv, .tsv, .txt |
✓ | — | Edge list, flat-table construction, or two-file graph bundle |
| Plain edge list | .edges, .edgelist, .el |
URL | — | Whitespace-delimited endpoints |
| Matrix Market | .mtx |
URL | — | Sparse matrix as an undirected graph |
| PNG | .png |
— | ✓ | Rendered canvas |
Node-link JSON
Section titled “Node-link JSON”{ "directed": false, "multigraph": false, "graph": {}, "nodes": [{ "id": "a" }, { "id": "b" }], "edges": [{ "source": "a", "target": "b" }]}Garphield accepts the current NetworkX edges key and the older links key.
Garphield uses a node’s label attribute for display and search when present.
Compact JSON
Section titled “Compact JSON”{ "nodes": ["Alice", { "label": "Bob", "group": "staff" }, "Carol"], "edges": [[0, 1], [1, 2, { "weight": 2 }]], "directed": true}Each node’s array position is its node ID. A string node is shorthand for a
label; an object contains node attributes. Each edge is
[sourceIndex, targetIndex] or [sourceIndex, targetIndex, attributes].
directed and multigraph are optional and default to false. Isolates remain
explicit in nodes, and duplicate labels are safe because structure uses array
positions.
This format is intentionally easy for agents to write and compact in inline URLs. It is import-only. Use node-link JSON when the original node IDs, edge keys, or graph attributes must survive.
graph6 family
Section titled “graph6 family”graph6, sparse6, and digraph6 are established printable-ASCII topology formats:
- graph6 stores simple undirected graphs compactly, especially dense ones.
- sparse6 stores sparse undirected graphs and can represent loops and parallel links.
- digraph6 stores directed graphs, including loops, with at most one link for each ordered node pair.
Garphield accepts one graph record per load, with or without the standard
header. Incremental sparse6 records are not accepted because they depend on a
preceding record. These formats carry topology only: imported nodes receive
keys and labels 0 through n-1. The loader caps them at 100,000 nodes and
1,000,000 links to prevent tiny declarations from causing unsafe allocations.
For a URL with no matching suffix—especially data:text/plain,...—pass
format=graph6, format=sparse6, or format=digraph6 explicitly.
CSV edge list
Section titled “CSV edge list”source,target,weighta,b,2b,c,1Garphield matches source and target headers case-insensitively. Other
columns become edge attributes. A table without that header pair opens the
graph construction dialog instead.
Two-file CSV graph bundle
Section titled “Two-file CSV graph bundle”Open two CSV or TSV files together from File → Open. Garphield treats the
file with source and target columns as the edge table and the other file as
the node table. It prefers an id column for the node key; when that column is
absent, it infers a key column from the overlap with the edge endpoints. The
node table’s remaining columns become node attributes, with label or name
supplying the displayed label when available.
Garphield classifies the files by their headers, so names such as links.csv
and points.csv work without a special naming convention. You can also open a
single-file edge list or construct a graph from a flat table.
Garphield projects
Section titled “Garphield projects”Use .gph for the graph and its visual work. The Python package and embed
driver use the same project document. Validate projects against the published
GPH schema.