ngx-graph icon indicating copy to clipboard operation
ngx-graph copied to clipboard

Fix panOffsetX and panOffsetY

Open huineng opened this issue 4 years ago • 3 comments

Please fix this inconsistent code, either just replace the null by the current position of x or y or remove it all together and update your documentation , because today this is non working code

https://github.com/swimlane/ngx-graph/blob/d7d03ca1eba4e4b50f0fd66d5fb27a39ee32d746/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts#L186

so this code never worked

set panOffsetX(x) {
    this.panTo(Number(x), null);
  }
set panOffsetY(y) {
    this.panTo(null, Number(y));
  }
panTo(x: number, y: number): void {
    if (x === null || x === undefined || isNaN(x) || y === null || y === undefined || isNaN(y)) {
      return;
    }

thanks

huineng avatar Sep 05 '20 11:09 huineng

Any update or workaround for it?

DigneshGujarathi avatar May 26 '21 11:05 DigneshGujarathi

panOffsfetX and panOffsetY still not working? Does anyone know any workaround?

rcoletta avatar Feb 04 '22 15:02 rcoletta

@rcoletta get Component Access by using ViewChild https://angular.io/api/core/ViewChild and use the function pan https://github.com/swimlane/ngx-graph/blob/master/projects/swimlane/ngx-graph/src/lib/graph/graph.component.ts#L826

Kr0san89 avatar Aug 10 '23 12:08 Kr0san89