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');
In your project's Gruntfile, add a section named angular_architecture_graph
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
angular_architecture_graph: {
diagram: {
files: {
'PATH/TO/OUTPUT/FILES': [ 'PATH/TO/YOUR/DIST/FILE.JS' ]
}
}
},
});
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
- module
nodes.
shapeModules: 'triangle'
Type: String
Default value: ellipse
A string value that allows you to change the default shape used for
- Provider
- Controller
- Service
- Factory
- Injected Service
nodes.
shapeFactories: 'house'
Type: String
Default value: cds
A string value that allows you to change the default shape used for
- Filter
- Directive
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.
- lucalanca (current maintainer)
- carlo-colombo (initial creator of the project)
- g1ps
- (g1ps) fixes 0.2.4 build break
- (g1ps) Adds colour scheme as a configuration
- (g1ps) Separated the legend from the graphs.
- (g1ps) Added the ability to configure which shapes to use.