added experimental graphviz graph generator...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-07-07 20:34:34 +03:00
parent e50f1ccaef
commit c56d8e1caf
2 changed files with 24 additions and 1 deletions

View File

@ -1027,6 +1027,29 @@ var FeatureSetProto = {
}) })
}, },
// Generate a Graphviz graph from features...
//
// XXX experimental...
gvGraph: function(lst, dep){
lst = lst || this.features
dep = dep || this
var graph = ''
graph += 'digraph ImageGrid {\n'
lst.forEach(function(f){
var deps = dep[f] || []
deps.length > 0 ?
deps.forEach(function(d){
graph += `\t"${f}" -> "${d}";\n` })
: (graph += `\t"${f}";\n`)
})
graph += '}'
return graph
},
// shorthand for: Feature(<feature-set>, ...) // shorthand for: Feature(<feature-set>, ...)
Feature: function(){ Feature: function(){
return this.__feature__.apply(null, [this].concat(args2array(arguments))) }, return this.__feature__.apply(null, [this].concat(args2array(arguments))) },

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-features", "name": "ig-features",
"version": "3.2.2", "version": "3.2.3",
"description": "", "description": "",
"main": "features.js", "main": "features.js",
"scripts": { "scripts": {