Create graphs of your angular projects using angular-architecture-graph.
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-angular-architecture-graph --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-angular-architecture-graph');
Requirements
if running OS X and using homebrew, simply execute:
brew install graphviz
Requirements
The windows installer of graphviz: graphviz-X.XX.msi, remember to set the Path and point it to your bin directory. e.g. C:\Program Files (x86)\GraphvizX.XX\bin
.
Requirements
Install via yaourt
the graphviz package e.g.: yaourt graphviz
.
Requirements
Make sure the following grunt packages are installed:
You only need to load the grunt-angular-architecture-graph in your grunt file.
Gruntfile
In your project's Gruntfile, add a section named angular_architecture_graph
to the data object passed into grunt.initConfig()
.
angular_architecture_graph: {
diagram: {
files: {
// "PATH/TO/OUTPUT/FILES": ["PATH/TO/YOUR/FILES/*.js"]
"architecture": [
"<%= projectConfig.app %>/<%= projectConfig.project %>/**/*.js"
]
}
}
}
execute the task and the diagrams will be in the output folder, in this example it is in the folder architecture
.
ui-router overview diagram
ui-router ui.router.state module
ui-bootstrap
ui-bootstrap ui.bootstrap.tooltip module
Type: Boolean
Default value: true
A boolean value that shows angular services (e.g. $http, $q) as dependencies when set to false.
hideAngularServices: false
Type: String
Default value: component
A string value that allows you to change the default shape used for
nodes.
shapeModules: 'triangle'
Type: String
Default value: ellipse
A string value that allows you to change the default shape used for
nodes.
shapeFactories: 'house'
Type: String
Default value: cds
A string value that allows you to change the default shape used for
nodes.
shapeDirectives: 'trapezium'
Available graphviz shapes are shown here
Type: String
Default value: paired12
A string value that allows you to change the graph colour scheme. You currently need to choose a scheme with at least 9 colours to ensure that all nodes are coloured. Colour schemes which include white or very pale colours will cause some nodes to be hard to see or appear invisible against the white background
colorScheme: 'set19'
Available graphviz colour schemes are shown here
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.