npm install constellation-js
const constellation = require('constellation-js');
var langText = '{a . b}';
var categories = {'a': ['a1', 'a2'], 'b': ['b1']};
var numDesigns = 3;
var cycleDepth = 1
var result = constellation(langText, categories, numDesigns, cycleDepth);
node demos/server.js
Then view the demo in a browser at http://localhost:8082/
.
Specification
one-or-more (a or (a then (zero-or-more b)))
Part Categories
{"a": ["a1", "a2"],
"b": ["b1", "b2"]}
Designs:
[
"a1,b1",
"a1,b2",
"a2,b1",
"a2,b2",
"a1",
"a2"
]
{
"id": "604571a7-9e38-4647-afd0-9546399480b5",
"text": "root",
"type": "root",
"edges": [
"b79407eb-95f0-4b78-99da-779f2c9cad46",
"7f6ca2fb-ef67-4687-924c-4285de896877"]
}