search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``igraph`.`drawing`.`cairo`.`text`.`CairoTextDrawer``

class documentation

`class CairoTextDrawer(AbstractCairoDrawer): (source)`

Constructor: `CairoTextDrawer(context, text, halign, valign)`

View In Hierarchy

Class that draws text on a Cairo context.

This class supports multi-line text unlike the original Cairo text drawing methods.

Method | `__init__` | Constructs a new instance that will draw the given `text` on the given Cairo `context`.
Method | `draw` | Draws the text in the current bounding box of the drawer.
Method | `draw_at` | Draws the text by setting up an appropriate path on the Cairo context and filling it. `x` and `y` denote the coordinates where the drawing should start. If they are both `None`, the current position of the context will be used.
Method | `get_text_layout` | Calculates the layout of the current text. `x` and `y` denote the coordinates where the drawing should start. If they are both `None`, the current position of the context will be used.
Method | `text.setter` | Sets the text that will be drawn.
Method | `text_extents` | Returns the X-bearing, Y-bearing, width, height, X-advance and Y-advance of the text.
Class Variable | `BOTTOM` | Undocumented
Class Variable | `CENTER` | Undocumented
Class Variable | `LEFT` | Undocumented
Class Variable | `RIGHT` | Undocumented
Class Variable | `TOP` | Undocumented
Instance Variable | `halign` | Undocumented
Instance Variable | `valign` | Undocumented
Property | `text` | Returns the text to be drawn.
Method | `_iterlines` | Iterates over the label line by line and returns a tuple containing the folloing for each line: the line itself, the width of the line and the X-bearing of the line.
Method | `_iterlines_wrapped` | Iterates over the label line by line and returns a tuple containing the folloing for each line: the line itself, the width of the line and the X-bearing of the line.
Instance Variable | `_text` | Undocumented

Inherited from `AbstractCairoDrawer`:

Method | `bbox.setter` | Sets the bounding box of the drawing area where this drawer will draw.
Instance Variable | `context` | Undocumented
Property | `bbox` | The bounding box of the drawing area where this drawer will draw.
Method | `_mark_point` | Marks the given point with a small circle on the canvas. Used primarily for debugging purposes.
Instance Variable | `_bbox` | Undocumented

def __init__(self, context, text='', halign='center', valign='center'): (source)
overrides `igraph.drawing.cairo.base.AbstractCairoDrawer.__init__`

Constructs a new instance that will draw the given `text` on the given Cairo `context`.

def draw(self, wrap=False): (source)
overrides `igraph.drawing.baseclasses.AbstractDrawer.draw`

Draws the text in the current bounding box of the drawer.

Since the class itself is an instance of `AbstractCairoDrawer`, it has an attribute named `bbox` which will be used as a bounding box.

Parameters
wrap | whether to allow re-wrapping of the text if it does not fit within the bounding box horizontally.

def draw_at(self, x=None, y=None, width=None, wrap=False): (source)

Draws the text by setting up an appropriate path on the Cairo context and filling it. `x` and `y` denote the coordinates where the drawing should start. If they are both `None`, the current position of the context will be used.

Vertical alignment settings are not taken into account in this method as the text is not drawn within a box.

Parameters
x | The X coordinate of the reference point where the layout should start.
y | The Y coordinate of the reference point where the layout should start.
width | The width of the box in which the text will be fitted. It matters only when the text is right-aligned or centered. The text will overflow the box if any of the lines is longer than the box width and `wrap` is `False`.
wrap | whether to allow re-wrapping of the text if it does not fit within the given width.

def get_text_layout(self, x=None, y=None, width=None, wrap=False): (source)

Calculates the layout of the current text. `x` and `y` denote the coordinates where the drawing should start. If they are both `None`, the current position of the context will be used.

Vertical alignment settings are not taken into account in this method as the text is not drawn within a box.

Parameters
x | The X coordinate of the reference point where the layout should start.
y | The Y coordinate of the reference point where the layout should start.
width | The width of the box in which the text will be fitted. It matters only when the text is right-aligned or centered. The text will overflow the box if any of the lines is longer than the box width and `wrap` is `False`.
wrap | whether to allow re-wrapping of the text if it does not fit within the given width.
Returns
a list consisting of `(x, y, line)` tuples where `x` and `y` refer to reference points on the Cairo canvas and `line` refers to the corresponding text that should be plotted there.

@text.setter
def text(self, text): (source)

Sets the text that will be drawn.

If `text` is `None`, it will be mapped to an empty string; otherwise, it will be converted to a string.

def text_extents(self): (source)

Returns the X-bearing, Y-bearing, width, height, X-advance and Y-advance of the text.

For multi-line text, the X-bearing and Y-bearing correspond to the first line, while the X-advance is extracted from the last line. and the Y-advance is the sum of all the Y-advances. The width and height correspond to the entire bounding box of the text.

BOTTOM = (source)

Undocumented

CENTER = (source)

Undocumented

LEFT = (source)

Undocumented

RIGHT = (source)

Undocumented

TOP = (source)

Undocumented

halign = (source)

Undocumented

valign = (source)

Undocumented

@property
text = (source)

Returns the text to be drawn.

def _iterlines(self): (source)

Iterates over the label line by line and returns a tuple containing the folloing for each line: the line itself, the width of the line and the X-bearing of the line.

def _iterlines_wrapped(self, width): (source)

Iterates over the label line by line and returns a tuple containing the folloing for each line: the line itself, the width of the line and the X-bearing of the line.

The difference between this method and `_iterlines()` is that this method is allowed to re-wrap the line if necessary.

Parameters
width | The width of the box in which the text will be fitted. Lines will be wrapped if they are wider than this width.

_text: `str` = (source)

Undocumented