Skip to content

Commit

Permalink
fix(core/graph): fix svg-pan-zoom import
Browse files Browse the repository at this point in the history
  • Loading branch information
sara-gnucoop authored and trik committed Apr 11, 2022
1 parent 319483b commit 921bd39
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions projects/core/graph/src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ import {
import {AjfGraphNode} from './graph-node';
import {BehaviorSubject} from 'rxjs';
import * as dagre from 'dagre';
import * as SvgPanZoom from 'svg-pan-zoom';
import * as svgPanZoom from 'svg-pan-zoom';

const TEXT_END = 20;
const LINE_HEIGHT = 40;
const BOX_WIDTH = 170;

const SvgPanZoom = ((svgPanZoom as any).default || svgPanZoom) as typeof svgPanZoom;

interface Box {
green: boolean;
height: number;
Expand Down Expand Up @@ -137,7 +139,9 @@ export class AjfGraphComponent implements OnInit {
});
try {
SvgPanZoom(this.graphElement.nativeElement, {controlIconsEnabled: true});
} catch (e) {}
} catch (e) {
console.log(e);
}
}

dagre.layout(this.graph);
Expand Down

0 comments on commit 921bd39

Please sign in to comment.