Skip to content

Conversation

@tbouffard
Copy link
Member

@tbouffard tbouffard commented Apr 24, 2025

Historically, the Graph class has been the main entry point in maxGraph. It loads default plugins and style elements automatically, making it convenient for prototyping by reducing initial setup. However, this approach is less ideal for production: it increases the bundle size by including features that might not be used.

The changes here introduce a new way to control what is loaded, with a focus on modularity:

  • BaseGraph: an alternative to Graph that does not load any default configuration. It gives full control to the application over which features are included.
  • AbstractGraph: a new abstract class that holds the common logic shared by Graph and BaseGraph.
  • A new constructor pattern using a single configuration object. This simplifies parameter handling (no more multiple null just to set one optional parameter).
  • The behavior of the existing Graph class is unchanged; it's now built on top of AbstractGraph.

The codebase has been updated to use AbstractGraph where it makes sense, mostly to adjust types and reduce duplication.

The high-level examples now use BaseGraph to demonstrate its benefits. In particular, they show how tree shaking can significantly reduce the bundle size, with a minimal setup resulting in just 105 kB when no optional features (plugins, style elements) are used.

Finally, BaseGraph introduces a simpler constructor model: using a single configuration object instead of multiple parameters. This makes the class easier to extend and avoids the need to override internal factory methods (like createXXX) when customizing behavior.

Examples of Usage of BaseGraph

// basic
const graph = new BaseGraph({
  container: document.getElementById('graphContainer')!,
});


// full configuration
const graph = new BaseGraph({
  cellRenderer: new CellRenderer(),
  container: document.getElementById('graphContainer')!,
  model: new GraphDataModel(),
  plugins: [],
  selectionModel: (graph: AbstractGraph) => new GraphSelectionModel(graph),
  stylesheet: new Stylesheet(),
  view: (graph: AbstractGraph) => new GraphView(graph),
});

Impact of the new implementation on the size of examples

Note:

  • the JS and TS examples doesn't cover the same use case
  • the JS examples are built with webpack, the TS examples are built with Vite
  • the size mentioned here is the one of the whole application in the JS examples and the one of the maxGraph chunk in the TS examples
example before (main branch, commit 94a1609) now
js-example 475.8 kB 476.1 kB
js-example-selected-features 476.1 kB 411.12 kB
js-example-without-default 454.2 kB 347.8 kB
ts-example 439.00 kB 439.30 kB
ts-example-selected-features 439.1 kB 368.72 kB
ts-example-without-default 434.9 kB 330.38 kB

ℹ️ Rollup (used in TS examples) seems to tree-shake maxGraph better than webpack based on the size of js-example-without-defaults (the part of the application in not 17 kB). There’s room for improvement on the webpack side - maybe by adjusting how things are structured in maxGraph.

Notes

Covers #760

Summary by CodeRabbit

  • New Features

    • Introduced a new abstract graph base class and a minimal graph implementation, enabling advanced customization and improved modularity.
    • Added new public exports for the abstract and base graph classes.
  • Refactor

    • Unified all graph-related components, utilities, and mixins to use the new abstract graph type, replacing previous references to the concrete graph type.
    • Updated type annotations, documentation, and method signatures throughout the codebase for consistency and clarity.
  • Documentation

    • Improved and clarified documentation comments across multiple files to reflect updated class names and usage patterns.
  • Tests

    • Enhanced test coverage and structure to validate behavior across different graph implementations.

Introduce BaseGraph, a variation of Graph that does not load default plugins and style builtins.
A new AbstractGraph class is available to share the common logic between Graph and BaseGraph.

The code now mostly use the AbstractGraph when possible to let use both graph classes indifferently.
@tbouffard tbouffard added the enhancement New feature or request label Apr 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Apr 24, 2025

Walkthrough

This change introduces a new AbstractGraph base class that encapsulates the core logic, collaborators, and extensibility points for graph management, rendering, and interaction. The existing Graph class is refactored to extend AbstractGraph, delegating most of its previous logic to the new base class and focusing on providing default registrations and collaborators. A new BaseGraph class is also added, offering a minimal implementation without built-in plugins or styles for optimized production use. All type references, mixins, and collaborators throughout the codebase are updated to use AbstractGraph instead of Graph, and mixin module augmentations are redirected accordingly. Extensive updates to documentation and type annotations are made to reflect this architectural shift.

Changes

File(s) Change Summary
src/view/AbstractGraph.ts Introduces new AbstractGraph class encapsulating core graph logic, collaborators, extensibility, and event handling.
src/view/Graph.ts Refactors Graph to extend AbstractGraph, removing most internal logic and focusing on default registrations and collaborator factories.
src/view/BaseGraph.ts Adds new BaseGraph class, a minimal graph implementation without built-in plugins/styles, for tree-shaking and production optimization.
src/index.ts Exports new AbstractGraph and BaseGraph classes alongside existing Graph.
src/types.ts Updates all graph-related types and plugin interfaces to use AbstractGraph; adds GraphOptions and GraphCollaboratorsOptions types.
src/view/mixins/*.ts, src/view/mixins/*.type.ts Updates all mixin type imports, type aliases, and module augmentations to target AbstractGraph instead of Graph.
src/view/*, src/view/layout/*, src/view/handler/*, src/view/other/*, src/util/*, src/editor/* Updates all type annotations, imports, and documentation to use AbstractGraph instead of Graph for all collaborators, handlers, layouts, utilities, and editor components.
__tests__/* Updates tests to import and use BaseGraph and/or AbstractGraph for parameterized testing and coverage.
Documentation comments Updates all references from Graph to AbstractGraph throughout codebase for clarity and accuracy.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Graph (now extends AbstractGraph)
    participant AbstractGraph
    participant Collaborators
    participant Plugins

    User->>Graph: instantiate Graph(options)
    Graph->>AbstractGraph: super(options)
    AbstractGraph->>Collaborators: initializeCollaborators(options)
    AbstractGraph->>Plugins: initialize plugins (if any)
    AbstractGraph->>AbstractGraph: set up event listeners, state, view, etc.
    User->>Graph: interact/call methods
    Graph->>AbstractGraph: delegate to base class logic
    AbstractGraph->>Collaborators: delegate to collaborators as needed
Loading
sequenceDiagram
    participant User
    participant BaseGraph
    participant AbstractGraph

    User->>BaseGraph: instantiate BaseGraph(options)
    BaseGraph->>AbstractGraph: super(options)
    BaseGraph->>BaseGraph: initializeCollaborators(options) (minimal, no built-ins)
    AbstractGraph->>AbstractGraph: core setup, plugin init (if any)
Loading

Possibly related issues

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sonarqubecloud
Copy link

@tbouffard tbouffard marked this pull request as ready for review April 24, 2025 12:16
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (6)
packages/core/src/view/mixins/PortsMixin.ts (1)

20-22: Pick members from AbstractGraph
Switching the PartialPorts alias to pick properties from AbstractGraph correctly generalizes this mixin. Consider renaming the intermediate PartialType alias (e.g., PortsMixinType) or inlining the type for improved readability.

packages/core/src/view/animate/Animation.ts (1)

33-34: Correct default delay annotation
The @default tag has been updated from 30ms to 20ms to match the constructor’s behavior. Consider adding the unit (ms) description in the main class JSDoc for clarity.

packages/core/src/view/layout/ParallelEdgeLayout.ts (1)

66-68: Constructor can be removed.

The constructor is unnecessary as it only calls the parent constructor without adding any functionality.

-  constructor(graph: AbstractGraph) {
-    super(graph);
-  }
🧰 Tools
🪛 Biome (1.9.4)

[error] 66-68: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

packages/core/src/view/layout/FastOrganicLayout.ts (1)

38-40: Constructor can be removed.

The constructor is unnecessary as it only calls the parent constructor without adding any functionality.

-  constructor(graph: AbstractGraph) {
-    super(graph);
-  }
🧰 Tools
🪛 Biome (1.9.4)

[error] 38-40: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

packages/core/src/view/mixins/ValidationMixin.ts (1)

107-113: Avoid double casting if possible
The expression <AbstractGraph>(<unknown>this) works, but suggests that the mixin’s type definitions don’t align exactly. Consider updating the signature of multiplicity.check (or the mixin interface) to accept the correct context type and eliminate the unknown cast.

packages/core/src/util/Clipboard.ts (1)

39-78: Consider updating example code in documentation.

While the implementation has been correctly updated to use AbstractGraph, the example code in the documentation still references the concrete Graph type. Consider updating this in a future PR for complete consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94a1609 and 9a40f40.

📒 Files selected for processing (107)
  • packages/core/__tests__/util/styleUtils.test.ts (3 hunks)
  • packages/core/__tests__/utils.ts (1 hunks)
  • packages/core/__tests__/view/Graph.test.ts (5 hunks)
  • packages/core/src/editor/Editor.ts (15 hunks)
  • packages/core/src/editor/EditorToolbar.ts (2 hunks)
  • packages/core/src/i18n/Translations.ts (1 hunks)
  • packages/core/src/i18n/config.ts (1 hunks)
  • packages/core/src/index.ts (1 hunks)
  • packages/core/src/serialization/codecs/GraphViewCodec.ts (1 hunks)
  • packages/core/src/serialization/codecs/editor/EditorToolbarCodec.ts (1 hunks)
  • packages/core/src/types.ts (16 hunks)
  • packages/core/src/util/Clipboard.ts (6 hunks)
  • packages/core/src/util/gestureUtils.ts (3 hunks)
  • packages/core/src/util/printUtils.ts (4 hunks)
  • packages/core/src/util/treeTraversal.ts (3 hunks)
  • packages/core/src/util/xmlUtils.ts (2 hunks)
  • packages/core/src/view/AbstractGraph.ts (1 hunks)
  • packages/core/src/view/BaseGraph.ts (1 hunks)
  • packages/core/src/view/Graph.ts (2 hunks)
  • packages/core/src/view/GraphSelectionModel.ts (3 hunks)
  • packages/core/src/view/GraphView.ts (8 hunks)
  • packages/core/src/view/animate/Animation.ts (1 hunks)
  • packages/core/src/view/animate/Effects.ts (3 hunks)
  • packages/core/src/view/animate/Morphing.ts (2 hunks)
  • packages/core/src/view/cell/Cell.ts (1 hunks)
  • packages/core/src/view/cell/CellHighlight.ts (3 hunks)
  • packages/core/src/view/cell/CellMarker.ts (3 hunks)
  • packages/core/src/view/cell/CellOverlay.ts (1 hunks)
  • packages/core/src/view/cell/CellStatePreview.ts (1 hunks)
  • packages/core/src/view/cell/CellTracker.ts (2 hunks)
  • packages/core/src/view/cell/VertexHandle.ts (2 hunks)
  • packages/core/src/view/event/EventSource.ts (1 hunks)
  • packages/core/src/view/event/InternalEvent.ts (3 hunks)
  • packages/core/src/view/event/InternalMouseEvent.ts (2 hunks)
  • packages/core/src/view/geometry/Geometry.ts (1 hunks)
  • packages/core/src/view/handler/ConstraintHandler.ts (3 hunks)
  • packages/core/src/view/handler/EdgeHandler.ts (4 hunks)
  • packages/core/src/view/handler/ElbowEdgeHandler.ts (3 hunks)
  • packages/core/src/view/handler/KeyHandler.ts (8 hunks)
  • packages/core/src/view/handler/VertexHandler.ts (5 hunks)
  • packages/core/src/view/image/ImageBundle.ts (1 hunks)
  • packages/core/src/view/layout/CircleLayout.ts (2 hunks)
  • packages/core/src/view/layout/CompactTreeLayout.ts (2 hunks)
  • packages/core/src/view/layout/CompositeLayout.ts (2 hunks)
  • packages/core/src/view/layout/EdgeLabelLayout.ts (2 hunks)
  • packages/core/src/view/layout/FastOrganicLayout.ts (2 hunks)
  • packages/core/src/view/layout/GraphLayout.ts (4 hunks)
  • packages/core/src/view/layout/HierarchicalLayout.ts (2 hunks)
  • packages/core/src/view/layout/LayoutManager.ts (4 hunks)
  • packages/core/src/view/layout/ParallelEdgeLayout.ts (2 hunks)
  • packages/core/src/view/layout/PartitionLayout.ts (2 hunks)
  • packages/core/src/view/layout/RadialTreeLayout.ts (3 hunks)
  • packages/core/src/view/layout/StackLayout.ts (2 hunks)
  • packages/core/src/view/layout/SwimlaneLayout.ts (2 hunks)
  • packages/core/src/view/layout/SwimlaneManager.ts (4 hunks)
  • packages/core/src/view/layout/hierarchical/CoordinateAssignment.ts (6 hunks)
  • packages/core/src/view/mixins/CellsMixin.ts (2 hunks)
  • packages/core/src/view/mixins/CellsMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/ConnectionsMixin.ts (1 hunks)
  • packages/core/src/view/mixins/ConnectionsMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/DragDropMixin.ts (1 hunks)
  • packages/core/src/view/mixins/DragDropMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/EdgeMixin.ts (2 hunks)
  • packages/core/src/view/mixins/EdgeMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/EditingMixin.ts (2 hunks)
  • packages/core/src/view/mixins/EditingMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/EventsMixin.ts (3 hunks)
  • packages/core/src/view/mixins/EventsMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/FoldingMixin.ts (2 hunks)
  • packages/core/src/view/mixins/FoldingMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/GroupingMixin.ts (2 hunks)
  • packages/core/src/view/mixins/GroupingMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/ImageMixin.ts (1 hunks)
  • packages/core/src/view/mixins/ImageMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/LabelMixin.ts (1 hunks)
  • packages/core/src/view/mixins/LabelMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/OrderMixin.ts (1 hunks)
  • packages/core/src/view/mixins/OrderMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/OverlaysMixin.ts (2 hunks)
  • packages/core/src/view/mixins/OverlaysMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/PageBreaksMixin.ts (2 hunks)
  • packages/core/src/view/mixins/PageBreaksMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/PanningMixin.ts (1 hunks)
  • packages/core/src/view/mixins/PanningMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/PortsMixin.ts (1 hunks)
  • packages/core/src/view/mixins/PortsMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/SelectionMixin.ts (2 hunks)
  • packages/core/src/view/mixins/SelectionMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/SnapMixin.ts (1 hunks)
  • packages/core/src/view/mixins/SnapMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/SwimlaneMixin.ts (2 hunks)
  • packages/core/src/view/mixins/SwimlaneMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/TerminalMixin.ts (1 hunks)
  • packages/core/src/view/mixins/TerminalMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/TooltipMixin.ts (1 hunks)
  • packages/core/src/view/mixins/TooltipMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/ValidationMixin.ts (3 hunks)
  • packages/core/src/view/mixins/ValidationMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/VertexMixin.ts (1 hunks)
  • packages/core/src/view/mixins/VertexMixin.type.ts (5 hunks)
  • packages/core/src/view/mixins/ZoomMixin.ts (1 hunks)
  • packages/core/src/view/mixins/ZoomMixin.type.ts (1 hunks)
  • packages/core/src/view/mixins/_graph-mixins-apply.ts (2 hunks)
  • packages/core/src/view/other/AutoSaveManager.ts (4 hunks)
  • packages/core/src/view/other/DragSource.ts (10 hunks)
  • packages/core/src/view/other/Guide.ts (2 hunks)
  • packages/core/src/view/other/Multiplicity.ts (5 hunks)
⛔ Files not processed due to max files limit (25)
  • packages/core/src/view/other/Outline.ts
  • packages/core/src/view/other/PanningManager.ts
  • packages/core/src/view/other/PrintPreview.ts
  • packages/core/src/view/plugins/CellEditorHandler.ts
  • packages/core/src/view/plugins/ConnectionHandler.ts
  • packages/core/src/view/plugins/FitPlugin.ts
  • packages/core/src/view/plugins/PanningHandler.ts
  • packages/core/src/view/plugins/PopupMenuHandler.ts
  • packages/core/src/view/plugins/RubberBandHandler.ts
  • packages/core/src/view/plugins/SelectionCellsHandler.ts
  • packages/core/src/view/plugins/SelectionHandler.ts
  • packages/core/src/view/plugins/TooltipHandler.ts
  • packages/core/src/view/style/config.ts
  • packages/core/src/view/undoable_changes/SelectionChange.ts
  • packages/core/tsconfig.json
  • packages/html/stories/DynamicToolbar.stories.ts
  • packages/html/stories/MenuStyle.stories.ts
  • packages/html/stories/Toolbar.stories.ts
  • packages/js-example-selected-features/src/index.js
  • packages/js-example-without-defaults/src/index.js
  • packages/ts-example-selected-features/src/main.ts
  • packages/ts-example-selected-features/vite.config.js
  • packages/ts-example-without-defaults/src/main.ts
  • packages/ts-example-without-defaults/vite.config.js
  • packages/ts-example/vite.config.js
🧰 Additional context used
🧬 Code Graph Analysis (39)
packages/core/src/view/mixins/PortsMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/_graph-mixins-apply.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/EditingMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/DragDropMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/DragDropMixin.type.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/ZoomMixin.type.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/PageBreaksMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/cell/CellHighlight.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/ImageMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/GroupingMixin.type.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/animate/Effects.ts (3)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/types.ts (1)
  • UndoableChange (37-41)
packages/core/src/view/cell/Cell.ts (1)
  • Cell (66-892)
packages/core/src/view/mixins/VertexMixin.type.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/cell/CellTracker.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/OrderMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/PortsMixin.type.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/OrderMixin.type.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/TerminalMixin.type.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/layout/SwimlaneManager.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/editor/EditorToolbar.ts (2)
packages/core/src/view/other/DragSource.ts (1)
  • DropHandler (47-53)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/CellsMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/util/xmlUtils.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/BaseGraph.ts (2)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/types.ts (1)
  • GraphCollaboratorsOptions (1402-1408)
packages/core/src/view/GraphSelectionModel.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/mixins/TerminalMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/handler/KeyHandler.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/__tests__/view/Graph.test.ts (2)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/__tests__/utils.ts (1)
  • createGraphWithoutPlugins (30-30)
packages/core/src/view/layout/GraphLayout.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/__tests__/util/styleUtils.test.ts (1)
packages/core/__tests__/utils.ts (1)
  • createGraphWithoutPlugins (30-30)
packages/core/src/view/handler/EdgeHandler.ts (2)
packages/core/src/types.ts (1)
  • MouseListenerSet (1140-1144)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/__tests__/utils.ts (1)
packages/core/src/view/Graph.ts (1)
  • Graph (41-102)
packages/core/src/view/mixins/ConnectionsMixin.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/layout/LayoutManager.ts (4)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/html/stories/HoverIcons.stories.js (1)
  • graph (119-119)
packages/html/stories/DragSource.stories.js (1)
  • graph (96-96)
packages/html/stories/HelloWorld.stories.js (1)
  • graph (50-50)
packages/core/src/view/other/AutoSaveManager.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/GraphView.ts (3)
packages/html/stories/Control.stories.js (1)
  • graph (141-141)
packages/html/stories/Permissions.stories.js (1)
  • graph (55-55)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/util/printUtils.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/layout/hierarchical/CoordinateAssignment.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
packages/core/src/view/other/Multiplicity.ts (2)
packages/core/src/index.ts (2)
  • AbstractGraph (20-20)
  • Cell (202-202)
packages/core/src/view/cell/Cell.ts (1)
  • Cell (66-892)
packages/core/src/view/Graph.ts (5)
packages/core/src/view/style/register.ts (3)
  • registerDefaultEdgeMarkers (109-128)
  • registerDefaultEdgeStyles (38-56)
  • registerDefaultPerimeters (67-82)
packages/core/src/view/cell/register-shapes.ts (1)
  • registerDefaultShapes (46-72)
packages/core/src/types.ts (2)
  • GraphCollaboratorsOptions (1402-1408)
  • GraphPluginConstructor (1108-1111)
packages/core/src/view/GraphDataModel.ts (1)
  • GraphDataModel (218-1182)
packages/core/src/view/plugins/index.ts (1)
  • getDefaultPlugins (46-55)
packages/core/src/view/other/DragSource.ts (1)
packages/core/src/index.ts (1)
  • AbstractGraph (20-20)
🪛 Biome (1.9.4)
packages/core/src/view/animate/Effects.ts

[error] 59-59: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

packages/core/src/view/layout/ParallelEdgeLayout.ts

[error] 66-68: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

packages/core/src/view/layout/FastOrganicLayout.ts

[error] 38-40: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

packages/core/src/util/gestureUtils.ts

[error] 89-89: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

packages/core/src/view/AbstractGraph.ts

[error] 83-83: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)


[error] 84-84: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

🔇 Additional comments (237)
packages/core/src/i18n/Translations.ts (1)

76-76: Docs: Reference updated to AbstractGraph
The JSDoc now correctly points to AbstractGraph instead of the concrete Graph class. No functional impact.

packages/core/src/view/image/ImageBundle.ts (1)

55-55: Docs: Corrected postProcessCellStyle reference
The documentation now links to AbstractGraph.postProcessCellStyle instead of Graph#postProcessCellStyle, aligning with the new abstract graph API.

packages/core/src/view/geometry/Geometry.ts (1)

48-48: Docs: Updated resetEdges hooks to AbstractGraph
The documentation for disabling control-point resets now references AbstractGraph.resetEdgesOnMove/resetEdgesOnResize as intended.

packages/core/src/view/event/InternalMouseEvent.ts (3)

83-83: Docs: Updated graphX setter reference
The JSDoc for graphX now correctly refers to AbstractGraph.fireMouseEvent instead of the old Graph class.


89-89: Docs: Updated graphY setter reference
Similarly, the JSDoc for graphY now links to AbstractGraph.fireMouseEvent to reflect the abstraction.


100-100: Docs: Updated sourceState resolution reference
The comment now points to AbstractGraph.getEventState, matching the new abstract API for event state resolution.

packages/core/src/view/cell/CellOverlay.ts (1)

30-32: Docs: Replaced Graph methods with AbstractGraph
The overlay JSDoc now references AbstractGraph.addCellOverlay, removeCellOverlay(s) and getCellOverlays, ensuring consistency with the abstract graph interface.

packages/core/src/view/mixins/PortsMixin.ts (1)

17-17: Adopt AbstractGraph for mixin typing
The import has been updated to AbstractGraph, aligning with the new abstraction layer. Ensure that packages/core/src/view/AbstractGraph.ts exports these members.

packages/core/src/i18n/config.ts (1)

91-93: Update JSDoc to reference AbstractGraph resources
The links for alreadyConnectedResource, collapseExpandResource, and containsValidationErrorsResource have been updated to point to AbstractGraph, ensuring consistency with the new base class.

packages/core/src/serialization/codecs/GraphViewCodec.ts (1)

54-54: Reference AbstractGraph.getLabel in JSDoc
The documentation now correctly points to AbstractGraph.getLabel instead of Graph.getLabel, aligning with the new abstraction.

packages/core/src/view/cell/Cell.ts (1)

43-44: Doc links updated to AbstractGraph
The example JSDoc now references AbstractGraph.convertValueToString and AbstractGraph.cellLabelChanged, keeping the documentation consistent with the refactored class hierarchy.

packages/core/src/view/mixins/DragDropMixin.ts (2)

17-17: Update of import type aligns with architecture refactoring.

The change from importing Graph to AbstractGraph supports the new class hierarchy introduced in this PR.


19-22: Type references properly updated to use AbstractGraph.

Both PartialGraph and PartialDragDrop now correctly pick properties from AbstractGraph instead of Graph, maintaining the same functionality while enabling compatibility with both Graph and the new BaseGraph class.

packages/core/src/view/mixins/FoldingMixin.type.ts (1)

22-23: Module declaration correctly updated to augment AbstractGraph.

The module augmentation now properly extends AbstractGraph instead of Graph, ensuring these folding-related methods are available on all graph implementations.

packages/core/src/view/mixins/GroupingMixin.ts (2)

24-24: Import type updated to AbstractGraph.

The change from importing Graph to AbstractGraph aligns with the architecture refactoring.


26-28: Type references correctly updated to AbstractGraph.

Both PartialGraph and PartialGrouping type aliases now properly reference AbstractGraph instead of Graph, ensuring compatibility with all graph implementations.

Also applies to: 51-53

packages/core/src/serialization/codecs/editor/EditorToolbarCodec.ts (1)

92-92: Documentation updated to reference AbstractGraph.

The JSDoc comment is correctly updated to reference AbstractGraph.getCellAt instead of Graph#getCellAt, reflecting the new class hierarchy.

packages/core/src/view/layout/CircleLayout.ts (2)

20-20: Import type updated to AbstractGraph.

The import now correctly references AbstractGraph instead of Graph, supporting the new class hierarchy.


41-42: Constructor parameter and JSDoc updated to use AbstractGraph.

The constructor parameter type and corresponding JSDoc comment now reference AbstractGraph instead of Graph, making the CircleLayout class compatible with both Graph and BaseGraph implementations.

Also applies to: 44-44

packages/core/src/index.ts (1)

20-21: Well-structured addition of new graph classes to the public API.

The addition of AbstractGraph and BaseGraph exports aligns perfectly with the PR's objective to introduce more efficient graph instantiation options that don't automatically load default plugins and style builtins.

packages/core/src/view/layout/StackLayout.ts (1)

21-21: Good refactoring to use AbstractGraph instead of Graph.

The update to use AbstractGraph instead of the concrete Graph implementation allows the layout to work with both Graph and the new BaseGraph classes, supporting the architectural improvement described in the PR objectives.

Also applies to: 40-40

packages/core/src/view/cell/VertexHandle.ts (1)

31-31: Proper type abstraction for graph dependency.

Changing the graph property type from Graph to AbstractGraph allows VertexHandle to work with both graph implementations, maintaining compatibility while enabling the more efficient BaseGraph option introduced in this PR.

Also applies to: 43-43

packages/core/src/view/mixins/_graph-mixins-apply.ts (1)

18-18: Appropriate update to mixins application target.

The change to apply mixins to AbstractGraph instead of Graph is essential for the new architecture - it ensures that the mixins are applied to the abstract base class, making functionality available to both Graph and BaseGraph implementations.

Also applies to: 43-43

packages/core/src/view/mixins/SnapMixin.ts (2)

17-17: Type import updated to use AbstractGraph.

The import has been correctly updated to reference AbstractGraph instead of Graph, which aligns with the architectural changes introduced in this PR.


19-19: Type references properly updated to AbstractGraph.

The type definitions for PartialGraph and PartialSnap have been correctly updated to pick properties from AbstractGraph instead of Graph, maintaining type consistency with the new class hierarchy.

Also applies to: 21-21

packages/core/src/view/mixins/LabelMixin.ts (2)

17-17: Type import updated to use AbstractGraph.

The import has been correctly updated to reference AbstractGraph instead of Graph, which aligns with the architectural changes introduced in this PR.


20-20: Type references properly updated to AbstractGraph.

The type definitions for PartialGraph and PartialLabel have been correctly updated to pick properties from AbstractGraph instead of Graph, maintaining type consistency with the new class hierarchy.

Also applies to: 28-28

packages/core/src/view/mixins/ZoomMixin.type.ts (1)

19-20: Module declaration properly updated to augment AbstractGraph.

The module declaration has been correctly updated to augment the AbstractGraph interface instead of the Graph interface, which is consistent with the new class hierarchy. The interface members remain unchanged, preserving the existing functionality.

packages/core/src/view/mixins/EditingMixin.type.ts (1)

21-22: Module declaration properly updated to augment AbstractGraph.

The module declaration has been correctly updated to augment the AbstractGraph interface instead of the Graph interface, which is consistent with the new class hierarchy. The interface members remain unchanged, preserving the existing functionality.

packages/core/src/view/layout/EdgeLabelLayout.ts (2)

23-23: The import type change aligns with the AbstractGraph refactoring.

The change from importing Graph to AbstractGraph is consistent with the PR objectives of generalizing graph interface usage, allowing for either Graph or BaseGraph implementations to be used interchangeably.


42-42: Constructor parameter type updated to use AbstractGraph.

This type change correctly implements the architectural shift from concrete Graph to AbstractGraph, enabling the EdgeLabelLayout to work with either Graph or the new BaseGraph implementations.

packages/core/src/view/mixins/EditingMixin.ts (3)

20-20: Import statement updated to use AbstractGraph.

This import change supports the architectural refactoring described in the PR objectives, allowing EditingMixin to work with the new class hierarchy.


23-25: Type reference in PartialGraph updated to AbstractGraph.

The PartialGraph type alias now correctly references AbstractGraph instead of Graph, ensuring type safety when the mixin is applied to either Graph or BaseGraph implementations.


36-38: Type reference in PartialEditing updated to AbstractGraph.

The PartialEditing type alias now correctly references AbstractGraph, maintaining consistency with the new class hierarchy introduced in this PR.

packages/core/src/view/mixins/DragDropMixin.type.ts (1)

19-20: Module declaration updated to extend AbstractGraph.

The module augmentation now correctly targets AbstractGraph instead of Graph, ensuring that drag-drop functionality is properly typed across both Graph and BaseGraph implementations. This change is essential for the architectural refactoring described in the PR objectives.

packages/core/src/view/mixins/PortsMixin.type.ts (1)

19-20: Module augmentation updated to target AbstractGraph.

The module declaration now correctly extends AbstractGraph instead of Graph, ensuring that ports functionality is properly typed across both Graph and BaseGraph implementations. This change is consistent with the PR's goal of enabling interchangeable use of both Graph and BaseGraph classes.

packages/core/src/view/mixins/CellsMixin.type.ts (1)

23-24: Updated module augmentation target to AbstractGraph

This change correctly modifies the module augmentation to target the new AbstractGraph interface instead of Graph, aligning with the architectural refactoring where Graph now extends AbstractGraph. This is consistent with the PR objective of creating a more flexible graph implementation hierarchy.

packages/core/src/view/mixins/SwimlaneMixin.type.ts (1)

21-22: Updated module augmentation target to AbstractGraph

The module augmentation has been properly updated to target the new AbstractGraph interface rather than Graph. This change maintains the type integration pattern used throughout the codebase and supports the new class hierarchy.

packages/core/src/view/mixins/SnapMixin.type.ts (1)

20-21: Updated module augmentation target to AbstractGraph

The module augmentation has been correctly modified to target the new AbstractGraph interface. This change is part of the broader refactoring to support both standard Graph and the new lightweight BaseGraph implementation.

packages/core/src/view/mixins/LabelMixin.type.ts (1)

19-20: Updated module augmentation target to AbstractGraph

The module augmentation has been appropriately changed to target AbstractGraph instead of Graph. This ensures that label-related functionality is available to all implementations extending from AbstractGraph.

packages/core/src/view/mixins/ImageMixin.ts (1)

17-17: Type reference updated to use AbstractGraph

This change correctly updates the import and type reference from Graph to AbstractGraph, aligning with the architectural shift to use the new abstract base class. This allows the mixin to work with both Graph and BaseGraph implementations.

Also applies to: 21-21

packages/core/src/view/mixins/ConnectionsMixin.type.ts (1)

23-24: Module augmentation now targets AbstractGraph

The module declaration correctly augments the new AbstractGraph interface instead of Graph, which is consistent with the architectural changes introduced in this PR. This allows connection-related functionality to be available on all graph implementations.

packages/core/src/view/mixins/SwimlaneMixin.ts (1)

22-22: Type references updated to use AbstractGraph

The import and type references have been properly updated from Graph to AbstractGraph for both PartialGraph and PartialSwimlane types. This change ensures that the swimlane functionality works with all graph implementations derived from the abstract base class.

Also applies to: 26-26, 40-40

packages/core/src/view/mixins/EdgeMixin.type.ts (1)

20-21: Module augmentation now targets AbstractGraph

The module declaration has been correctly updated to augment the AbstractGraph interface instead of Graph. This change ensures that edge-related functionality is available on all graph implementations, including the new BaseGraph class mentioned in the PR objectives.

packages/core/src/view/other/Guide.ts (1)

25-26: Consistent Graph abstraction applied in Guide.ts

The import, constructor signature, JSDoc, and class property have all been correctly updated from the concrete Graph to the new AbstractGraph type, aligning this helper with the refactored graph hierarchy.

Also applies to: 35-36, 41-43

packages/core/src/view/mixins/VertexMixin.ts (1)

19-24: Type references updated to AbstractGraph in VertexMixin

The import type and Pick<> aliases have been updated to reference AbstractGraph instead of Graph. All required graph methods (addCell, getChildCells, createVertex, etc.) are now correctly sourced from the abstract interface.

packages/core/src/view/layout/HierarchicalLayout.ts (1)

28-29: Refactor Graph dependency to AbstractGraph in HierarchicalLayout

The import, JSDoc @param, and constructor signature have been updated to use AbstractGraph, ensuring that this layout works against the generalized graph interface.

Also applies to: 41-47

packages/core/src/view/mixins/GroupingMixin.type.ts (1)

20-21: Module augmentation refactored to AbstractGraph

The declaration merging target has been changed from Graph to AbstractGraph, and the interface name updated accordingly, ensuring the grouping APIs extend the correct abstract base.

packages/core/src/view/mixins/TerminalMixin.ts (1)

19-23: TerminalMixin types adapted to AbstractGraph

The import type and Pick<> definitions for getView, isTerminalPointMovable, and getOpposites now correctly reference AbstractGraph, keeping the mixin aligned with the new abstraction.

packages/core/src/view/mixins/OverlaysMixin.type.ts (1)

21-22: LGTM!

Good refactoring to use AbstractGraph instead of Graph in the module declaration. This aligns with the PR objective of updating type references to use the abstract base class.

packages/core/src/view/layout/PartitionLayout.ts (2)

21-21: LGTM!

Correct import of AbstractGraph type to replace the previous Graph import.


42-42: LGTM!

Properly updated constructor parameter type from Graph to AbstractGraph to support both Graph and BaseGraph instances.

packages/core/src/view/mixins/TooltipMixin.ts (2)

20-20: LGTM!

Correct import of AbstractGraph type to replace the previous Graph import.


25-32: LGTM!

Good refactoring of the PartialGraph and PartialTooltip type aliases to pick properties from AbstractGraph instead of Graph. This ensures compatibility with both Graph and BaseGraph implementations.

packages/core/src/view/layout/RadialTreeLayout.ts (3)

25-25: LGTM!

Correct import of AbstractGraph type to replace the previous Graph import.


40-40: LGTM!

Properly updated constructor parameter type from Graph to AbstractGraph to support both Graph and BaseGraph instances.


136-136: LGTM!

Correctly updated JSDoc comment to reference AbstractGraph.findTreeRoots instead of Graph.findTreeRoots, maintaining documentation consistency with the new abstraction.

packages/core/src/view/event/EventSource.ts (2)

27-29: Update documentation to modern ES6 subclassing
The example now shows class MyClass extends EventSource {…}, replacing legacy prototype patterns.


40-40: Replace Graph with AbstractGraph in known subclasses list
References were updated to AbstractGraph, aligning docs with the new class hierarchy.

packages/core/src/util/xmlUtils.ts (2)

22-22: Switch import from Graph to AbstractGraph
The utility now types its graph parameter as AbstractGraph, matching the new abstraction layer.


42-42: Update getViewXml signature to use AbstractGraph
Ensures getViewXml accepts the abstract base class, supporting both Graph and BaseGraph.

packages/core/src/view/cell/CellTracker.ts (2)

21-21: Import AbstractGraph instead of Graph
Aligns the handler to depend on the abstract base class for broader compatibility.


81-81: Constructor parameter now AbstractGraph
Updates the graph argument type to AbstractGraph without altering the handler logic.

packages/core/src/view/mixins/EdgeMixin.ts (3)

21-21: Import AbstractGraph for mixin type definitions
Unifies all graph typings to the new AbstractGraph interface.


29-30: Update PartialGraph to pick from AbstractGraph
The PartialGraph alias now references AbstractGraph methods, replacing the concrete Graph type.


43-44: Update PartialEdge to pick from AbstractGraph
All edge-related methods are now typed against AbstractGraph for consistency.

packages/core/src/view/mixins/CellsMixin.ts (2)

46-46: Import AbstractGraph in CellsMixin
Reflects the new abstraction by using AbstractGraph in mixin typings.


50-51: Update PartialGraph alias to use AbstractGraph
Switches the PartialGraph definition to pull methods from AbstractGraph, consistent with the refactor.

packages/core/src/view/cell/CellStatePreview.ts (2)

23-23: Update import to use AbstractGraph consistently

The import statement now properly references AbstractGraph from the updated path, aligning with the architectural changes in the codebase.


30-30: Update type annotations to use AbstractGraph instead of Graph

The constructor, property type, and JSDoc comments now reference AbstractGraph instead of Graph, properly aligning with the new architecture where AbstractGraph serves as the base class from which concrete implementations extend.

Also applies to: 36-38

packages/core/src/view/handler/ConstraintHandler.ts (2)

34-34: Update import to use AbstractGraph consistently

The import statement now properly references AbstractGraph from the updated path, aligning with the new class hierarchy.


54-56: Update type annotations to use AbstractGraph instead of Graph

The constructor parameter type, property type, and JSDoc comments now consistently reference AbstractGraph instead of Graph, ensuring this component works with any implementation that extends the AbstractGraph base class.

Also applies to: 88-88

packages/core/src/view/cell/CellHighlight.ts (2)

28-28: Update import to use AbstractGraph consistently

The import statement now properly references AbstractGraph from the updated path, aligning with the architectural refactoring.


62-64: Update type annotations to use AbstractGraph instead of Graph

The constructor parameter type, property type, and JSDoc comments now consistently reference AbstractGraph instead of Graph, making this component compatible with any implementation that extends the AbstractGraph base class.

Also applies to: 85-85

packages/core/src/editor/EditorToolbar.ts (2)

28-28: Update import to use AbstractGraph consistently

The import statement now properly references AbstractGraph from the updated path, aligning with the architectural refactoring of the graph classes.


303-306: Update dropHandler type to use AbstractGraph

The dropHandler function parameter has been properly updated to use AbstractGraph instead of Graph, ensuring compatibility with both Graph and the new BaseGraph implementations. The parameter is also renamed to _graph to indicate it's not used in the function body.

packages/core/src/view/mixins/OrderMixin.type.ts (1)

19-20: LGTM - Correct module augmentation update.

The update from augmenting Graph to augmenting AbstractGraph is aligned with the PR's goal of introducing AbstractGraph as a base class. This change ensures that both Graph and the new BaseGraph implementations will have these methods.

packages/core/src/view/layout/ParallelEdgeLayout.ts (1)

22-22: LGTM - Properly updated import from Graph to AbstractGraph.

This change correctly updates the import to use the new AbstractGraph type, aligning with the PR's goal of generalizing code to work with both Graph and BaseGraph implementations.

packages/core/src/view/layout/FastOrganicLayout.ts (1)

20-20: LGTM - Properly updated import from Graph to AbstractGraph.

This change correctly updates the import to use the new AbstractGraph type, allowing the layout to work with both Graph and BaseGraph implementations.

packages/core/src/view/mixins/SelectionMixin.ts (3)

21-21: LGTM - Properly updated import from Graph to AbstractGraph.

This change correctly updates the import to use the new AbstractGraph type, aligning with the PR's goal of generalizing code to work with both Graph and BaseGraph implementations.


23-25: LGTM - Updated Pick utility type to use AbstractGraph.

The PartialGraph type correctly references AbstractGraph now, ensuring consistency with the new class hierarchy.


34-36: LGTM - Updated Pick utility type to use AbstractGraph.

The PartialCells type correctly references AbstractGraph now, ensuring consistency with the new class hierarchy.

packages/core/src/view/mixins/ZoomMixin.ts (3)

19-19: Import replacement aligns with the new abstraction.

The change from importing Graph to AbstractGraph correctly implements the architectural change described in the PR, allowing this mixin to work with both Graph and the new BaseGraph implementations.


22-23: Type reference update ensures compatibility with all graph implementations.

Updating the PartialGraph type to reference AbstractGraph rather than Graph is necessary to support both the original Graph class and the new BaseGraph class introduced in this PR.


25-27: Type reference update preserves zoom functionality across graph implementations.

The PartialZoom type now correctly references AbstractGraph, ensuring that zoom capabilities work consistently regardless of whether a user is using the full Graph or the more efficient BaseGraph class.

packages/core/src/view/mixins/PageBreaksMixin.type.ts (1)

21-22: Module declaration update supports the new abstract graph architecture.

The module augmentation now correctly targets AbstractGraph instead of Graph, which aligns with the PR's objective of creating an abstraction layer that supports both the full-featured Graph and the lighter BaseGraph implementations.

packages/core/src/view/mixins/ValidationMixin.type.ts (1)

21-22: Module augmentation properly redirected to the new abstract type.

Changing the module declaration to target AbstractGraph ensures that validation features are available to both graph implementations while maintaining type safety.

packages/core/src/view/layout/CompositeLayout.ts (3)

20-20: Import refactoring for layout compatibility with both graph implementations.

The updated import ensures CompositeLayout works with both Graph and BaseGraph implementations by depending on the common AbstractGraph interface rather than the concrete Graph class.


45-46: JSDoc update maintains documentation accuracy.

The JSDoc comment has been appropriately updated to reflect the parameter type change, ensuring that documentation remains consistent with the new type system.


49-49: Constructor parameter type correctly updated for abstraction.

The constructor now accepts any implementation of AbstractGraph rather than only the concrete Graph class, supporting the PR's goal of allowing efficient instantiation with BaseGraph when default plugins aren't needed.

packages/core/src/view/mixins/TerminalMixin.type.ts (1)

19-20: Module and interface update to support the new AbstractGraph class

This change aligns with the PR's architectural refactoring, updating the module declaration and interface name to use AbstractGraph instead of Graph. This is part of the broader effort to generalize graph handling through the AbstractGraph abstraction.

packages/core/src/view/event/InternalEvent.ts (3)

30-30: Updated import to use AbstractGraph

The import statement has been updated to reference the new AbstractGraph type, aligning with the architectural changes in this PR.


57-57: Updated documentation to reference AbstractGraph

Documentation now correctly references AbstractGraph instead of Graph, maintaining consistency with the new architectural approach.


241-241: Updated parameter type from Graph to AbstractGraph

The type annotation for the graph parameter has been updated to use AbstractGraph, allowing this method to work with any class that implements the AbstractGraph interface, including both Graph and the new BaseGraph.

packages/core/src/view/mixins/EventsMixin.type.ts (1)

24-25: Updated module declaration and interface name

The module declaration and interface name have been updated to reflect the new AbstractGraph class. This change is part of the architectural refactoring that introduces AbstractGraph as a base class for Graph implementations.

packages/core/src/view/mixins/TooltipMixin.type.ts (1)

20-21: Updated module declaration and interface name

The module declaration and interface name have been changed from Graph to AbstractGraph, consistent with the other mixin type files. This change supports the new class hierarchy where Graph and BaseGraph both extend AbstractGraph.

packages/core/src/view/mixins/OrderMixin.ts (3)

20-20: Properly updated the import statement to use AbstractGraph

This change correctly updates the import statement to use the newly introduced AbstractGraph type, aligning with the architectural changes in the PR.


24-25: Correctly updated type reference to AbstractGraph

The PartialGraph type definition now correctly uses AbstractGraph as its base type, maintaining compatibility with both Graph and BaseGraph implementations.


27-27: Correctly updated PartialOrder to use AbstractGraph

The type definition now properly references AbstractGraph, ensuring consistent type definitions throughout the mixin implementation.

packages/core/src/view/mixins/SelectionMixin.type.ts (1)

21-22: Updated module declaration to properly extend AbstractGraph

This change correctly updates the module declaration to augment the AbstractGraph interface instead of Graph, ensuring that selection-related properties and methods are properly attributed to the abstract base class. This enables consistent typing for both Graph and BaseGraph implementations.

packages/core/__tests__/utils.ts (2)

20-24: Added helpful JSDoc comments to explain utility function purpose

The added documentation clearly explains the purpose of the createGraphWithoutContainer utility function, which is valuable for test readability and maintenance. The comment properly explains when this utility should be used (when tests don't check the view).


27-29: Added clear documentation for the createGraphWithoutPlugins function

The JSDoc comment clearly describes that this function creates a Graph without plugins by passing an empty array of plugins. This documentation makes the function's purpose and behavior explicit for test authors.

packages/core/src/view/cell/CellMarker.ts (3)

32-32: Updated import statement to use AbstractGraph

This change correctly updates the import to use the new AbstractGraph type from its proper location, aligning with the architectural changes introduced in this PR.


62-64: Updated property JSDoc and type to use AbstractGraph

The JSDoc comment and type annotation for the graph property have been correctly updated to reference AbstractGraph instead of Graph, maintaining consistent typing throughout the codebase.


116-123: Updated constructor parameter JSDoc and type to use AbstractGraph

The JSDoc for the constructor parameter and the type annotation have been properly updated to use AbstractGraph, ensuring type consistency.

packages/core/src/util/treeTraversal.ts (3)

19-19: Import updated to use AbstractGraph type.

The import is correctly updated to use the new AbstractGraph type, aligning with the architectural changes where Graph now extends AbstractGraph.


30-31: Clear parameter documentation added.

Good addition of explicit documentation for the graph parameter, improving code readability.


40-40: Parameter type updated to AbstractGraph.

The parameter type is correctly updated from Graph to AbstractGraph, allowing this function to work with both Graph and BaseGraph instances, in line with the PR objectives.

packages/core/src/view/layout/CompactTreeLayout.ts (2)

27-27: Import updated to use AbstractGraph type.

The import is correctly updated to use the new AbstractGraph type instead of Graph.


78-78: Constructor parameter type updated to AbstractGraph.

The constructor parameter type is correctly updated from Graph to AbstractGraph, allowing this layout to work with both Graph and BaseGraph instances, in line with the PR objectives.

packages/core/src/view/handler/ElbowEdgeHandler.ts (3)

34-34: JSDoc updated to reference AbstractGraph.

The JSDoc comment is correctly updated to reference AbstractGraph.createHandler instead of Graph.createHandler, reflecting the architectural change.


48-48: JSDoc updated to reference AbstractGraph.

The JSDoc comment is correctly updated to reference AbstractGraph.flipEdge instead of Graph.flipEdge.


95-95: JSDoc updated to reference AbstractGraph.

The JSDoc comment is correctly updated to reference AbstractGraph.flipEdge instead of Graph.flipEdge, maintaining documentation consistency with the new architecture.

packages/core/src/view/mixins/ImageMixin.type.ts (1)

19-20: Module augmentation updated to target AbstractGraph.

The module augmentation is correctly updated to target the AbstractGraph interface in '../AbstractGraph' module instead of Graph in '../Graph'. This ensures that image-related functionalities are available to all implementations of AbstractGraph, supporting the new architecture.

packages/core/src/view/mixins/OverlaysMixin.ts (3)

21-21: Properly updated type import to use AbstractGraph

The import has been changed to use the new abstract base class, which aligns with the PR objective of making the codebase use AbstractGraph where possible.


23-25: Type reference correctly updated to AbstractGraph

The PartialGraph type now picks properties from AbstractGraph instead of Graph, maintaining the same functionality while supporting the new architecture.


33-35: Type reference correctly updated to AbstractGraph

The PartialOverlays type now picks properties from AbstractGraph instead of Graph, maintaining the same functionality while supporting the new architecture.

packages/core/src/view/mixins/VertexMixin.type.ts (5)

21-22: Module declaration properly updated to augment AbstractGraph

The module augmentation has been changed to target AbstractGraph instead of Graph, which is consistent with the architectural change introduced in this PR.


56-57: JSDoc reference updated to AbstractGraph

The JSDoc comment has been updated to refer to AbstractGraph instead of Graph, maintaining consistency in the documentation.


72-73: JSDoc reference updated to AbstractGraph

The JSDoc comment has been updated to refer to AbstractGraph instead of Graph, maintaining consistency in the documentation.


107-108: JSDoc reference updated to AbstractGraph

The JSDoc comment has been updated to refer to AbstractGraph instead of Graph, maintaining consistency in the documentation.


128-129: JSDoc reference updated to AbstractGraph

The JSDoc comment has been updated to refer to AbstractGraph instead of Graph, maintaining consistency in the documentation.

packages/core/src/view/mixins/PageBreaksMixin.ts (3)

20-20: Properly updated type import to use AbstractGraph

The import has been changed to use the new abstract base class, which aligns with the PR objective of making the codebase use AbstractGraph where possible.


22-24: Type reference correctly updated to AbstractGraph

The PartialGraph type now picks properties from AbstractGraph instead of Graph, maintaining the same functionality while supporting the new architecture.


33-35: Type reference correctly updated to AbstractGraph

The PartialPageBreaks type now picks properties from AbstractGraph instead of Graph, maintaining the same functionality while supporting the new architecture.

packages/core/src/view/layout/SwimlaneLayout.ts (3)

29-29: Properly updated type import to use AbstractGraph

The import has been changed to use the new abstract base class, which aligns with the PR objective of making the codebase use AbstractGraph where possible.


43-45: Updated JSDoc parameter type and fixed constant reference

The JSDoc comment has been improved in two ways:

  1. Updated to refer to AbstractGraph instead of Graph
  2. Fixed the constant reference to use DIRECTION.NORTH instead of DIRECTION_NORTH to match the actual implementation

These changes make the documentation more accurate and consistent with the code.


47-47: Constructor parameter type updated to AbstractGraph

The constructor parameter type has been updated to accept AbstractGraph rather than Graph, allowing instances to be created with either Graph or BaseGraph implementations.

packages/core/src/view/handler/KeyHandler.ts (4)

19-19: Import updated to reference AbstractGraph

The import statement is correctly updated to use the more abstract AbstractGraph type instead of the concrete Graph implementation, aligning with the architectural changes to promote abstraction and flexibility.


37-37: Documentation updated to reference AbstractGraph.container

JSDoc comment properly updated to reference AbstractGraph.container property, maintaining documentation consistency with the type changes.


77-77: Type annotations updated to AbstractGraph

Constructor parameter, property type, and associated JSDoc comments have been appropriately updated to use AbstractGraph instead of Graph. This change enables the KeyHandler to work with any implementation of the AbstractGraph interface, including both Graph and the new lightweight BaseGraph.

Also applies to: 81-81, 98-100


228-229: JSDoc references updated to AbstractGraph

Documentation references to graph methods (isEnabled, isEditing, stopEditing) have been properly updated to point to AbstractGraph implementation, maintaining accurate API documentation.

Also applies to: 299-299, 309-310

packages/core/__tests__/util/styleUtils.test.ts (3)

25-25: Import updated to include BaseGraph

The import statement has been correctly updated to import BaseGraph alongside the CellStyle type, which will be used in the parameterized tests.


125-129: Test expanded to run with both Graph and BaseGraph

Excellent enhancement to the test coverage. The test has been refactored to run against both the standard Graph implementation (via createGraphWithoutPlugins()) and the new minimal BaseGraph implementation. This ensures that the setCellStyleFlags functionality works consistently across different graph implementations.

The comment clearly explains why a graph instance is needed for this test (to have a view and ensure cell state updates).


145-149: Test expanded to run with both Graph and BaseGraph

Similar to the previous test case, this test for setCellStyles has been enhanced to run against both graph implementations, ensuring consistent behavior between them.

The explanatory comment is helpful in understanding test requirements.

packages/core/src/view/animate/Morphing.ts (3)

24-24: Import updated to reference AbstractGraph

The import statement is correctly updated to use AbstractGraph instead of Graph, aligning with the architectural changes.


53-54: Documentation updated to reference AbstractGraph

JSDoc comment for the constructor parameter correctly updated to reference AbstractGraph. Additionally, the delay parameter documentation has been improved for clarity by adding the reference to Animation.

Also applies to: 56-57


59-59: Type annotations updated to AbstractGraph

Constructor parameter and property type have been appropriately updated to use AbstractGraph instead of Graph. This allows the Morphing class to work with any implementation that follows the AbstractGraph interface.

Also applies to: 66-66

packages/core/src/view/layout/LayoutManager.ts (4)

32-32: Import updated to reference AbstractGraph

The import statement is correctly updated to use AbstractGraph type instead of Graph, aligning with the architectural changes to improve abstraction.


60-62: Property documentation and type updated to AbstractGraph

JSDoc comment and property type annotation have been appropriately updated to use AbstractGraph instead of Graph, allowing the LayoutManager to work with any implementation of the AbstractGraph interface.


92-92: Constructor parameter type updated to AbstractGraph

Constructor parameter type has been properly updated to accept an AbstractGraph instance instead of a Graph instance, making the class more flexible and consistent with the architectural changes.


167-167: setGraph method parameter type updated to AbstractGraph

The setGraph method parameter type has been correctly updated to accept an AbstractGraph instance, maintaining consistency with the property type and constructor parameter.

packages/core/src/view/mixins/PanningMixin.ts (3)

21-21: Type import updated to use AbstractGraph.

The import has been correctly updated to use the new AbstractGraph type instead of the concrete Graph implementation. This is a necessary change for the architectural shift outlined in the PR objectives.


26-29: Type alias references AbstractGraph instead of Graph.

The PartialGraph type alias has been properly updated to pick properties from AbstractGraph instead of Graph. This change is consistent with the overall refactoring to use the abstract base class.


30-32: Type reference updated for PartialPanning.

The PartialPanning type alias now correctly picks properties from AbstractGraph instead of Graph, maintaining type consistency across the mixin implementation.

packages/core/src/view/mixins/PanningMixin.type.ts (1)

20-21: Module augmentation target changed to AbstractGraph.

The module augmentation has been properly updated to augment the AbstractGraph interface instead of Graph. This ensures that the panning functionality is properly attached to the abstract interface, allowing any implementation to inherit these properties and methods.

packages/core/src/view/GraphView.ts (4)

44-44: Import updated to reference AbstractGraph.

The import statement has been correctly updated to reference the new AbstractGraph type instead of the concrete Graph implementation.


95-95: Constructor parameter type updated to AbstractGraph.

The constructor parameter type has been updated to accept any implementation of AbstractGraph. This change is crucial as it allows GraphView to work with both the original Graph implementation and the new BaseGraph implementation mentioned in the PR objectives.


159-161: Property type and JSDoc updated to reference AbstractGraph.

Both the property type and associated JSDoc comment have been correctly updated to reference AbstractGraph instead of Graph. This maintains consistency in the codebase and documentation.


230-243: JSDoc references updated to AbstractGraph.

All references to Graph in JSDoc comments have been systematically updated to AbstractGraph. This ensures documentation remains accurate with the new architecture.

Also applies to: 262-267, 381-394, 401-408, 1285-1289

packages/core/src/view/mixins/FoldingMixin.ts (3)

23-23: Import updated to use AbstractGraph.

The import has been correctly updated to use the new AbstractGraph type instead of the concrete Graph implementation, consistent with the architectural changes.


26-28: PartialGraph type now references AbstractGraph.

The PartialGraph type alias has been updated to pick properties from AbstractGraph instead of Graph, maintaining type consistency with the new architecture.


40-42: PartialFolding type updated to reference AbstractGraph.

The PartialFolding type alias now correctly picks properties from AbstractGraph instead of Graph, ensuring type consistency across the mixin implementation.

packages/core/src/view/layout/SwimlaneManager.ts (4)

22-22: Use abstract graph type for SwimlaneManager
The import was correctly updated from Graph to AbstractGraph, aligning this manager with the new abstraction layer.


36-36: Constructor signature updated to AbstractGraph
Changing the constructor parameter to AbstractGraph generalizes the manager to work with any graph implementation extending the new base class.


63-65: Doc comment and property type aligned with AbstractGraph
The JSDoc and the graph! property declaration now reference AbstractGraph, maintaining consistency across the codebase.


172-172: Allow null in setGraph for proper cleanup
The setGraph method signature now permits null, enabling the manager’s destroy() method to remove listeners and clear its reference safely.

packages/core/src/view/other/AutoSaveManager.ts (4)

21-21: Switch import to AbstractGraph
The import has been updated to use AbstractGraph, aligning with the overall refactor away from the concrete Graph type.


36-36: Constructor now accepts AbstractGraph
The constructor signature change to AbstractGraph makes the autosave manager compatible with any graph implementation extending the abstract base.


50-52: Doc and property updated for AbstractGraph
The JSDoc and the graph property declaration now reference AbstractGraph | null, ensuring the manager can detach from its graph.


118-118: setGraph signature generalized to allow null
Updating setGraph(graph: AbstractGraph | null) enables safe listener removal when destroying the manager.

packages/core/src/view/GraphSelectionModel.ts (4)

20-20: Update import to AbstractGraph
The import was correctly changed from Graph to AbstractGraph, reflecting the new abstraction for selection models.


29-34: Modernize JSDoc example
The code sample in the JSDoc has been updated to use const and for...of, improving readability and modern JS usage.


62-62: Constructor signature updated to AbstractGraph
Changing constructor(graph: Graph) to constructor(graph: AbstractGraph) ensures the selection model works with any graph subtype.


68-68: Property type switched to AbstractGraph
The class property graph: AbstractGraph now matches the constructor and import, preserving type consistency.

packages/core/src/view/animate/Effects.ts (3)

25-25: Switch import to AbstractGraph
The import statement for the graph type has been updated to AbstractGraph, aligning with the core refactor.


56-60: AnimateChanges signature uses AbstractGraph
Updating the animateChanges static method to accept AbstractGraph and UndoableChange[] ensures it works with any graph implementation and the new change interface.

🧰 Tools
🪛 Biome (1.9.4)

[error] 59-59: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)


131-136: CascadeOpacity signature updated to AbstractGraph
The cascadeOpacity method and its JSDoc now reference AbstractGraph, preserving consistency across animation utilities.

packages/core/src/util/gestureUtils.ts (3)

20-20: Import updated to AbstractGraph
The import now correctly references AbstractGraph, matching the updated drag-and-drop utilities.


25-27: JSDoc parameter graphF now references AbstractGraph
The documentation for graphF has been updated to describe its abstract graph type and function behavior.


98-98: JSDoc for getDropTarget updated to AbstractGraph
The parameter graph in the getDropTarget callback now references AbstractGraph, ensuring accurate type annotations.

packages/core/src/view/mixins/ValidationMixin.ts (3)

19-19: Consistent type import
The import of AbstractGraph replaces the concrete Graph type, aligning with the new abstraction layer. No issues detected.


22-34: Update PartialGraph alias to use AbstractGraph
Switching the Pick source to AbstractGraph correctly captures only the intended subset of graph methods. The change is purely mechanical with no functional impact.


35-45: Update PartialValidation alias to use AbstractGraph
Similarly, switching this alias to pick from AbstractGraph maintains type consistency across mixins.

packages/core/src/view/mixins/ConnectionsMixin.ts (1)

25-31: Migrate to AbstractGraph in mixin types
Importing AbstractGraph and updating the PartialGraph and PartialConnections aliases is consistent with the architectural refactor. Type references now correctly point to the abstraction.

packages/core/src/view/layout/GraphLayout.ts (4)

23-23: Import AbstractGraph for type annotations
The type import change aligns this layout class with the new base graph abstraction.


36-43: Replace concrete Graph references with AbstractGraph
Updating the constructor signature and graph property ensures the layout works with any AbstractGraph subclass.


99-99: Return type updated to AbstractGraph
The getGraph() method now correctly returns the abstract type, supporting both Graph and BaseGraph implementations.


420-421: JSDoc references updated
The documentation for arrangeGroups now points to AbstractGraph.updateGroupBounds, keeping comments in sync with the code.

packages/core/src/view/handler/EdgeHandler.ts (5)

56-56: Import abstract graph dependency
Switching the handler to depend on AbstractGraph ensures compatibility with both graph implementations.


73-73: Update documentation to reference AbstractGraph
The class-level JSDoc now correctly references the abstract graph’s createHandler method.


81-81: Handler’s internal graph reference
Changing the graph property to AbstractGraph is consistent with type abstraction.


507-510: validateConnection JSDoc alignment
The doc now points to AbstractGraph.getEdgeValidationError, matching the new method owner.


2251-2252: EdgeHandlerCellMarker constructor signature updated
The graph parameter’s type is switched to AbstractGraph. Ensure that callers pass the correct abstract type.

packages/core/src/view/BaseGraph.ts (2)

17-23: Introduce lightweight BaseGraph subclass
The new BaseGraph imports only essential collaborators and avoids default plugin/style registrations for optimized builds. This aligns well with the PR objectives.


35-43: Override initializeCollaborators correctly
The override instantiates or injects core collaborators without loading defaults. Consider whether calling super.initializeCollaborators() is required (if the base provides essential setup), or document why it’s omitted.

packages/core/src/util/printUtils.ts (4)

23-23: Import type updated appropriately.

The import statement correctly references the new AbstractGraph type instead of the concrete Graph implementation, aligning with the architectural changes introduced in this PR.


33-40: Parameter type annotations updated correctly.

The JSDoc parameter annotation and function parameter type have been properly updated to use AbstractGraph, allowing both Graph and the new BaseGraph implementations to be used with these utility functions.


165-174: JSDoc and parameter type annotation updated consistently.

The parameter types in both JSDoc comments and function signatures have been consistently updated to AbstractGraph. This ensures that utility functions work with any concrete implementation of the abstract graph interface.


284-284: Function parameter type annotation updated correctly.

The printScreen function parameter type has been properly updated to use AbstractGraph type, completing the consistent type updates throughout this utility file.

packages/core/src/view/mixins/EventsMixin.ts (4)

44-44: Import type updated appropriately.

The import statement correctly references the AbstractGraph type, aligning with the architectural refactoring to use AbstractGraph as the base class.


47-49: Type Pick reference updated correctly.

The PartialGraph type now correctly references AbstractGraph instead of Graph, ensuring that mixin types align with the new class hierarchy.


90-92: PartialEvents type updated consistently.

The PartialEvents type now correctly references AbstractGraph, maintaining consistency with the architectural updates throughout the codebase.


576-576: Default parameter type casting updated correctly.

The type cast for the default sender parameter has been properly updated to use AbstractGraph, ensuring type safety when the sender parameter isn't provided.

packages/core/src/view/handler/VertexHandler.ts (5)

29-29: Import type updated appropriately.

The import statement correctly references the AbstractGraph type, aligning with the architectural refactoring to use AbstractGraph as the base class.


45-46: JSDoc reference updated correctly.

The JSDoc comment is updated to reference AbstractGraph.createHandler instead of Graph.createHandler, reflecting the new class hierarchy.


56-58: Field type and documentation updated correctly.

Both the JSDoc comment and the property type declaration have been updated to use AbstractGraph, ensuring the handler works with any implementation of the abstract interface.


788-789: JSDoc reference updated for checkTolerance method.

The JSDoc comment correctly references AbstractGraph.tolerance instead of Graph.tolerance, maintaining consistency with the architectural changes.


1411-1412: JSDoc reference updated for resizeCell method.

The JSDoc comment correctly references AbstractGraph.resizeCell instead of Graph.resizeCell, reflecting the method's location in the new class hierarchy.

packages/core/src/util/Clipboard.ts (6)

20-20: Import type updated appropriately.

The import statement correctly references the AbstractGraph type instead of the concrete Graph implementation.


34-35: JSDoc references updated correctly.

The documentation references to canExportCell and canImportCell methods have been properly updated to use AbstractGraph instead of Graph.


122-126: Method signature and documentation updated for cut method.

Both the JSDoc comments and parameter type annotations have been updated to use AbstractGraph, allowing the method to work with any graph implementation that extends the abstract class.


137-140: Method signature and documentation updated for removeCells method.

The parameter type annotations and JSDoc have been properly updated to use AbstractGraph instead of Graph.


149-152: Method signature and documentation updated for copy method.

The parameter type annotations and JSDoc have been properly updated to use AbstractGraph instead of Graph.


163-167: Method signature and documentation updated for paste method.

The parameter type annotations and JSDoc comments have been properly updated to use AbstractGraph, completing the consistent type updates throughout this utility class.

packages/core/__tests__/view/Graph.test.ts (4)

19-30: Import list updated correctly.

The import list has been updated to include AbstractGraph, EdgeHandler, and VertexHandler, properly maintaining alphabetical order and aligning with the architectural changes.


71-79: Excellent helper function addition.

The createCellState helper function is a good improvement that reduces code duplication and standardizes the creation of test cell states throughout the test file.


89-89: Refactored test code to use helper function.

The tests have been properly updated to use the new createCellState helper function, improving consistency and reducing duplication.

Also applies to: 101-101, 112-112


117-129: Added tests for createHandler functionality.

These new tests verify that the graph correctly creates VertexHandler or EdgeHandler instances based on the cell type, which is crucial functionality for the AbstractGraph implementation. This is a good addition to ensure the handler creation logic works correctly.

packages/core/src/view/other/Multiplicity.ts (5)

21-21: Correctly updated import to use AbstractGraph.

The import statement has been properly updated to reference the new AbstractGraph type instead of the concrete Graph type, aligning with the architectural changes introduced in this PR.


28-30: Documentation updated appropriately to reference AbstractGraph.

JSDoc comment has been updated to reference AbstractGraph.multiplicities instead of Graph.multiplicities, maintaining consistency with the type changes.


134-139: Parameter types in JSDoc updated to match implementation.

The JSDoc parameter types have been updated to reference:

  1. AbstractGraph instead of Graph for the graph parameter
  2. Cell type for edge, source, and target parameters, which correctly aligns with the imported Cell type

This change maintains consistency with the architectural shift to AbstractGraph.


142-144: Method signature updated to use AbstractGraph type.

The check method signature has been updated to use AbstractGraph instead of Graph, ensuring consistent API typing throughout the application.


184-184: All method signatures consistently updated to use AbstractGraph.

The remaining method signatures (checkNeighbors, checkTerminal, and checkType) have been properly updated to use the AbstractGraph type. This consistent change throughout the class ensures type safety when using either Graph or BaseGraph implementations.

Also applies to: 208-208, 217-219

packages/core/src/view/layout/hierarchical/CoordinateAssignment.ts (6)

31-31: Import statement correctly updated to use AbstractGraph.

The import statement has been properly updated to reference the AbstractGraph type from the correct path.


667-667: Method signature updated to use AbstractGraph type.

The initialCoords method signature has been updated to use AbstractGraph instead of Graph for the facade parameter, allowing the method to work with any implementation of AbstractGraph.


694-694: Method signature updated to use AbstractGraph type.

The rankCoordinates method signature has been updated to use AbstractGraph for the graph parameter, maintaining consistency with the architectural changes.


762-762: Method signature updated to use AbstractGraph type.

The calculateWidestRank method signature has been properly updated to use AbstractGraph.


863-863: Method signature updated to use AbstractGraph type.

The minPath method signature has been properly updated to use AbstractGraph for the graph parameter.


1033-1033: Method signature updated to use AbstractGraph type.

The setCellLocations method signature has been properly updated to use AbstractGraph type, completing the consistent updates throughout this class.

packages/core/src/types.ts (5)

17-18: Import statements updated to reference AbstractGraph.

The import statements have been properly updated to import AbstractGraph from the new location.


29-33: Imported additional collaborator types for graph construction.

Added imports for CellRenderer, GraphDataModel, Stylesheet, GraphSelectionModel, and GraphView which are needed for the new collaborator options type definitions later in the file.


129-130: JSDoc references updated to AbstractGraph throughout the file.

All JSDoc references to graph-related methods have been properly updated to reference AbstractGraph instead of Graph, ensuring documentation consistency.

Also applies to: 141-142, 175-176, 505-506, 608-609, 629-631, 845-846


1108-1111: Updated GraphPluginConstructor to use AbstractGraph.

The GraphPluginConstructor interface has been updated to accept an AbstractGraph instance in its constructor signature instead of a Graph. This enables plugins to work with any implementation of AbstractGraph, including both Graph and BaseGraph.


1354-1408: Added new types to support flexible graph instantiation.

Two new types have been introduced:

  1. GraphOptions - Defines options for instantiating an AbstractGraph, including container, plugins, and collaborators
  2. GraphCollaboratorsOptions - Defines optional collaborators that can be injected into a graph instance

These types are crucial for the architectural changes in this PR, enabling customizable graph instances with or without default plugins and styles.

packages/core/src/editor/Editor.ts (11)

37-37: Import statement updated to use AbstractGraph.

The import statement has been appropriately changed to import AbstractGraph as a type, reflecting the architectural changes in the codebase.


509-513: Class property type updated to AbstractGraph.

The graph property type and its JSDoc comment have been updated to reference AbstractGraph instead of Graph, allowing the Editor to work with different graph implementations.


1394-1395: Updated method return type and JSDoc.

The createGraph method's return type and documentation have been updated to indicate it returns an AbstractGraph instance, providing better type safety for the architectural changes.


1452-1452: Method parameter type updated to AbstractGraph.

The createSwimlaneManager method has been updated to accept an AbstractGraph parameter instead of a Graph, maintaining consistent typing throughout the codebase.


1472-1472: Method parameter type updated to AbstractGraph.

The createLayoutManager method parameter type has been properly updated to use AbstractGraph.


1513-1514: JSDoc updated to reference AbstractGraph.

The JSDoc comment for setGraphContainer has been updated to reference AbstractGraph.init instead of Graph.init, maintaining documentation consistency.


1540-1540: Method parameter type updated to AbstractGraph.

The installDblClickHandler method parameter type has been properly updated to use AbstractGraph.


1556-1556: Method parameter type updated to AbstractGraph.

The installUndoHandler method parameter type has been properly updated to use AbstractGraph.


1579-1579: Method parameter type updated to AbstractGraph.

The installDrillHandler method parameter type has been properly updated to use AbstractGraph.


1594-1594: Method parameter type updated to AbstractGraph.

The installChangeHandler method parameter type has been properly updated to use AbstractGraph.


1627-1627: Method parameter type updated to AbstractGraph.

The installInsertHandler method parameter type has been properly updated to use AbstractGraph, completing the consistent updates throughout the Editor class.

packages/core/src/view/other/DragSource.ts (1)

43-54: Type refactor looks good

All usages of Graph have been migrated to AbstractGraph consistently. No runtime behaviour is affected because the interface is a strict superset.

Also applies to: 126-129

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