Skip to content

fix: export GraphSelectionModel - #1184

Open
redfish4ktc wants to merge 1 commit into
mainfrom
feat/export-graph-selection-model
Open

redfish4ktc wants to merge 1 commit into
mainfrom
feat/export-graph-selection-model

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

BaseGraph accepts a selectionModel option, typed (graph: AbstractGraph) => GraphSelectionModel, so an application that supplies its own selection model has to name that class. GraphSelectionModel was never re-exported from packages/core/src/index.ts, and @maxgraph/core exposes a single entry point, so a TypeScript application had no way to import the base class its selection model must extend, nor to type the value its factory returns. The option was documented and unusable.

The four other collaborators an application can inject through the constructor options were already exported: CellRenderer, GraphDataModel, GraphView and Stylesheet. This adds the fifth, next to them, re-exporting the default export under its name exactly as CellRenderer does.

The class itself is unchanged, and nothing else in the package is affected.

Summary by CodeRabbit

  • New Features
    • Made the graph selection model available through the core package’s public API.

The `selectionModel` option of `BaseGraph` is typed `(graph: AbstractGraph) => GraphSelectionModel`, so an application
supplying its own selection model has to name that class. It was reachable only from inside the package, and
`@maxgraph/core` has a single entry point, which left the option unusable from TypeScript: there was no way to import
the base class a custom selection model must extend, nor to type the value the factory returns.

The four other collaborators an application can inject through the constructor options, `CellRenderer`,
`GraphDataModel`, `GraphView` and `Stylesheet`, were already exported.
@redfish4ktc redfish4ktc added the bug Something isn't working label Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b98e843e-7521-4fb9-8a2f-893a157b221d

📥 Commits

Reviewing files that changed from the base of the PR and between 016e5da and bea1504.

📒 Files selected for processing (1)
  • packages/core/src/index.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The core package index now exports GraphSelectionModel from ./view/GraphSelectionModel.js.

Changes

Public API

Layer / File(s) Summary
Expose GraphSelectionModel
packages/core/src/index.ts
The index re-exports the default export from GraphSelectionModel.js as GraphSelectionModel.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to bea15

This change makes the existing selection model available through the package entry point. No material merge risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: exporting GraphSelectionModel. It follows the Conventional Commits format with the fix type.
Description check ✅ Passed The description gives a clear overview of the problem, its impact on TypeScript applications, the implementation, and the scope of the change. It does not include the template checklist, issue referen…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.

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.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant