Garphield
v0.1.3Build, style, lay out, share and export network graphs from tables and graph files.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
garphield_create Create a Garphield graph
Create a stored graph document from data and return its reference (doc). Pass exactly one of: graph (node-link JSON: nodes [{id, ...attributes}] and edges [{source, target, ...attributes}]), table (CSV text for links, optionally nodes), file (a GEXF, GraphML, GML, node-link JSON, Cytoscape JSON, a Gephi Lite workspace, Kumu JSON, edge list, Matrix Market, graph6 or .gph text), or url. url fetches from three public sources only, and refuses every other site: a file on GitHub (raw.githubusercontent.com, a github.com/<owner>/<repo>/blob/... page, or a gist's raw link), a Google Sheet shared with…
| Parameter | Type | Description |
|---|---|---|
file | object | A graph file in a format the workbench opens (not DOT), as text or as a path. |
graph | object | Node-link JSON. Nodes named only by a link are created. Ids are stored as strings. |
name | string | Title shown in the workbench and in share previews. |
output | string | Where to write the .gph, relative to the working directory; must end in .gph. Default: a new file in the working directory named after name or the input file. |
overwrite | boolean | Replace an existing .gph document at output (never another kind of file). Default false. |
path | string | A data file to read; its extension picks the reader (.csv/.tsv links table, .gexf, .graphml, .gml, .json node-link, Cytoscape, Gephi Lite or Kumu, .cyjs, .gph, .edges, .mtx, .g6 ...). Use table or fil… |
table | object | Tables as text or as files. Columns match case-insensitively; numeric cells become numbers and blank cells stay missing. |
url | object | Data fetched from a public link. A table's columns match case-insensitively; when source or target is missing, the error lists the columns. |
garphield_inspect Inspect a Garphield graph
Describe a stored graph: size, density, connected components, whether it has saved positions, its data fields (ids to bind, type num or cat, missing counts, ranges or example values; temporal: true marks a date field, listed as (date), which a time filter can read, and years: true a numeric field of years), the channels and the types each accepts, the computed algorithms, the current view config (bindings, filters and saved sets), and a quality grade of the saved layout. The field ids it lists are the names a binding accepts.
| Parameter | Type | Description |
|---|---|---|
doc * | string | Document reference: a stored document id, a file path, or "current" in the workbench. |
include | array | Sections to return. Default ["fields", "channels", "config"]. "algorithms" lists computed sources (degree, louvain, ...) with their params; "scales" gives what each binding draws (every value's mark,… |
garphield_style Style a Garphield graph
Bind data fields or computed algorithms to visual channels, and set the layout mode, how links show direction (arrows), theme, tooltip templates for nodes and links, drawing values (appearance: link width and opacity, node size, curvature, label placement), structure (Group by rings, the Backbone, or a merge into one node per field value) and a time filter on a date field (timeFilter) of a stored graph. Example binding: {"channel": "edgeWidth", "field": "amount_bn"}; a bare field name resolves to the field on the channel's target (node or edge). Strict and atomic: if any entry is invalid nothi…
garphield_focus Highlight or focus part of a Garphield graph
Save named sets of nodes and focus the view on them; the app, share links, embeds and PNG exports all show the result. A set comes from exactly one of: nodes (ids), edges ([source, target] pairs, kept as their endpoints), path (a shortest path from one node to another), top (the k highest or lowest by a field or algorithm such as degree), or match (a range, values, or one node's value of a field or algorithm, e.g. a louvain community). filters fade (default) or hide everything outside a set ({"set": "path"}) or outside a range or values of a field or algorithm. mark rings a set's nodes. clear…
| Parameter | Type | Description |
|---|---|---|
doc * | string | Document reference: a stored document id, a file path, or "current" in the workbench. |
clear | string | Applied first. "filters" empties the filter stack; "all" also deletes every set and every binding that reads one. |
filters | array | Merged into the filter stack by id. |
mark | Ring this set's nodes (the border channel bound to the set). null removes a set ring. | |
sets | array |
garphield_layout Lay out a Garphield graph
Compute and save node positions for a stored graph with the workbench's own layout recipes, and grade the result with its quality gate. Optional: a graph without positions is laid out by the browser when it opens. Use this to bake positions (for a gallery file or a stable share) or to get a quality grade. Reports which engine ran. Large graphs over the host's budget return LAYOUT_TOO_LARGE; clear: true removes saved positions. preview: true also returns a small image of the result, to check for overlaps, tangles and unreadable labels against the grade's findings; it adds a render (10-20 s on t…
| Parameter | Type | Description |
|---|---|---|
doc * | string | Document reference: a stored document id, a file path, or "current" in the workbench. |
aspect | number | Width over height of the frame to fit. Default 1.6. |
clear | boolean | Remove saved positions instead, so the browser lays the graph out when it opens. Pass only doc with it. |
levels | object | levels mode only. |
mode | string | force (production Blend, or ForceAtlas2 for large graphs), levels (layered), or geo (the browser places nodes by their coordinate fields). Default: the document's layout, else force. |
preview | boolean | true returns a 600x400 image of the saved graph, so you can check it for overlapping nodes, tangles and unreadable labels and fix them. A render can take 10-20 s and counts toward the host's image lim… |
garphield_validate Validate a Garphield document
Check a stored document (doc) or a raw .gph document (document) the way the workbench would load it, strictly: the schema, the graph, every binding against the graph's fields and the channel rules, and the filter stack. Returns ok, errors (code, path, message, expected, suggestions) and warnings such as UNLAID (no saved positions) and TEMPLATE_SENDS_FIELDS (a card template puts field values in a URL on another host).
| Parameter | Type | Description |
|---|---|---|
doc | string | Document reference: a stored document id, a file path, or "current" in the workbench. |
document | object | A whole .gph document as JSON, for callers who wrote one themselves. |
garphield_export Export a Garphield graph
Export a stored graph as a .gph project (with its view config and positions), as node-link JSON, GEXF, GraphML or GML, or as a PNG where the host can render. Text formats come back inline up to the host's result limit; gph also reports where the stored file is, when the host has a location. The export is a frozen copy: later style or layout calls do not change it. Where the host stores images, a png export is also kept as the document's preview image.
| Parameter | Type | Description |
|---|---|---|
doc * | string | Document reference: a stored document id, a file path, or "current" in the workbench. |
format * | string | gph is the full Garphield project; nodeLink, gexf, graphml and gml carry the graph and its attributes; png is an image where the host can render one. |
height | integer | png only. |
inline | boolean | gph only: false returns just the stored location and size, without the text. Default true. |
width | integer | png only. |