Schematex

Sociogram

Social network diagrams with mutual choices, rejections, group coloring, force-directed or hierarchical layout. Auto-detects sociometric roles — stars, isolates, cliques. Based on Moreno sociometry.

sociogram·§ Moreno
↘ preview
100%
Sociogram: Playground Dynamics Sociogram with 7 members and 4 connections Playground Dynamics conflict tom jack mike leo anna beth diana
UTF-8 · LF · 10 lines · 279 chars✓ parsed·7.6 ms·5.8 KB SVG

Moreno (1934) sociometry model + modern social network analysis conventions + multi-domain application extensions. Visualization and analysis of social relationships within groups.

Primary References:

  • Moreno, J.L. (1934). Who Shall Survive? Foundations of Sociometry, Group Psychotherapy and Sociodrama. Beacon House.
  • Moreno, J.L. & Jennings, H.H. (1938). Statistics of social configurations. Sociometry, 1(3/4), 342-374.
  • Brandes, U. et al. (2011). Effects of sociogram drawing conventions and edge crossings in social network visualization. J Graph Algorithms Appl. 15(1), 157-176.
  • Hanneman, R.A. & Riddle, M. (2005). Introduction to Social Network Methods. UC Riverside.
  • FBI Law Enforcement Bulletin (2014). Social Network Analysis: A Systematic Approach for Investigating.

1. What is a Sociogram?

A sociogram is a group social relationship visualization tool developed by Jacob L. Moreno in 1934. Unlike an ecomap (individual ↔ external systems), a sociogram focuses on the relationship network between members within a group — who chose whom, who is isolated, who is central, and which people form cliques.

Key differences:

DimensionEcomapSociogram
FocusOne person/family vs. external systemsAll members within a group, among each other
LayoutRadial (center-periphery)Network graph (force-directed / circular)
Edge meaningRelationship quality (strong/weak/stressful)Social choices (choice/rejection/mutual)
Use caseClinical assessmentGroup dynamics analysis

2. Who Uses Sociograms — User Segments

2.1 Education (Largest User Group)

Teachers + school counselors are the primary user group for sociograms. Typical use cases:

ScenarioMethodPurpose
Classroom social assessmentHave each student list 2 classmates they want to work withIdentify stars (popular), isolates (excluded), cliques (subgroups)
Seating/group arrangementOptimize based on sociogram dataEnsure isolates are included, break up exclusive cliques
Bullying preventionRegular sociogram trackingDetect relationship changes, early intervention
Camp/class assignmentTeacher-student relationship mappingBalance social dynamics across groups

Key search signals: "sociogram classroom", "sociogram maker" (teacher tool intent)

2.2 Clinical / Social Work (Professional Users)

Social workers + group therapists + psychodrama therapists:

ScenarioMethodPurpose
Group therapy dynamics assessmentTherapist observation + member questionnaireIdentify alliances, conflicts, power structures
Social atomIndividual draws their most important relationshipsMoreno's core technique, warm-up for psychodrama
Family system dynamicsChoices/rejections among family membersComplements the dynamic dimension of genograms
Community assessmentMapping relationships between institutionsIdentify service gaps, resource concentration

Overlap with existing Schematex users: Social workers/therapists who use genogram + ecomap are natural sociogram users as well.

2.3 Organizational Development (Enterprise Users)

HR professionals + organizational development consultants + team leads:

ScenarioMethodPurpose
Informal influence mapping"Who do you turn to when you have a problem?"Discover informal leaders vs. formal org chart
Team buildingCross-departmental social network analysisOptimize cross-functional team composition
Information flow analysis"Who do you get work information from?"Identify information bottlenecks and silos
Post-merger cultural integrationCross-connections between two teamsAssess integration progress

2.4 Law Enforcement / Intelligence (High-Value Professional Users)

Law enforcement analysts + intelligence analysts:

ScenarioMethodPurpose
Criminal network analysisPhone records, social media, surveillance data → link analysisIdentify organizational leaders, intermediaries, periphery
Gang structure mappingArrest records, co-location recordsUnderstand gang hierarchy and territory
Suspect social circle1-2 degree relationship networkTrack fugitives, predict behavior
Counter-terrorism network analysisCommunication patterns + financial flowsIdentify cell structures

Note: Law enforcement scenarios typically use specialized tools like Palantir or i2 Analyst's Notebook, but basic sociogram visualization capability (lightweight, embeddable, Text DSL input) represents a differentiation opportunity.

2.5 Academic Research (Long-Tail Users)

Social network analysis in sociology, anthropology, and political science research. Typically uses heavy tools like Gephi, NetworkX, and Pajek. Schematex's opportunity lies in lightweight, fast visualization — paper figures, teaching demonstrations.


3. Sociogram Structure

A sociogram consists of three layers:

  1. Nodes — individual members within the group
  2. Edges — social relationships/choices between members
  3. Structural Patterns — group structures emerging from nodes + edges

4. Node Types & Symbols

4.1 Standard Node Shape

ElementShapeSVGMeaning
Default memberCircle (r=20)<circle>Individual in the group
Star (popular)Circle + star marker<circle> + <polygon> overlayCentral figure chosen by many
IsolateCircle + dashed border<circle stroke-dasharray>Chosen by no one / chooses no one
Ego (focal person)Double circle (concentric)Two <circle> elements, gap=3pxFocal person for egocentric view

Auto-detection rules (automatically labeled based on data):

  • Star: in-degree ≥ mean + 1.5 × SD, or in-degree ≥ group_size × 0.4
  • Isolate: in-degree = 0 AND out-degree = 0
  • Neglectee: in-degree = 0 but out-degree > 0
  • Rejected: rejection count ≥ 2

4.2 Node Sizing

Node size can reflect sociometric metrics:

ModeSize RuleMeaning
Uniform (default)All nodes same size (r=20)Neutral display
By in-degreer = 14 + in_degree × 4 (min: 14, max: 40)More popular = larger
By betweennessr = 14 + normalized_betweenness × 26More central bridge role = larger

DSL: config: sizing = in-degree or on a node: [size: large]

4.3 Node Coloring

ModeColor RuleMeaning
DefaultAll #42A5F5 (blue)Neutral
By group/categoryColor by group attributeDistinguish subgroups (class, department, gender, etc.)
By roleStar=gold, Isolate=gray, Normal=blueHighlight social status
By custom attributeUser-definedAny classification dimension

Default color palette for groups (up to 8 groups):

group1: #42A5F5 (blue)
group2: #66BB6A (green)
group3: #FFA726 (orange)
group4: #AB47BC (purple)
group5: #EF5350 (red)
group6: #26C6DA (cyan)
group7: #FFEE58 (yellow)
group8: #8D6E63 (brown)

4.4 Node Labels

ElementPositionFontMeaning
Name/IDBelow node center, 4px gap11px, font-family: sans-serifPrimary identifier
Role badgeTop-right corner9pxOptional: ★ star, ● isolate
DetailsBelow name9px, grayOptional: age, title, etc.

5. Edge Types (Connection Lines)

5.1 Relationship Direction

TypeLine StyleDSL SyntaxSVGMeaning
One-way choiceArrow →A -> B<line> + marker-end="url(#arrow)"A chose B
Mutual choiceDouble arrow ↔A <-> B<line> + both markersMutual choice
UndirectedPlain line —A -- B<line> without markersKnown relationship, direction unknown

5.2 Relationship Valence (Positive/Negative)

TypeLine StyleDSL SyntaxSVGMeaning
Positive/attractionSolid line-> / <-> / --<line> solid, color: #388E3C (green)Choice/like/trust
Negative/rejectionDashed red line-x> / <x-> / -x-<line> dashed, color: #D32F2F (red)Rejection/conflict/avoidance
Neutral/indifferentDotted gray line-.> / <.-> / -.-<line> dotted, color: #9E9E9E (gray)Neutral/no clear attitude

5.3 Edge Weight (Relationship Strength)

WeightLine WidthDSL SyntaxMeaning
Weak (1)1pxA -> B [weight: 1]Weak connection
Normal (2, default)2pxA -> BAverage connection
Strong (3)3.5pxA -> B [weight: 3] or A ==> BStrong connection
Very strong (4+)5pxA -> B [weight: 4] or A ===> BVery strong connection

5.4 Edge Labels

A -> B [label: "best friend"]
C -x> D [label: "bullying"]
E <-> F [label: "study partners"]

5.5 Combined DSL Examples

# One-way positive choice
alice -> bob

# Mutual strong positive
alice <==> carol

# One-way rejection
dave -x> eve

# Mutual neutral
frank <.-> grace

# Weighted with label
alice -> bob [weight: 3, label: "trusted advisor"]

6. Structural Patterns (Auto-Detected)

Schematex should auto-detect and optionally annotate the following classic sociometric structures:

6.1 Individual-Level Patterns

PatternDetection RuleVisual Annotation
Starin-degree ≥ mean + 1.5σGold fill / ★ badge
Isolatein-degree = 0 AND out-degree = 0Dashed border, gray fill
Neglecteein-degree = 0, out-degree > 0Dashed border, blue fill
Rejectedrejection count ≥ 2Red dashed border

6.2 Pair-Level Patterns

PatternDetection RuleVisual Annotation
Mutual pairA→B AND B→AThicker bidirectional line
Asymmetric pairA→B but NOT B→AStandard arrow

6.3 Group-Level Patterns

PatternDetection RuleVisual Annotation
CliqueSubgroup where all members mutually choose each other (≥3 members)Shaded convex hull background
ChainA→B→C→... (unidirectional sequence, no mutual)Sequential arrow path highlighted
BridgeNode connecting two otherwise separate clustersDiamond shape overlay or highlight ring

DSL control: config: highlight = stars, isolates, cliques (default: stars, isolates)


7. Layout Rules

7.1 Layout Algorithm Options

Sociogram supports multiple layouts suitable for different scenarios:

LayoutAlgorithmBest ForComplexity
Force-directed (default)Fruchterman-Reingold / spring modelGeneral group networks, automatic clusteringO(n² × iterations)
CircularEvenly arranged around a circleSmall groups (≤15 people), emphasizing who connects to whomO(n)
ConcentricLayered rings by in-degreeEmphasizing core-periphery structureO(n log n)
Group-basedPartitioned by group attributeCross-group relationship visualizationO(n) + force within group

7.2 Force-Directed Layout (Default)

Fruchterman-Reingold algorithm implementation:

Initialize: nodes placed randomly within canvas
Loop max_iterations times:
  Calculate repulsive force for each node pair (f_rep = k²/d)
  Calculate attractive force for each edge (f_att = d²/k)
  Update node positions (clamp to canvas bounds)
  Gradually reduce temperature (simulated annealing)
ParameterDefault ValueMeaning
k (optimal distance)sqrt(canvas_area / node_count)Ideal distance between nodes
max_iterations300Convergence steps
initial_temperaturecanvas_width / 10Initial displacement limit
cooling_rate0.95Temperature decay per step
min_distance60pxMinimum node spacing (hard constraint)

7.3 Circular Layout

Angle interval = 2π / node_count
Position of i-th node:
  x = center_x + radius × cos(i × angle_interval - π/2)
  y = center_y + radius × sin(i × angle_interval - π/2)
ParameterDefault ValueMeaning
Radiusmax(120, node_count × 20)Circle radius
Start angle-π/2 (12 o'clock)Starting position of first node

Sorting optimization: Cluster nodes of the same group into adjacent positions to reduce cross-group edge crossings.

7.4 Concentric Layout

Layered by social status:

Ring 0 (center):  Stars (highest in-degree)
Ring 1:           Above-average in-degree
Ring 2:           Average in-degree
Ring 3 (outer):   Below-average + isolates
ParameterDefault Value
Ring 0 radius0px (single star at center) or 40px (multiple)
Ring gap80px
Outer ring radiusring_count × 80px

7.5 Spacing & Canvas Rules

ParameterDefaultMeaning
Node radius20px (uniform)Default node size
Min node-to-node gap60pxAvoid overlapping
Edge-to-node gap2pxLines do not enter nodes
Canvas padding50pxEdge whitespace
Label gap below node4pxGap between label and node
Arrow marker size8pxArrow size

7.6 Responsive Sizing

Group SizeRecommended LayoutCanvas Size
≤ 8Circular400 × 400
9-20Force-directed or Circular600 × 600
21-40Force-directed800 × 800
41+Force-directed + group clustering1000 × 1000+

8. DSL Grammar (Sociogram)

document        = header config* group_def* node_def* edge_def*
header          = "sociogram" quoted_string? NEWLINE

config          = "config:" config_key "=" config_value NEWLINE
config_key      = "layout" | "sizing" | "highlight" | "coloring"
config_value    = /[a-zA-Z0-9_, -]+/

group_def       = "group" ID properties? NEWLINE
                  INDENT node_ref+ DEDENT

node_def        = ID properties? NEWLINE
properties      = "[" property ("," property)* "]"
property        = "label:" quoted_string
               | "group:" ID
               | "size:" SIZE
               | "role:" ROLE
               | kv_prop

SIZE            = "small" | "medium" | "large"
ROLE            = "star" | "isolate" | "bridge"

edge_def        = ID edge_op ID edge_props? NEWLINE
edge_op         = "->" | "<->" | "--"          (* positive *)
               | "-x>" | "<x->" | "-x-"       (* negative/rejection *)
               | "-.>" | "<.->" | "-.-"        (* neutral *)
               | "==>" | "<==>" | "==="        (* strong positive *)
               | "===>" | "<===>"              (* very strong positive *)
edge_props      = "[" edge_prop ("," edge_prop)* "]"
edge_prop       = "label:" quoted_string
               | "weight:" NUMBER

ID              = /[a-zA-Z][a-zA-Z0-9_-]*/
quoted_string   = '"' /[^"]*/ '"'
NUMBER          = /[0-9]+/
kv_prop         = IDENTIFIER ":" VALUE

9. Test Cases

Case 1: Basic Classroom Sociogram (Directed Choices)

sociogram "Mrs. Chen's 4th Grade Class"
  alice [label: "Alice"]
  bob [label: "Bob"]
  carol [label: "Carol"]
  dave [label: "Dave"]
  eve [label: "Eve"]
  frank [label: "Frank"]
  alice -> bob
  alice -> carol
  bob -> alice
  bob -> dave
  carol -> alice
  carol -> eve
  dave -> bob
  dave -> frank
  eve -> carol
  eve -> alice
  frank -> dave

Verify: alice is a star (in-degree 3), frank is a neglectee (in-degree 1, only chosen by dave). alice ↔ bob and alice ↔ carol are mutual pairs.

Case 2: With Groups and Rejection (Bullying Analysis)

sociogram "Playground Dynamics"
  config: layout = force-directed
  config: highlight = stars, isolates, cliques
  config: coloring = group

  group boys [label: "Boys", color: "#42A5F5"]
    tom
    jack
    mike
    leo

  group girls [label: "Girls", color: "#EF5350"]
    anna
    beth
    chloe
    diana

  tom <-> jack
  tom -> mike
  jack -> leo
  mike -x> leo [label: "conflict"]
  anna <-> beth
  anna <-> chloe
  beth <-> chloe
  anna -> diana
  diana -.- tom
  leo -.- anna

Verify: anna-beth-chloe form a clique (all three mutually choose each other). leo is close to an isolate (only jack chooses him unidirectionally). mike → leo is a rejection (red dashed line). diana and tom have a neutral connection.

Case 3: Organizational Influence Map

sociogram "Engineering Team Informal Influence"
  config: layout = concentric
  config: sizing = in-degree

  ceo [label: "CEO", group: leadership]
  vp [label: "VP Eng", group: leadership]
  lead1 [label: "Tech Lead A", group: team-a]
  lead2 [label: "Tech Lead B", group: team-b]
  dev1 [label: "Senior Dev", group: team-a]
  dev2 [label: "Dev", group: team-a]
  dev3 [label: "Dev", group: team-b]
  dev4 [label: "Junior Dev", group: team-b]
  ops [label: "DevOps", group: infra]

  dev1 -> lead1
  dev2 -> lead1
  dev2 -> dev1
  dev3 -> lead2
  dev4 -> dev3
  lead1 -> vp
  lead2 -> vp
  vp -> ceo
  dev1 -> ops [label: "deployment help"]
  dev3 -> ops [label: "infra questions"]
  lead1 <-> lead2 [label: "weekly sync"]
  dev4 -> dev1 [label: "mentorship"]

Verify: in concentric layout, lead1 and vp should be in the inner ring (high in-degree), dev4 in the outer ring. ops is a bridge (connecting team-a and team-b).

Case 4: Group Therapy Sociogram (Social Atom)

sociogram "Group Therapy Session 5 - Trust Network"
  config: layout = circular

  therapist [label: "Dr. Park", role: star]
  james [label: "James"]
  maria [label: "Maria"]
  lee [label: "Lee"]
  sarah [label: "Sarah"]
  tom [label: "Tom"]
  nina [label: "Nina"]

  james -> therapist
  james <-> maria [weight: 3, label: "strong bond"]
  james -> lee
  maria -> therapist
  maria -> sarah
  lee -> therapist
  lee -.- nina
  sarah <-> nina
  sarah -> therapist
  tom -> therapist
  nina -> maria

Verify: circular layout, therapist is a star. james ↔ maria is a strong mutual pair (thick line). tom is close to an isolate (only connected to therapist). lee and nina have a neutral connection.

Case 5: Criminal Network Analysis

sociogram "Operation Sunset - Communication Network"
  config: layout = force-directed
  config: sizing = betweenness

  boss [label: "Subject Alpha"]
  lt1 [label: "Lieutenant 1"]
  lt2 [label: "Lieutenant 2"]
  courier1 [label: "Courier A"]
  courier2 [label: "Courier B"]
  contact1 [label: "External Contact 1"]
  contact2 [label: "External Contact 2"]
  associate1 [label: "Associate"]
  associate2 [label: "Associate"]

  boss <-> lt1 [weight: 4]
  boss <-> lt2 [weight: 4]
  lt1 -> courier1
  lt1 -> courier2
  lt2 -> associate1
  lt2 -> associate2
  courier1 -> contact1 [label: "supplier"]
  courier2 -> contact2 [label: "distributor"]
  lt1 <-> lt2 [weight: 2]
  associate1 -.- courier1

Verify: boss and lt1 have the highest betweenness (largest nodes). courier1 is a bridge (connecting lt1 and contact1). The hierarchical structure should emerge naturally in force-directed layout.

Case 6: Large Group Stress Test (30 nodes)

sociogram "Conference Networking"
  config: layout = force-directed

  p1 [label: "Person 1", group: a]
  p2 [label: "Person 2", group: a]
  p3 [label: "Person 3", group: a]
  p4 [label: "Person 4", group: a]
  p5 [label: "Person 5", group: a]
  p6 [label: "Person 6", group: b]
  p7 [label: "Person 7", group: b]
  p8 [label: "Person 8", group: b]
  p9 [label: "Person 9", group: b]
  p10 [label: "Person 10", group: b]
  p11 [label: "Person 11", group: c]
  p12 [label: "Person 12", group: c]
  p13 [label: "Person 13", group: c]
  p14 [label: "Person 14", group: c]
  p15 [label: "Person 15", group: c]
  p16 [label: "Person 16", group: d]
  p17 [label: "Person 17", group: d]
  p18 [label: "Person 18", group: d]
  p19 [label: "Person 19", group: d]
  p20 [label: "Person 20", group: d]
  p21 [label: "Person 21"]
  p22 [label: "Person 22"]
  p23 [label: "Person 23"]
  p24 [label: "Person 24"]
  p25 [label: "Person 25"]
  p26 [label: "Person 26"]
  p27 [label: "Person 27"]
  p28 [label: "Person 28"]
  p29 [label: "Person 29"]
  p30 [label: "Person 30"]
  p1 <-> p2
  p1 <-> p3
  p2 <-> p4
  p3 <-> p5
  p4 <-> p5
  p6 <-> p7
  p6 <-> p8
  p7 <-> p9
  p8 <-> p10
  p11 <-> p12
  p11 <-> p13
  p12 <-> p14
  p13 <-> p15
  p16 <-> p17
  p16 <-> p18
  p17 <-> p19
  p18 <-> p20
  p1 -> p6 [label: "cross-group"]
  p6 -> p11 [label: "cross-group"]
  p11 -> p16 [label: "cross-group"]
  p21 -> p1
  p22 -> p6
  p23 -> p11
  p24 -> p16
  p25 -- p26
  p27 -- p28
  p29 -- p30

Verify: 30 nodes → automatically uses 800×800 canvas. The 4 groups should naturally cluster via force-directed layout. p1, p6, p11, p16 are cross-group bridges. p25-p30 are independent pairs.


10. SVG Implementation Details

10.1 Arrow Markers

<defs>
  <!-- Positive arrow (dark gray) -->
  <marker id="sociogram-arrow" viewBox="0 0 10 10" refX="9" refY="5"
          markerWidth="8" markerHeight="8" orient="auto">
    <path d="M 0 0 L 10 5 L 0 10 z" fill="#333"/>
  </marker>
  <!-- Rejection arrow (red) -->
  <marker id="sociogram-arrow-reject" viewBox="0 0 10 10" refX="9" refY="5"
          markerWidth="8" markerHeight="8" orient="auto">
    <path d="M 0 0 L 10 5 L 0 10 z" fill="#D32F2F"/>
  </marker>
  <!-- Neutral arrow (gray) -->
  <marker id="sociogram-arrow-neutral" viewBox="0 0 10 10" refX="9" refY="5"
          markerWidth="8" markerHeight="8" orient="auto">
    <path d="M 0 0 L 10 5 L 0 10 z" fill="#9E9E9E"/>
  </marker>
</defs>

10.2 Edge Rendering

Edge-to-edge calculation (same as ecomap):

  • Lines run from node edge to node edge, not center to center
  • Calculation: along the line between (center_A, center_B), subtract each respective radius + marker size

Bidirectional edges:

  • Mutual choice (<->): markers at both ends, using a single line
  • Avoid overlap: if A→B and B→A are both one-way but not mutual, draw two slightly curved lines (offset ±3px)

Self-referential edges:

  • Not supported (sociograms do not require self-referential relationships)

10.3 Clique Highlighting

When config: highlight = cliques:

  1. Detect all cliques (complete subgraph, ≥3 nodes)
  2. For each clique, compute convex hull
  3. Render semi-transparent background <polygon> with rounded corners
<polygon points="..." fill="#42A5F5" fill-opacity="0.08"
         stroke="#42A5F5" stroke-opacity="0.2" stroke-width="1"
         class="schematex-sociogram-clique"/>

10.4 CSS Classes

.schematex-sociogram-node { }
.schematex-sociogram-node-star { }
.schematex-sociogram-node-isolate { }
.schematex-sociogram-edge { }
.schematex-sociogram-edge-positive { }
.schematex-sociogram-edge-negative { }
.schematex-sociogram-edge-neutral { }
.schematex-sociogram-label { }
.schematex-sociogram-clique { }
.schematex-sociogram-group-label { }

11. Sociogram Variants (Future Phases)

11.1 Social Atom (Moreno)

Personal sociogram — one person draws their most important surrounding relationships. Can reuse ecomap radial layout.

11.2 Spectrogram

Linear arrangement, members positioned along a line according to some dimension. Extremely simple layout (one-dimensional).

11.3 Target Sociogram

Bullseye layout — focal person at center, with people placed closer to the center the closer the relationship. Similar to concentric layout but centered on a single person.


12. Implementation Priority

PriorityFeatureComplexityReuse
P0 (Phase 3)Circular layout + directed edges + 3 valence typesMediumArrow markers reused from ecomap
P0Node auto-detection (star/isolate)LowPure data computation
P1Force-directed layout (Fruchterman-Reingold)HighNew algorithm, but formula is well-defined
P1Group coloring + group-based node clusteringMediumColor palette reused from ecomap
P1Edge weight → line thicknessLow
P2Concentric layoutMediumAdapted from radial layout
P2Clique detection + convex hull highlightingHighGraph theory algorithm
P2Node sizing by metric (in-degree/betweenness)Medium
P3Edge labelsLowReused from ecomap
P3Social Atom variant (egocentric view)LowReused from ecomap radial
P3Bridge detectionMediumBetweenness centrality