flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
23
VISUALIZACION/node_modules/ngraph.forcelayout/inline-transform.js
generated
vendored
Executable file
23
VISUALIZACION/node_modules/ngraph.forcelayout/inline-transform.js
generated
vendored
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
var through = require('through2');
|
||||
|
||||
module.exports = function (file) {
|
||||
return through(function (buf, enc, next) {
|
||||
let originalContent = buf.toString('utf8');
|
||||
let dimensions = 2; // change this if you need different number of dimensions
|
||||
if (file.match(/codeGenerators\/generate/)) {
|
||||
let content = require(file);
|
||||
let matches = originalContent.match(/^\/\/ InlineTransform: (.+)$/gm);
|
||||
let additionalTransform = matches ? matches.map(name => {
|
||||
let f = name.substr('// InlineTransform: '.length);
|
||||
return content[f](dimensions);
|
||||
}).join('\n') : '';
|
||||
let exportCodeMatch = originalContent.match(/^\/\/ InlineTransformExport: (.+)$/m);
|
||||
let codeExport = exportCodeMatch ? exportCodeMatch[1] :
|
||||
`module.exports = function() { return ${content(dimensions).toString()} }`;
|
||||
this.push(`${additionalTransform}\n${codeExport}`);
|
||||
} else {
|
||||
this.push(originalContent);
|
||||
}
|
||||
next();
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue