react-tree-svg
Introduction
This project allows to create a horizontal representation of a tree.
It uses React and can be included in other project as a React component but can also be used to generate a svg.
In order to be able to generate the SVG on the server and on the client we need that each element is rendered synchronously
const {render} = require('svg-boxes-tree');
const data = {
name: "Test",
children: [{
name: "Child 1",
children: [{
name: "Subchild 1"
}]
}]
}
render(data, {
box: (node) => {
node.value
}
arrow: (targetNode) => {
}
})
License
MIT