dabeng / OrgChart

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

display problem with huge tree

manuel-84 opened this issue · comments

When I have a huge tree displayed with full opened depth, if I hide all the children of one of the topmost parents then the chart disappear from screen because it does not update its position to center screen

To avoid this problem I created a button that resets the positioning if it's needed

$('.orgchart').css('transform','');

Hi @manuel-84 , you are right and your solution is really nice, I'll encapsulate the above code into a new tip -- Why is the root node gone.

Actually I'm using a bit more complex code to adapt recentering for huge and little charts

  $('.btnRecenter').click(function() {
    var chart = $('.yourOrgChart');
    var posX = chart.width() > chart.parent('div').width() ? -(chart.width() / 2) : '0';
    chart.css('transform', 'matrix(1, 0, 0, 1, ' + posX + ', 0)');
  });
commented

Suppose you want to do the same thing you do when you open from the bottom up and center the relative in the initial position as you want to call him and if from a descending any close relatives he all centers that same child. Now what I wanted to know was how to always center the relative when opening the children and so successively by the chart below

How can this plugin implement the family tree, I had seen that one node just could belong to just one parent one, but it could not belong multiple parent node?