Contents
New in version 2.1.
Contains all the general image properties used to render a tree
– About tree design –
Parameters: | layout_fn (None) – Layout function used to dynamically control the aspect of nodes. Valid values are: None or a pointer to a method, function, etc. |
---|
– About tree shape –
Parameters: |
|
---|
– About Tree branches –
Parameters: |
|
---|
– About node faces –
Parameters: |
|
---|
– Addons –
Parameters: |
|
---|
– Tree surroundings –
The following options are actually Face containers, so graphical elements can be added just as it is done with nodes. In example, to add tree legend:
TreeStyle.legend.add_face(CircleFace(10, "red"), column=0) TreeStyle.legend.add_face(TextFace("0.5 support"), column=1)
Parameters: |
|
---|
New in version 2.1.
A dictionary with all valid node graphical attributes.
Parameters: |
|
---|
Adds a Face to a given node.
Parameters: | face – A Face instance |
---|
Parameters: |
---|
Base Face object. All Face types (i.e. TextFace, SeqMotifFace, etc.) inherit the following options:
Parameters: |
|
---|
border and inner_border sub-parameters:
Parameters: |
|
---|
See also specific options for each face type.
Static text Face object
Parameters: |
|
---|
approximated according to general font metrics, producing slightly worse aligned text faces but improving the performance of tree visualization in scenes with a lot of text faces.
Dynamic text Face. Text rendered is taken from the value of a given node attribute.
Parameters: |
|
---|
Creates a node Face using an external image file.
Parameters: |
|
---|
If only one dimension value (width or height) is provided, the other will be calculated to keep aspect ratio.
New in version 2.1.
Creates a Circle or Sphere Face.
Parameters: |
|
---|
New in version 2.3.
Creates a Rectangular solid face.
Creates a new molecular sequence face object. :param seq: Sequence string to be drawn :param seqtype: Type of sequence: “nt” or “aa” :param fsize: Font size, (default=10)
You can set custom colors for amino-acids or nucleotides:
Parameters: |
|
---|
New in version 2.2.
Creates a face based on an amino acid or nucleotide sequence and a list of motif regions.
Parameters: |
|
---|
New in version 2.2.
Parameters: |
|
---|
New in version 2.2.
Parameters: |
|
---|
A profile Face for ClusterNodes
Parameters: |
|
---|
New in version 2.1.
Creates a Face containing a Tree object. Yes, a tree within a tree :)
Parameters: |
|
---|
New in version 2.1.
Creates a face based on an external QtGraphicsItem object. QGraphicsItem object is expected to be independent from tree node properties, so its content is assumed to be static (drawn only once, no updates when tree changes).
Parameters: | item – an object based on QGraphicsItem |
---|
New in version 2.1.
Creates a face based on an external QGraphicsItem object whose content depends on the node that is linked to.
Parameters: | constructor – A pointer to a method (function or class constructor) returning a QGraphicsItem based object. “constructor” method is expected to receive a node instance as the first argument. The rest of arguments passed to ItemFace are optional and will passed also to the constructor function. |
---|
Apart from RGB color codes, the following SVG color names are supported:
returns the RGB code of a random color. Hue (h), Lightness (l) and Saturation (s) of the generated color could be fixed using the pertinent function argument.