Skip to content

Interactive Script Mode

What Is Interactive Script Mode?

--interactive-script <path> runs the real, full SocNetV application — the same event loop, graph engine, and canvas you use interactively — driven by a plain-text script instead of manual clicking.

It is useful for:

  • Scripted demos — reproduce a specific sequence of actions exactly, every time.
  • Automated testing — exercise menu actions, dialogs, and canvas behavior that a purely headless tool can’t reach.
  • Reproducible profiling — drive a specific scenario deterministically while profiling.

This is different from socnetv-cli, SocNetV’s headless regression tool. socnetv-cli runs compute kernels with no GUI at all; interactive script mode drives the real GUI application through a scripted sequence of actions. Use socnetv-cli for pure algorithm/data checks, and interactive script mode for anything touching menus, dialogs, or the canvas.


Usage

Terminal window
socnetv --interactive-script path/to/script.txt

The script is a plain-text file, one command per line. Blank lines and #-prefixed comments are ignored. Commands run in order — each command finishes before the next one starts.

Every command prints one line to stdout on completion, of the form:

BENCH <command> [command-specific fields] N=<node count> E=<edge count> elapsed_ms=<N>

Commands

Control

CommandEffect
delay XWait X seconds before the next command.
newFile → New.
quitEnd the script and the app.

Network construction

CommandEffect
relation NSwitch to relation N.
add-relation nameAdd a new relation and switch to it.
add-nodeAdd a node at a random position.
add-edge source target [weight]Add a directed edge (default weight 1).
erdos N p directed|undirectedGenerate an Erdős–Rényi G(n,p) network.
move <node> <x> <y>Set an absolute canvas position.
save pathSave the current network as GraphML.

Filters

CommandEffect
unilateralToggle unilateral edges.
filter-egoEgo-network filter.
filter-isolatesFilter isolated nodes.
symmetrize-strongtiesSymmetrize by strong ties.
symmetrize-cocitationSymmetrize by cocitation.

Distances / matrices

CommandEffect
distances [weights] [inverse] [dropisolates] [csv]Distances Matrix report (Cohesion → Distances Matrix).
distances-bench [weights] [inverse] [dropisolates] [centralities]Same computation, no disk write — benchmarking only.

Centrality / prestige reports

Each of these mirrors its equivalent Analyze menu action:

report-centrality-degree [weights] [dropisolates] [csv]
report-centrality-degree-signed [weights] [dropisolates] [csv]
report-centrality-pn [all|out|in] [dropisolates] [csv]
report-centrality-closeness [weights] [inverse] [dropisolates] [csv]
report-centrality-closeness-ir [weights] [inverse] [dropisolates] [csv]
report-centrality-betweenness [weights] [inverse] [dropisolates] [csv]
report-centrality-stress [weights] [inverse] [dropisolates] [csv]
report-centrality-eccentricity [weights] [inverse] [dropisolates] [csv]
report-centrality-power [weights] [inverse] [dropisolates] [csv]
report-centrality-information [weights] [inverse] [csv]
report-centrality-eigenvector [weights] [inverse] [csv]
report-prestige-degree [weights] [dropisolates] [csv]
report-prestige-proximity [dropisolates] [csv]
report-prestige-pagerank [dropisolates] [csv]

Other reports

report-reciprocity [weights] [csv]
report-eccentricity [weights] [inverse] [dropisolates] [csv]
report-clustering-coefficient [csv]
report-triad-census [csv]

Canvas / bulk edit

CommandEffect
renderForce a synchronous canvas repaint.
bulk-node-size <N>Set all node sizes to N.
bulk-edge-color <name>Set all edge colors.

Example

example.txt
new
erdos 50 0.1 undirected
relation 1
report-centrality-betweenness weights csv
render
save /tmp/demo.graphml
quit
Terminal window
socnetv --interactive-script example.txt

See also

  • socnetv-cli — the headless regression/benchmarking tool, for pure compute checks with no GUI at all.