Skip to content

Deprecate insertVertex and insertEdge legacy methods in AbstractGraph #856

@tbouffard

Description

@tbouffard

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.

In maxGraph, we've already introduced new methods that take a single options object instead of a long list of arguments:

These new APIs are easier to use:

  • Optional parameters can just be omitted (no need for null or undefined)
  • They are easier to read
  • Easier to extend with new features

However, 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.

Important

The old methods are already marked as legacy in their JSDoc.

Proposal

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

Tasks (non-exhaustive)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions