How meia-yong/mapping-the-broadway-network works
Purpose and Entry Points
This repository builds a Broadway performer-collaboration network from Internet Broadway Database (IBDB) production data. The operational entry points are the scraper module at src/ibdb_scraper.py, staged analysis/pipeline notebooks under notebooks/, and a browser-based interactive visualization rooted at visualisation/index.html and visualisation/src/main.js.
Acquisition: IBDB Production Data
IBDB is the external source. Scraping prototypes mature into production, metadata, and cast extraction stages in notebooks/08_production_scraper.ipynb, notebooks/10_production_catalogue.ipynb, notebooks/11_production_metadata.ipynb, and notebooks/12_cast_extraction.ipynb. src/ibdb_scraper.py is the reusable Python boundary for HTTP/HTML scraping. Raw and intermediate source artifacts are retained in data/raw/ and checkpoints in data/processed/.
Catalogue and Cast Data Pipeline
The pipeline creates a season/production catalogue, associates productions with opening-night casts, then cleans duplicate or malformed records. Core persisted datasets are data/processed/season_catalogue.csv, data/processed/production_catalogue_unique.csv, and data/processed/production_cast_clean.csv. Checkpoint files such as data/processed/production_metadata_checkpoint.csv support long-running or recoverable extraction rather than requiring a single transactional run.
Network Construction and Projection
The central transformation converts production–performer membership into a bipartite graph and projects it to a performer–performer collaboration graph: two performers are connected when appearing in a common production. This work is represented by notebooks/13_network_construction.ipynb and notebooks/16_network_reconstruction.ipynb. The resulting graph is materialized as node, edge, and cast tables: data/processed/performer_nodes.csv, data/processed/performer_edges.csv, and data/processed/performer_edges_clean.csv.
Cleaning, Metrics, and Analysis
Graph diagnostics and cleaning are distinct stages, preventing raw co-cast projection artifacts from directly reaching visual output. notebooks/14_network_diagnostics.ipynb and notebooks/15_network_cleaning.ipynb produce the cleaned collaboration network and associated degree/metric outputs, including data/processed/performer_degree_raw.csv and data/processed/performer_metrics.csv. Exploratory network analysis is continued in notebooks/17_network_analysis.ipynb.
Layout and Visualization Data Boundary
Layout computation is offline and exported as CSV coordinates, separating expensive graph-layout experimentation from client rendering. Candidate layouts live in data/layouts/coordinates/, notably DRL variants and standard layouts such as data/layouts/coordinates/fruchterman_reingold.csv. Visualization-ready edge data is additionally curated in data/processed/performer_edges_visual.csv. Selected layout and cleaned-edge files are copied into visualisation/public/data/, forming the static-data contract consumed by the frontend.
Interactive Visualization Runtime
visualisation/ is a separate JavaScript/npm application, with dependencies declared in visualisation/package.json. Its client entry point, visualisation/src/main.js, loads static network data from visualisation/public/data/ and renders it in the browser through visualisation/index.html. There is no indicated backend API or database runtime; Python/notebook processing produces versioned CSV artifacts, and the frontend serves/consumes those artifacts as static assets.
Main entry points: 08_production_scraper.ipynb Scraping stages · performer_metrics.csv Clean network and metrics · production_cast_clean.csv Clean production cast · performer_edges_clean.csv Static data contract
Components 18
IBDB acquisition
- IBDB · Production, metadata, and cast source.
- Scraper module · Reusable HTTP and HTML extraction boundary.
src/ibdb_scraper.py - Scraping stages · Production, catalogue, metadata, and cast extraction.
notebooks/08_production_scraper.ipynb - Raw artifacts
data/raw/broadway_cast.csv
Data and network pipeline
- Production catalogue · Season and deduplicated production records.
data/processed/production_catalogue_unique.csv - Clean production cast · Production-to-performer membership data.
data/processed/production_cast_clean.csv - Extraction checkpoints · Recoverable state for long-running extraction.
data/processed/production_metadata_checkpoint.csv - Network construction · Builds bipartite membership and performer projection.
notebooks/13_network_construction.ipynb - Raw performer network · Projected nodes, edges, and raw degree output.
data/processed/performer_edges.csv - Diagnostics and cleaning · Removes projection artifacts and calculates graph measures.
notebooks/15_network_cleaning.ipynb - Clean network and metrics · Cleaned collaboration edges and performer metrics.
data/processed/performer_metrics.csv - Network analysis · Exploratory analysis of the reconstructed network.
notebooks/17_network_analysis.ipynb
Layout export
- Offline layout computation · Candidate graph coordinates, including force-directed layouts.
data/layouts/coordinates/fruchterman_reingold.csv - Visualization edge export · Curated edges for rendering.
data/processed/performer_edges_visual.csv
Interactive visualization
- Static data contract · Selected layouts and cleaned edges copied for the client.
visualisation/public/data/performer_edges_clean.csv - Browser visualization · Loads static network data and renders the interactive graph.
visualisation/src/main.js - HTML entry
visualisation/index.html - Frontend dependencies
visualisation/package.json
Connections 19
- IBDB → Scraper module: scraped by
- Scraper module → Scraping stages: used by
- Scraping stages → Raw artifacts: retains source artifacts
- Scraping stages → Production catalogue: builds
- Scraping stages → Clean production cast: extracts and cleans
- Scraping stages → Extraction checkpoints: writes recovery state
- Production catalogue → Clean production cast: associates productions
- Clean production cast → Network construction: membership input
- Network construction → Raw performer network: projects co-cast graph
- Raw performer network → Diagnostics and cleaning: diagnoses and filters
- Diagnostics and cleaning → Clean network and metrics: writes cleaned edges and metrics
- Clean network and metrics → Network analysis: analyzed by
- Clean network and metrics → Offline layout computation: layout input
- Clean network and metrics → Visualization edge export: curates
- Offline layout computation → Static data contract: copies selected coordinates
- Visualization edge export → Static data contract: copies edge data
- Static data contract → Browser visualization: loaded as static CSV
- HTML entry → Browser visualization: boots
- Frontend dependencies → Browser visualization: declares dependencies