Skip to the content.

Table of Contents

TidyTree

This class function creates a TidyTree object.

Parameters

setData

Update the TidyTree’s underlying data structure There are two contexts in which you should call this: 1. You wish to replace the tree with a completely different tree, given by a different newick string 2. Your underlying tree data has changed (e.g. the tree has been re-rooted)

Parameters

Returns Object the TidyTree object

setTree

Update the TidyTree’s underlying data structure There are two contexts in which you should call this: 1. You wish to replace the tree with a completely different tree, given by a different newick string 2. Your underlying tree data has changed (e.g. the tree has been re-rooted)

Parameters

Returns Object the TidyTree object

draw

Draws a Phylogenetic on the element referred to by selector

Parameters

Returns TidyTree the TidyTree object

redraw

Redraws the links and relocates the nodes accordingly

Returns TidyTree The TidyTree Object

recenter

Recenters the tree in the center of the view

Returns TidyTree The TidyTree object

setLayout

Set the TidyTree’s layout

Parameters

Returns TidyTree The TidyTree Object

setColorOptions

Set the TidyTree’s colorOptions

Parameters

Returns TidyTree The TidyTree Object

setMode

Set the TidyTree’s mode

Parameters

Returns TidyTree The TidyTree object

setType

Set the TidyTree’s type

Parameters

Returns TidyTree the TidyTree object

setRotation

Set the TidyTree’s rotation

Parameters

Returns TidyTree the TidyTree object

setHStretch

Set the TidyTree’s Horizontal Stretch

Parameters

Returns TidyTree the TidyTree object

setVStretch

Set the TidyTree’s Vertical Stretch

Parameters

Returns TidyTree the TidyTree object

setAnimation

Set the TidyTree’s animation time. Note that this does not trigger a redraw.

Parameters

Returns TidyTree The TidyTree object

setBranchNodes

Shows or hides the Branch Nodes

Parameters

Returns TidyTree the TidyTree object

eachBranchNode

Restyles Leaf Nodes

Parameters

Returns TidyTree the TidyTree Object

setBranchLabels

Set the TidyTree’s branchLabels

Parameters

Returns TidyTree the TidyTree Object

eachBranchLabel

Restyles Branch Label

Parameters

Returns TidyTree the TidyTree Object

setBranchDistances

Shows or hides the TidyTree’s branch labels

Parameters

Returns TidyTree The TidyTree Object

eachBranchDistance

Restyles Branch Distances

Parameters

Returns TidyTree the TidyTree Object

setLeafNodes

Shows or Hides the Leaf Nodes

Parameters

Returns TidyTree The TidyTree Object

eachLeafNode

Restyles Leaf Nodes

Parameters

Returns TidyTree the TidyTree Object

setEquidistantLeaves

Set the TidyTree’s leaves to be equidistant

Parameters

setLeafLabels

Shows or Hides the TidyTree’s Leaf Labels

Parameters

Returns TidyTree the TidyTree Object

eachLeafLabel

Restyles Leaf Labels

Parameters

Returns TidyTree the TidyTree Object

setRuler

Shows or hides the TidyTree’s branch labels

Parameters

Returns TidyTree The TidyTree Object

getNodeGUIDs

Retrieves the GUIDs of the nodes in the TidyTree instance.

Parameters

Returns Array An array of GUIDs of the nodes.

Searches the tree, returns Search Results

Parameters

Returns Array The array of results

on

Attaches a new event listener Please note that this is not yet functioning.

Parameters

Returns TidyTree The TidyTree on which this method was called.

off

Removes all event listeners from the given events

Parameters

Returns TidyTree The TidyTree on which this method was called.

trigger

Forces the tree to respond as though an event has occurred

Parameters

Returns any The output of the callback run on event

destroy

Destroys the TidyTree

Returns undefined

validLayouts

The available layouts for rendering trees.

Type: Array

validTypes

The available types for rendering branches.

Type: Array

validModes

The available modes for rendering branches.

Type: Array

validNodeColorModes

The available color modes for rendering nodes.

Type: Array

validBranchColorModes

The available color modes for rendering branches.

Type: Array

circularPoint

Calculate the coordinates of a point transformed onto a circle.

Parameters

Returns Array<number> The new x and y coordinates of the point on the circle.

findNodeColor

Finds the color of a given node based on the color options provided.

Parameters

Returns string The color of the node.

findBranchColor

Find the color of a given link based on the provided color options.

Parameters

Returns string The color of the link.

getAllLeaves

Returns an array of all the child leaf nodes of the given node in a tree.

Parameters

Returns Array An array of leaf nodes.