Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
Basic Primitives Diagrams - too much useless lines

I am using Basic Primitives Diagrams and it is the only what can work with 2 parents. But the problem is that lines are chaotic and tree becomes total unreadable.
Can anybody help me to make it beauty and readable? Or maybe there is more light library.
I no need any extended actions, I want to display cat's pedigree only.
I am not so good in JS to write such tree myself =(
I read documentation https://www.basicprimitives.com/ and tried to optimize it with simple options, but seems like I need to set some fixed settings like priorityParent or Order, it is not good because this tree will grow time to time and should be dynamically

  <div id="basicdiagram" style="width: 640px; height: 480px; border-style: dotted; border-width: 1px;"></div>

     <script type='text/javascript'>
        var control;
        document.addEventListener('DOMContentLoaded', function () {
            var options = new primitives.FamConfig();
    
           var items = [
        { id: 1, parents: []},
        { id: 2, parents: []},
        { id: 3, parents: []},
        { id: 4, parents: [] },

        { id: 5, parents: [1,2]},
        { id: 6, parents: [1,3]},
        { id: 7, parents: [2,4]},
        { id: 8, parents: [3,4]},
    ];
options.items = items; 
        options.hasSelectorCheckbox = primitives.Enabled.False;
        options.linesColor = "#7b7b7b";
        options.linesWidth = 1;
        options.showExtraArrows = false;


        options.pageFitMode = primitives.PageFitMode.AutoSize;
        options.cursorItem = 0;
        options.elbowType = primitives.ElbowType.None;   
        options.showNeigboursConnectorsHighlighted = true;  
        options.alignBylevels = true;
        options.groupByType = primitives.GroupByType.Parents;  
        options.hideGrandParentsConnectors  = true;

 control = primitives.FamDiagram(document.getElementById("basicdiagram"), options);
        </script>

enter image description here enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda