{"id":7661,"date":"2020-09-23T11:34:41","date_gmt":"2020-09-23T08:34:41","guid":{"rendered":"https:\/\/dhtmlx.com\/blog\/?p=7661"},"modified":"2024-08-15T11:31:32","modified_gmt":"2024-08-15T08:31:32","slug":"javascript-tree-diagram-with-dhtmlx","status":"publish","type":"post","link":"https:\/\/dhtmlx.com\/blog\/javascript-tree-diagram-with-dhtmlx\/","title":{"rendered":"How to Create a JavaScript Tree Diagram with DHTMLX"},"content":{"rendered":"<p><em>It is high time to <a href=\"https:\/\/financesonline.com\/data-visualization\/\" rel=\"noopener\" target=\"_blank\">expand your arsenal of data visualization tools<\/a> with one more diagram type that can be implemented with the DHTMLX Diagram library. We are willing to share with you a comprehensive guide on how to produce JavaScript tree diagrams. All you have to do is to download a <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxDiagram\/download.shtml\" rel=\"noopener\" target=\"_blank\">trial version of our diagram library<\/a> and adhere to detailed instructions that are provided in this post.<\/em><\/p>\n<h5>What is a Tree Diagram<\/h5>\n<p>A tree diagram is a widely used tool that allows graphically presenting various kinds of data in the hierarchical or tree-like structure. It commonly consists of tree elements (nodes) that are joined together with connection lines (branches), vividly illustrating parent-child relations between nodes. Using this type of diagram, you can enjoy a simple data representation concept, the possibility to easily trace dependencies between diagram elements, and clarity of the provided info.<\/p>\n<p>Thanks to the combination of simplicity and high adaptability, JavaScript tree diagrams (also named as tree graphs) have gained popularity in various fields of application such as:<\/p>\n<ul>\n<li>Different areas of business management like staff management (org charts) or task management (WBS diagram)<\/li>\n<li>Computer science (tree data structure, decision tree)<\/li>\n<li>Mathematics (probability theory)<\/li>\n<li>Biology (evolutionary tree)<\/li>\n<li>Genealogy (family tree), and other traditional branches of knowledge.<\/li>\n<\/ul>\n<h5>JavaScript Family Tree<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Family-Tree.png\" alt=\"JavaScript Family Tree by DHTMLX\" width=\"1658\" height=\"805\" class=\"aligncenter size-full wp-image-7668\" srcset=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Family-Tree.png 1658w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Family-Tree-300x146.png 300w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Family-Tree-768x373.png 768w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Family-Tree-1024x497.png 1024w\" sizes=\"auto, (max-width: 1658px) 100vw, 1658px\" \/><\/p>\n<p>Apart from the widespread use in organizational hierarchies, tree diagrams are popular in genealogy for family tree visualization. A JavaScript family tree is a type of diagram intended for visually presenting kin relationships and generational bonds within a family. These diagrams can be utilized not only in academic disciplines like history or genealogy but also by ordinary people interested in their ancestry.<\/p>\n<p>The example above depicts a part of the British royal family tree with the line of succession highlighted in red.<\/p>\n<h5>Example of a JavaScript Tree Diagram by DHTMLX<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Tree-Diagram.png\" alt=\"JavaScript Tree Diagram by DHTMLX\" width=\"1372\" height=\"823\" class=\"aligncenter size-full wp-image-7662\" srcset=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Tree-Diagram.png 1372w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Tree-Diagram-300x180.png 300w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Tree-Diagram-768x461.png 768w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/JavaScript-Tree-Diagram-1024x614.png 1024w\" sizes=\"auto, (max-width: 1372px) 100vw, 1372px\" \/><\/p>\n<p>Let us have a closer look at the instance of a JavaScript tree diagram generated by the DHTMLX Diagram library.<\/p>\n<p>The diagram above is an org chart, which showcases the hierarchical organizational structure of a medical institution. It comes with custom shapes that include visual and textual info about medical workers: a doctor&#8217;s photo, name, position, fields for contact information (phone number and email) as well as icons and labels.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/Custom-shapes-of-JS-tree-diagram.png\" alt=\"Custom shapes of JS tree diagram\" width=\"656\" height=\"282\" class=\"aligncenter size-full wp-image-7693\" srcset=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/Custom-shapes-of-JS-tree-diagram.png 656w, https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2020\/09\/Custom-shapes-of-JS-tree-diagram-300x129.png 300w\" sizes=\"auto, (max-width: 656px) 100vw, 656px\" \/><\/p>\n<p>Straight and orthogonal connectors (branches) demonstrate the staff reporting structure.<\/p>\n<h5>How to Create a JavaScript Tree Diagram with DHTMLX<\/h5>\n<p>Now we are going to gain insight into the sequence of actions performed with our JavaScript library for drawing tree diagrams like in the example above.<\/p>\n<p><strong>1. Initialize the JavaScript tree diagram:<\/strong><\/p>\n<div class=\"codecolorer-container javascript default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"sy0\">&lt;!<\/span>DOCTYPE html<span class=\"sy0\">&gt;<\/span><br \/>\n<span class=\"sy0\">&lt;<\/span>html<span class=\"sy0\">&gt;<\/span><br \/>\n<span class=\"sy0\">&lt;<\/span>head<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; <span class=\"sy0\">&lt;<\/span>script type<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;text\/javascript&quot;<\/span> src<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;codebase\/diagram.js&quot;<\/span><span class=\"sy0\">&gt;&lt;\/<\/span>script<span class=\"sy0\">&gt;<\/span> &nbsp; &nbsp;<br \/>\n&nbsp; <span class=\"sy0\">&lt;<\/span>link rel<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;stylesheet&quot;<\/span> href<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;codebase\/diagram.css&quot;<\/span><span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; <span class=\"sy0\">&lt;<\/span>link href<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;https:\/\/cdn.materialdesignicons.com\/4.5.95\/css\/materialdesignicons.min.css?v=3.0.2&quot;<\/span> media<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;all&quot;<\/span> rel<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;stylesheet&quot;<\/span> type<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;text\/css&quot;<\/span><span class=\"sy0\">&gt;<\/span><br \/>\n<span class=\"sy0\">&lt;\/<\/span>head<span class=\"sy0\">&gt;<\/span><br \/>\n<span class=\"sy0\">&lt;<\/span>body<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; <span class=\"sy0\">&lt;<\/span>div id<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;diagram&quot;<\/span><span class=\"sy0\">&gt;&lt;\/<\/span>div<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; <span class=\"sy0\">&lt;<\/span>script<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">const<\/span> diagram <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> dhx.<span class=\"me1\">Diagram<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;diagram&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; type<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;org&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; defaultShapeType<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;template&quot;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp;<span class=\"sy0\">&lt;\/<\/span>script<span class=\"sy0\">&gt;<\/span><br \/>\n<span class=\"sy0\">&lt;\/<\/span>body<span class=\"sy0\">&gt;<\/span><br \/>\n<span class=\"sy0\">&lt;\/<\/span>html<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>The first steps that must be taken before the initialization are the following:<\/p>\n<ul>\n<li>add DHTMLX Diagram JS and CSS source files<\/li>\n<li>create a container to embed your tree diagram into it<\/li>\n<li>add a CDN file with Material Design icons to be used in personal cards of medical workers<\/li>\n<\/ul>\n<p>Then call the <strong>dhx.Diagram<\/strong> constructor to carry out the initialization of your tree diagram. The constructor function comes with two parameters: an already created container and an object with configuration properties. In the configuration object, you have to define the <strong>type:&#8221;org&#8221;<\/strong> property to create an org chart, which is a kind of a tree diagram for showing the organization hierarchy. Besides, you need to specify the type of diagram shapes via the <strong>defaultShapeType<\/strong> property.<\/p>\n<p><strong>2. Set  the default configuration for diagram shapes:<\/strong><\/p>\n<div class=\"codecolorer-container javascript default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">const<\/span> defaults <span class=\"sy0\">=<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; height<span class=\"sy0\">:<\/span> <span class=\"nu0\">115<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; width<span class=\"sy0\">:<\/span> <span class=\"nu0\">330<\/span><br \/>\n&nbsp;<span class=\"br0\">&#125;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>You can speed up the process of creating your JavaScript tree diagram from scratch by applying the <strong>defaults<\/strong> config. It enables you to set common characteristics of specific elements for all shapes at once. Our example of the tree diagram consists of 12 nodes with the same dimensions (115 x 330). So, we can specify the default height and width for them.<\/p>\n<p><strong>3. Create a template for custom shapes:<\/strong><\/p>\n<div class=\"codecolorer-container javascript default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\">&nbsp; <span class=\"kw1\">const<\/span> template <span class=\"sy0\">=<\/span> <span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span> photo<span class=\"sy0\">,<\/span> name<span class=\"sy0\">,<\/span> post<span class=\"sy0\">,<\/span> phone<span class=\"sy0\">,<\/span> mail <span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">&#40;<\/span>`<br \/>\n&nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>div <span class=\"kw5\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;dhx-diagram-demo_personal-card&quot;<\/span><span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>div <span class=\"kw5\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;dhx-diagram-demo_personal-card__container dhx-diagram-demo_personal-card__img-container&quot;<\/span><span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"sy0\">&lt;<\/span>img src<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;${photo}&quot;<\/span> alt<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;${name}-${post}&quot;<\/span><span class=\"sy0\">&gt;&lt;\/<\/span>img<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;\/<\/span>div<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>div <span class=\"kw5\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;dhx-diagram-demo_personal-card__container&quot;<\/span><span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>h3<span class=\"sy0\">&gt;<\/span>$<span class=\"br0\">&#123;<\/span>name<span class=\"br0\">&#125;<\/span><span class=\"sy0\">&lt;\/<\/span>h3<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>p<span class=\"sy0\">&gt;<\/span>$<span class=\"br0\">&#123;<\/span>post<span class=\"br0\">&#125;<\/span><span class=\"sy0\">&lt;\/<\/span>p<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>span <span class=\"kw5\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;dhx-diagram-demo_personal-card__info&quot;<\/span><span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>i <span class=\"kw5\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;mdi mdi-cellphone-android&quot;<\/span><span class=\"sy0\">&gt;&lt;\/<\/span>i<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>p<span class=\"sy0\">&gt;<\/span>$<span class=\"br0\">&#123;<\/span>phone<span class=\"br0\">&#125;<\/span><span class=\"sy0\">&lt;\/<\/span>p<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;\/<\/span>span<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>span <span class=\"kw5\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;dhx-diagram-demo_personal-card__info&quot;<\/span><span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>i <span class=\"kw5\">class<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">&quot;mdi mdi-email-outline&quot;<\/span><span class=\"sy0\">&gt;&lt;\/<\/span>i<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;<\/span>a href<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;mailto:${mail}&quot;<\/span> target<span class=\"sy0\">=<\/span><span class=\"st0\">&quot;_blank&quot;<\/span><span class=\"sy0\">&gt;<\/span>$<span class=\"br0\">&#123;<\/span>mail<span class=\"br0\">&#125;<\/span><span class=\"sy0\">&lt;\/<\/span>a<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;\/<\/span>span<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"sy0\">&lt;\/<\/span>div<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"sy0\">&lt;\/<\/span>div<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>When it comes to the creation of a custom shape for your tree diagram, the first thing you should do is set up an HTML template for shapes. We apply the ES6+ standard for this purpose.You can define all required attributes of custom shapes via this template:<\/p>\n<ul>\n<li>photo of a medical worker<\/li>\n<li>doctor&#8217;s name and position<\/li>\n<li>phone icon from the package of Material design icons and phone number<\/li>\n<li>email icon and email address link<\/li>\n<\/ul>\n<p><strong>4. Add shapes to the tree diagram:<\/strong><\/p>\n<div class=\"codecolorer-container javascript default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\">diagram.<span class=\"me1\">addShape<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;template&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; template<span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; defaults<br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>The following step will be the addition of custom shapes to your JavaScript tree graph. It can be done with the <strong>addShape<\/strong> method. This simple method enables you to swiftly add various shapes utilizing templates and the default configuration of shapes.<\/p>\n<p><strong>5. Prepare and parse data into the diagram:<\/strong><\/p>\n<div class=\"codecolorer-container javascript default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;height:600px;\"><div class=\"javascript codecolorer\">diagram.<span class=\"me1\">data<\/span>.<span class=\"me1\">parse<\/span><span class=\"br0\">&#40;<\/span>data<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"kw1\">const<\/span> data <span class=\"sy0\">=<\/span> <span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;main&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Kristin Mccoy&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Medical director&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(405) 555-0128&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;kmccoy@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-1.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Theo Fisher&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Head of department&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(405) 632-1372&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;tfisher@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-2.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;main&quot;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1.1&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Francesca Saunders&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Attending physician&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(402) 371-6736&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;fsaunders@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-3.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; open<span class=\"sy0\">:<\/span> <span class=\"kw2\">false<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Alisha Hall&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Head of department&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(405) 372-9756&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;ahall@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-4.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;main&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; open<span class=\"sy0\">:<\/span> <span class=\"kw2\">false<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2.1&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Milena Hunter&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Attending physician&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(124) 622-1256&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;mhunter@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-25.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; dir<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;vertical&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2.2&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Maximus Dixon&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Medical director&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(264) 684-4373&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;mdixon@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-29.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; dir<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;vertical&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Edward Sharp&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Head of department&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(451) 251-2578&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;esharp@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-6.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;main&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; dir<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;vertical&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3.1&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Cruz Burke&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Attending physician&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(587) 234-8975&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;cburke@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-7.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3.2&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Eloise Saunders&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Attending physician&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(875) 231-5332&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;esaunders@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-8.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3.3&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Sophia Matthews&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Attending physician&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(361) 423-7234&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;smatthews@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-9.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3.4&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; name<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Kara Foster&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; post<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Attending physician&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; phone<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;(565) 525-0672&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; mail<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;kfoster@gmail.com&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; photo<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;https:\/\/docs.dhtmlx.com\/diagram\/samples\/common\/big_img\/big-avatar-10.jpg&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;3&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#93;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>In order to fill your tree diagram with content, you have to apply the <strong>parse<\/strong> method.<\/p>\n<p><strong>6. Modify the appearance of specific elements in your JavaScript tree graph:<\/strong><\/p>\n<div class=\"codecolorer-container javascript default codecolorer-noborder\" style=\"overflow:auto;white-space:nowrap;height:600px;\"><div class=\"javascript codecolorer\"><span class=\"sy0\">&lt;<\/span>style<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; height<span class=\"sy0\">:<\/span> <span class=\"nu0\">100<\/span><span class=\"sy0\">%;<\/span><br \/>\n&nbsp; &nbsp; display<span class=\"sy0\">:<\/span> flex<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; align<span class=\"sy0\">-<\/span>items<span class=\"sy0\">:<\/span> center<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; justify<span class=\"sy0\">-<\/span>content<span class=\"sy0\">:<\/span> center<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; background<span class=\"sy0\">:<\/span> white<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; color<span class=\"sy0\">:<\/span> rgba<span class=\"br0\">&#40;<\/span><span class=\"nu0\">0<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">0<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">0<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">0.7<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; border<span class=\"sy0\">:<\/span> 1px solid #DFDFDF<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; padding<span class=\"sy0\">:<\/span> 10px 12px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card i <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; color<span class=\"sy0\">:<\/span> rgba<span class=\"br0\">&#40;<\/span><span class=\"nu0\">0<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">0<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">0<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">0.7<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; height<span class=\"sy0\">:<\/span> 20px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; width<span class=\"sy0\">:<\/span> 20px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; font<span class=\"sy0\">-<\/span>size<span class=\"sy0\">:<\/span> 18px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card__info <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; display<span class=\"sy0\">:<\/span> flex<span class=\"sy0\">;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card__info a <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; color<span class=\"sy0\">:<\/span>#0288D1<br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card__container <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; height<span class=\"sy0\">:<\/span> <span class=\"nu0\">100<\/span><span class=\"sy0\">%;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; width<span class=\"sy0\">:<\/span> <span class=\"nu0\">100<\/span><span class=\"sy0\">%;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; overflow<span class=\"sy0\">:<\/span> hidden<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; position<span class=\"sy0\">:<\/span> relative<span class=\"sy0\">;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card__container h3<span class=\"sy0\">,<\/span> .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card__container p <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; text<span class=\"sy0\">-<\/span>align<span class=\"sy0\">:<\/span> left<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; font<span class=\"sy0\">-<\/span>size<span class=\"sy0\">:<\/span> 14px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; line<span class=\"sy0\">-<\/span>height<span class=\"sy0\">:<\/span> 20px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; height<span class=\"sy0\">:<\/span> 20px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; margin<span class=\"sy0\">:<\/span> <span class=\"nu0\">0<\/span> <span class=\"nu0\">0<\/span> 4px <span class=\"nu0\">0<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; overflow<span class=\"sy0\">:<\/span> hidden<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; text<span class=\"sy0\">-<\/span>overflow<span class=\"sy0\">:<\/span> ellipsis<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; white<span class=\"sy0\">-<\/span>space<span class=\"sy0\">:<\/span> nowrap<span class=\"sy0\">;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card__container i <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; margin<span class=\"sy0\">-<\/span>right<span class=\"sy0\">:<\/span> 4px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card__img<span class=\"sy0\">-<\/span>container <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; min<span class=\"sy0\">-<\/span>width<span class=\"sy0\">:<\/span> 93px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; width<span class=\"sy0\">:<\/span> 93px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; margin<span class=\"sy0\">-<\/span>right<span class=\"sy0\">:<\/span> 12px<span class=\"sy0\">;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; .<span class=\"me1\">dhx<\/span><span class=\"sy0\">-<\/span>diagram<span class=\"sy0\">-<\/span>demo_personal<span class=\"sy0\">-<\/span>card__img<span class=\"sy0\">-<\/span>container img <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; width<span class=\"sy0\">:<\/span> inherit<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; height<span class=\"sy0\">:<\/span> auto<span class=\"sy0\">;<\/span><br \/>\n&nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"sy0\">&lt;\/<\/span>style<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>And last of all, you can manipulate the look and feel of your HTML5 tree diagram by defining styles for personal card elements via CSS. You can apply a range of CSS properties to the elements of your choice and specify their dimensions, alignment, spacing, color, and any other settings.<\/p>\n<p>Upon the completion of this final step, you can start using this tree diagram to outline the internal structure of a company.<\/p>\n<h5>Final Thoughts<\/h5>\n<p>This easy-to-follow guide shows how our <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxDiagram\/\" rel=\"noopener\" target=\"_blank\">JavaScript Diagram<\/a> library can be used for building tree diagrams. Apart from this diagram type, you can build any other diagrams using simple HTML templates like <a href=\"https:\/\/dhtmlx.com\/blog\/create-javascript-network-diagram\/\" rel=\"noopener\" target=\"_blank\">network diagrams<\/a> or <a href=\"https:\/\/dhtmlx.com\/blog\/javascript-uml-class-diagram-dhtmlx\/\" rel=\"noopener\" target=\"_blank\">UML class diagrams<\/a>. <\/p>\n<p>Take advantage of a <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxDiagram\/download.shtml\" rel=\"noopener\" target=\"_blank\">30-day free trial version<\/a> and start diagramming right now.<\/p>\n<h5>Related Materials:<\/h5>\n<ul>\n<li><a href=\"https:\/\/snippet.dhtmlx.com\/8fubjmlz?mode=wide\" rel=\"noopener\" target=\"_blank\">Medical hierarchy diagram sample<\/a><\/li>\n<li><a href=\"https:\/\/docs.dhtmlx.com\/diagram\/guides\/diagram\/initialization\/\" rel=\"noopener\" target=\"_blank\">DHTMLX Diagram documentation<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>It is high time to expand your arsenal of data visualization tools with one more diagram type that can be implemented with the DHTMLX Diagram library. We are willing &#8230;<\/p>\n","protected":false},"author":101012,"featured_media":7685,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,1],"tags":[33,58,14],"class_list":["post-7661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-uncategorized","tag-all-posts","tag-diagram","tag-tips"],"_links":{"self":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/7661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/users\/101012"}],"replies":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/comments?post=7661"}],"version-history":[{"count":28,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/7661\/revisions"}],"predecessor-version":[{"id":12756,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/7661\/revisions\/12756"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/media\/7685"}],"wp:attachment":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/media?parent=7661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/categories?post=7661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/tags?post=7661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}