Skip to content

Commit

Permalink
fix: catch error for all instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
touv committed Jul 25, 2024
1 parent c4e36de commit 5f24f13
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/app/js/formats/chart/hierarchy/Hierarchy.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ class Hierarchy extends PureComponent {

this.update();
}
let current = this.divContainer.current;
let gBbox = this.g().node().getBBox();

if (
current.clientWidth / gBbox.width <
current.clientHeight / gBbox.height
) {
this.initialPosition.scale = current.clientWidth / gBbox.width;
} else {
this.initialPosition.scale =
current.clientHeight / gBbox.height;
}

this.initialPosition.scale = this.initialPosition.scale * 0.8;
this.centerGraphClick();
} catch (error) {
const { p: polyglot } = this.props;
this.tooltip()
Expand All @@ -162,21 +177,7 @@ class Hierarchy extends PureComponent {
);
}

let current = this.divContainer.current;
let gBbox = this.g().node().getBBox();

if (
current.clientWidth / gBbox.width <
current.clientHeight / gBbox.height
) {
this.initialPosition.scale = current.clientWidth / gBbox.width;
} else {
this.initialPosition.scale =
current.clientHeight / gBbox.height;
}

this.initialPosition.scale = this.initialPosition.scale * 0.8;
this.centerGraphClick();
}
}

Expand Down

0 comments on commit 5f24f13

Please sign in to comment.