Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!