swimlane / ngx-graph

Graph visualization library for angular
https://swimlane.github.io/ngx-graph
MIT License
938 stars 287 forks source link

Fix panOffsetX and panOffsetY #346

Open huineng opened 4 years ago

huineng commented 4 years ago

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

DigneshGujarathi commented 3 years ago

Any update or workaround for it?

rcoletta commented 2 years ago

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

Kr0san89 commented 1 year ago

@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