Schematex

Sociogram

About sociograms

A sociogram maps the web of choices, rejections, and alliances within a group — who likes whom, who is isolated, where cliques form. Jacob Moreno introduced the method in 1934 as a clinical tool for group therapy; it has since been adopted by classroom teachers (who use it to detect exclusion and bullying), HR teams (informal influence mapping), and organizational researchers. Unlike an ecomap, which centers on one person's external environment, a sociogram treats every member of the group symmetrically.

Schematex follows the Moreno (1934) sociometry conventions for node roles and edge types, extended with modern social network analysis notations for valence, direction, and weight. This page documents what the parser accepts today.

sociogram·§ Moreno
↘ preview
100%
Sociogram: Group Therapy — Week 6 Sociogram with 7 members and 12 connections Group Therapy — Week 6 strong bond tension Dr. Park James Maria Lee Sarah Tom Nina ROLES Star (sociometric center) TIES Positive tie Negative tie Neutral tie
UTF-8 · LF · 21 lines · 473 chars✓ parsed·4.6 ms·9.7 KB SVG

1. Your first sociogram

The smallest useful sociogram: four people, three different relationship types.

sociogram·§ Moreno
↘ preview
100%
Sociogram: Study group Sociogram with 4 members and 3 connections Study group lab partners rivalry Alice Bob Carol Dave TIES Positive tie Negative tie
UTF-8 · LF · 8 lines · 194 chars✓ parsed·0.7 ms·5.5 KB SVG

Four rules cover 80% of usage:

  1. Start with the keyword sociogram, optionally followed by a quoted title.
  2. Each person is a node — declared explicitly with id [label: "…"] or auto-created the first time they appear in an edge.
  3. Connect two nodes with an edge operator<-> (mutual), -> (one-way), -x> (rejection), -.- (neutral). See §3.
  4. Optionally declare groups and config lines to control layout and coloring.

Comments must start with # on their own line.


2. Nodes

A node line is id [attr: value, …]. Nodes are also created implicitly when first referenced in an edge — but explicit declaration lets you set labels, groups, and roles.

ID rules. Must match [a-zA-Z][a-zA-Z0-9_-]*. The ID is used internally; the label: attribute sets the display name.

Node attributes:

AttributeValuesEffect
label: "…"quoted stringDisplay name (defaults to the ID)
group: idgroup IDAssociates the node with a group for coloring
role: …star, isolate, bridge, neglectee, rejectedExplicit sociometric role annotation
size: …small, medium, largeNode size override
sociogram·§ Moreno
↘ preview
100%
Sociogram: Group roles demo Sociogram with 5 members and 5 connections Group roles demo Dr. Park James Nina Alex Sam ROLES Star (sociometric center) Isolate Neglectee TIES Positive tie
UTF-8 · LF · 12 lines · 321 chars✓ parsed·0.8 ms·7.2 KB SVG

3. Edges

An edge line is leftId OP rightId optionally followed by [label: "…", weight: N]. Both IDs are auto-registered as nodes if not yet declared.

3.1 Direction and valence

sociogram·§ Moreno
↘ preview
100%
Sociogram: Edge types Sociogram with 6 members and 6 connections Edge types chose B mutual rejects D mutual reject indifferent mutual neutral A B C D E F TIES Positive tie Negative tie Neutral tie
UTF-8 · LF · 17 lines · 351 chars✓ parsed·0.6 ms·7.4 KB SVG
OperatorDirectionValenceMeaning
A -> Bone-waypositiveA chose B
A <- Bone-waypositiveB chose A (same as B -> A)
A <-> BmutualpositiveBoth chose each other
A -- BundirectedpositiveRelationship known; direction not recorded
A -x> Bone-waynegativeA rejects B
A <x- Bone-waynegativeB rejects A
A <x-> BmutualnegativeMutual rejection
A -x- BundirectednegativeConflict; direction unknown
A -.> Bone-wayneutralA is indifferent toward B
A <.-> BmutualneutralMutual indifference
A -.- BundirectedneutralNeutral relationship

3.2 Weight / strength

Higher weight = thicker line. Use the shorthand operators or override explicitly with [weight: N].

WeightShorthandDirectionMeaning
2 (default)-> <-> -- -x> -.-anyStandard connection
3==> <== <==> ===one-way / mutual / undirectedStrong
4===> <=== <===>one-way / mutualVery strong
custom[weight: N]Any integer
sociogram·§ Moreno
↘ preview
100%
Sociogram: Relationship strengths Sociogram with 4 members and 4 connections Relationship strengths weight 2 (default) weight 3 (strong) weight 4 (very strong) weight 1 (weak) A B C D TIES Positive tie
UTF-8 · LF · 10 lines · 282 chars✓ parsed·0.4 ms·5.7 KB SVG

3.3 Edge labels

A -> B [label: "best friend"] — the label appears on the connecting line.


4. Groups

A group block collects nodes into a named subgroup for coloring and layout clustering.

Group syntax:

  • group id [label: "…", color: "#hex"] — the group header line.
  • Member lines follow, each indented at least 4 spaces, one node per line.
  • A non-indented line (or the next group) closes the current group.
  • Members can carry their own props: anna [label: "Anna K.", size: large].

Nodes can also be assigned inline: alice [group: girls].

sociogram·§ Moreno
↘ preview
100%
Sociogram: Classroom dynamics Sociogram with 8 members and 7 connections Classroom dynamics conflict cross-group Tom Jack Mike Leo Anna Beth Chloe Diana GROUPS Boys Girls TIES Positive tie Negative tie
UTF-8 · LF · 19 lines · 477 chars✓ parsed·5.2 ms·8.7 KB SVG

5. Configuration

config: lines tune layout and visual encoding. Each is its own line.

Config keyValuesDefaultEffect
layoutcircular, force-directed, concentriccircularPlacement algorithm
sizinguniform, in-degree, betweennessuniformNode size by metric
coloringdefault, group, roledefaultNode color scheme
highlightcomma list: stars, isolates, cliquesstars,isolatesWhich patterns to annotate

Layout notes:

  • circular — nodes evenly spaced on a ring. Best for small groups (≤15).
  • force-directed — spring model; clusters emerge automatically. Best for medium-sized groups with distinct subgroups.
  • concentric — inner rings hold high-in-degree nodes. Best for showing core-periphery structure.

Circular — uniform ring placement; every node equally visible. Best for small, tightly-knit groups.

sociogram·§ Moreno
↘ preview
100%
Sociogram: Therapy group — circular Sociogram with 7 members and 10 connections Therapy group — circular Dr. Park James Maria Lee Sarah Tom Nina ROLES Star (sociometric center) Neglectee TIES Positive tie Negative tie
UTF-8 · LF · 19 lines · 411 chars✓ parsed·0.7 ms·9.1 KB SVG

Force-directed — spring physics pulls connected nodes together and pushes disconnected ones apart. Subgroups cluster organically.

sociogram·§ Moreno
↘ preview
100%
Sociogram: Classroom dynamics — force-directed Sociogram with 8 members and 8 connections Classroom dynamics — force-directed conflict cross-group Tom Jack Mike Leo Anna Beth Chloe Diana GROUPS Boys Girls TIES Positive tie Negative tie
UTF-8 · LF · 20 lines · 507 chars✓ parsed·1.8 ms·8.9 KB SVG

Concentric — nodes sorted by in-degree; high-centrality nodes appear on inner rings, peripheral nodes on outer rings.

sociogram·§ Moreno
↘ preview
100%
Sociogram: Informal influence — concentric Sociogram with 7 members and 9 connections Informal influence — concentric VP Eng Lead A Lead B Alice Bob Carol Dave TIES Positive tie
UTF-8 · LF · 19 lines · 387 chars✓ parsed·0.6 ms·8.0 KB SVG

6. Sociometric roles

The parser stores role annotations on nodes. The renderer uses them to apply visual badges — a star marker for star, a dashed border for isolate, and so on.

RoleMeaning
starCentral figure chosen by many (high in-degree)
isolateNo connections in or out
neglecteeReaches out to others but receives no choices
rejectedReceives rejection edges from multiple members
bridgeConnects two otherwise separate clusters
sociogram·§ Moreno
↘ preview
100%
Sociogram: Role annotations Sociogram with 5 members and 6 connections Role annotations Maria Sam New Kid Alex Pat ROLES Star (sociometric center) Isolate Neglectee Rejected TIES Positive tie Negative tie
UTF-8 · LF · 13 lines · 384 chars✓ parsed·0.5 ms·8.1 KB SVG

7. Labels & comments

  • Title: sociogram "Study group" — first line only.
  • Node label: alice [label: "Alice K."].
  • Group label: group boys [label: "Boys"].
  • Edge label: alice -> bob [label: "lab partners"].
  • Comments: # at the start of a line (after leading whitespace).

8. Reserved words & escaping

Reserved at line start: sociogram (header), group, config:.

Reserved operator tokens — avoid these sequences inside IDs: ->, <-, <->, --, ===, ==>, <==, <===>, -x>, <x-, -x-, <x->, -.>, <.->, -.-.

Strings with spaces must be double-quoted in label: and color: values.


9. Common mistakes

You wroteParser saysFix
tom; jack; mike on one group linetom; fails the ID regex — silently ignoredOne node per line, each indented ≥4 spaces
Group members indented 2 spacesNot treated as group members (parser requires ≥4)Use 4+ spaces indent
alice <> bobNo matching operator — not parsed as an edgeUse <-> for mutual positive
config: layout = gridUnknown value silently ignored; layout stays circularUse circular, force-directed, or concentric
Node with a space in the ID: dr parkParser takes dr as the ID and park as a stray tokenUse underscore: dr_park [label: "Dr. Park"]

10. Grammar (EBNF)

document       = header (blank | comment | config | group-block | edge | node)*

header         = "sociogram" ( WS quoted-string )? NEWLINE
quoted-string  = '"' any-char-but-quote* '"'

config         = "config:" WS key WS "=" WS value NEWLINE
key            = "layout" | "sizing" | "coloring" | "highlight"

group-block    = "group" WS id ( "[" group-attrs "]" )? NEWLINE
                   ( INDENT≥4 member-line )*
member-line    = id ( "[" node-attrs "]" )? NEWLINE
group-attrs    = group-attr ("," group-attr)*
group-attr     = "label:" quoted-string | "color:" quoted-string

node           = id ( "[" node-attrs "]" )? NEWLINE
node-attrs     = node-attr ("," node-attr)*
node-attr      = "label:" quoted-string
               | "group:" id
               | "role:" role
               | "size:" ("small" | "medium" | "large")

edge           = id WS op WS id ( "[" edge-attrs "]" )? NEWLINE
edge-attrs     = edge-attr ("," edge-attr)*
edge-attr      = "label:" quoted-string | "weight:" number

op             = // positive
                 "<===>" | "===>" | "<==="
               | "<==>"|"==>"|"<=="
               | "===" | "<->" | "->" | "<-" | "--"
               // negative
               | "<x->" | "-x>" | "<x-" | "-x-"
               // neutral
               | "<.->" | "-\.>" | "-.-"

role           = "star" | "isolate" | "bridge" | "neglectee" | "rejected"
id             = [a-zA-Z] [a-zA-Z0-9_-]*
comment        = "#" any NEWLINE

Authoritative source: src/diagrams/sociogram/parser.ts. If this diverges from the parser, the parser wins — please open an issue.


11. Standard compliance

Schematex sociograms follow Moreno (1934) sociometry conventions for node roles (star, isolate, neglectee) and directed-choice semantics. The edge operator set is extended with valence (positive / negative / neutral) and weight levels following modern social network analysis practice (Hanneman & Riddle, 2005).

What is implemented today:

  • ✅ Directed, mutual, and undirected edges
  • ✅ Positive, negative, and neutral valence operators
  • ✅ Four weight levels (1–4) with shorthand operators and [weight: N]
  • ✅ Groups with color
  • ✅ Node role declarations (star, isolate, bridge, neglectee, rejected)
  • ✅ Three layouts: circular, force-directed, concentric
  • ✅ Three sizing modes: uniform, in-degree, betweenness
  • ⏳ Auto-detected clique highlighting — shaded convex hull (see §13)
  • ⏳ Social atom view (ego-centered layout)

References:

  • Moreno, J.L. (1934). Who Shall Survive? Foundations of Sociometry, Group Psychotherapy and Sociodrama. Beacon House.
  • Hanneman, R.A. & Riddle, M. (2005). Introduction to Social Network Methods. UC Riverside.

sociogram·§ Moreno 1934
Sociogram: Playground Dynamics Sociogram with 8 members and 10 connections Playground Dynamics conflict tom jack mike leo anna beth chloe diana GROUPS Boys Girls TIES Positive tie Negative tie Neutral tie
Playground dynamics
Moreno sociogram of classroom playground dynamics — mutual friendships, one-way choices, and peer conflicts mapped by gender group using force-directed layout.
education
sociogram·§ Moreno 1934
Sociogram: Engineering team — informal influence Sociogram with 10 members and 10 connections Engineering team — informal influence alex sam priya jordan kim tao lee ravi nina dev GROUPS Tech leads Senior ICs Junior TIES Positive tie Neutral tie
Engineering team influence mapping
Informal influence map of an engineering team showing tech leads, senior ICs, and junior members — reveals bridging nodes and isolated individuals.
business & operations

13. Roadmap

Planned — not yet parseable. Do not use these in generated DSL today; the parser will reject or ignore them.

  • Auto-detected clique highlighting — shaded convex hull drawn around mutual-choice subgroups of ≥3.
  • Bridge auto-detectionrole: bridge inferred from betweenness centrality without explicit declaration.
  • Social atom view — ego-centered layout where one nominated node sits at the center.
  • Reciprocity matrix export — structured table output alongside the diagram.

Track in the GitHub issues if you need any of these sooner.