Garphield

v0.1.3
com.garphield/garphield Checked 3 days ago Published 5 days ago

Build, 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…

ParameterTypeDescription
fileobjectA graph file in a format the workbench opens (not DOT), as text or as a path.
graphobjectNode-link JSON. Nodes named only by a link are created. Ids are stored as strings.
namestringTitle shown in the workbench and in share previews.
outputstringWhere 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.
overwritebooleanReplace an existing .gph document at output (never another kind of file). Default false.
pathstringA 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…
tableobjectTables as text or as files. Columns match case-insensitively; numeric cells become numbers and blank cells stay missing.
urlobjectData 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.

ParameterTypeDescription
doc *stringDocument reference: a stored document id, a file path, or "current" in the workbench.
includearraySections 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…

ParameterTypeDescription
doc *stringDocument reference: a stored document id, a file path, or "current" in the workbench.
clearstringApplied first. "filters" empties the filter stack; "all" also deletes every set and every binding that reads one.
filtersarrayMerged into the filter stack by id.
markRing this set's nodes (the border channel bound to the set). null removes a set ring.
setsarray

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…

ParameterTypeDescription
doc *stringDocument reference: a stored document id, a file path, or "current" in the workbench.
aspectnumberWidth over height of the frame to fit. Default 1.6.
clearbooleanRemove saved positions instead, so the browser lays the graph out when it opens. Pass only doc with it.
levelsobjectlevels mode only.
modestringforce (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.
previewbooleantrue 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).

ParameterTypeDescription
docstringDocument reference: a stored document id, a file path, or "current" in the workbench.
documentobjectA whole .gph document as JSON, for callers who wrote one themselves.

garphield_share Share a Garphield graph

Get links that open a stored graph in the Garphield workbench and in its embeddable view, plus an iframe snippet. Depending on the host the link points at the stored document (anyone with the link can open it, until expiresAt), carries the whole document in the URL (selfContained), or, in the workbench, carries just the view of a built-in sample or generator. Rendering happens in the viewer's browser; a graph without saved positions is laid out when it opens.

ParameterTypeDescription
doc *stringDocument reference: a stored document id, a file path, or "current" in the workbench.
chromearrayEmbed controls to show. Omitted: the embed's defaults. -wordmark takes the link off the Garphield wordmark; the mark stays.
targetstringWhich link `url` is: the full workbench ("app", default) or the chromeless embed.
themestringEmbed theme. Default: the document's theme, if it has one.

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.

ParameterTypeDescription
doc *stringDocument reference: a stored document id, a file path, or "current" in the workbench.
format *stringgph 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.
heightintegerpng only.
inlinebooleangph only: false returns just the stored location and size, without the text. Default true.
widthintegerpng only.