This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
InfluenceMap visualizes citation-based academic influence as "influence flowers" — radial diagrams with a central ego entity surrounded by the most influential related entities (authors, affiliations, journals, topics). Data comes from the OpenAlex dataset (2025-05-30 snapshot).
Three-tier system with two Flask services:
- Konigsberg (
konigsberg/): Scoring engine that computes influence from binary graph data using Numba-accelerated algorithms. Runs on port 8081 locally, port 8000 inside Docker. - Webapp (
webapp/): User-facing Flask app serving search UI and flower visualizations. Communicates with Konigsberg via HTTP. Runs on port 8000 locally. - Core (
core/): Shared modules for OpenAlex API integration and entity type definitions.
konigsberg/flowers.py— Core influence computation engine (Numba JIT-compiled)konigsberg/builder.py— Builds binary graph structure from CSV datakonigsberg/preprocessor.py— Converts OpenAlex JSON snapshots to MAG-compatible CSVkonigsberg/app.py— Flask API (/get-flower,/get-stats,/get-node-info)webapp/views.py— Main routes and query orchestrationwebapp/front_end_helper.py— Response formatting, node deduplication, log scalingwebapp/konigsberg_client.py— HTTP client to Konigsberg servicecore/search/openalex.py— Entity name resolution via OpenAlex APIcore/utils/entity_type.py— Entity type enum: AUTH, AFFI, JOUR, FSTD
# Install (editable mode)
pip install -e .
# Run webapp locally
python -m webapp.app
# Docker deployment (production with 32 Gunicorn workers)
docker compose up --buildOpenAlex snapshot (S3) → preprocessor.py (JSON→CSV) → builder.py (CSV→binary graph) → konigsberg/bingraph-openalex/ (~88GB)
See HowTo.md for detailed data processing steps.
- Numba is used extensively in
flowers.pyfor JIT-compiled graph traversal — be careful with type annotations and array operations (recent commits fixNumbaTypeSafetyWarningand signed int casting issues) - Entity types map to OpenAlex concepts: AUTH=authors, AFFI=institutions, JOUR=venues, FSTD=topics
- Influence = sum of citations weighted by 1/(number of authors in cited paper)
- Self-citations and coauthor filtering are ego-relative (depend on entity type being queried)
- The webapp communicates with Konigsberg via
KONIGSBERG_URLenv var (defaults tohttp://localhost:8081)