Skip to content

Graph.importCells should have optional x/y args in ts-signature #148

@Neschastje

Description

@Neschastje

Hello.
Current signature of importCells is:
importCells: (cells: Cell[], dx: number, dy: number, target?: Cell | null, evt?: MouseEvent | null, mapping?: any) => Cell[];
In the "Drag Source" example importCells being called inside DropHandler for gestureUtils.makeDraggable. It feels like its common case and current implementation makes you write something like:

const xNum: number = x || 0;
const yNum: number = y || 0;

in every TypeScript DropHandler implementation.
Original mxGraph docs says that default of x/y args in importCells is 0, so my suggestion that x and y should be optional in it's signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions