Skip to content

Commit

Permalink
Clear generated graph nodes on each render of a graph.
Browse files Browse the repository at this point in the history
  • Loading branch information
pahen committed Sep 22, 2014
1 parent d3df3ab commit 4bd4f00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ minimize a global energy function, which is equivalent to statistical multi-dime

# Release Notes

## v0.3.5 (Septemper 22, 2014)
Fix issue with number of graph node lines increased with each render (Thanks to Colin H. Fredericks).

## v0.3.4 (Septemper 04, 2014)
Correctly detect circular dependencies when using path aliases in RequireJS config (Thanks to Nicolas Ramz).

Expand Down
8 changes: 5 additions & 3 deletions lib/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
*/
var exec = require('child_process').exec,
cyclic = require('./cyclic'),
graphviz = require('graphviz'),
g = graphviz.digraph('G');
graphviz = require('graphviz');

/**
* Set color on a node.
Expand Down Expand Up @@ -79,6 +78,8 @@ function createGraphvizOptions(opts) {
* @param {Function} callback
*/
module.exports.image = function (modules, opts, callback) {
var g = graphviz.digraph('G');

checkGraphvizInstalled();

opts.imageColors = opts.imageColors || {};
Expand Down Expand Up @@ -115,7 +116,8 @@ module.exports.image = function (modules, opts, callback) {
* @return {String}
*/
module.exports.dot = function (modules) {
var nodes = {};
var nodes = {},
g = graphviz.digraph('G');

checkGraphvizInstalled();

Expand Down

0 comments on commit 4bd4f00

Please sign in to comment.