@figtreejs/core 0.1.0-beta.2 → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -625,25 +625,25 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
625
625
  class="branch-layer"
626
626
  >
627
627
  <path
628
- d="M 303.9999492243224 284.97489210109876 C303.9999492243224,284.97489210109876 227.99989844864467,189.9497842021975 227.99989844864467,189.9497842021975 C227.99989844864467,189.9497842021975 189.9998730608058,142.43723025274684 170.99986036688637,118.68095327802152 C170.99986036688637,118.68095327802152 161.49985401992666,106.80281479065886 156.7498508464468,100.86374554697753 C156.7498508464468,100.86374554697753 154.37484925970688,97.89421092513686 153.1873484663369,96.40944361421654 C153.1873484663369,96.40944361421654 152.59359806965193,95.66705995875637 152.29672287130944,95.29586813102628 C152.29672287130944,95.29586813102628 151.99984767296695,94.92467630329621 151.99984767296695,94.92467630329621 "
628
+ d="M 306.5924779152444 95.03594795523999 C306.5924779152444,95.03594795523999 233.18495583048883,190.07189591047998 233.18495583048883,190.07189591047998 C233.18495583048883,190.07189591047998 196.48119478811105,237.5898698881 178.12931426692217,261.34885687690996 C178.12931426692217,261.34885687690996 168.95337400632775,273.22835037131495 164.36540387603054,279.1680971185175 C164.36540387603054,279.1680971185175 162.07141881088194,282.1379704921187 160.92442627830764,283.6229071789194 C160.92442627830764,283.6229071789194 160.35093001202046,284.3653755223197 160.06418187887687,284.7366096940199 C160.06418187887687,284.7366096940199 159.7774337457333,285.10784386572 159.7774337457333,285.10784386572 "
629
629
  fill="none"
630
630
  stroke="black"
631
631
  stroke-width="2"
632
632
  />
633
633
  <path
634
- d="M 151.99984767296695 94.92467630329621 C151.99984767296695,94.92467630329621 190.12010533393422,47.462338151648105 190.12010533393422,47.462338151648105 C190.12010533393422,47.462338151648105 209.18023416441787,23.731169075824052 218.71029857965968,11.865584537912026 C218.71029857965968,11.865584537912026 223.4753307872806,5.932792268956013 225.85784689109104,2.9663961344780065 C225.85784689109104,2.9663961344780065 227.04910494299628,1.4831980672390033 227.64473396894888,0.7415990336195016 C227.64473396894888,0.7415990336195016 227.9425484819252,0.3707995168097508 228.09145573841334,0.1853997584048754 C228.09145573841334,0.1853997584048754 228.2403629949015,0 228.2403629949015,0 "
634
+ d="M 159.7774337457333 285.10784386572 C159.7774337457333,285.10784386572 79.88871687286665,293.2946004927189 79.88871687286665,293.2946004927189 C79.88871687286665,293.2946004927189 39.944358436433326,297.38797880621837 19.972179218216663,299.4346679629681 C19.972179218216663,299.4346679629681 9.986089609108332,300.45801254134295 4.993044804554166,300.96968483053035 C4.993044804554166,300.96968483053035 2.496522402277083,301.2255209751241 1.2482612011385414,301.3534390474209 C1.2482612011385414,301.3534390474209 0.6241306005692707,301.41739808356937 0.31206530028463536,301.4493776016436 C0.31206530028463536,301.4493776016436 0,301.4813571197178 0,301.4813571197178 "
635
635
  fill="none"
636
636
  stroke="black"
637
637
  stroke-width="2"
638
638
  />
639
639
  <path
640
- d="M 151.99984767296695 94.92467630329621 C151.99984767296695,94.92467630329621 75.99992383648348,95.0249491830781 75.99992383648348,95.0249491830781 C75.99992383648348,95.0249491830781 37.99996191824174,95.07508562296906 18.99998095912087,95.10015384291452 C18.99998095912087,95.10015384291452 9.499990479560434,95.11268795288726 4.749995239780217,95.11895500787364 C4.749995239780217,95.11895500787364 2.3749976198901086,95.12208853536683 1.1874988099450543,95.12365529911341 C1.1874988099450543,95.12365529911341 0.5937494049725272,95.12443868098671 0.2968747024862636,95.12483037192337 C0.2968747024862636,95.12483037192337 0,95.12522206286 0,95.12522206286 "
640
+ d="M 159.7774337457333 285.10784386572 C159.7774337457333,285.10784386572 196.69432122862028,332.55392193286 196.69432122862028,332.55392193286 C196.69432122862028,332.55392193286 215.15276497006377,356.27696096643 224.38198684078552,368.138480483215 C224.38198684078552,368.138480483215 228.9965977761464,374.06924024160753 231.30390324382682,377.03462012080377 C231.30390324382682,377.03462012080377 232.45755597766703,378.5173100604019 233.03438234458713,379.25865503020094 C233.03438234458713,379.25865503020094 233.3227955280472,379.6293275151005 233.46700211977725,379.81466375755025 C233.46700211977725,379.81466375755025 233.61120871150726,380 233.61120871150726,380 "
641
641
  fill="none"
642
642
  stroke="black"
643
643
  stroke-width="2"
644
644
  />
645
645
  <path
646
- d="M 303.9999492243224 284.97489210109876 C303.9999492243224,284.97489210109876 341.99997461216117,332.48744605054935 341.99997461216117,332.48744605054935 C341.99997461216117,332.48744605054935 360.9999873060806,356.2437230252747 370.4999936530403,368.12186151263734 C370.4999936530403,368.12186151263734 375.24999682652015,374.06093075631867 377.6249984132601,377.0304653781593 C377.6249984132601,377.0304653781593 378.81249920663004,378.51523268907965 379.406249603315,379.2576163445398 C379.406249603315,379.2576163445398 379.7031248016575,379.62880817226994 379.85156240082875,379.81440408613497 C379.85156240082875,379.81440408613497 380,380 380,380 "
646
+ d="M 306.5924779152444 95.03594795523999 C306.5924779152444,95.03594795523999 343.2962389576222,47.517973977619995 343.2962389576222,47.517973977619995 C343.2962389576222,47.517973977619995 361.6481194788111,23.758986988809998 370.8240597394056,11.879493494404999 C370.8240597394056,11.879493494404999 375.4120298697028,5.939746747202499 377.7060149348514,2.9698733736012497 C377.7060149348514,2.9698733736012497 378.8530074674257,1.4849366868006248 379.4265037337128,0.7424683434003124 C379.4265037337128,0.7424683434003124 379.7132518668564,0.3712341717001562 379.8566259334282,0.1856170858500781 C379.8566259334282,0.1856170858500781 380,0 380,0 "
647
647
  fill="none"
648
648
  stroke="black"
649
649
  stroke-width="2"
@@ -655,13 +655,13 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
655
655
  <g>
656
656
  <text
657
657
  alignment-baseline="middle"
658
- text-anchor="end"
659
- transform="translate(297.9999492243224,284.97489210109876) rotate(0)"
658
+ text-anchor=" start"
659
+ transform="translate(310.83511860236365,99.27858864235928) rotate(45.00000000000005)"
660
660
  >
661
661
  Label!
662
662
  </text>
663
663
  <path
664
- d="M303.9999492243224 284.97489210109876L303.9999492243224 284.97489210109876"
664
+ d="M306.5924779152444 95.03594795523999L306.5924779152444 95.03594795523999"
665
665
  stroke="grey"
666
666
  stroke-dasharray="2"
667
667
  stroke-width="1"
@@ -671,12 +671,12 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
671
671
  <text
672
672
  alignment-baseline="middle"
673
673
  text-anchor="end"
674
- transform="translate(148.99984767296695,89.72852388058958) rotate(59.99999999999997)"
674
+ transform="translate(157.05349074729602,290.4538830108502) rotate(-62.99999999999994)"
675
675
  >
676
676
  Label!
677
677
  </text>
678
678
  <path
679
- d="M151.99984767296695 94.92467630329621L151.99984767296695 94.92467630329621"
679
+ d="M159.7774337457333 285.10784386572L159.7774337457333 285.10784386572"
680
680
  stroke="grey"
681
681
  stroke-dasharray="2"
682
682
  stroke-width="1"
@@ -685,13 +685,13 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
685
685
  <g>
686
686
  <text
687
687
  alignment-baseline="middle"
688
- text-anchor=" start"
689
- transform="translate(231.24985501012264,-5.190660633322136) rotate(660.1047197551197)"
688
+ text-anchor="end"
689
+ transform="translate(-5.928883166189175,302.40241325355476) rotate(-8.830353996706094)"
690
690
  >
691
691
  Label!
692
692
  </text>
693
693
  <path
694
- d="M228.2403629949015 0L228.2403629949015 0"
694
+ d="M0 301.4813571197178L0 301.4813571197178"
695
695
  stroke="grey"
696
696
  stroke-dasharray="2"
697
697
  stroke-width="1"
@@ -700,13 +700,13 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
700
700
  <g>
701
701
  <text
702
702
  alignment-baseline="middle"
703
- text-anchor="end"
704
- transform="translate(-5.999989978491366,95.13618828386687) rotate(-0.10471975511964615)"
703
+ text-anchor=" start"
704
+ transform="translate(236.350968734111,385.33795045111344) rotate(62.8303539967062)"
705
705
  >
706
706
  Label!
707
707
  </text>
708
708
  <path
709
- d="M0 95.12522206286L0 95.12522206286"
709
+ d="M233.61120871150726 380L233.61120871150726 380"
710
710
  stroke="grey"
711
711
  stroke-dasharray="2"
712
712
  stroke-width="1"
@@ -716,12 +716,12 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
716
716
  <text
717
717
  alignment-baseline="middle"
718
718
  text-anchor=" start"
719
- transform="translate(383,385.19615242270663) rotate(59.99999999999999)"
719
+ transform="translate(382.7239429984373,-5.346039145130206) rotate(657)"
720
720
  >
721
721
  Label!
722
722
  </text>
723
723
  <path
724
- d="M380 380L380 380"
724
+ d="M380 0L380 0"
725
725
  stroke="grey"
726
726
  stroke-dasharray="2"
727
727
  stroke-width="1"
@@ -748,25 +748,25 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
748
748
  class="branch-layer"
749
749
  >
750
750
  <path
751
- d="M 303.9999492243224 284.97489210109876 C303.9999492243224,284.97489210109876 227.99989844864467,189.9497842021975 227.99989844864467,189.9497842021975 C227.99989844864467,189.9497842021975 189.9998730608058,142.43723025274684 170.99986036688637,118.68095327802152 C170.99986036688637,118.68095327802152 161.49985401992666,106.80281479065886 156.7498508464468,100.86374554697753 C156.7498508464468,100.86374554697753 154.37484925970688,97.89421092513686 153.1873484663369,96.40944361421654 C153.1873484663369,96.40944361421654 152.59359806965193,95.66705995875637 152.29672287130944,95.29586813102628 C152.29672287130944,95.29586813102628 151.99984767296695,94.92467630329621 151.99984767296695,94.92467630329621 "
751
+ d="M 306.5924779152444 95.03594795523999 C306.5924779152444,95.03594795523999 233.18495583048883,190.07189591047998 233.18495583048883,190.07189591047998 C233.18495583048883,190.07189591047998 196.48119478811105,237.5898698881 178.12931426692217,261.34885687690996 C178.12931426692217,261.34885687690996 168.95337400632775,273.22835037131495 164.36540387603054,279.1680971185175 C164.36540387603054,279.1680971185175 162.07141881088194,282.1379704921187 160.92442627830764,283.6229071789194 C160.92442627830764,283.6229071789194 160.35093001202046,284.3653755223197 160.06418187887687,284.7366096940199 C160.06418187887687,284.7366096940199 159.7774337457333,285.10784386572 159.7774337457333,285.10784386572 "
752
752
  fill="none"
753
753
  stroke="black"
754
754
  stroke-width="2"
755
755
  />
756
756
  <path
757
- d="M 151.99984767296695 94.92467630329621 C151.99984767296695,94.92467630329621 190.12010533393422,47.462338151648105 190.12010533393422,47.462338151648105 C190.12010533393422,47.462338151648105 209.18023416441787,23.731169075824052 218.71029857965968,11.865584537912026 C218.71029857965968,11.865584537912026 223.4753307872806,5.932792268956013 225.85784689109104,2.9663961344780065 C225.85784689109104,2.9663961344780065 227.04910494299628,1.4831980672390033 227.64473396894888,0.7415990336195016 C227.64473396894888,0.7415990336195016 227.9425484819252,0.3707995168097508 228.09145573841334,0.1853997584048754 C228.09145573841334,0.1853997584048754 228.2403629949015,0 228.2403629949015,0 "
757
+ d="M 159.7774337457333 285.10784386572 C159.7774337457333,285.10784386572 79.88871687286665,293.2946004927189 79.88871687286665,293.2946004927189 C79.88871687286665,293.2946004927189 39.944358436433326,297.38797880621837 19.972179218216663,299.4346679629681 C19.972179218216663,299.4346679629681 9.986089609108332,300.45801254134295 4.993044804554166,300.96968483053035 C4.993044804554166,300.96968483053035 2.496522402277083,301.2255209751241 1.2482612011385414,301.3534390474209 C1.2482612011385414,301.3534390474209 0.6241306005692707,301.41739808356937 0.31206530028463536,301.4493776016436 C0.31206530028463536,301.4493776016436 0,301.4813571197178 0,301.4813571197178 "
758
758
  fill="none"
759
759
  stroke="black"
760
760
  stroke-width="2"
761
761
  />
762
762
  <path
763
- d="M 151.99984767296695 94.92467630329621 C151.99984767296695,94.92467630329621 75.99992383648348,95.0249491830781 75.99992383648348,95.0249491830781 C75.99992383648348,95.0249491830781 37.99996191824174,95.07508562296906 18.99998095912087,95.10015384291452 C18.99998095912087,95.10015384291452 9.499990479560434,95.11268795288726 4.749995239780217,95.11895500787364 C4.749995239780217,95.11895500787364 2.3749976198901086,95.12208853536683 1.1874988099450543,95.12365529911341 C1.1874988099450543,95.12365529911341 0.5937494049725272,95.12443868098671 0.2968747024862636,95.12483037192337 C0.2968747024862636,95.12483037192337 0,95.12522206286 0,95.12522206286 "
763
+ d="M 159.7774337457333 285.10784386572 C159.7774337457333,285.10784386572 196.69432122862028,332.55392193286 196.69432122862028,332.55392193286 C196.69432122862028,332.55392193286 215.15276497006377,356.27696096643 224.38198684078552,368.138480483215 C224.38198684078552,368.138480483215 228.9965977761464,374.06924024160753 231.30390324382682,377.03462012080377 C231.30390324382682,377.03462012080377 232.45755597766703,378.5173100604019 233.03438234458713,379.25865503020094 C233.03438234458713,379.25865503020094 233.3227955280472,379.6293275151005 233.46700211977725,379.81466375755025 C233.46700211977725,379.81466375755025 233.61120871150726,380 233.61120871150726,380 "
764
764
  fill="none"
765
765
  stroke="black"
766
766
  stroke-width="2"
767
767
  />
768
768
  <path
769
- d="M 303.9999492243224 284.97489210109876 C303.9999492243224,284.97489210109876 341.99997461216117,332.48744605054935 341.99997461216117,332.48744605054935 C341.99997461216117,332.48744605054935 360.9999873060806,356.2437230252747 370.4999936530403,368.12186151263734 C370.4999936530403,368.12186151263734 375.24999682652015,374.06093075631867 377.6249984132601,377.0304653781593 C377.6249984132601,377.0304653781593 378.81249920663004,378.51523268907965 379.406249603315,379.2576163445398 C379.406249603315,379.2576163445398 379.7031248016575,379.62880817226994 379.85156240082875,379.81440408613497 C379.85156240082875,379.81440408613497 380,380 380,380 "
769
+ d="M 306.5924779152444 95.03594795523999 C306.5924779152444,95.03594795523999 343.2962389576222,47.517973977619995 343.2962389576222,47.517973977619995 C343.2962389576222,47.517973977619995 361.6481194788111,23.758986988809998 370.8240597394056,11.879493494404999 C370.8240597394056,11.879493494404999 375.4120298697028,5.939746747202499 377.7060149348514,2.9698733736012497 C377.7060149348514,2.9698733736012497 378.8530074674257,1.4849366868006248 379.4265037337128,0.7424683434003124 C379.4265037337128,0.7424683434003124 379.7132518668564,0.3712341717001562 379.8566259334282,0.1856170858500781 C379.8566259334282,0.1856170858500781 380,0 380,0 "
770
770
  fill="none"
771
771
  stroke="black"
772
772
  stroke-width="2"
@@ -778,13 +778,13 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
778
778
  <g>
779
779
  <text
780
780
  alignment-baseline="middle"
781
- text-anchor="end"
782
- transform="translate(297.9999492243224,284.97489210109876) rotate(0)"
781
+ text-anchor=" start"
782
+ transform="translate(310.83511860236365,99.27858864235928) rotate(45.00000000000005)"
783
783
  >
784
784
  Label!
785
785
  </text>
786
786
  <path
787
- d="M303.9999492243224 284.97489210109876L303.9999492243224 284.97489210109876"
787
+ d="M306.5924779152444 95.03594795523999L306.5924779152444 95.03594795523999"
788
788
  stroke="grey"
789
789
  stroke-dasharray="2"
790
790
  stroke-width="1"
@@ -794,12 +794,12 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
794
794
  <text
795
795
  alignment-baseline="middle"
796
796
  text-anchor="end"
797
- transform="translate(148.99984767296695,89.72852388058958) rotate(59.99999999999997)"
797
+ transform="translate(157.05349074729602,290.4538830108502) rotate(-62.99999999999994)"
798
798
  >
799
799
  Label!
800
800
  </text>
801
801
  <path
802
- d="M151.99984767296695 94.92467630329621L151.99984767296695 94.92467630329621"
802
+ d="M159.7774337457333 285.10784386572L159.7774337457333 285.10784386572"
803
803
  stroke="grey"
804
804
  stroke-dasharray="2"
805
805
  stroke-width="1"
@@ -808,13 +808,13 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
808
808
  <g>
809
809
  <text
810
810
  alignment-baseline="middle"
811
- text-anchor=" start"
812
- transform="translate(231.24985501012264,-5.190660633322136) rotate(660.1047197551197)"
811
+ text-anchor="end"
812
+ transform="translate(-5.928883166189175,302.40241325355476) rotate(-8.830353996706094)"
813
813
  >
814
814
  Label!
815
815
  </text>
816
816
  <path
817
- d="M228.2403629949015 0L228.2403629949015 0"
817
+ d="M0 301.4813571197178L0 301.4813571197178"
818
818
  stroke="grey"
819
819
  stroke-dasharray="2"
820
820
  stroke-width="1"
@@ -823,13 +823,13 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
823
823
  <g>
824
824
  <text
825
825
  alignment-baseline="middle"
826
- text-anchor="end"
827
- transform="translate(-5.999989978491366,95.13618828386687) rotate(-0.10471975511964615)"
826
+ text-anchor=" start"
827
+ transform="translate(236.350968734111,385.33795045111344) rotate(62.8303539967062)"
828
828
  >
829
829
  Label!
830
830
  </text>
831
831
  <path
832
- d="M0 95.12522206286L0 95.12522206286"
832
+ d="M233.61120871150726 380L233.61120871150726 380"
833
833
  stroke="grey"
834
834
  stroke-dasharray="2"
835
835
  stroke-width="1"
@@ -839,12 +839,12 @@ exports[`Node labels > renders a tree node labels in radial layout 1`] = `
839
839
  <text
840
840
  alignment-baseline="middle"
841
841
  text-anchor=" start"
842
- transform="translate(383,385.19615242270663) rotate(59.99999999999999)"
842
+ transform="translate(382.7239429984373,-5.346039145130206) rotate(657)"
843
843
  >
844
844
  Label!
845
845
  </text>
846
846
  <path
847
- d="M380 380L380 380"
847
+ d="M380 0L380 0"
848
848
  stroke="grey"
849
849
  stroke-dasharray="2"
850
850
  stroke-width="1"
@@ -12,12 +12,12 @@ describe("Test rectangular layout", () => {
12
12
  // //a
13
13
  const a = tree.getNodeByTaxon(tree.getTaxonByName("a"));
14
14
  const aV = layout(a);
15
- expect(aV.x).toBeCloseTo(0.0015820025368573631);
16
- expect(aV.y).toBeCloseTo(-1.7311355093381278);
15
+ expect(aV.x).toBeCloseTo(-1.4421376941044097);
16
+ expect(aV.y).toBeCloseTo(1.0445158798278553);
17
17
 
18
18
  const c = tree.getNodeByTaxon(tree.getTaxonByName("c"));
19
19
  const cV = layout(c);
20
- expect(cV.x).toBeCloseTo(0.5);
21
- expect(cV.y).toBeCloseTo(0.8660254037844386);
20
+ expect(cV.x).toBeCloseTo(0.4539904997395474);
21
+ expect(cV.y).toBeCloseTo(-0.8910065241883676);
22
22
  });
23
23
  });