Skip to content

docs: use the object parameter form of insertVertex - #1125

Merged
redfish4ktc merged 1 commit into
mainfrom
docs/insert_vertex_object_parameter
Aug 7, 2026
Merged

docs: use the object parameter form of insertVertex#1125
redfish4ktc merged 1 commit into
mainfrom
docs/insert_vertex_object_parameter

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented Aug 7, 2026

Copy link
Copy Markdown
Member

The tutorial still documented insertVertex with the positional signature, guarded by a TODO comment asking for the migration. That signature is a legacy mxGraph inheritance and is going to be formally deprecated, so the documentation should not keep teaching it to new users.

Changes

  • docs/tutorials/graph.md: convert the styled vertex sample to the single object parameter form and remove the TODO that tracked this migration.
  • docs/usage/migrate-from-mxgraph.md: say why the new signature should be preferred (more readable and maintainable, and the positional one is going to be deprecated) instead of only stating that the former one still exists, and link issue Deprecate insertVertex and insertEdge legacy methods in AbstractGraph #856.

Note

The converted sample was missing the closing brace of the object literal, which made it invalid JavaScript:

    fillColor: 'green'
  },
);      // <- the object literal is never closed

This is fixed in this PR, so the published sample now parses. Verified with node --check.

Summary by CodeRabbit

  • Documentation
    • Updated the graph tutorial to demonstrate the recommended object-parameter API for inserting vertices.
    • Clarified that legacy multi-argument vertex and edge insertion signatures are deprecated.
    • Added guidance to use the current object-parameter signatures instead.

The positional signature is a legacy mxGraph inheritance and is going to be formally deprecated (see issue #856), so
the documentation should not keep teaching it. Convert the tutorial sample to the single object parameter form and
drop the TODO that tracked this migration.

Also state in the mxGraph migration guide why the new signature should be preferred, instead of only mentioning that
the former one still exists.
@redfish4ktc redfish4ktc added the documentation Improvements or additions to documentation label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f9cc1e5a-62b3-4e03-9ce8-26a0dddb7a6d

📥 Commits

Reviewing files that changed from the base of the PR and between 1264b06 and 3aae5d9.

📒 Files selected for processing (2)
  • packages/website/docs/tutorials/graph.md
  • packages/website/docs/usage/migrate-from-mxgraph.md

Walkthrough

The documentation updates replace the positional insertVertex example with the object-parameter API and clarify the deprecation status of legacy insertVertex() and insertEdge() signatures.

Changes

Graph API documentation

Layer / File(s) Summary
Update graph insertion guidance
packages/website/docs/tutorials/graph.md, packages/website/docs/usage/migrate-from-mxgraph.md
The tutorial uses named fields with graph.insertVertex. The migration guide recommends object-parameter signatures and notes that multi-argument signatures are deprecated.

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

Possibly related issues

  • Issue 856: The documentation updates directly address the object-parameter insertVertex migration and deprecation tasks.

Possibly related PRs

  • maxGraph/maxGraph#618: Updates the same tutorial and migration documentation for graph insertion API migration.
  • maxGraph/maxGraph#684: Documents migrated graph APIs, including insertVertex() and insertEdge().
  • maxGraph/maxGraph#876: Updates insertVertex documentation toward the object-parameter API and clarifies legacy signature deprecation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary documentation change and follows the repository's Conventional Commits format.
Description check ✅ Passed The description explains the problem, documents each change, links the issue, and states the validation performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

❤️ Share

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

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@redfish4ktc
redfish4ktc merged commit afc9aec into main Aug 7, 2026
8 checks passed
@redfish4ktc
redfish4ktc deleted the docs/insert_vertex_object_parameter branch August 7, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant