社會關係圖(Sociogram)

關於 sociogram

**社會關係圖(sociogram)**將一個群體內部的選擇、排斥與聯盟網絡可視化——誰喜歡誰、誰被孤立、哪裡形成了小圈子。Jacob Moreno 於 1934 年將此方法作為團體治療的臨床工具提出;此後被課堂教師(用於偵測排斥與霸凌)、人力資源團隊(非正式影響力映射)以及組織研究人員廣泛採用。與以單一個人外部環境為中心的生態圖(ecomap)不同,sociogram 以對稱的方式對待群體中的每位成員。

Schematex 遵循 Moreno(1934)社會計量學慣例 中的節點角色與邊類型,並以現代社會網路分析符號擴充了情緒效價、方向性與權重。本頁記錄了剖析器目前所接受的語法。

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·1.1 ms·9.7 KB SVG

1. 第一個 sociogram

最小的實用 sociogram:四個人、三種不同的關係類型。

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.4 ms·5.5 KB SVG

四條規則涵蓋 80% 的使用情境:

  1. 以關鍵字 sociogram 開頭,後面可接一個引號標題。
  2. 每個人是一個節點——以 id [label: "…"] 明確宣告,或在邊中第一次出現時自動建立。
  3. 邊運算子連接兩個節點:<-> (互相)、->(單向)、-x>(排斥)、-.-(中性)。請見第 3 節。
  4. 可選擇宣告群組config 行以控制佈局與配色。

註解必須以 # 開頭,獨立成一行。


2. 節點

節點行的格式為 id [attr: value, …]。節點也會在邊中第一次被引用時隱式建立——但明確宣告可讓你設定標籤、群組與角色。

ID 規則: 必須符合 [a-zA-Z][a-zA-Z0-9_-]*。ID 僅供內部使用;label: 屬性設定顯示名稱。

節點屬性:

屬性效果
label: "…"引號字串顯示名稱(預設為 ID)
group: id群組 ID將節點關聯至一個群組以供配色使用
role: …starisolatebridgeneglecteerejected明確的社會計量角色標注
size: …smallmediumlarge覆寫節點大小
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·2.2 ms·7.2 KB SVG

3. 邊

邊行的格式為 leftId OP rightId,後面可選擇加上 [label: "…", weight: N]。若兩個 ID 尚未宣告,會自動登記為節點。

3.1 方向性與情緒效價

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.5 ms·7.4 KB SVG
運算子方向效價含義
A -> B單向正向A 選擇 B
A <- B單向正向B 選擇 A(等同於 B -> A
A <-> B互相正向雙方互相選擇
A -- B無方向正向關係已知,方向未記錄
A -x> B單向負向A 排斥 B
A <x- B單向負向B 排斥 A
A <x-> B互相負向互相排斥
A -x- B無方向負向衝突,方向未知
A -.> B單向中性A 對 B 漠不關心
A <.-> B互相中性相互漠然
A -.- B無方向中性中性關係

3.2 權重/強度

權重越高,線條越粗。使用簡寫運算子,或以 [weight: N] 明確覆寫。

權重簡寫方向含義
2(預設)-> <-> -- -x> -.-任意標準連接
3==> <== <==> ===單向 / 互相 / 無方向
4===> <=== <===>單向 / 互相非常強
自訂[weight: N]任意整數
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 邊標籤

A -> B [label: "best friend"] — 標籤顯示於連接線上。


4. 群組

group 區塊將節點歸入一個命名子群組,用於配色與佈局聚類。

群組語法:

  • group id [label: "…", color: "#hex"] — 群組標題行。
  • 成員行緊接其後,每行至少縮排 4 個空格,每行一個節點。
  • 非縮排行(或下一個 group)結束當前群組。
  • 成員可以有自己的屬性:anna [label: "Anna K.", size: large]

節點也可以行內指定: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·3.8 ms·8.7 KB SVG

5. 配置

config: 行調整佈局與視覺編碼,每個設定獨立成一行。

設定鍵預設效果
layoutcircularforce-directedconcentriccircular排版演算法
sizinguniformin-degreebetweennessuniform依指標設定節點大小
coloringdefaultgrouproledefault節點配色方案
highlight逗號清單:starsisolatescliquesstars,isolates標注哪些模式

佈局說明:

  • circular — 節點均勻分布在一個圓環上。適合小型群組(≤15 人)。
  • force-directed — 彈簧模型;群集自動浮現。適合有明顯子群組的中型群組。
  • concentric — 入度高的節點位於內環。適合顯示核心—外圍結構。

環形佈局(Circular) — 均勻環形排列,每個節點同等可見。適合小型、緊密的群組。

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) — 彈簧物理拉近連接節點,推開未連接節點,子群組有機聚類。

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·2.3 ms·8.9 KB SVG

同心圓佈局(Concentric) — 依入度排序節點;高中心性節點位於內環,外圍節點位於外環。

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.8 ms·8.0 KB SVG

6. 社會計量角色

剖析器將角色標注儲存於節點上,渲染器使用這些標注套用視覺徽章——star 顯示星形標記、isolate 顯示虛線邊框,依此類推。

角色含義
star被許多人選擇的中心人物(高入度)
isolate沒有任何連接(無向外也無向內)
neglectee主動接觸他人,但沒有人選擇他
rejected被多位成員排斥
bridge連接兩個原本分離的群集
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.6 ms·8.1 KB SVG

7. 標籤與註解

  • 標題: sociogram "Study group" — 僅限第一行。
  • 節點標籤: alice [label: "Alice K."]
  • 群組標籤: group boys [label: "Boys"]
  • 邊標籤: alice -> bob [label: "lab partners"]
  • 註解: # 位於行首(前方可有空白)。

8. 保留字與跳脫

行首保留字: sociogram(標題)、groupconfig:

保留運算子符號 — 在 ID 內部應避免以下序列:-><-<->--=====><==<===>-x><x--x-<x->-.><.->-.-

含空格的字串label:color: 值中必須使用雙引號。


9. 常見錯誤

你寫了什麼剖析器的反應修正方式
tom; jack; mike 寫在同一個群組行tom; 不符合 ID 正規表達式——被靜默略過每行一個節點,每行縮排 ≥4 個空格
群組成員縮排 2 個空格不被視為群組成員(剖析器要求 ≥4)使用 4 個以上的空格縮排
alice <> bob不符合任何運算子——不被解析為邊使用 <-> 表示正向互相
config: layout = grid未知值被靜默忽略,佈局保持 circular使用 circularforce-directedconcentric
節點 ID 含空格:dr park剖析器將 dr 視為 ID,park 視為多餘符號使用底線:dr_park [label: "Dr. Park"]

10. 語法(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

權威來源:src/diagrams/sociogram/parser.ts。若此文件與剖析器有所出入,以剖析器為準——請開立 issue 回報。


11. 標準合規性

Schematex sociogram 遵循 Moreno(1934)社會計量學慣例,包含節點角色(star、isolate、neglectee)與有向選擇語義。邊運算子集合依現代社會網路分析實踐(Hanneman & Riddle,2005)擴充了情緒效價(正向/負向/中性)與權重層級。

目前已實作的功能:

  • ✅ 有向、互相與無方向邊
  • ✅ 正向、負向與中性效價運算子
  • ✅ 四個權重層級(1–4),含簡寫運算子及 [weight: N]
  • ✅ 含顏色的群組
  • ✅ 節點角色宣告(starisolatebridgeneglecteerejected
  • ✅ 三種佈局:circular、force-directed、concentric
  • ✅ 三種大小模式:uniform、in-degree、betweenness
  • ⏳ 自動偵測的派系標注——著色凸包(見第 13 節)
  • ⏳ 社會原子視圖(以自我為中心的佈局)

參考文獻:

  • 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.

12. 相關範例

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. 路線圖

已規劃——目前尚無法剖析。 請勿在今日生成的 DSL 中使用以下功能;剖析器會拒絕或忽略它們。

  • 自動偵測的派系標注 — 在 ≥3 個成員的互選子群組外側繪製著色凸包。
  • 橋接者自動偵測 — 依介數中心性自動推斷 role: bridge,無需明確宣告。
  • 社會原子視圖 — 以一個指定節點為中心的自我中心佈局。
  • 互惠矩陣匯出 — 在圖表旁輸出結構化表格。

如需提前實現以上功能,請在 GitHub issues 中追蹤進度。

Found this useful?

Schematex is free, fully open source, and zero-dependency. A star helps other developers discover it.