0 ) { echo ''; } elseif ($ph==3 && $init == 'Y' && $_SESSION['NumGens'] < $_SESSION['MaxNumGens']) { echo ''; } ?> 0) { echo ' '; } else { echo ' '; } echo '
"; echo ""; metaDataFor($_SESSION['Primary1'][$ID]); } if ($ph == 0) { echo "


Fractal Tree

"; // ===== ======= // LOGIN PHASE // ===== ======= if ($ph<1) { // ERROR MESSAGE // ===== ======= if ($ErrorMessage > '') { echo "

" . $ErrorMessage . "

"; } echo '

Enter the WikiID for the central person in the Fractal Tree, to create a display of all direct ancestors.


Primary Person:
e.g. Marcoux-336

or enter "none" for a blank chart



 

 
 
  '; } } else { if ($_SESSION['Primary1'][$SHORTNAME] > "") { if ($_SESSION['useLNAB'] == 'Y') { $ThePrimaryName = $_SESSION['Primary1'][$BIRTHNAME]; }{ $ThePrimaryName = $_SESSION['Primary1'][$SHORTNAME]; } echo "

Fractal Tree for " . $ThePrimaryName . "

"; } else { echo "

Fractal Tree template

"; } // echo "... is "; } // echo "

How to decipher the Fractal Tree   

"; // ======================================================================================================================================================================== // CUSTOMIZE the PHASE # note at the TOP OF THE PAGE - OR - the BR's that line up the spacing (THIS SHOULD NOT BE NEEDED ... CHECK AND FIX THIS FOR LATER!!!!) // ======================================================================================================================================================================== // if ($ph > 0 && $ph < 3) { // // echo "

Phase # " . $_SESSION['ph'] . " of 3"; // } else { // // echo " 
"; // // echo " 
"; // } // ============================================================================================================================== // MENU BAR - FAN OPTIONS on LEFT (various angle options) | SUMMARY of PERSON ID & NUM of GENS in MIDDLE | RESET btn on RIGHT // ============================================================================================================================== if ($ph >= 1 ) { echo " "; // if ($ph >=3 ){ // // don't show during calculation phases of 1 and 2 as they whip by // echo ""; echo "
        "; if ($ph >=3 ){ echo ""; } echo "  - 1    " . $_SESSION['NumGens'] . " generations    + 1  //


"; } // echo "
"; echo ""; // ======================= // MEAT & POTATOES - here's where the PHASES display different things // ======================= // ==================================================== // PHASE 1 and PHASE 2 - Pure calculations - no display // ==================================================== // ========================================= // PHASE 3 - DISPLAY the Fractal Tree // ========================================= if ($ph == 3) { // CLEAR OUT all previous coordinate placements $NumGens4ThisGraph = $_SESSION['NumGens'] - 1; foreach ($_SESSION['IndexFullerList'] as $key => $value) { $_SESSION['IndexFullerList'][$key][$COORDS] = [0,0,0,0,0, array() , 0, 0]; $_SESSION['IndexFullerList'][ $key ][$PATHS] = array(); } $ListOfPeeps = ""; $ThePrimary = 'Primary1'; // CALCULATE FULL WIDTHs and HEIGHTs - especially MAX WIDTH and CENTERING BUFFER $EachNameWidth = 100; $EachNameHeight = 70; $CellWidth = $EachNameWidth; $CellHeight = $EachNameHeight; $maxWidth = $GraphMargin + ($EachNameWidth + $InnerSpacing) * (2**(floor(($_SESSION['NumGens']+2)/2)) ); if ($maxWidth < $window_width) { $centeringBuffer = ($window_width - $maxWidth)/2; } else { $centeringBuffer = 0; } $InitialX = $centeringBuffer + $maxWidth/2; // $InitialY = 3 * $maxWidth / 8 + 0*500; $InitialY = $GraphMargin + (2 ** ceil($_SESSION['NumGens']/2) - 1) * ($EachNameWidth + $InnerSpacing)/2; $InitialRadius = $maxWidth / 4; $CurrGenNum = 1; // if ($alt == "Y"){ // $AccumulatedHeight = $InitialRadius ; // for ($i=5; $i <= $_SESSION['NumGens']; $i+=2) { // // $AccumulatedHeight += $EachNameHeight;// / (2** ( ($i - 3)/2 )); // $AccumulatedHeight += $InitialRadius / (2** ( ($i - 3)/2 )); // } // if ($_SESSION['NumGens'] % 2 == 1) { // $AccumulatedHeight += $EachNameHeight/2; // } else { // $AccumulatedHeight += $EachNameWidth/2; // } // } else { // $AccumulatedHeight = $InitialRadius + $EachNameHeight/2; // for ($i=5; $i <= $_SESSION['NumGens']; $i+=2) { // // $AccumulatedHeight += $EachNameHeight;// / (2** ( ($i - 3)/2 )); // $AccumulatedHeight += $InitialRadius / (2** ( ($i - 3)/2 )); // } // // } // echo "
InitialY = $InitialY
AccumulatedHeight = $AccumulatedHeight
InitialRadius = $InitialRadius"; // $InitialY = max(0*$InitialY, $AccumulatedHeight); // $CurrGenNum = 1; buildPathFor($_SESSION[$ThePrimary ][$ID], "", 1); assignColoursForRepeats($_SESSION[$ThePrimary ][$ID], 1); $XFullAhfenIndexArray = [1]; populateXtable(3, "F", 2) ; if ($_SESSION[$ThePrimary ][$GENDER] == "Female") { populateXtable(2, "M", 2) ; } // var_dump($XFullAhfenIndexArray); // drawFractal(); // CALCULATE PIX DOWN - starting position $PixDown = $PixDownStartingPoint; // CREATE the DIV to HOLD the GRAPH (FRACTAL TREE) // CALCULATE all the DIV info needed for the ancestors, and store in LinesHTML and NamesHTML graphPerson($_SESSION[$ThePrimary][$FATHER], $InitialX, $InitialY, "H", "Male", $InitialRadius, $CurrGenNum , "" , 2); graphPerson($_SESSION[$ThePrimary][$MOTHER], $InitialX, $InitialY, "H", "Female", $InitialRadius, $CurrGenNum , "" , 3 ); // Now, print those out echo "
"; echo $LinesSVG . $CellsSVG . $NamesSVG; echo ''; if ($_SESSION['useLNAB'] == 'Y') { $WHICHNAME = $BIRTHNAME; } else { $WHICHNAME = $SHORTNAME; } echo getSVGtext($InitialX + 2 - $centeringBuffer - $CellWidth/2, $InitialY + 10 - $CellHeight/2, 0, $_SESSION[$ThePrimary][$WHICHNAME] , "Black", $_SESSION[$ThePrimary][$LIFESPAN], $OnActions = ""); echo "
"; // echo "
"; // echo $LinesHTML; // echo $NamesHTML; // END it off with the INFO for the PRIMARY PERSON in the MIDDLE $detailsArray = getDetailsForGraphing ( $_SESSION[ $ThePrimary ][$ID] ); $heightAdjustment = ($detailsArray[0]-1)*16; // echo "
" . $_SESSION[$ThePrimary][$SHORTNAME] . "
"; // echo "
expecting : " . $_SESSION['IndexFullerList'][ $_SESSION[ $ThePrimary ][$ID] ][$SHORTNAME]; // echo "
got: " . $detailsArray[1]; // echo "
" . $detailsArray[1] . "
" ; echo "
"; // end DIV id=GraphHolder // echo $TheMetaData; } // =================================================== // PHASE 11 - Testing the Colours // ==================================================== if ($ph == 11) { echo "The Available Colours:"; $PixDownBase = 240; echo "
clr #
"; echo "
black text
"; echo "
white text
"; echo "
best choice
"; echo "
"; for ($i=0; $i < count($HRclrs); $i++) { # code... $PixDown = $PixDownBase + 10 + 2*$PersonWidth*($i + $j + 1); $Distance = 200; $clr = $HRclrs[$i]; $RGBs = $RGBclrs[$i]; echo "

"; echo "
" . $i . "
"; echo "

"; echo "
" . $HRclrs[$i] . "
"; echo "

"; echo "
" . $HRclrs[$i] . "
"; if ($FONTclrs[$i] == "White") { $TheFontClr = "White"; } else { $TheFontClr = "Black"; } // echo "

"; echo "
" . $HRclrs[$i] . "
"; // if ($TheFontClr == "White") { // echo "
" . $HRclrs[$i] . "
"; // } else { // echo "
" . $HRclrs[$i] . "
"; // } } } // =================================================== // PHASE 12 - Complete List of Peeps // ==================================================== if ($ph == 12) { echo "

Peeps Directory

"; echo "
P1: bdd = " . $_SESSION['Primary1'][$BIRTHDATEDECADE]; echo "
P2: bdd = " . $_SESSION['Primary2'][$BIRTHDATEDECADE]; echo "
P1: dad = *" . $_SESSION['Primary1'][$FATHER] . "*"; echo "
P2: dad = *" . $_SESSION['Primary2'][$FATHER] . "*"; echo "
P1: mom = *" . $_SESSION['Primary1'][$MOTHER] . "*"; echo "
P2: mom = *" . $_SESSION['Primary2'][$MOTHER] . "*"; foreach ($_SESSION['IndexFullerList'] as $key => $value) { echo "
" . $_SESSION['IndexFullerList'][$key][$NAME] . " : " . $_SESSION['IndexFullerList'][$key][$SHORTNAME] . " (" . $_SESSION['IndexFullerList'][$key][$BIRTHDATE] . " in " . $_SESSION['IndexFullerList'][$key][$BIRTHDATEDECADE] . " - " . $_SESSION['IndexFullerList'][$key][$DEATHDATE] . ") from [" . $_SESSION['IndexFullerList'][$_SESSION['IndexFullerList'][$key][$FATHER]][$NAME] . " & " . $_SESSION['IndexFullerList'][$_SESSION['IndexFullerList'][$key][$MOTHER]][$NAME] . "]"; } } ?> 0 && $_SESSION['MaxNumGens'] < $_GET['NumGens'] && $_GET['NumGens'] <= 11) { echo "
Reading in info for Generation " . $_GET['NumGens'] . " and following up " . count ($_SESSION['GreatestGreatsArray']) . " leads."; $AddedIDsArray = array(); while (count ($_SESSION['GreatestGreatsArray']) > 0){ $theKey = array_shift($_SESSION['GreatestGreatsArray']) ; $theURL = "https://api.wikitree.com/api.php?action=getAncestors&fields=Id&depth=1&key=" . $theKey ; $page = file_get_contents($theURL); $JSONobject = json_decode($page); //$AncestorArray1 // echo "
Key is " . $_SESSION['GreatestGreatsArray'][0]; $NewAncsArray = $JSONobject[0]->ancestors; for ($i=0; $i < count($NewAncsArray); $i++) { //echo "
New ancestor: " . $NewAncsArray[$i]->ShortName . " @ " . $NewAncsArray[$i]->Id; if (!$_SESSION['IndexFullerList'][$NewAncsArray[$i]->Id]) { //echo " ADDING ... "; $TheName = $NewAncsArray[$i]->Name; $TheID = $NewAncsArray[$i]->Id; $TheShortName = $NewAncsArray[$i]->ShortName; if (!$TheName) { // //echo "
NO NAME !" ; $TheName = "Private" . $TheID; $TheShortName = "Private"; } $TheBirthDate = $NewAncsArray[$i]->BirthDate; $TheDeathDate = $NewAncsArray[$i]->DeathDate; $TheBirth4Bio = $TheBirthDate; $TheLifeSpan = "(????-"; if ($TheBirthDate && strlen($TheBirthDate)>=4) { if (substr($TheBirthDate, 0,4) == "0000") { $TheLifeSpan = "( ? -"; } else { $TheLifeSpan = "(" . substr($TheBirthDate, 0,4) . "-"; } } if (!$TheBirthDate && $NewAncsArray[$i]->BirthDateDecade > '') { $TheBirthDate = $NewAncsArray[$i]->BirthDateDecade + 5; $TheBirth4Bio = " in " . $NewAncsArray[$i]->BirthDateDecade; $TheLifeSpan = "(" . $NewAncsArray[$i]->BirthDateDecade . "-"; } if ($TheDeathDate && strlen($TheDeathDate)>=4) { if (substr($TheDeathDate, 0,4) == "0000") { $TheLifeSpan .= " ? )"; } else { $TheLifeSpan .= substr($TheDeathDate, 0,4) . ")"; } } elseif (!$TheDeathDate && $NewAncsArray[$i]->DeathDateDecade > '') { $TheLifeSpan .= $NewAncsArray[$i]->DeathDateDecade . ")"; } else { $TheLifeSpan .= "????)"; } $_SESSION['IndexFullerList'][$NewAncsArray[$i]->Id] = [$TheName, $TheID, $NewAncsArray[$i]->Father, $NewAncsArray[$i]->Mother, $TheShortName, $TheBirthDate , '-', [0,0,0,0,0] , $NewAncsArray[$i]->DeathDate, $NewAncsArray[$i]->BirthDateDecade, str_replace("'", "'",$NewAncsArray[$i]->BirthLocation), str_replace("'", "'", $NewAncsArray[$i]->DeathLocation) , $TheBirth4Bio, array() , 'black', $TheLifeSpan, 0,$NewAncsArray[$i]->Gender,$NewAncsArray[$i]->BirthNamePrivate]; //echo " ADDED !"; $AddedIDsArray[] = $TheID; } } } $NewGreatestGreatsArray = array(); for ($i=0; $i < count($AddedIDsArray); $i++) { $key = $AddedIDsArray[$i]; if (!$_SESSION['IndexFullerList'][ $_SESSION['IndexFullerList'][$key][$MOTHER] ] && !$_SESSION['IndexFullerList'][ $_SESSION['IndexFullerList'][$key][$FATHER] ] ) { // echo "
" . $_SESSION['IndexFullerList'][$key][$SHORTNAME] . " needs ancestors looked up .."; $NewGreatestGreatsArray[] = $key; } } $_SESSION['GreatestGreatsArray'] = $NewGreatestGreatsArray; $_SESSION['MaxNumGens'] += 1; // RECALCULATE the COLORS foreach ($_SESSION['IndexFullerList'] as $key => $value) { $_SESSION['IndexFullerList'][$key][$PATHS] = array(); } calcPathFor($_SESSION['Primary1'][$FATHER], $_SESSION['Primary1'][$ID] ); calcPathFor($_SESSION['Primary1'][$MOTHER], $_SESSION['Primary1'][$ID] ); $NumOfHRclrs = count($HRclrs); // echo "
Primary1ID = *" . $Primary1ID . "* Primary2ID = #". $Primary2ID . "#"; foreach ($_SESSION['IndexFullerList'] as $key => $value) { if (count ($_SESSION['IndexFullerList'][$key][$PATHS]) > 1) { $NumOfMultiAncestors++; $_SESSION['IndexFullerList'][$key][$HRCOLOR] = $HRclrs[($NumOfMultiAncestors % $NumOfHRclrs)]; } } } // if ($num=999) { // echo "

HI there !

"; // $ThePerson ='Marcoux-336'; // $theChildrenURL = "https://api.wikitree.com/api.php?action=getRelatives&getChildren=1&keys=". $ThePerson; // $pageSp = file_get_contents($theChildrenURL); // $JSONobjectSp = json_decode($pageSp); // //$AncestorArray1 // // $_SESSION['SpouseNames'] = array(); // // $_SESSION['SpouseNames'] = $JSONobjectSp[0]->items; // $ItemsArray = $JSONobjectSp[0]->items; // echo "
There are " . count ($ItemsArray) . " records."; // $ChildrenObject = $ItemsArray[0]->person->Children; // echo "
hi again
"; // // var_dump($ItemsArray[0]->key); // var_dump($ItemsArray[0]->person->Children); // // echo "
Children Object = " . $ChildrenObject; // foreach ($ChildrenObject as $key => $value) { // echo "
Child : " . $key . " : " . $value->Name . ' = ' . $value->ShortName; // // $_SESSION['SpouseNames'][] = [$value->Name , $value->ShortName]; // } // // echo "
PageSP
" . $pageSp; // } // COLOURED WEDGE: width = widest part / border-bottom = height (radius) / border-left & border-right = amount dx to reduce the widest part for each side (each amount is 1/2 of total dx) // $wedgeX = round(($CurrRadius + $BaseRadius/2) * sin(($TheAng - $dAng/2) * pi() / 180), 2); // $wedgeY = round(($CurrRadius + $BaseRadius/2) * cos(($TheAng - $dAng/2) * pi() / 180), 2); // $wedgeX2 = round(($CurrRadius + $BaseRadius/2) * sin(($TheAng + $dAng/2) * pi() / 180), 2); // $wedgeY2 = round(($CurrRadius + $BaseRadius/2) * cos(($TheAng + $dAng/2) * pi() / 180), 2); // $wedgeWidth = round(sqrt(($wedgeX2 - $wedgeX)*($wedgeX2 - $wedgeX) + ($wedgeY2 - $wedgeY)*($wedgeY2 - $wedgeY))); // echo "
"; // DIVIDER // echo "

"; ?>