Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Recursive tree template #201

niki-eng opened this Issue Dec 7, 2012 · 1 comment


None yet
2 participants

niki-eng commented Dec 7, 2012


I want to create a template for a hierarchical data visualization, but get stuck. Database representation of the data is with field named "parent" that points to the parent of the current element. The result I'm trying to achieve looks like this http://sitepointstatic.com/graphics/sitepoint_tree.gif. My first attempt of json data representation was that:

data = {
element: 1,
children: [
   {element: 2,
   children: []},
   {element: 3,
   children: [
      element: 4,
      children: []

but couldn't create a template with reusable partials that recursively visualize the tree

Can you please advise is it possible to create a template for a tree like the above with dusjs partials and how json data should look like?

Thanks in advance.


rragan commented Dec 13, 2013

This seems like something better asked on StackOverflow. It is a "how to" question rather than an issue.

@rragan rragan closed this Dec 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment