# unwb/crowds architecture

> Architecture diagram of the GitHub repository unwb/crowds, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/unwb/crowds
- Repository: https://github.com/unwb/crowds

## Overview

This is a browser-based interactive explainer about how ideas and behaviors spread through social networks. A visitor opens a translated page, moves through a narrated slideshow, and manipulates network simulations and puzzles; the sandbox provides a free-form final experience. The map preserves the distinct network, contagion, social-structure, and sandbox stages, plus slideshow and simulation internals. Source excerpts show slideshow dispatch and simulation interactions, but not all chapter wiring, so undocumented links are omitted.

Main entry points: [`js/slideshow/Slideshow.js`](https://github.com/unwb/crowds/blob/master/js/slideshow/Slideshow.js) (Slideshow flow), [`js/sim/Simulations.js`](https://github.com/unwb/crowds/blob/master/js/sim/Simulations.js) (Simulation manager), [`index.html`](https://github.com/unwb/crowds/blob/master/index.html) (Translated entry), [`js/sim/ConnectorCutter.js`](https://github.com/unwb/crowds/blob/master/js/sim/ConnectorCutter.js) (Connect and cut)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learning experience"]
  node_slideshow["Slideshow flow<br/>[Slideshow.js]"]
  node_preloader["Asset preloading<br/>[A_Preloader.js]"]
  node_intro["Introduction<br/>[B_Introduction.js]"]
  node_networks["Network concepts<br/>[C_Networks.js]"]
  node_simple["Simple contagion"]
  node_complex["Complex contagion"]
  node_bonding["Bonding and bridging"]
  node_smallworld["Small-world networks<br/>[G_Small_World.js]"]
  node_conclusion["Conclusion<br/>[H_Conclusion.js]"]
  node_sandbox["Sandbox chapter<br/>[J_Sandbox.js]"]
end

subgraph group_simulation["Network simulation"]
  node_simulations["Simulation manager<br/>[Simulations.js]"]
  node_peeps["People and contagion<br/>[Peep.js]"]
  node_connections["Network connections<br/>[Connection.js]"]
  node_cutter["Connect and cut<br/>[ConnectorCutter.js]"]
end

subgraph group_interface["Interaction interface"]
  node_boxes["Text and picture boxes<br/>[Boxes.js]"]
  node_sandboxui["Sandbox controls<br/>[SandboxUI.js]"]
end

subgraph group_localization["Language support"]
  node_entry["Translated entry<br/>[index.html]"]
  node_languagepages["Language pages<br/>[translations.txt]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_entry
node_entry -.->|"starts experience"| node_slideshow
node_slideshow -->|"adds and clears"| node_boxes
node_slideshow -->|"adds simulations"| node_simulations
node_slideshow -.->|"begins at"| node_preloader
node_networks -.->|"defines slides"| node_slideshow
node_simple -.->|"defines slides"| node_slideshow
node_complex -.->|"defines slides"| node_slideshow
node_bonding -.->|"defines slides"| node_slideshow
node_smallworld -.->|"defines slides"| node_slideshow
node_intro -.->|"defines slides"| node_slideshow
node_conclusion -.->|"defines slides"| node_slideshow
node_sandbox -.->|"defines slides"| node_slideshow
node_simulations -.->|"creates people"| node_peeps
node_simulations -.->|"creates connections"| node_connections
node_simulations -->|"uses cutter"| node_cutter
node_cutter -->|"edits network"| node_simulations
node_boxes -->|"creates controls"| node_sandboxui
node_sandboxui -->|"sets contagion"| node_simulations
node_languagepages -.->|"lists translations"| node_entry

click node_entry "https://github.com/unwb/crowds/blob/master/index.html"
click node_slideshow "https://github.com/unwb/crowds/blob/master/js/slideshow/Slideshow.js"
click node_preloader "https://github.com/unwb/crowds/blob/master/js/chapters/A_Preloader.js"
click node_intro "https://github.com/unwb/crowds/blob/master/js/chapters/B_Introduction.js"
click node_networks "https://github.com/unwb/crowds/blob/master/js/chapters/C_Networks.js"
click node_simple "https://github.com/unwb/crowds/blob/master/js/chapters/D_Simple_Contagion.js"
click node_complex "https://github.com/unwb/crowds/blob/master/js/chapters/E_Complex_Contagion.js"
click node_bonding "https://github.com/unwb/crowds/blob/master/js/chapters/F_Bonding_And_Bridging.js"
click node_smallworld "https://github.com/unwb/crowds/blob/master/js/chapters/G_Small_World.js"
click node_conclusion "https://github.com/unwb/crowds/blob/master/js/chapters/H_Conclusion.js"
click node_sandbox "https://github.com/unwb/crowds/blob/master/js/chapters/J_Sandbox.js"
click node_simulations "https://github.com/unwb/crowds/blob/master/js/sim/Simulations.js"
click node_peeps "https://github.com/unwb/crowds/blob/master/js/sim/Peep.js"
click node_connections "https://github.com/unwb/crowds/blob/master/js/sim/Connection.js"
click node_cutter "https://github.com/unwb/crowds/blob/master/js/sim/ConnectorCutter.js"
click node_boxes "https://github.com/unwb/crowds/blob/master/js/slideshow/Boxes.js"
click node_sandboxui "https://github.com/unwb/crowds/blob/master/js/slideshow/SandboxUI.js"
click node_languagepages "https://github.com/unwb/crowds/blob/master/translations.txt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_slideshow,node_preloader,node_intro,node_networks,node_simple,node_complex,node_bonding,node_smallworld,node_conclusion,node_sandbox toneBlue
class node_simulations,node_peeps,node_connections,node_cutter toneAmber
class node_boxes,node_sandboxui toneMint
class node_entry,node_languagepages toneRose
class node_visitor toneIndigo
```

## Components

### Learning experience

- [Slideshow flow](https://github.com/unwb/crowds/blob/master/js/slideshow/Slideshow.js): `js/slideshow/Slideshow.js`
- [Asset preloading](https://github.com/unwb/crowds/blob/master/js/chapters/A_Preloader.js): `js/chapters/A_Preloader.js`
- [Introduction](https://github.com/unwb/crowds/blob/master/js/chapters/B_Introduction.js): `js/chapters/B_Introduction.js`
- [Network concepts](https://github.com/unwb/crowds/blob/master/js/chapters/C_Networks.js): `js/chapters/C_Networks.js`
- [Simple contagion](https://github.com/unwb/crowds/blob/master/js/chapters/D_Simple_Contagion.js): `js/chapters/D_Simple_Contagion.js`
- [Complex contagion](https://github.com/unwb/crowds/blob/master/js/chapters/E_Complex_Contagion.js): `js/chapters/E_Complex_Contagion.js`
- [Bonding and bridging](https://github.com/unwb/crowds/blob/master/js/chapters/F_Bonding_And_Bridging.js): `js/chapters/F_Bonding_And_Bridging.js`
- [Small-world networks](https://github.com/unwb/crowds/blob/master/js/chapters/G_Small_World.js): `js/chapters/G_Small_World.js`
- [Conclusion](https://github.com/unwb/crowds/blob/master/js/chapters/H_Conclusion.js): `js/chapters/H_Conclusion.js`
- [Sandbox chapter](https://github.com/unwb/crowds/blob/master/js/chapters/J_Sandbox.js): `js/chapters/J_Sandbox.js`

### Network simulation

- [Simulation manager](https://github.com/unwb/crowds/blob/master/js/sim/Simulations.js): `js/sim/Simulations.js`
- [People and contagion](https://github.com/unwb/crowds/blob/master/js/sim/Peep.js): `js/sim/Peep.js`
- [Network connections](https://github.com/unwb/crowds/blob/master/js/sim/Connection.js): `js/sim/Connection.js`
- [Connect and cut](https://github.com/unwb/crowds/blob/master/js/sim/ConnectorCutter.js): `js/sim/ConnectorCutter.js`

### Interaction interface

- [Text and picture boxes](https://github.com/unwb/crowds/blob/master/js/slideshow/Boxes.js): `js/slideshow/Boxes.js`
- [Sandbox controls](https://github.com/unwb/crowds/blob/master/js/slideshow/SandboxUI.js): `js/slideshow/SandboxUI.js`

### Language support

- [Translated entry](https://github.com/unwb/crowds/blob/master/index.html): `index.html`
- [Language pages](https://github.com/unwb/crowds/blob/master/translations.txt): `translations.txt`

### Other components

- **Visitor**

## Connections

- Visitor → Translated entry: opens (evidence: `README.md`)
- Translated entry → Slideshow flow: starts experience
- Slideshow flow → Text and picture boxes: adds and clears (evidence: `js/slideshow/Slideshow.js`)
- Slideshow flow → Simulation manager: adds simulations (evidence: `js/slideshow/Slideshow.js`)
- Slideshow flow → Asset preloading: begins at
- Network concepts → Slideshow flow: defines slides
- Simple contagion → Slideshow flow: defines slides
- Complex contagion → Slideshow flow: defines slides
- Bonding and bridging → Slideshow flow: defines slides
- Small-world networks → Slideshow flow: defines slides
- Introduction → Slideshow flow: defines slides
- Conclusion → Slideshow flow: defines slides
- Sandbox chapter → Slideshow flow: defines slides
- Simulation manager → People and contagion: creates people
- Simulation manager → Network connections: creates connections
- Simulation manager → Connect and cut: uses cutter (evidence: `js/sim/Simulations.js`)
- Connect and cut → Simulation manager: edits network (evidence: `js/sim/ConnectorCutter.js`)
- Text and picture boxes → Sandbox controls: creates controls (evidence: `js/slideshow/Boxes.js`)
- Sandbox controls → Simulation manager: sets contagion (evidence: `js/slideshow/SandboxUI.js`)
- Language pages → Translated entry: lists translations
