Skip to content

Commit

Permalink
fix(graph): Not able to generate graph on large projects
Browse files Browse the repository at this point in the history
fix #283
  • Loading branch information
vogloblinsky committed Aug 29, 2017
1 parent 99a3e24 commit 9ee7775
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 46 deletions.
29 changes: 13 additions & 16 deletions dist/index-cli.js

Large diffs are not rendered by default.

29 changes: 13 additions & 16 deletions dist/index.js

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions src/app/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1447,22 +1447,21 @@ export class Application {
}
finalMainGraphPath += 'graph';
$ngdengine.init(path.resolve(finalMainGraphPath));
if ($dependenciesEngine.rawModulesForOverview.length > 150) {
logger.warn(`Too many modules (${$dependenciesEngine.rawModulesForOverview.length}), main graph generation disabled`);
this.configuration.mainData.disableMainGraph = true;
loop();
} else {
$ngdengine.renderGraph(this.configuration.mainData.tsconfig, path.resolve(finalMainGraphPath), 'p').then(() => {
$ngdengine.readGraph(path.resolve(finalMainGraphPath + path.sep + 'dependencies.svg'), 'Main graph').then((data) => {
this.configuration.mainData.mainGraph = <string>data;
loop();
}, (err) => {
logger.error('Error during graph read: ', err);
});

$ngdengine.renderGraph(this.configuration.mainData.tsconfig, path.resolve(finalMainGraphPath), 'p').then(() => {
$ngdengine.readGraph(path.resolve(finalMainGraphPath + path.sep + 'dependencies.svg'), 'Main graph').then((data) => {
this.configuration.mainData.mainGraph = <string>data;
loop();
}, (err) => {
logger.error('Error during graph generation: ', err);
logger.error('Error during main graph reading : ', err);
this.configuration.mainData.disableMainGraph = true;
loop();
});
}
}, (err) => {
logger.error('Ooops error during main graph generation, moving on next part with main graph disabled : ', err);
this.configuration.mainData.disableMainGraph = true;
loop();
});
}
}

Expand Down

0 comments on commit 9ee7775

Please sign in to comment.