Tree Json Generator Sandbox

Config:

Result:

Full docs on GitHub and NPM

Config API

node: {}
Required. Contains node fields with pipes.
rootNodesNumber:
Not required. Number (5) or array range ([1, 40]). Default is 1.
childNodesNumber:
Not required. Number (9) or array range ([1, 15]). Default is 1.
maxLevel:
Not required. Max node level. Number (3). Default is 3.
hasChildRate:
Not required. The probability that the node has children. From 0 to 1. Default is 1.


Pipes

This allows you to generate fields values for the nodes. Warning: custom user functions only assign the same value to all nodes Remember: Pipes are strings Prebuilded pipes:
"@id()"
Random node ID
"@child()"
Child field pointer
"@parent()"
Field with parent node ID. (For this field, a field with an "@id" pipe before required.
"@level()"
Node level
"@randomName()"
Random name
"@randomFruit()"
Random fruit
"@randomEmail()"
Random E-Mail
"@randomInteger(min, max)"
Random Integer from range
"@randomBoolean(value = 0.5)"
Random Boolean (value - coefficient)