Title: Deprecate `insertVertex` and `insertEdge` legacy methods in AbstractGraph · Issue #856 · maxGraph/maxGraph · GitHub
Open Graph Title: Deprecate `insertVertex` and `insertEdge` legacy methods in AbstractGraph · Issue #856 · maxGraph/maxGraph
X Title: Deprecate `insertVertex` and `insertEdge` legacy methods in AbstractGraph · Issue #856 · maxGraph/maxGraph
Description: The methods insertVertex and insertEdge come from mxGraph. They take a long list of parameters, which makes them hard to use and maintain. It's also not practical when adding new features, since each new feature often requires an additio...
Open Graph Description: The methods insertVertex and insertEdge come from mxGraph. They take a long list of parameters, which makes them hard to use and maintain. It's also not practical when adding new features, since ea...
X Description: The methods insertVertex and insertEdge come from mxGraph. They take a long list of parameters, which makes them hard to use and maintain. It's also not practical when adding new features, sinc...
Opengraph URL: https://github.com/maxGraph/maxGraph/issues/856
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Deprecate `insertVertex` and `insertEdge` legacy methods in AbstractGraph","articleBody":"The methods `insertVertex` and `insertEdge` come from mxGraph. They take a long list of parameters, which makes them hard to use and maintain. It's also not practical when adding new features, since each new feature often requires an additional parameter.\n\n- `insertVertex` legacy signature: \n https://github.com/maxGraph/maxGraph/blob/9130103a8e03123fd9b844caec5b7603a8746175/packages/core/src/view/mixins/VertexMixin.type.ts#L86-L97 \n- `insertEdge` legacy signature: \n https://github.com/maxGraph/maxGraph/blob/9130103a8e03123fd9b844caec5b7603a8746175/packages/core/src/view/mixins/EdgeMixin.type.ts#L185-L192\n\nIn maxGraph, we've already introduced new methods that take a single options object instead of a long list of arguments:\n\n- New `insertVertex` method: \n https://github.com/maxGraph/maxGraph/blob/9130103a8e03123fd9b844caec5b7603a8746175/packages/core/src/view/mixins/VertexMixin.type.ts#L132\n\n- New `insertEdge` method: \n https://github.com/maxGraph/maxGraph/blob/9130103a8e03123fd9b844caec5b7603a8746175/packages/core/src/view/mixins/EdgeMixin.type.ts#L201\n\nThese new APIs are easier to use:\n- Optional parameters can just be omitted (no need for `null` or `undefined`)\n- They are easier to read\n- Easier to extend with new features\n\nHowever, many examples and parts of the documentation still use the old methods. That makes it harder to encourage adoption of the new APIs and to plan the removal of the legacy ones.\n\n\u003e [!IMPORTANT]\n\u003e The old methods are already marked as legacy in their JSDoc.\n\n\n### Proposal\n\nWe should officially deprecate the legacy methods and promote the new ones. We won’t remove them yet, to avoid breaking changes and help users migrating from mxGraph.\n\n\n### Tasks (non-exhaustive)\n\n- [ ] Mark `insertVertex` and `insertEdge` as `@deprecated` in the source code\n - Include the version in which they are deprecated\n- [x] Update JSDoc examples to use the new API. Done in #876\n- [x] Update documentation references. Done in #876\n - [x] lots of usage in tutorial/manual \n - [x] in particular in https://maxgraph.github.io/maxGraph/docs/manual/model-and-transactions#inserting-cells\n- [ ] Update stories and examples:\n - [x] examples in this repository. Done in #876\n - [ ] examples in https://github.com/maxGraph/maxGraph-integration-examples/\n - [ ] stories","author":{"url":"https://github.com/tbouffard","@type":"Person","name":"tbouffard"},"datePublished":"2025-06-26T07:06:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/856/maxGraph/issues/856"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a39b8077-3c75-9e23-df26-9724d4263728 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D554:2C98AB:6D71325:95322B9:69786EB7 |
| html-safe-nonce | 2566420b725fdf1b1d2e8afeff17c863a49e3aba302984d05de35ce1cfcd5bb4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTU0OjJDOThBQjo2RDcxMzI1Ojk1MzIyQjk6Njk3ODZFQjciLCJ2aXNpdG9yX2lkIjoiNzQ2NTEyMTcxNzM3OTY5MDE2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 09ca543c9ad76bed3c492ed58be8c7a0c85244af5b83c5d06b53ca4b97cca531 |
| hovercard-subject-tag | issue:3178051700 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/maxGraph/maxGraph/856/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dc2a48a28d70f3fd743a1e7820fdbc1fcb4a65de37485db12a4ddb585403c086/maxGraph/maxGraph/issues/856 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dc2a48a28d70f3fd743a1e7820fdbc1fcb4a65de37485db12a4ddb585403c086/maxGraph/maxGraph/issues/856 |
| og:image:alt | The methods insertVertex and insertEdge come from mxGraph. They take a long list of parameters, which makes them hard to use and maintain. It's also not practical when adding new features, since ea... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tbouffard |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/maxGraph/maxGraph git https://github.com/maxGraph/maxGraph.git |
| octolytics-dimension-user_id | 74362339 |
| octolytics-dimension-user_login | maxGraph |
| octolytics-dimension-repository_id | 312287063 |
| octolytics-dimension-repository_nwo | maxGraph/maxGraph |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 4398231 |
| octolytics-dimension-repository_parent_nwo | jgraph/mxgraph |
| octolytics-dimension-repository_network_root_id | 4398231 |
| octolytics-dimension-repository_network_root_nwo | jgraph/mxgraph |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 520b65a872113b919c1bbdb03834a50af15859fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width