Skip to content

Commit

Permalink
Document new graph settings
Browse files Browse the repository at this point in the history
  • Loading branch information
pahen committed Jun 26, 2018
1 parent 007432e commit c6e742f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ Property | Type | Default | Description
`requireConfig` | String | null | RequireJS config for resolving aliased modules
`webpackConfig` | String | null | Webpack config for resolving aliased modules
`layout` | String | dot | Layout to use in the graph
`rankdir` | String | LR | Sets [direction](https://graphviz.gitlab.io/_pages/doc/info/attrs.html#d:rankdir) of the graph layout
`fontName` | String | Arial | Font name to use in the graph
`fontSize` | String | 14px | Font size to use in the graph
`backgroundColor` | String | #000000 | Background color for the graph
`nodeShape` | String | box | A string specifying the [shape](https://graphviz.gitlab.io/_pages/doc/info/attrs.html#k:shape) of a node in the graph
`nodeStyle` | String | rounded | A string specifying the [style](https://graphviz.gitlab.io/_pages/doc/info/attrs.html#k:style) of a node in the graph
`nodeColor` | String | #c6c5fe | Default node color to use in the graph
`noDependencyColor` | String | #cfffac | Color to use for nodes with no dependencies
`cyclicNodeColor` | String | #ff6c60 | Color to use for circular dependencies
Expand Down
3 changes: 3 additions & 0 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ const defaultConfig = {
includeNpm: false,
requireConfig: null,
webpackConfig: null,
rankdir: 'LR',
layout: 'dot',
fontName: 'Arial',
fontSize: '14px',
backgroundColor: '#111111',
nodeColor: '#c6c5fe',
nodeShape: 'box',
nodeStyle: 'rounded',
noDependencyColor: '#cfffac',
cyclicNodeColor: '#ff6c60',
edgeColor: '#757575',
Expand Down
6 changes: 3 additions & 3 deletions lib/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function createGraphvizOptions(config) {
G: Object.assign({
overlap: false,
pad: 0.3,
rankdir: 'LR',
rankdir: config.rankdir,
layout: config.layout,
bgcolor: config.backgroundColor
}, graphVizOptions.G),
Expand All @@ -60,8 +60,8 @@ function createGraphvizOptions(config) {
fontname: config.fontName,
fontsize: config.fontSize,
color: config.nodeColor,
shape: 'box',
style: 'rounded',
shape: config.nodeShape,
style: config.nodeStyle,
height: 0,
fontcolor: config.nodeColor
}, graphVizOptions.N)
Expand Down

0 comments on commit c6e742f

Please sign in to comment.