Skip to content

Conversation

@tbouffard
Copy link
Member

@tbouffard tbouffard commented May 1, 2025

This slightly decreases the size of applications. In maxGraph examples, the decrease is about 0.5 kB.

BREAKING CHANGES: some enums have been removed. Use the string counterparts from related types:

  • constants.ARROW --> ArrowValue
  • constants.EDGESTYLE --> EdgeStyleValue
  • constants.PERIMETER --> PerimeterValue

Notes

Covers #378

Impact on the size of the examples

Example v0.19.0 With #795 and #796
js-example 475.30 kB 474.01 kB
js-example-selected-features 415.10 kB 413.98 kB
js-example-without-default 347.33 kB 346.21 kB
ts-example 438.64 kB 437.42 kB
ts-example-selected-features 380.70 kB 379.54 kB
ts-example-without-default 329.90 kB 328.74 kB

Summary by CodeRabbit

Summary by CodeRabbit

  • Breaking Changes
    • Removed several enums for arrow, edge style, and perimeter types; use corresponding string values instead.
  • Documentation
    • Improved and clarified documentation for edge styles, perimeters, and type aliases, including registration names and usage guidance.
    • Updated changelog to reflect expanded breaking changes and migration instructions.
    • Updated code examples to use string values for style properties.
  • Chores
    • Adjusted build configuration to slightly lower chunk size warning limits in example projects.

This slightly decreases the size of applications. In maxGraph examples, the decrease is about 0.5 kB.

BREAKING CHANGES: some enums have been removed. Use the string counterparts from related types:
  - `ArrowValue` instead of `constants.ARROW`
  - `EdgeStyleValue` instead of `constants.EDGESTYLE`
  - `PerimeterValue` instead of `constants.PERIMETER`
@tbouffard tbouffard added the refactor Code refactoring label May 1, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 1, 2025

## Walkthrough

This update removes the exported enums `ARROW`, `EDGESTYLE`, and `PERIMETER` from the codebase, replacing their usage with string-based types and literals. Documentation and code comments are updated throughout to clarify the use of string values for arrows, edge styles, and perimeters. Type aliases now include comments specifying their intended usage. Example code and documentation in various files are revised to use string literals instead of enum references. No functional or behavioral changes are introduced; all updates are related to type definitions, documentation, and usage examples.

## Changes

| File(s)                                                                                   | Change Summary |
|-------------------------------------------------------------------------------------------|----------------|
| `packages/core/src/util/Constants.ts`                                                     | Removed exported enums: `ARROW`, `EDGESTYLE`, and `PERIMETER`. |
| `CHANGELOG.md`                                                                            | Expanded breaking changes section to list all removed enums and specify migration to string-based types. |
| `packages/core/src/types.ts`                                                              | Added documentation comments to `ArrowValue`, `PerimeterValue`, and `EdgeStyleValue` type aliases. |
| `packages/core/src/view/style/Stylesheet.ts`                                              | Updated example in documentation to use string literal `'rectanglePerimeter'` instead of enum reference. |
| `packages/html/stories/SwimLanes.stories.ts`                                              | Replaced enum-based edge style and arrow values with string literals in style assignments. |
| `packages/core/src/view/style/edge/Elbow.ts`<br>`.../EntityRelation.ts`<br>`.../Loop.ts`<br>`.../Manhattan.ts`<br>`.../Orthogonal.ts`<br>`.../Segment.ts`<br>`.../SideToSide.ts`<br>`.../TopToBottom.ts` | Enhanced or added documentation comments clarifying registration names for edge styles in `StyleRegistry`. Minor type assertion change in `Elbow.ts`. |
| `packages/core/src/view/style/perimeter/EllipsePerimeter.ts`<br>`.../HexagonPerimeter.ts`<br>`.../RectanglePerimeter.ts`<br>`.../RhombusPerimeter.ts`<br>`.../TrianglePerimeter.ts` | Added documentation comments specifying registration names for perimeter functions in `StyleRegistry`. |
| `packages/ts-example-selected-features/vite.config.js`<br>`.../ts-example-without-defaults/vite.config.js`<br>`.../ts-example/vite.config.js` | Decreased `chunkSizeWarningLimit` values by 1 in Vite build configurations. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant Graph
    participant StyleRegistry

    User->>Graph: Set edgeStyle/endArrow/startArrow/perimeter with string literal
    Graph->>StyleRegistry: Lookup style/perimeter by string name
    StyleRegistry-->>Graph: Return registered function
    Graph->>User: Apply style/perimeter to cell

Possibly related PRs

  • maxGraph/maxGraph#787: Replaces enum usages with string literals and updates type signatures, directly related to the removal of enums and migration to string-based types.
  • maxGraph/maxGraph#785: Changes the export of Perimeter to a namespace and documents the breaking change, related to perimeter enum/type refactoring and breaking changes.
  • maxGraph/maxGraph#795: Removes the SHAPE enum and replaces it with string literals, related to enum removal and migration to string-based types but focused on a different enum.


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

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

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 2bbe70c1c0bf5c5394540ebfdf18fb898a93a0c1 and 57209feb7d117da69f3b3b9f0a92404e324bf5bf.

</details>

<details>
<summary>📒 Files selected for processing (4)</summary>

* `CHANGELOG.md` (1 hunks)
* `packages/core/src/view/style/edge/EntityRelation.ts` (1 hunks)
* `packages/core/src/view/style/edge/Orthogonal.ts` (1 hunks)
* `packages/html/stories/SwimLanes.stories.ts` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* packages/html/stories/SwimLanes.stories.ts

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (3)</summary>

* packages/core/src/view/style/edge/Orthogonal.ts
* CHANGELOG.md
* packages/core/src/view/style/edge/EntityRelation.ts

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (4)</summary>

* GitHub Check: build
* GitHub Check: build (windows-2022)
* GitHub Check: build (ubuntu-22.04)
* GitHub Check: build (macos-14)

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACJ/ADM0MXwKEC5/ZnwpSABBGxsAeQB1ABpIAFEAEQBxMoBlaABNABky0qsymwBJAFky6A7IMkdEaMg5SGxESjCBfGw4hIp6AApbSDMAdgBOADYASh4KfG58KeRcWA90zLRffDiw2H8PIeZEQBQCXIKS8uq6xpapUw9HaXV6/Rs7ziR2Yjw8zDQAA8qlRuLAFEoBGgphoYAhkAxYJhSH5pN5cMh4Fg0PYvPAiLBQv5aNgxPB8FgqehuNw6QxqOysIh4AAvEilADu6nR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MPIHgmbhE2Q+GyXZNFAkBHJn4gMK5KKTuTLJWxcXETC2A/wiYJMTCQnRCYlhmEVEvAqRB/LmUYpjEt8SxOgKPkOJNsZxlOF4lIh+Jm2aXNmJElRT/sRjFKVBPpAgSgiErG9FDn5699dhOU1xnlLUEFSNBRU1ZNK1zgBxJIZsCGBbDAHXFq8ccQhB03GCV504PsLOP7GNg4Z1AAAfS3SIBSZ/gLQnQFJm1js4iM4mSjFUAkABYDAAqAwB1ACA4g+oBgPqGohbAZo+oGaDqD4hxBaAcQAqHRDiACA6IH0NAFsGohoAdQ7MhmQYCRn6gNgKMHUFsEugCANgtAAqAVANloAdgus6iAIAtm6ydQCslGCLJmgkBNYM0bmfqG5lqz1ZxM9lGTIplUySANM2gKTNNgMygAA -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=maxGraph/maxGraph&utm_content=796):

- 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.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

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](https://docs.coderabbit.ai/finishing-touches/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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

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: 1

🔭 Outside diff range comments (1)
packages/html/stories/SwimLanes.stories.ts (1)

23-23: ⚠️ Potential issue

Remove unused constants import.

The constants import is no longer referenced after replacing enum usages with string literals, resulting in a TS6133 error. Please remove constants from the import list.

🧰 Tools
🪛 GitHub Actions: Generate website

[error] 23-23: TypeScript error TS6133: 'constants' is declared but its value is never read.

🧹 Nitpick comments (2)
CHANGELOG.md (1)

14-17: Refine breaking change bullet phrasing.

The repeated “instead of” in each bullet can be streamlined. For example:

  • Use ArrowValue, EdgeStyleValue, PerimeterValue and ShapeValue in place of the removed enums.
🧰 Tools
🪛 LanguageTool

[grammar] ~14-~14: This phrase is duplicated. You should probably use “instead of” only once.
Context: ...ts from related types: - ArrowValue instead of constants.ARROW - EdgeStyleValue instead of constants.EDGESTYLE - `PerimeterVal...

(PHRASE_REPETITION)


[grammar] ~16-~16: This phrase is duplicated. You should probably use “instead of” only once.
Context: ...nstants.EDGESTYLE -PerimeterValueinstead ofconstants.PERIMETER -ShapeValueinstead ofconstants.SHAPE` ## 0.19.0 Release ...

(PHRASE_REPETITION)

packages/core/src/view/style/edge/EntityRelation.ts (1)

36-36: Fix typo in JSDoc ("ant" → "and").

Correct the typo in “The first ant the last point...” to “The first and the last point...”.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9de5256 and 2bbe70c.

📒 Files selected for processing (21)
  • CHANGELOG.md (1 hunks)
  • packages/core/src/types.ts (3 hunks)
  • packages/core/src/util/Constants.ts (0 hunks)
  • packages/core/src/view/style/Stylesheet.ts (1 hunks)
  • packages/core/src/view/style/edge/Elbow.ts (2 hunks)
  • packages/core/src/view/style/edge/EntityRelation.ts (1 hunks)
  • packages/core/src/view/style/edge/Loop.ts (1 hunks)
  • packages/core/src/view/style/edge/Manhattan.ts (1 hunks)
  • packages/core/src/view/style/edge/Orthogonal.ts (1 hunks)
  • packages/core/src/view/style/edge/Segment.ts (1 hunks)
  • packages/core/src/view/style/edge/SideToSide.ts (1 hunks)
  • packages/core/src/view/style/edge/TopToBottom.ts (1 hunks)
  • packages/core/src/view/style/perimeter/EllipsePerimeter.ts (1 hunks)
  • packages/core/src/view/style/perimeter/HexagonPerimeter.ts (1 hunks)
  • packages/core/src/view/style/perimeter/RectanglePerimeter.ts (1 hunks)
  • packages/core/src/view/style/perimeter/RhombusPerimeter.ts (1 hunks)
  • packages/core/src/view/style/perimeter/TrianglePerimeter.ts (1 hunks)
  • packages/html/stories/SwimLanes.stories.ts (1 hunks)
  • packages/ts-example-selected-features/vite.config.js (1 hunks)
  • packages/ts-example-without-defaults/vite.config.js (1 hunks)
  • packages/ts-example/vite.config.js (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/core/src/util/Constants.ts
🧰 Additional context used
🪛 GitHub Actions: Generate website
packages/html/stories/SwimLanes.stories.ts

[error] 23-23: TypeScript error TS6133: 'constants' is declared but its value is never read.

🪛 LanguageTool
CHANGELOG.md

[grammar] ~14-~14: This phrase is duplicated. You should probably use “instead of” only once.
Context: ...ts from related types: - ArrowValue instead of constants.ARROW - EdgeStyleValue instead of constants.EDGESTYLE - `PerimeterVal...

(PHRASE_REPETITION)


[grammar] ~16-~16: This phrase is duplicated. You should probably use “instead of” only once.
Context: ...nstants.EDGESTYLE -PerimeterValueinstead ofconstants.PERIMETER -ShapeValueinstead ofconstants.SHAPE` ## 0.19.0 Release ...

(PHRASE_REPETITION)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build (ubuntu-22.04)
  • GitHub Check: build (windows-2022)
🔇 Additional comments (22)
packages/ts-example-without-defaults/vite.config.js (1)

30-30: Consistent chunk size threshold update
The chunkSizeWarningLimit value has been decremented by 1 (330 → 329) to match the adjustments in other example configs. This change is aligned and requires no further modifications.

packages/ts-example-selected-features/vite.config.js (1)

30-30: Aligned chunk size warning limit
Lowered chunkSizeWarningLimit from 381 to 380 to maintain consistency across example packages. No additional changes needed.

packages/core/src/view/style/edge/TopToBottom.ts (1)

27-29: Documentation enhancement looks good
The added JSDoc clarifies that this style is registered under topToBottomEdgeStyle. Formatting matches other edge style docs in this directory.

packages/ts-example/vite.config.js (1)

30-30: Chunk size warning threshold updated consistently
Adjusted chunkSizeWarningLimit from 439 to 438 in line with the other Vite configs. This is a non-breaking, cosmetic change.

packages/core/src/view/style/edge/Loop.ts (1)

28-30: Added registration note is clear and consistent
The new JSDoc line specifying loopEdgeStyle registration aligns with similar updates across edge style files. No functional changes required.

packages/core/src/view/style/edge/Manhattan.ts (1)

31-32: Approve JSDoc enhancement for registration clarity.

The added JSDoc comment clearly specifies that the ManhattanConnector edge style is registered under the string key manhattanEdgeStyle in the StyleRegistry. This aligns with the removal of the enum and improves documentation consistency.

packages/core/src/view/style/edge/SideToSide.ts (1)

27-28: Approve JSDoc registration comment.

The new comment correctly documents that the SideToSide edge style is registered under sideToSideEdgeStyle in the StyleRegistry, matching the pattern used elsewhere in the codebase.

packages/core/src/view/style/Stylesheet.ts (1)

136-136: Approve example update for perimeter string literal.

The example now uses the string literal 'rectanglePerimeter' instead of the removed PERIMETER.RECTANGLE enum value, accurately reflecting the new recommended usage in style definitions.

packages/core/src/view/style/perimeter/RhombusPerimeter.ts (1)

26-27: Approve JSDoc addition for perimeter registration.

The added JSDoc comment correctly registers the RhombusPerimeter function under the key rhombusPerimeter in the StyleRegistry, ensuring consistency with other perimeter functions after enum removal.

packages/core/src/view/style/perimeter/RectanglePerimeter.ts (1)

27-28: Approve JSDoc registration documentation.

The new comment accurately indicates that the RectanglePerimeter function is registered under rectanglePerimeter in the StyleRegistry, aligning with the updated documentation and type guidance.

packages/core/src/view/style/perimeter/EllipsePerimeter.ts (1)

25-26: Approve documentation enhancement for perimeter registration.

The added JSDoc lines clearly specify the registration key ellipsePerimeter in the StyleRegistry and follow the existing pattern for other perimeter functions. Well formatted and consistent.

packages/core/src/view/style/perimeter/TrianglePerimeter.ts (1)

27-28: Approve documentation enhancement for perimeter registration.

The new JSDoc correctly documents the registration name trianglePerimeter and matches the style of other perimeter functions. No issues detected.

packages/core/src/view/style/edge/Segment.ts (1)

30-31: Approve documentation enhancement for edge style registration.

The added JSDoc entry clearly indicates the registration name segmentEdgeStyle in the StyleRegistry for this connector. It aligns with similar updates across other edge style modules.

packages/core/src/view/style/perimeter/HexagonPerimeter.ts (1)

27-28: Approve documentation enhancement for perimeter registration.

The JSDoc now properly records the registration key hexagonPerimeter and is consistent with the updates in other perimeter modules.

packages/html/stories/SwimLanes.stories.ts (2)

144-145: Replace enum usage with string literals for default edge style.

The edgeStyle and endArrow properties now use string values ('elbowEdgeStyle' and 'block') that align with EdgeStyleValue and ArrowValue. This update correctly reflects the removed enums.


152-153: Replace enum usage with string literals for 'crossover' style.

The cloned edge style now uses 'open' for endArrow and 'oval' for startArrow, matching the ArrowValue definitions and removing enum dependencies.

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

933-935: Clarify usage of ArrowValue.

Adding “Can be used as a value for {@link CellStateStyle.startArrow} and {@link CellStateStyle.endArrow}” improves discoverability and guides migration from the ARROW enum.


1233-1235: Clarify usage of PerimeterValue.

The inserted JSDoc note explicitly ties PerimeterValue to CellStateStyle.perimeter, aiding users moving away from the PERIMETER enum.


1267-1269: Clarify usage of EdgeStyleValue.

Documenting that EdgeStyleValue can be assigned to CellStateStyle.edgeStyle completes the migration guidance for the removed EDGESTYLE enum.

packages/core/src/view/style/edge/Elbow.ts (2)

30-31: Document registered style name.

The added JSDoc line about elbowEdgeStyle registration aligns with other edge style docs and improves clarity in StyleRegistry.


53-53: Use non-null assertion instead of type assertion.

Switching from a cast (<Point>) to a non-null assertion (!) is more idiomatic. Please verify that transformControlPoint cannot return null in this context to avoid runtime errors.

packages/core/src/view/style/edge/EntityRelation.ts (1)

28-38: Enhance JSDoc with style registration details.

The expanded comments clearly explain the entity relation algorithm and note that it’s registered under entityRelationEdgeStyle, matching the pattern used for other edge styles.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 1, 2025

@tbouffard tbouffard merged commit 6c36e4b into main May 2, 2025
7 checks passed
@tbouffard tbouffard deleted the refactor/remove_some_enums branch May 2, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant