Skip to content

Remove notion of center node from code #40

@aboydnw

Description

@aboydnw

Context

Root cause fix for this error: #41

For now we'll just fix to get the visualization working again, but I had claude write this user story to come back to later.

The current visualization places a pseudo-repository node ("DevSeed Team") at the center, with all contributors linked to it via synthetic links. Every real repository orbits this hub. This pattern was inherited from the original ORCA visualization, where a central node represented the award program. For our use case, this node doesn't represent a real repository — it's a fabricated anchor point.

Desired Outcome

The visualization should render as a force-directed network where repositories and contributors are positioned based on their actual collaboration relationships, without a single artificial center. The layout should naturally cluster around highly-connected repos and contributors.

Scope of Change

Configuration (config.toml)

  • Remove central_repository field
  • Update Config model in python/contributor_network/config.py to remove the field

Data Generation (python/contributor_network/cli.py)

  • Stop generating the synthetic central repo entry in repositories.csv
  • Stop generating synthetic contributor-to-central links in links.csv
  • These are created at lines 93-104 (repo) and 116-124 (links)

JavaScript — Data Preparation (js/data/prepare.js)

  • Remove central repo lookup and validation (lines 325-331)
  • Remove central repo exclusion from owner group creation (line 416)
  • Rethink how the visualization finds its "anchor" — may need a different layout strategy

JavaScript — Force Simulation (js/simulations/collaborationSimulation.js)

  • Remove special central node handling in force simulation (line 70, 107)
  • Will need a new positioning strategy — possibly multi-focal or gravity-based

JavaScript — Rendering (js/render/draw.js)

  • Remove central node exclusion from rendering pipeline (line 118)
  • Remove central link filtering (line 143)
  • Remove central node lookup for contributor ring positioning (line 156)
  • Remove central label skip (line 191)
  • The contributor ring positioning currently depends on the central node's position — needs a replacement anchor

JavaScript — Rendering (js/render/shapes.js)

  • Remove IS_CENTRAL detection and muted styling (lines 84-87)

JavaScript — Interactions (js/interaction/hover.js, click.js)

  • Remove central node guards from hover (line 53) and click (line 69) handlers
  • All nodes become interactive

JavaScript — Main Chart (js/chart.js)

  • Remove REPO_CENTRAL variable declaration (line 137)
  • Remove chart.repository() accessor (lines 1291-1292)
  • Remove central node exclusions in filter logic (line 691)
  • Remove central exclusions in link filtering (lines 1002, 1018)
  • Remove central exclusions in neighbor calculations (line 1012)
  • Remove central handling in rebuild (lines 1329, 1360, 1391)
  • Update createContributorNetworkVisual() signature — remove initial_repo_central parameter

JavaScript — Layout (js/layout/resize.js)

  • Contributor ring positioning currently uses the central node as the origin — needs a replacement

Templates

  • index.html: Remove REPOSITORY constant, update createContributorNetworkVisual() call
  • index.html.jinja: Remove {{ central_repository }} usage, update function call
  • Both: The title "The Contributor Network of [DevSeed Team]" needs rethinking

Key Risks

  1. Layout collapse: Without a central anchor, the force simulation may not converge to a readable layout. Will need experimentation with multi-focal forces or gravity wells.
  2. Contributor ring: Contributors are currently arranged in a ring around the central node. Without it, contributor positioning needs a completely different strategy.
  3. Scale factor calculations: SF (scale factor) and radius calculations reference the central node's position. These need new reference points.
  4. Filter behavior: The central node is always preserved during org filtering. Removing it changes how filtered views look.

Suggested Approach

  1. Start by replacing the single central node with a gravity-based layout (e.g., d3.forceCenter() or d3.forceRadial())
  2. Test with the existing dataset to see if the layout is readable
  3. Progressively remove REPO_CENTRAL references file by file
  4. Keep the contributor ring concept but anchor it to the viewport center instead of a node
  5. Visual regression test at each step

Acceptance Criteria

  • No synthetic "DevSeed Team" node appears in the visualization
  • All real repositories and contributors are visible and interactive
  • The layout is readable and doesn't collapse into a ball
  • Org filtering still works
  • Hover and click interactions work on all nodes
  • No console errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions