Skip to content

feat(style): add register helper per built-in edge style#1077

Merged
redfish4ktc merged 3 commits into
mainfrom
feat/add_function_register_single_builtin_edgestyle
May 27, 2026
Merged

feat(style): add register helper per built-in edge style#1077
redfish4ktc merged 3 commits into
mainfrom
feat/add_function_register_single_builtin_edgestyle

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented May 26, 2026

Copy link
Copy Markdown

Introduce one register*EdgeStyle helper per built-in edge style (Elbow, EntityRelation, Loop, Manhattan, Orthogonal, Segment, SideToSide, TopToBottom) so BaseGraph users can register only what they need without having to know the associated EdgeStyleMetaData. registerDefaultEdgeStyles now simply calls the 8 helpers.

Update doc to point users at the new helpers:

  • EdgeStyleRegistryInterface.add gets a jsdoc (previously undocumented) linking every helper via {@link ...}.
  • Each built-in edge style class jsdoc points at its dedicated helper before the existing "register manually with this metadata" reference block.
  • The edge-styles usage page lists the 8 helpers in a tip.
  • The Graph usage page samples and the ts-example-selected-features now use registerOrthogonalEdgeStyle().

Summary by CodeRabbit

  • New Features

    • Added dedicated registration helpers for each built-in edge style to ensure correct metadata and simplify registration.
  • Documentation

    • Updated edge-style docs and code examples to recommend using the dedicated registration helpers.
    • Added site tip listing the new helpers and noted default registration now uses them.
    • Changelog guidance added about required metadata for manual EntityRelation registration.

Review Change Stack

Introduce one register*EdgeStyle helper per built-in edge style (Elbow, EntityRelation, Loop, Manhattan,
Orthogonal, Segment, SideToSide, TopToBottom) so BaseGraph users can register only what they need without having
to know the associated EdgeStyleMetaData. registerDefaultEdgeStyles now simply calls the 8 helpers.

Update doc to point users at the new helpers:
- EdgeStyleRegistryInterface.add gets a jsdoc (previously undocumented) linking every helper via {@link ...}.
- Each built-in edge style class jsdoc points at its dedicated helper before the existing "register manually
  with this metadata" reference block.
- The edge-styles usage page lists the 8 helpers in a tip.
- The Graph usage page samples and the ts-example-selected-features now use registerOrthogonalEdgeStyle().
@redfish4ktc redfish4ktc added the enhancement New feature or request label May 26, 2026
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b9919831-cb81-4169-b402-74a16fb08c09

📥 Commits

Reviewing files that changed from the base of the PR and between ace3691 and f6b3896.

📒 Files selected for processing (1)
  • CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

Walkthrough

This PR adds eight per-edge registration helpers that register built-in edge styles with explicit metadata, refactors registerDefaultEdgeStyles to call these helpers, and updates JSDoc, examples, website docs, and the changelog to recommend the new helpers over manual EdgeStyleRegistry.add usage.

Changes

Edge Style Registration Helpers

Layer / File(s) Summary
Type Contract & Interface Documentation
packages/core/src/types.ts
EdgeStyleRegistryInterface.add receives extended JSDoc explaining EdgeStyleMetaData, parameters, and guidance to prefer dedicated registration helpers.
Registration Helper Functions
packages/core/src/view/style/register.ts
Adds eight exported helpers (registerElbowEdgeStyle, registerEntityRelationEdgeStyle, registerLoopEdgeStyle, registerManhattanEdgeStyle, registerOrthogonalEdgeStyle, registerSegmentEdgeStyle, registerSideToSideEdgeStyle, registerTopToBottomEdgeStyle) that register each style with explicit metadata. registerDefaultEdgeStyles now calls these helpers directly.
Edge Style Documentation Updates
packages/core/src/view/style/edge/Elbow.ts, EntityRelation.ts, Loop.ts, Manhattan.ts, Orthogonal.ts, Segment.ts, SideToSide.ts, TopToBottom.ts
JSDoc in all eight edge-style files updated to recommend using their dedicated register*EdgeStyle helpers and to clarify manual EdgeStyleRegistry.add metadata requirements.
Usage Examples & User Documentation
packages/ts-example-selected-features/src/main.ts, packages/website/docs/usage/edge-styles.md, packages/website/docs/usage/graph.md, CHANGELOG.md
Example and docs updated to import and call registerOrthogonalEdgeStyle() (and other helpers) instead of inline EdgeStyleRegistry.add(...). A docs tip and changelog note were added describing the helper API and metadata requirements.

Sequence Diagram(s)

No sequence diagram generated: the changes are local registration helpers and documentation updates without multi-component sequential interactions suitable for visualization.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • maxGraph/maxGraph#1040: Related changes around EntityRelation intermediate-handle behavior and registration metadata.
  • maxGraph/maxGraph#775: Overlaps refactoring of default edge-style registration flow.
  • maxGraph/maxGraph#757: Modifies the same registration pipeline in register.ts and adds related registration helpers.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main feature: adding dedicated register helper functions for each built-in edge style, which is the core of this PR.
Description check ✅ Passed The description comprehensively covers the changes: introduces per-style helpers, explains the purpose, and details all documentation updates. However, it does not reference any issue number or use linking keywords.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ange

The unreleased EntityRelation breaking change now points to the new registerEntityRelationEdgeStyle() helper as
the simplest way to register the style with the correct allowIntermediateHandles metadata.
@sonarqubecloud

Copy link
Copy Markdown

@redfish4ktc redfish4ktc merged commit d3cb3c2 into main May 27, 2026
14 checks passed
@redfish4ktc redfish4ktc deleted the feat/add_function_register_single_builtin_edgestyle branch May 27, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant