Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

refactor: use Map<EdgeType, List<edge>> in GraphStats constructor - #96

Closed
sauravbhattacharya001 wants to merge 1 commit into
masterfrom
gardener/refactor-graph-stats-constructor
Closed

sauravbhattacharya001 wants to merge 1 commit into
masterfrom
gardener/refactor-graph-stats-constructor

Conversation

@sauravbhattacharya001

@sauravbhattacharya001 sauravbhattacharya001 commented Mar 20, 2026

Copy link
Copy Markdown
Owner

Summary Replace the 5-parameter positional edge list constructor with a \Map<EdgeType, List>\ variant. ## Changes - New primary constructor: \GraphStats(Graph, Map<EdgeType, List>)\ - Old constructor marked @deprecated\ for backward compatibility - Added \getEdges(EdgeType)\ accessor for type-safe edge queries - Uses \EnumMap\ for efficient edge type lookup ## Why The old constructor had 5 positional \List\ parameters ΓÇö easy to mix up and requires signature changes whenever a new edge type is added. The map-based constructor is extensible and self-documenting.

Replace the 5-parameter positional edge list constructor with a
Map<EdgeType, List<edge>> variant. The old constructor is preserved
as @deprecated for backward compatibility. Adds getEdges(EdgeType)
accessor for type-safe edge queries.

This makes the API cleaner and future-proof — adding a new edge
type no longer requires changing the constructor signature.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added visualization Graph visualization and UI size/m labels Mar 20, 2026
@sauravbhattacharya001

Copy link
Copy Markdown
Owner Author

Closing: superseded or conflicting with newer changes already on main/master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/m visualization Graph visualization and UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant