Skip to content

refactor(dia.Graph): remove extra cell collection - #3084

Merged
kumilingus merged 74 commits into
clientIO:masterfrom
kumilingus:graph-remove-extra-cell-collection
Oct 29, 2025
Merged

kumilingus merged 74 commits into
clientIO:masterfrom
kumilingus:graph-remove-extra-cell-collection

Conversation

@kumilingus

@kumilingus kumilingus commented Oct 25, 2025 •

Copy link
Copy Markdown
Contributor

Description

Revision of #3025.

This PR refactors the layer API in JointJS by renaming classes and updating method names to be more consistent and clear.

  • Remove the redundant graph cell collection that existed solely as an event proxy and for quick lookups.

  • Rename models:

    • before: Graph -> GraphCellLayerCollection -> CellLayer -> GraphCells -> Cell
    • now: Graph -> GraphLayerCollection -> GraphLayer -> CellCollection -> Cell
  • Updated Graph API methods: addLayer(), moveLayer(), removeLayer().

  • mvc.Collection now supports dry flag

  • Move port namespace logic to Element (was executed for all cells)

Comment thread packages/joint-core/types/joint.d.ts
Comment thread packages/joint-core/types/joint.d.ts Outdated
Comment thread packages/joint-core/types/joint.d.ts Outdated
@kumilingus
kumilingus requested a review from Copilot October 29, 2025 22:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the layer API in JointJS by renaming classes and updating method names to be more consistent and clear. The main changes include renaming CellLayer to GraphLayer, GraphCells to CellCollection, and updating related API methods from cellLayer prefixes to just layer.

Key changes:

  • Renamed CellLayer → GraphLayer and GraphCells → CellCollection
  • Updated API methods: addCellLayer() → addLayer(), getCellLayer() → getLayer(), etc.
  • Changed option names: insertBefore → before, cellLayers → layers in JSON
  • Updated test snapshots to reflect CSS class name change from joint-cell-layer to joint-cells/joint-graph-layer

Reviewed Changes

Copilot reviewed 47 out of 49 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/joint-core/types/joint.d.ts TypeScript definitions updated with renamed classes and methods
packages/joint-core/test/ts/layers.test.ts New TypeScript test file for layer API
packages/joint-core/test/jointjs/graph.js Extensive formatting changes and API method name updates
packages/joint-core/test/jointjs/paper.js Updated method calls to use new getLayerView().el pattern
packages/joint-core/test/jointjs/layers/basic.js Updated all layer-related method and property names
packages/joint-core/test/jointjs/index.html Updated script references for renamed test files
packages/joint-core/test/jointjs/dia/*.js Updated method calls and layer references throughout
packages/joint-react/src/components/**/snapshots/*.snap Updated snapshots with new CSS class names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/joint-core/test/ts/layers.test.ts Outdated
Comment thread packages/joint-core/test/jointjs/layers/basic.js Outdated
Comment thread packages/joint-core/test/jointjs/dia/GraphLayer.js Outdated
Comment thread packages/joint-core/test/ts/layers.test.ts
Comment thread packages/joint-core/test/ts/layers.test.ts
@kumilingus
kumilingus requested a review from Copilot October 29, 2025 22:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 47 out of 49 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kumilingus
kumilingus marked this pull request as ready for review October 29, 2025 22:57
@kumilingus
kumilingus merged commit 567196e into clientIO:master Oct 29, 2025
8 checks passed
@kumilingus
kumilingus deleted the graph-remove-extra-cell-collection branch October 29, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants