Web Playground
The playground is a single-page web app that runs Graphersal in the browser: the real engine,
compiled to WebAssembly (crates/graphersal-wasm), in a Web Worker. There is no server-side part;
any static file server can host it. Its source is playground/ in the repository; the developer
details (engine boundary, file layout, libraries) are in playground/README.md.
Build and run
rustup target add wasm32-unknown-unknown # one-time
cargo install --locked wasm-bindgen-cli --version 0.2.129 # one-time; must match the wasm-bindgen crate
playground/build.sh # builds playground/pkg/
python3 playground/serve.py 8000 # open http://localhost:8000/ (no browser caching)
wasm-opt (from binaryen) is optional; when it is installed, build.sh uses it to make the module
smaller. Without the build output the page explains how to build it.
The same UI also runs against the CLI as a local engine, without WebAssembly:
graphersal --graph <src> --server (DEV mode, unstable, local only; see
Dev Server and MCP). There the Query panel can also open an
AI Chat tab (EXPERIMENTAL, --ai FILE): an LLM agent that
answers questions by querying the served graph. In the WebAssembly playground that tab is read-only.
What it does
- Graphs: the empty graph, the TinkerPop "modern" graph, the generated ~110k element graph (the
CLI's
--graph large), a file tree sample, or a GraphSON (.json, TinkerPop'sg.io()format) or GraphML file from your disk (it stays in the browser). What a GraphSON import skips (dates, unsupported types) is shown in a notice. - Queries: the full DSL, both spellings, with completion from the engine's own function list
(each entry's tooltip shows its overloads, a one-line description and a runnable example). A
traversal without a terminal runs as
execute(), so one run gives the results and, with Profile on, the metrics; Memory adds the exact per-step memory figures (the module installs the counting allocator, so the source istracked). Results are shown as a table, JSON and the raw text the CLI prints, within the CLI's display limits (see Displaying Results). - Examples: the Query panel's Examples button (a click, or resting the pointer on it) opens
a panel over the editor with every example, in collapsible groups (GQL split by topic). Its search
field finds a plain text in titles and scripts, case-insensitive (
.order(lists every example that uses it, with the matching line);Up/Downmove,Enteropens,Escclears the search and then closes. Reopening returns to where you were and marks the example opened last, so the next one is right below it. The Modern graph group hassubgraph()examples (the edges of one kind, the edges walked byrepeat(), the result as a graph, traversing the extracted graph). - Query tabs: the Query panel holds several queries side by side. Each tab has its own text,
Profile/Memory toggles, last result and last profile; switching tabs shows that tab's results
without running anything. The graph is shared: when a run in one tab changes it, the other tabs'
results are marked "possibly stale" until they run again. An example from the Examples menu goes
into the active tab only when that tab is empty or still holds an unchanged example; otherwise it
opens in a new tab, so your own text is never overwritten. The tab menu also offers Duplicate
tab, Close other tabs and Run all tabs. The tabs (not their results) are kept in the browser;
the query history records every run with its tab's name. Shortcuts:
Ctrl/⌘+Enterruns the active tab (or its selection, see Run below),Ctrl/⌘+Shift+Enterruns all tabs,Alt+Nopens andAlt+Wcloses a tab,Alt+[/Alt+]switch to the previous / next tab andAlt+Shift+1…9to tab 1…8 or the last one (the browser keepsCtrl/⌘+T,Wand1…9for its own tabs). - GQL query tabs: a query tab is in Rhai (the Gremlin DSL, the default) or in
GQL. Open one with + ▸ GQL query (marked
GQLin the tab strip), or switch the tab with the Rhai / GQL switch in the Query panel's header; nothing is detected from the text. In a GQL tab you write the query itself,MATCH (p:person) WHERE p.age > $min RETURN p.name, with GQL highlighting and completion: the keywords that fit the position (afterMATCHa pattern'sWHERE,RETURNand the next clauses, afterRETURNAS,ORDER BY,LIMIT, ...), the GQL functions with a short description, the graph's labels after:(edge types inside[..]), the property keys aftern.(those ofn's labels), the variables the query binds, the parameters after$, and afterCALLthe saved queries written in GQL asfolder.name(Calling saved queries from GQL). Under the editor the Parameters field holds the parameter map as JSON,{"min": 30}(checked as you type; a fault names its line and column); + Add $parameters adds every$namethe query reads that the map lacks. Run, Run selection, Stop, Profile, the history and the results work as in a Rhai tab: the tab runsg.gql("<query>", #{min: 30}), and an error's GQLSTATUS stays in its message while the part of the query it names is underlined in the editor (Go to line jumps there). Switching a tab that holds exactly oneg.gql(`...`, #{..})call to GQL takes its query and its literal parameters out of it; switching back writes them as that call again; any other text is kept as it is. GQL examples of the Examples menu open as GQL tabs. Save as query… of a GQL tab saves a GQL query with its$parameters, typed and defaulted by the Parameters field. - Statistics, a tab of the Profile panel (next to Steps and Text), shows two sources
side by side: the graph's data (
g.statistics(): vertex and edge totals, the counts per vertex label, also as primary label, and per edge label; at most 50 labels per kind, largest first) with its memory footprint (g.memory_usage()), and the limits a query runs under: the host's presets (none in the playground; the dev server's--timeout,--max-*, ...) and the engine's defaults for the rest (see Resource Limits;g.with(..)changes them per query). While open it reloads after every run that changed the data. A Process memory section (hidden when empty) lists what the process holds: the resident set size (RSS, with its peak) and the live heap on the dev server (RSS on Linux and macOS only), every loaded embedding model with its size (measured at its load; marked "estimate" where no tracking allocator counted it) and, on the dev server with--ai, the AI Chat history (conversations and an estimate of their bytes). The WebAssembly playground has no loaded models, no chat and no RSS; it shows the live heap and the size of its WebAssembly memory. Above the Memory section, the process memory bar shows how full the process is against its memory ceiling: used of the ceiling, where the ceiling comes from (configured, cgroup limit, 80 % of RAM, WebAssembly default), and the percentage (normal below 70 %, amber from 70 to 90 %, red above). One coloured segment per place the memory goes: structure (vertex and edge slots, ids and labels: the Memory row's Structure), properties (plain values), compressed (compressed and deduplicated values with their dictionaries), indexes (the id and label indexes plus the property indexes: the Memory row's Indexes and Property indexes), models (embedding models in memory), live_graph (a store's live graph, held beside the read-only view of a past state you are looking at), store (the store's buffers and, for a database kept in memory, its files), engine (the script engine, the workload statistics, the session's layouts, the dev server's MCP and AI Chat state) and other (the rest of the heap no segment explains: query buffers, caches, allocator overhead). A segment's tooltip lists the parts it sums. The legend lists every segment with its size, also a tiny one, and a line says what compression saves. Without a tracking allocator only the known segments are shown, marked "process total not tracked"; without a ceiling there is no percentage. The same bar opens the Memory tab of Optimize; the Statistics tab's Components and memory report… button opens that tab, whose Process memory table lists every component with its bytes (the memory report's walk, so it is not repeated in the Statistics tab). With Profile on, a line under the step tree, Peak memory, shows the most memory the run held at once against the per-query limittraversal.max_materialized_bytes(amber and red by the same thresholds): a different figure from the process bar, against a different limit. - Errors show the message, the step path of a runtime error (the same step ids as the profile),
the
help()advice, a "Go to line" for script errors, and the full diagnostic. - Graph, Schema, Profile panels draw the graph (capped), show and edit the schema (see The schema editor below; the drawings, a label graph and a Mermaid diagram, show at most 300 labels), and the optimized plan with timings, traverser counts, loop statistics, path recording and memory. The Graph panel draws the whole graph when it has at most 10 000 vertices and 20 000 edges (Settings), else its labels; it also draws the neighbourhood of a vertex and the last query result. Clicking a vertex or an edge shows its properties, fetched from the engine at that moment (the drawing itself carries only ids, labels and names; long texts and vectors are collapsed with an expand button, see Long values); double-clicking a vertex in the neighbourhood or the query result expands it by one hop from the engine (in the whole graph: selects it with its neighbours, again for one hop more), double-clicking empty space fits the drawing. The toolbar keeps Layout, Edit, Fit and Export; the ⚙ Display menu holds the drawing tier, vertex and edge IDs, edge labels and a short mouse help (a narrow panel moves Layout and Edit there too). Above 200 vertices the engine lays the drawing out (with progress and Stop) instead of the browser. See The graph drawing below for what the panel shows and its two drawing tiers.
- Run (or
Ctrl/⌘+Enter) runs the selected text when the editor has a selection, else the whole tab, so a script can be tried piece by piece. The button then reads Run selection, and the status bar and the Results header say "selection (N lines)". A selection of only whitespace runs the whole tab; with several selections (Alt+drag) only the main one runs. Everything else is a normal run: one unit (committed only when it succeeds), the history records the text that ran, Profile and Memory apply, and an error's "Go to line" points into the full text of the tab. Run all tabs always runs whole tabs. - Stop (next to Run) ends a long query: the engine is restarted and the graph restored as it was last loaded (sample or file) or last saved. Changes made after that point are lost, and so is the history of the store in memory (it starts over from that state). While no query runs but the graph drawing is being laid out, Stop ends only the layout: the drawing keeps the positions reached so far and nothing is restarted.
- Save ▾ (top bar; the start page has the same entries as buttons) downloads ONE file per
entry: the graph data as GraphSON 3.0 (
graphersal-graph-YYYYMMDD-HHMMSS.json) or GraphML (.graphml), the schema (graphersal-schema-YYYYMMDD-HHMMSS.json; neither data format carries it, see UUID Values), the saved queries, or a snapshot (.gsnap) with data, schema and saved queries in one file. One file per click, because browsers block or drop a second download started by the same click. To load both back, choose both in Load from file on the start page: the graph file and, in the dialog's optional second field, the schema file (JSON). The schema is set on the new, empty graph first and the data is imported against it as one unit, so the elements, ids, labels, properties and the schema come back; in modeopenorcloseda violation fails the load with the error and nothing changes. Load from file always starts without the previous graph's schema: a graph file loaded without a schema file has no schema (a previous graph's schema has nothing to do with an unrelated file). Dropping ONE file on the card loads it without a schema; dropping a graph file together with its.jsonschema pairs them when that is unambiguous (the graph file is GraphML,.jsonlor.graphson; two.jsonfiles are refused, choose them in the dialog). A snapshot (.gsnap) brings its own schema and takes no schema file. GraphSON keeps every value type (uuid, lists, maps) by itself; GraphML gets them back from the schema's declarations, and Save warns about values that come back as strings without one (an undeclareduuid, lists and maps, a property with different types on different labels). - Load schema applies a JSON file in the schema format
(
set_schema) to the current graph. In modeopenorclosedthe existing data is validated first; on violations nothing changes and the error is shown. It changes only the current graph: a graph loaded from a file afterwards does not keep it (give the schema file in Load from file instead).
Scripts run without Rhai resource limits and without a default timeout, as in the CLI: the page is your own local front end, and Stop ends a runaway query or loop. Every run starts with a fresh script scope; the graph keeps the changes queries make until you load another one.
A run is all-or-nothing: the whole script is one unit of work, and a run that shows an error leaves the graph as it was before the run (see Transactions). Scripts may do everything except file access, which the browser does not have (see Permissions).
Links to a query
A link can open the playground with a query in the editor, and run it, on a sample graph or on a small graph the link carries itself:
https://play.graphersal.dev/#/play?graph=modern&q=g.v().has_label(%22person%22).values(%22name%22)&run=1
https://play.graphersal.dev/#/play?v=1&data=xZWxboMwEIb3PoZnFIFtSMOUoR36Al...&q=g.v().count()&run=1
https://play.graphersal.dev/#/play?graph=modern&q=MATCH%20(p%3Aperson)%20WHERE%20p.age%20%3E%20%24min%20RETURN%20p.name&lang=gql¶ms=%7B%22min%22%3A30%7D&run=1
| Parameter | Meaning |
|---|---|
graph | the sample graph: modern (the default), empty, large, tree |
data | instead of graph: the graph itself, as GraphSON 3.0 compressed with deflate and written as base64url |
schema | with data only: the graph's schema (the schema format), encoded the same way |
v | the format of data and schema; 1 (the default) is the only one so far |
q | the query, percent-encoded (encodeURIComponent; a literal + must be %2B) |
lang | gql: q is a plain GQL query and opens in a GQL tab (absent: a Rhai script) |
params | with lang=gql: the GQL tab's Parameters field, a JSON map, percent-encoded (optional) |
title | the name of the query tab (optional) |
run | 1 runs the query once it is in the editor |
The parameters are in the fragment (after #), so the browser never sends them to a server: a
graph in a link goes only where you paste the link. The query goes into a new tab when the current
one holds your own text. When a graph is already open in the page, the playground asks before it
replaces it; declined, the query is only put into the editor. The address then goes back to
#/play, so a reload does not apply the link again. With the dev server a link only opens the
query: the served graph is your own data, so nothing is replaced and nothing runs. Parameters the
playground does not know are ignored, so later additions keep older links working.
Share a query with its graph
The green Share link button in the top bar (also Share as link… in the Query panel's tab menu) makes such a link for the active tab: its query and the graph. A sample graph that has not changed goes into the link by its name; any other graph goes into the link itself, with its schema. Saved queries and compression rules are not included. Copy the link into a bug report or a message; whoever opens it gets the same graph and query in their own browser.
The playground over the dev server has no Share button: its graph lives on the server, and a link to the public playground could not carry it.
Only small graphs fit into a link. A link is at most 60,000 characters, so that it fits into the text of an issue: roughly a graph of a thousand elements, fewer with long property values. For a bug report, reduce the graph to the few vertices and edges that reproduce the problem and leave out everything else; a minimal graph is also the fastest to understand. For a larger graph, save it with Save ▸ Data (GraphSON) and attach the file instead.
The book uses these links: every example that runs on a sample graph has a ▶ run button next to each of its queries (or a Run in the playground link under a block with one query).
UI profiles
EXPERIMENTAL. UI profiles and the profile API may change in any release, like the dev server's hosting core.
One playground code base serves several pages: a UI profile says what the page shows. The
playground as described on this page is the built-in profile full, and it is what you get
unless something asks for another one. A profile names:
| Key | Meaning |
|---|---|
name | lowercase letters, digits and - |
title | the page title and the top bar's name |
version | optional: the version of the product the profile belongs to ("0.1.0"); the top bar shows it (v0.1.0) beside the name instead of the engine's version, which moves into its tooltip |
tabs | the tabs: {"id", "title", "builtin": "workspace"} (the workspace of this page, at most once) or {"id", "title", "module": "<path>.js"} (a tab of the profile's own); with more than one tab the page shows a tab row under the top bar |
startTab | the tab the page opens on |
header | optional: {"module": "<path>.js"}, a module of the profile shown in the top bar on every tab; see "The top-bar module" below |
can | what the user can reach: true, false, "wasm" (only in the browser playground) or "server" (only with the dev server) per key; a key left out is false |
cards | card templates per label for the profile's tabs (may be empty; see Cards) |
graph | styles of the profile's graph views per label, classes and legend entries (may be empty; see Graph views) |
styles | optional (EXPERIMENTAL): ["<path>.css", ...], one to eight style sheets of the profile, relative paths below files like the modules; the page links each one once it has the profile, so a host need not change index.html |
files | where the module files are: "" (next to the page) or a path ending in / on the same origin |
The can keys: the top bar's devBadge, mcp, share, view, catalog, optimize, store,
save, saveToFile, changeGraph, settings, theme, help, layerDiff (a layer's badge
and Layer changes dialog, Start / Drop layer in the browser); the panels panel.editor,
panel.results, panel.graph, panel.schema, panel.profile; the Query panel's examples
and its tab kinds tab.query, tab.gql, tab.ai. What the engine cannot do stays off whatever
the profile says (the Store menu needs a store, the MCP badge an MCP endpoint, Save to file a
graph file on the server). full sets every key; Share, Examples and Change graph only in the
browser playground, the DEV SERVER badge, the MCP badge and Save to file only with the dev
server: exactly the page as it was before profiles.
Choosing a profile. The browser playground takes a built-in profile from its address:
#/play?profile=demo (the parameter stays in the address, so a reload keeps it; a link that
names no profile opens full). The dev server takes it from graphersal --server --ui-profile NAME|FILE (a built-in name or a JSON file with a profile object) and tells the page through
GET /api/info (uiProfile); a host built on the server's core sets it with
ContextBuilder::ui_profile. A host that is not the dev server can deliver a profile too
(EXPERIMENTAL): the page talks to any Graphersal host, recognized by "protocol": "graphersal/1"
in its GET /api/info (every host built on the server's core answers it); server only names
the host (ContextBuilder::server_name, for example "graphersal-server"), and an answer
without protocol (a static file server, an older host) leaves the page in the browser
playground. The DEV SERVER badge shows only when the host says it is a development server
("dev": true, ContextBuilder::dev; the dev server does). A profile name the page does not know, or an object that breaks a
rule above, is shown as an error naming every problem, never replaced by another profile. The
built-in demo profile is a small example: a tab of its own that lists the people of the modern
graph through a saved query as cards (it shows the script that defines the query when the graph
has none), a Graph tab that draws them as a graph view, and the workspace without the catalog,
the optimizer, the store and the examples.
A profile's own tabs. A module tab is an ES module (files + module, loaded when the tab
is first shown) whose default export is a Vue component. It gets two props: params, the tab's
parameters from the address (#/play?tab=<id>&key=value), and api, the profile API:
| Member | What it does |
|---|---|
query(name, params) | calls the saved query name with named arguments through the page's engine (the dev server's POST /api/query, the browser engine's worker), under the engine's rules (read-only mode, access policy); the caller passes every parameter; resolves to its results, rejects with {message, help} |
markdown(text) | the text through the playground's safe Markdown renderer (never HTML) |
card(label, row, options) | a card of row by the profile's card template for label (see Cards) |
graph(data, options) | a graph view of {nodes, edges}, styled by the profile's graph key (see Graph views) |
mergeGraph(base, addition) | the union of two graph datas without duplicates, with the ids it added |
toast(kind, text) | a notification: info, success, warn or error |
navigate(tab, params) | shows another tab of the profile (and puts it into the address) |
theme | mode, dark and token(name), the value of a colour token such as accent |
info | the profile's name and title, whether the engine is the dev server, its version and read-only flag; info.host (EXPERIMENTAL) is the server's GET /api/info answer as the host sent it, with fields of the host's own (for example an upload limit), null in the browser playground |
A module that cannot be loaded, has no default export or fails while rendering shows an error card in its tab; the other tabs keep working.
A host's home page. A server that serves the playground for several graphs, each under its
own prefix such as /db/<name>/ (GET /api/info mountPath), shows the graph's name in the top
bar. When its GET /api/info also has home (EXPERIMENTAL), the name links there: home is a
path from the server root that starts with / ("/" is the root itself, "/admin/" a page
below it). The page turns it into a link relative to itself, climbing one level per segment of
mountPath, so home: "/" under /db/acme/ links to ../../, and a proxy that puts the whole
server under a prefix of its own keeps working. A home that does not start with a single /,
or has ./.. segments, a query or a fragment, gives no link. The home page itself is
usually the host's own UI profile.
The top-bar module. A choice that affects every tab (a project filter, a status text)
belongs in the top bar, not inside each tab: the profile key header: {"module": "<path>.js"}
names a module (loaded from files like a tab's) whose default export the page renders in the
top bar, right of the free space and left of the bar's buttons, on every tab. It gets the same
api prop as a module tab and no params. Keep it small: the bar lets it shrink and never
grows wider than the window, so hide parts of it on narrow screens with media queries of its own
(or the playground's hide-narrow class, hidden below 760 px). A header module that cannot be
loaded or fails shows a small "Header module failed" marker in the bar (its tooltip names the
module and the error); the tabs keep working. The demo profile has one: the engine's kind and
a button that opens its Graph tab. The profile's files are served like the rest of
the page: with the dev server, put them into the --ui-dir directory (an overlay over the
embedded playground). The details of the API are in the playground's js/profile-api.js.
Cards
api.card(label, row, options) shows one row of a saved query (an element, a map such as
value_map() returns, or a single value) by the profile's card template for label. A label
without a template gets a plain card: the label and every field of the row. The full profile
defines no cards; the demo profile's Hello tab shows the people of the modern graph as cards.
A template says which fields go where; every key is optional and an unknown key is an error:
| Key | What it shows |
|---|---|
title | the heading: a field (or a list of fields, the first present wins); without one, the label |
subtitle | one muted line of parts joined with · |
badges | small pills after the title; a badge shows when its field (or its when) is present and true |
body | a field holding Markdown: rendered by the playground's safe renderer in the full card (never HTML), a one-line plain-text excerpt in the compact card |
excerpt | the characters of that excerpt (default 160, 0: none) |
fields | a key/value list in the full card; long values collapse like everywhere else (setting Collapse values above); left out, every field the other parts do not show; [], none |
actions | default buttons {id, text, kind, when, unless, title} (kind default, primary or danger) |
A field is a dot-separated path (name, author.name, tags.0); on an element it is looked
up in the properties first, then on the element (id, label). A one-item list, as
value_map() returns every property, is shown as its item. A part is a field or an object
{field, title, text, prefix, format, tone, when, unless}: title names the field in fields,
text replaces the value by a fixed text, prefix comes before the value, format is text
(the default; lists joined with commas), date, datetime (an ISO text or milliseconds since
1970, shown in UTC), count (a list's length) or markdown (fields only), tone colours a
badge (neutral, accent, ok, warn, danger, or a map from the value to a tone), and
when/unless show the part only when another field is (or is not) present and true. A field
that is absent, null, empty text or an empty list renders nothing.
"cards": {
"memory": {
"title": ["title", "slug"],
"subtitle": ["kind", "scope", "source", {"field": "updated", "format": "date"}],
"badges": [
{"field": "pinned", "text": "pinned", "tone": "accent"},
{"field": "superseded_by", "text": "replaced", "tone": "warn"},
{"field": "conflicts", "text": "conflict", "tone": "danger"}
],
"body": "body",
"fields": [{"field": "why", "title": "Why", "format": "markdown"}, {"field": "links", "title": "Links"}],
"actions": [
{"id": "pin", "text": "Pin", "unless": "pinned"},
{"id": "forget", "text": "Forget", "kind": "danger", "unless": "imported_at"}
]
}
}
The module chooses how a card is shown with options (all optional):
| Option | Meaning |
|---|---|
variant | "full" (the default: body and fields) or "compact" (a list row: title, subtitle, badges, excerpt) |
selected | true marks the card as the current one |
onOpen(row) | the title becomes a button and a click on the card calls it (to open the full card of a list row) |
actions | the buttons, in place of the template's |
onAction(id, row) | called when a button is clicked; without it the card shows no buttons. While the promise it returns is pending, the card's buttons are disabled; a failure shows as an error notification |
Actions are the module's: the template only names the buttons, and the module decides what a click does (call a saved query, navigate, show a notification). Cards take their colours from the page's theme, so they follow light and dark mode, and they wrap on a narrow screen.
Graph views
api.graph(data, options) draws a graph that the module builds, typically from saved queries,
with the same drawing code as the Graph panel: Cytoscape for ordinary
sizes, the Fast tier (WebGL) for large views. The data is
{
"nodes": [{"id": "a", "label": "memory", "caption": "Graph first", "data": {"kind": "feedback"}, "classes": ["pinned"]}],
"edges": [{"id": "e1", "source": "a", "target": "b", "label": "supersedes", "data": {}}]
}
id is a text or a number (unique per kind), label chooses the style and the card template,
caption is the text under the node (else the style's caption field of data, else the label),
data holds the element's fields (what its card shows), classes names style classes. Every
edge's source and target must be nodes of the data. Data that breaks a rule is not drawn: the
view shows every problem instead (nodes[1].id "a" is used twice, edges[0].target "zz" is not a node of the data, ...).
The profile's graph key styles the views per label ("*" applies to every label; the label's
own entry on top of it):
"graph": {
"nodes": {
"memory": {"color": "--accent", "shape": "ellipse", "size": 24, "caption": "slug"},
"session": {"shape": "round-rectangle", "color": "#8a93a3"}
},
"edges": {
"supersedes": {"arrow": true, "width": 2},
"conflicts_with": {"color": "--danger", "arrow": false},
"relates_to": {"color": "--text-faint", "width": 0.8}
},
"classes": {"pinned": {"border": {"width": 4}}},
"legend": [{"text": "loaded at every session start", "node": {"border": {"width": 4}}}]
}
| Key | Values |
|---|---|
color | #rgb, #rrggbb or a colour token of the page (--accent, --danger, ...: follows light and dark mode); a node without one takes its label's colour from the Graph panel's palette |
shape (node) | ellipse, round-rectangle, rectangle, diamond, triangle, hexagon, star |
size (node) | 6 to 96 pixels (default 24) |
border (node) | {width: 0..12, color, style} |
style (edge), border.style | solid, dashed, dotted |
arrow (edge) | true (default) or false |
width (edge) | 0.5 to 12 pixels (default 1.6) |
opacity | 0.05 to 1 |
caption | a field path of data (as in Cards) |
A class carries the same keys (node and edge keys together). Three are built in: faded
(opacity 0.3), bold (a thick border, a wide edge) and dashed; a profile class of the same
name replaces one, and an unknown name changes nothing. The module can also style each element
itself with styleOf(element, kind), which returns {classes, ...keys} or null. Later wins:
the defaults, "*", the label's entry, the element's classes, the classes styleOf returns,
then the keys styleOf returns. The legend under the drawing lists the labels drawn (the key
legendLabels: true by default, "nodes" or "edges" for only those, false for none: a
profile that colours by classes lists its own entries), then the profile's legend entries,
then the module's.
| Option | Meaning |
|---|---|
styleOf(element, kind) | per-element style (above) |
onSelect(selection) | a click chose {kind, id, label, data, element}, or empty space (null) |
onExpand(node) | a double click on a node, or the side card's Expand button: the module reads the node's neighbours and merges them in with api.mergeGraph |
selected | {kind, id} or null: the selection set from outside (for example a tab parameter) |
card | true or {actions, onAction(id, selection), expand}: a side card of the selected element through api.card(label, element.data, ...); expand names the Expand button (false: none; a function (selection) => text or false decides per node) |
legend | true (default), false, or extra entries [{text, node}] / [{text, edge}] |
layout | cose (default), circle, concentric, breadthfirst or grid |
height | the drawing's CSS height (default 520px) |
highlight | what a selection highlights: neighbours (default: the element with its neighbours), element, none |
emptyText | the text of a view without nodes |
A click selects (the rest fades), a double click on empty space or Fit fits the drawing, Esc
clears the selection; the toolbar zooms, picks the layout and lays the drawing out again. When
the module replaces the data (an expansion merged in, new styles), the nodes it had keep their
positions and the new ones appear next to their neighbours, without a new layout. The view itself
never writes: a module changes the graph through query from its card's buttons. The Fast tier
draws every node as a circle and every line solid. On a server in allow-list mode the engine's
force layout is not available: the browser's force layout runs up to 1,500 nodes, a larger view
is drawn as a grid.
Allow-list mode
A host built on the dev server's core can serve such a profile in allow-list mode (GET /api/info apiMode: "allow-list"): the server answers only the saved queries the host selected,
so only a profile whose tabs are all modules can be shown there (a profile with the workspace is
an error naming the reason). See the HTTP API.
Request headers of a host
EXPERIMENTAL, like UI profiles.
A host whose server wants more on every request than the playground sends (for example a token,
Authorization: Bearer <token>) tells the playground before it starts: a classic script that
runs before the playground's modules sets
<script>
window.GRAPHERSAL_ENGINE = { headers: { Authorization: 'Bearer ' + token } };
</script>
The page reads it once, when it finds the server, and every request it sends to the server's
/api/ carries these headers (the API calls of the workspace and of the profile API alike; the
page's own Accept, Content-Type and X-Graphersal-Client cannot be replaced). A header with an
invalid name or a value that is not a single line of text is left out with a warning in the
browser console that names the header, never its value. The values never go into an address or
a log. A plain link cannot carry a header, so with host headers the Store menu shows no download
links of stored snapshots (Download current state still works). Without the setting the page
sends exactly what it always sent. Requests a profile's modules send themselves, to endpoints of
the host's own, add the header themselves.
Login of a host
EXPERIMENTAL, like UI profiles.
A host that requires a login (for example a multi-database server serving the playground under
/db/<name>/) answers an API request of a visitor who is not logged in with 401 and names its
login page in the JSON body:
{ "error": "log in to open this database", "login": "/" }
The page then goes to that login page with the way back: login plus ?next= and the page's
path and query (/?next=%2Fdb%2Facme%2F; &next= when login has a query of its own), so the
login page can return there afterwards. This happens when the page starts (instead of falling back
to the WebAssembly playground) and on every later request. Only a path of the page's own origin
counts: it starts with / but not // and has no backslash, space or control character; any
other login (another site, a relative path) is ignored and the error shows as usual. The page
never redirects to the page it is on (no loop). A 401 without login (for example a host's own token
check) is an error as before, and the dev server and the
WebAssembly playground never send one.
The graph drawing
What the panel shows
Drawing "the first 1000 vertices" of a large graph shows an arbitrary slice of it. The Graph panel's tabs choose a meaningful part instead:
- Whole graph: the graph itself when it has at most the vertex and edge limits of the settings (10 000 vertices and 20 000 edges by default). A larger graph shows its labels (below) with a note saying how large it is; Draw the first N vertices anyway draws that slice (said to be one), Double the limits raises them.
- Labels: the label overview. Each vertex label is a node sized by its number of vertices,
each edge is a label pair (
person –created→ software) with its number of edges. The 40 largest labels are drawn, the others form one "other labels" node; the 200 largest pairs are drawn and the note counts the rest. The counts come from the graph's statistics and one pass over the edges, so they are exact (for graphs with more than five million edges, the pairs are counted over the first five million and the note says so). Double-click a label to draw a sample of its vertices with the edges between them, double-click an edge for a sample of that label pair. A sample is the first matching elements in storage order (at most 1000 vertices), not a random choice, and its note says how many of how many it shows. - Neighbourhood: a vertex and its neighbours, fetched from the engine. Type a vertex id (or click Neighbourhood in a vertex's properties, or the ⌖ button of a vertex row in the Results table) and choose the Depth (1 = the direct neighbours, 2 = their neighbours too, up to 5) and the direction: both, out → (the vertices it points to) or ← in (the vertices pointing to it); changing either redraws from the same vertex. Double-click a vertex to expand it by one hop (along the chosen direction): its neighbours are added, everything already drawn stays where it is and the new vertices are placed around it. The note says how many edges still lead out of the drawing, and when the limits (Settings) cut the neighbourhood, how many vertices and edges within that depth were left out.
- Query result: the vertices, edges and paths the last query returned, with the edges between them. At most 50 000 vertices + edges by default (Result graph in the settings, up to 200 000; the result's data itself is never cut); the note says when a result has more. Double-click a vertex of the result to expand it by one hop from the engine, like in a neighbourhood: the drawing continues as a neighbourhood ("the query result, expanded"), the result's vertices stay in place, and further double clicks keep expanding. A result with more vertices than the drawing limit is not expanded (the note says so; open a vertex's neighbourhood instead).
Result highlight. In the Whole graph tab the elements the active tab's last query result
refers to are highlighted and everything else is faded (Highlight result in the toolbar's ⚙
Display menu turns this off for good). ✕ Clear highlight in the toolbar, shown while a highlight is active, or
Esc on the drawing (click it first) shows the graph normally again; Esc also clears a
double-click selection. Clearing applies to that result only: the next query result highlights
again, and switching to another query tab shows that tab's result highlighted, while the tab you
cleared stays cleared. Both tiers behave the same.
Vertex details. Clicking a vertex shows its id and label, then edges: in 3 · out 5: the number
of incoming and outgoing edges of the vertex in the whole graph, also when its neighbours are not
in the drawing (the engine counts them from the graph, not from the visible subgraph).
Long values. In an element's details (click a vertex or an edge) and in the Results table, a
text longer than 200 characters or with more than 3 lines is cut to its start and "…", and a
vector (a list of 16 or more numbers) shows as vector[384] [0.12, -0.03, 0.5, 1, …]. expand
shows the full value, collapse the short form again; the copy button next to it in the
element's details copies the full value. Collapse values above in the Settings sets the
number of characters (20 to 100 000), 0 shows every value in full. A vector in the Results table
keeps its own disclosure (vector[768 f32], the JSON tab has every value).
Vertex size. Vertex size in the toolbar's ⚙ Display menu sizes each vertex by its number of edges in the whole graph: Degree (incoming + outgoing), In or Out; Off (the default) draws every vertex the same size. The size grows with the logarithm of the degree, relative to the largest degree among the drawn vertices, so a few hubs do not shrink everything else to dots. The choice is kept in the browser; while it is Off the engine counts no degrees. A query result run before the option was switched on is sized by its edges within the drawing until it runs again.
Filtering the drawing
⚲ Filter in the Graph panel's toolbar opens a popover under the button, at the left of the
drawing, that decides what is drawn; it stays open while you click the drawing, does not cover
the details of the selected element on the right, and Esc closes it. It lists the graph's vertex
and edge labels with their counts; a dot before each vertex label shows its colour in the drawing
(a ring while the label is hidden, a dashed outline while the label has not been drawn yet).
Uncheck a label to hide it (all / none check or uncheck every label of that side).
+ condition under a label adds a condition on one of its properties, such as age > 30 or name contains "an"; several
conditions of one label must all hold, and an element is drawn when its label is checked and its
conditions hold. Every label you do not touch stays visible, including labels the drawer does not
list (on a graph with very many labels it lists only the largest ones). A vertex with several
labels is drawn when none of its labels is unchecked and the conditions of each of its labels
hold. A hidden vertex hides its edges; Hide vertices without visible edges hides vertices
left alone as well.
- The operators depend on the property's type, which comes from the schema (the stored one, or
the schema inferred from the data when the drawer opens): numbers and dates offer
=,≠,<,≤,>,≥and between (from inclusive, to exclusive), text offers=,≠, contains, starts with, ends with and regex, and every key offers exists and missing. A number key sends a number; every other value is sent as text and, when the schema declares the key's type, converted like a write (2024-01-01compares as a date). The value text never decides a type. - Changes apply 300 ms after the last edit. On a graph with more than 100 000 vertices and edges the drawer says Large graph: Apply to use and changes apply with Apply.
- A condition the engine refuses (a bad regular expression, a value the schema cannot convert) is marked in red at that condition; the drawing keeps showing the last filter that worked.
- While a filter is on, a strip above the drawing says what passes, for example
Filtered: 3 of 6 vertices, 1 of 6 edges(for a neighbourhood: of the vertices and edges it holds without the filter). Clear there, and the switch next to the Filter button or in the popover's header, turn the filter off without deleting it (the button then shows· off); the same switch turns it on again. Reset in the drawer deletes it. - Open as query opens a new query tab with the query that selects what the filter shows.
- The filter applies to the Whole graph (the engine filters first and then draws up to the limits, so a filter makes a large graph drawable) and to the Neighbourhood. A Query result and a label sample carry no properties, so they are filtered by label only, and the Labels overview draws hidden labels faded. A neighbourhood keeps every vertex you expanded into when the filter changes: vertices it hid come back when they pass the new filter, and the count of edges leading out of the drawing counts only edges to vertices the filter shows.
- The filter, including whether it is on, is kept per graph in the browser.
- A graph with very many labels lists the largest ones (the drawer says so); while a label is hidden or has a condition, the labels not listed are hidden too.
Editing properties
Click a vertex or an edge for its properties, then the pencil next to the close button: a
dialog edits them. Each property is one line with its name, its type (string, int64,
float64, boolean, uuid, array, object, null), its value and its buttons, in columns
aligned across the rows (in a narrow window a property takes two lines); a changed or invalid
property is marked at its left edge. The last line adds a property: name, type and value, then
+ Add or Enter. Remove (with undo) and rename properties. Arrays and objects are edited as a
tree below their line (expand, collapse, add and remove items and keys); the { } button edits
any value as JSON, Edit as JSON (next to Save) the whole element. A string always stays a
string, whatever it looks like, until you pick another type. Long or multi-line strings, and every
string a compression rule covers, get a large text box below their
line (⤢ opens one for any string).
When the graph has a schema, the dialog follows it: the properties of the
element's label(s) are listed (also the ones not set yet), required ones are marked with *, the
type, bounds and description are shown under each line, and an enum is a menu. Every change is
checked by the engine before you save; its errors appear next to their fields and Save stays
disabled until they are fixed. Saving writes all changes as one commit: if the engine still refuses
(for example the schema changed meanwhile), nothing is applied and the dialog stays open with the
error. Ids and labels are shown but not edited. The pencil is disabled, with the reason as its
tooltip, while a query runs and when the graph cannot be written: a read-only view of a past state
(Store menu), a backup, or a store in maintenance mode.
Edit mode
The ✎ Edit switch in the Graph panel's toolbar (in the ⚙ Display menu when the panel is narrow) turns the mouse into an editor of the graph:
- Add a vertex: double-click empty space. A dialog asks for the label (a menu of the labels the
schema declares and the graph already has; any label can be typed unless the schema is
closed), an optional id (empty: automatic) and the properties, laid out by the label's schema (required ones are already there,*). The vertex appears where you double-clicked. - Add an edge: drag from one vertex to another (a dashed line follows the pointer; back onto
the start vertex after leaving it makes a loop). The label menu offers the schema's edge labels
whose
connectionsallow the two vertices (*matches any label, any label of a multi-label vertex counts), then the graph's other edge labels; with aclosedschema only the allowed ones. - Delete: select a vertex or an edge (click it) and press Delete, or use the bin in its card. A confirmation says how many edges go with a vertex.
- Edit properties: double-click an element (or use the pencil), as above.
Every draft is checked by the engine with a dry run, its errors shown at their fields; each change is one commit. The drawing changes in place: the other vertices keep their positions and no layout runs. In edit mode vertices cannot be dragged around (a drag draws an edge). The Fast tier edits and deletes but adds nothing with the mouse (switch to Detailed to add). Edit mode is off, with the reason as its tooltip, in the Labels overview and when the graph cannot be written (a read-only view of a past state, a backup, a store in maintenance mode or frozen by damage).
A small cloud inventory (58 vertices, 91 edges) in the three views:



Tiers
The Graph panel draws in one of two tiers:
| Detailed | Fast | |
|---|---|---|
| Engine | Cytoscape.js (Canvas 2D) | sigma.js + graphology (WebGL) |
| Chosen by Auto | below 2000 vertices + edges | from 2000 (back to Detailed below 1600) |
| Vertex labels | always (from 2000 elements only when large enough to read) | as you zoom in |
| Edge labels | yes | only on hover: hovering a vertex highlights its neighbours and labels its edges |
| Edges | curved, loops, arrows | straight, arrows, no loops |
| Layouts | Force, Circle, Concentric, Tree, Grid | Force (the engine's), Circle, Grid |
| Export | PNG | PNG |
| Pans smoothly up to | about 2000 elements | 100 000 elements (the largest measured) |
The switch Auto / Detailed / Fast in the toolbar's ⚙ Display menu (also in Settings) chooses the tier; Auto decides by size, with a margin so a drawing does not flip back and forth around the threshold. Switching keeps the drawing's positions. In the Fast tier a banner says what it lacks, and the controls it cannot honour (edge labels, the Concentric and Tree layouts) are disabled with the reason as tooltip. The schema drawing and the label overview always use the Detailed tier.
Drill down: in the Fast tier, click a vertex (or double-click it to select its neighbours, again for one hop more) and choose Open in Detailed: that neighbourhood is drawn in the Detailed tier, with every label and style; Back to the whole drawing returns.
A drawing waits for an explicit Draw it only where it can still make the page slow: Detailed forced above 5000 vertices + edges, the Fast tier above 200 000. A browser without WebGL (or where the Fast tier's scripts cannot load) draws in the Detailed tier, at most 10 000 vertices + edges, and says so. The Fast tier's scripts are loaded only the first time a drawing needs them.
The Fast tier draws the first 10 000 vertices of the generated 110k-element graph:

Saved queries
Saved queries are named, parameterized queries stored in the graph. The top bar's Catalog ▾ ▸ Saved queries manager lists them by folder (the description and the signature) with a badge each: R/O (it only reads), R/W (it changes data; the tooltip lists what, as inferred from its body), R/O ⚠ (read-only, its writing steps are denied until it is saved again) or unavailable (it cannot run; the tooltip says why), and its language, Rhai or GQL (the tooltip names the dialect). It manages them on the WebAssembly playground and on the dev server alike:
- New saved query… / ✎ opens the editor: name, folder, description, the language, the
parameter list and the body. Each parameter has a name, a type (
string,integer,number,boolean,uuid,arrayof one of these,object, or a schema written as JSON), constraints (minimum and maximum, length, pattern, allowed values), a default (empty: the parameter is required) and a description; ↑/↓ reorder and ✕ removes one. The body is what goes inside the function, in the code editor with the DSL completion; the linefn name(a, b) {above it follows the parameter list, so a parameter is added or renamed in one place. Save stores it (a rename replaces the old name in the same commit); what the engine refuses is shown next to its field (a bad name or folder, a parameter whose default breaks its schema, a body that does not compile). Moving a query to another folder is changing its folder here. Delete… asks first. - The Rhai / GQL switch picks the language. A GQL query
is the whole query text, highlighted as GQL, with no function line around it; every
$nameit reads must be a declared parameter and every parameter must be read (+ Add $parameters of the query declares the missing ones as strings). Switching ag.gql(`...`)body to GQL keeps its query; switching a GQL query to Rhai wraps it intog.gql(`...`, #{p: p}). - Save as query… in a query tab's ⋯ menu opens the editor on the tab's text. A GQL tab
becomes a GQL query with every
$nameas a parameter, typed and defaulted by its Parameters field. A Rhai tab holding exactly oneg.gql(`...`)call (as Wrap as GQL writes it) becomes a GQL query of the inner text the same way, typed by the values the tab passes in its#{..}map; any other tab becomes a Rhai query whose body is the tab's text. - The body editor completes the declared parameters: in a Rhai body their names (the function's
arguments), shown with their type above the DSL's own names; in a GQL query
$nameafter$. A parameter added, renamed or removed in the list is offered at once. - Clicking a query opens its run form, built from the parameter schemas: a number field with
its minimum and maximum, a list for allowed values, a checkbox for a boolean, UUID text that is
checked, one line per item for a list; defaults are prefilled and required fields marked with
*, the descriptions are hints. Run writes the call, for exampleg.query("older_than", #{age: 29, label: "person"}), into a query tab and runs it there: it is visible, editable and in the history like any other query. The form remembers the last values per query (in the browser). An empty field takes the parameter's default. - In the editor,
g.query("completes the names of the saved queries, grouped by folder. - Saved queries travel in the catalog file, like the schema: Catalog ▾ ▸ Save catalog
(.json) (
graphersal-catalog-YYYYMMDD-HHMMSS.json, also Save catalog on the start page) holds the whole catalog, saved queries, compression rules and property indexes; Catalog ▾ ▸ Load catalog… (or Load catalog on the start page) adds the file's definitions to the current graph (one of the same kind and name is replaced; a compression rule compresses its values at once). A graph loaded from a GraphSON or GraphML file afterwards keeps them; a sample graph starts without any, a snapshot (.gsnap) brings its own. Stop keeps the catalog the page loaded or edited (like the schema); definitions a script made since the last load or save are gone with the rest of the run's changes.
The Catalog
The top bar's Catalog ▾ lists what the graph stores besides its data and schema, each kind with its count, and opens its manager:
- Saved queries: the queries by folder with Run…, Edit…, Delete and New saved query… (the editor and run form described above).
- Compression: the compression rules with their stats (compressed values, plain and stored size, ratio, saving, dictionary size), Edit…, Recompress and Drop, and New rule…: a form with name, element (vertex or edge), label (the graph's labels are suggested), path, minimum size and dictionary; the engine's errors show next to their field. Saving re-encodes the label's values at once.
- Property indexes: the property indexes with their stats (entries,
distinct values, elements per value, memory; not served on a storage that keeps the
definition but serves no index) and Drop (after a confirmation), and New index…: a form
with element (vertex or edge), label (the graph's labels are suggested), key and an optional
name (the default
<label>_<key>is shown as you type); the engine's errors show next to their field. Creating builds the index from the data at once.
The same dropdown holds Save catalog (.json) and Load catalog…. The Statistics tab of the Profile panel shows the compressed strings and the dictionaries, and the property indexes' memory, in its memory part when there are any.
A catalog change is a commit: in the store in memory it is part of the history, and on the dev server another browser tab or an AI agent sees it through the change feed.
System journal
Catalog ▾ ▸ System journal… (in the section Kept by this instance: the journal is not part of the catalog and no catalog file carries it) shows the system journal of the served graph: what the instance did, such as the store opened or closed, checkpoints, backups, damage found and permissions denied. The newest record is at the top; each row shows the time in the browser's time zone (the exact UTC time with microseconds in its tooltip), the level, the source, the kind, the message with its fields, and the record's sequence number.
- Level shows that level and the more severe ones (
error>warn>notice>info); Source shows a source and the ones below it (storeshowsstore.backuptoo; the sources seen so far are suggested). - It opens on the newest 300 records: a long journal on disk is read from its end, never from its start.
- While the dialog is open it shows the records written since its last read as they come (every five seconds on the dev server, every two in the WebAssembly playground; switch it off with follow new records, or press Refresh); it never reads the whole journal again. It keeps the newest 2000 records it follows.
- Show more shows 300 more rows, reading the next older page from the journal when all held rows are shown; the line under the table says how many loaded rows are not shown and whether older records exist.
Notifications. A new journal record also pops up as a small notification in the top-right
corner, without blocking anything: red for error, amber for warn, blue for notice, grey for
info. warn and error stay until you close them; the others close after 30 seconds, and
not while the pointer is on them. The close button (×) shows when the pointer is on a
notification or it has keyboard focus (always on touch screens). At most three are shown; more
become one +N more journal records notification, and repeats of the same kind and message
merge into one with a counter (×3). A click opens the System journal at that record,
highlighted. Only records written while the page is open pop up, never older ones. Settings ▸
Notifications ▸ Journal records sets the least severe level shown: notice and above (the
default), warn and above, error only or Off; it is kept in the browser with the other
settings. The playground reads the journal for them every five seconds on the dev server and
every two in the WebAssembly playground, only while the page is visible; the open System journal
dialog shares these reads.
In the WebAssembly playground the journal is the one of the graph's store in
memory, gone with a page reload like the store. On the dev server it is
the served graph's (GET /api/journal): the store's journal on disk for a --graph <store>,
else the graph's journal in memory.
The store in memory
Every graph you load is kept as a Store in memory: every run that changes the graph is a commit,
and the Store menu in the top bar checkpoints, marks, opens past states read-only, forks and
rolls back. Everything in memory is lost on page reload: download a .gsnap to keep a state.
The details are on the page The Store in the Playground.
Store ▸ Start a layer over this graph freezes the loaded graph as the base of a layer: writes go to the layer, a top-bar badge shows the changes, and the drawing outlines added and modified elements. See Layered graphs: In the playground.
The schema editor
The Schema panel's Tables tab shows the schema (the stored one, or, without one, the schema
inferred from the data; the badge says which) as nested tables on one page: a table per vertex and
edge label, one row per property with its type, required, nullable and a compact constraint
column (0..150, length 1..80, ^\d{5}$, <= 10, one of a, b). A nested object is a table
inside its row; arrays show as array of T (an array of objects gets the item table); objects
deeper than the first level start collapsed as object {n fields}. The format is described in
Schemas.
Everything is edited in place, and every edit changes a draft, never the stored schema:
- the type (a dropdown;
uuidisstring+format: "uuid",anyis{}; a union of several kinds is edited in the JSON tab), required, nullable, the property name, a+ propertyrow in every table, and a detail form per property (open it from the constraint column) with the constraints of its type,enum,const,additionalPropertiesfor objects, and the annotationstitle,description,default,examples,$comment,deprecated; - labels: add, rename (a renamed vertex label is renamed in the edge connections too), remove; the
connections of an edge label with from/to dropdowns (
*is any label; no connection allows every pair);additionalPropertiesper label; - the
mode(toolbar) andmeta(free JSON); - the JSON tab is the same draft as text, synchronised both ways: text that parses becomes the draft, invalid JSON is shown inline while the tables keep the last valid state;
- Infer from data starts a draft from
infer_schema(); Load… reads aschema.jsoninto the draft; Download saves what the editor shows asschema.json; - Freeze as open / Freeze as closed (offered while the graph stores no enforcing schema and
no draft is being edited) store the inferred schema with that mode in one step,
set_schema(infer_schema(), mode): see Freeze the structure you have. It always applies, exceptclosedwith vertices or edges without a label: then nothing changes and the report is shown.
A property's default is stored when a vertex or edge is created without it (see
Defaults on create), never filled into existing
elements; the editor's backfill script uses it as the value it writes into those.
With a draft, the toolbar offers the review and the apply:
- What changes lists the changes from the stored schema (
diff_schema), each marked backward compatible or not (compatible: it only adds or relaxes, so data and clients written against the old schema keep working; adding an optional property is compatible, removing one is not; see the rule set). Existing data that conflicts is what the next step finds. - Check against data validates the existing data against the draft (
validate_schema_patch; nothing changes) and lists the violations grouped by rule. A click on a group opens a new query tab that runs a query showing the offending elements (g.V().hasLabel("person").not(__.has("email"))for a missing required key, the sample ids for a constraint violation). - Apply stores the draft with
patch_schema(a JSON Merge Patch computed from the stored schema; one unit, all or nothing). It checks first and is blocked while the data violates the draft. To make a key required on existing data, Open a backfill script writes the recipe as one run: the draft with modenone, aproperty(key, value)for every element that lacks the key (the draft'sdefault, or a placeholder to edit), then the draft itself; a playground run is one unit, so nothing is kept unless all of it succeeds.
Discard drops the draft. A draft that sets a member to null ("default": null) cannot be a
merge patch; Apply then uses set_schema with the whole draft. The editor talks to the engine only
through the seven schema methods, the same as in Rust, the DSL and Python. The Graph and Mermaid
tabs draw the stored (or inferred) schema, not the draft.
When the panel infers. Inferring a schema reads the whole graph, so the panel does it only when it is first shown (expanded) and when you press its refresh button, never after every change of the graph. A stored schema is read again after every change (a schema set or changed by a query shows at once). Without one, a change (a query that writes, the property editor, a change made in another tab or by an AI agent) keeps the schema inferred last on screen and adds the badge may be outdated - refresh next to the refresh button; press refresh to infer it again. The same badge appears when the stored schema is dropped. Loading another graph, opening a read-only view of the Store, going back to the live graph, rolling back or switching databases replaces the graph: the panel infers once for it, right away if it is shown, else when you open it. The WebAssembly playground and the dev server behave the same.
If the playground freezes
Open the playground's address with /reset added (for example http://localhost:8000/reset/).
That page loads nothing of the playground itself: it removes the playground's saved state from the
browser (settings, panel layout, theme, query tabs, view choices; the query history is kept) and
then opens the playground with the Modern sample graph. Use it when a saved state makes the page
hang again after every reload, for example a huge drawing that is restored on start.