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

refactor: deduplicate escapeXml across 5 layout/animator classes - #128

Merged
sauravbhattacharya001 merged 1 commit into
masterfrom
refactor/deduplicate-escapeXml
Mar 28, 2026
Merged

sauravbhattacharya001 merged 1 commit into
masterfrom
refactor/deduplicate-escapeXml

Conversation

@sauravbhattacharya001

Copy link
Copy Markdown
Owner

Summary

Five classes had private \�scapeXml()\ methods with copy-pasted XML escaping logic. \ExportUtils.escapeXml()\ already provides a canonical, null-safe implementation.

Changes

Replaced inline implementations in CircularLayout, ForceDirectedLayout, GraphAlgorithmAnimator, HierarchicalLayout, and SpectralLayout with one-line delegations to \ExportUtils.escapeXml().

GexfExporter and SvgExporter already delegated correctly — no changes needed.

Impact

  • Eliminates 5 duplicate implementations (~17 lines → 6)
  • Future escaping fixes only need to touch ExportUtils
  • No behavioral change

Five classes had private escapeXml() methods with copy-pasted XML
escaping logic. Replaced each with a one-line delegation to the
canonical ExportUtils.escapeXml(), which already handles null safety
and all five XML special characters.

Affected: CircularLayout, ForceDirectedLayout, GraphAlgorithmAnimator,
HierarchicalLayout, SpectralLayout.

GexfExporter and SvgExporter already delegated correctly.
@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/s labels Mar 27, 2026
@sauravbhattacharya001
sauravbhattacharya001 merged commit e6027fa into master Mar 28, 2026
4 of 8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/s visualization Graph visualization and UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant