pub struct DrawingArea<DB: DrawingBackend, CT: CoordTranslate> { /* private fields */ }
Expand description

The abstraction of a drawing area. Plotters uses drawing area as the fundamental abstraction for the high level drawing API. The major functionality provided by the drawing area is 1. Layout specification - Split the parent drawing area into sub-drawing-areas 2. Coordinate Translation - Allows guest coordinate system attached and used for drawing. 3. Element based drawing - drawing area provides the environment the element can be drawn onto it.

Implementations

Draw the mesh on a area

Get the range of X of the guest coordinate for current drawing area

Get the range of Y of the guest coordinate for current drawing area

Get the range of X of the backend coordinate for current drawing area

Get the range of Y of the backend coordinate for current drawing area

Get the left upper conner of this area in the drawing backend

Strip the applied coordinate specification and returns a shift-based drawing area

Strip the applied coordinate specification and returns a drawing area

Get the area dimension in pixel

Compute the relative size based on the drawing area’s height

Compute the relative size based on the drawing area’s width

Get the pixel range of this area

Fill the entire drawing area with a color

Draw a single pixel

Present all the pending changes to the backend

Draw an high-level element

Map coordinate to the backend coordinate

Estimate the dimension of the text if drawn on this drawing area. We can’t get this directly from the font, since the drawing backend may or may not follows the font configuration. In terminal, the font family will be dropped. So the size of the text is drawing area related.

  • text: The text we want to estimate
  • font: The font spec in which we want to draw the text
  • return: The size of the text if drawn on this area

Shrink the region, note all the locations are in guest coordinate

Apply a new coord transformation object and returns a new drawing area

Create a margin for the given drawing area and returns the new drawing area

Split the drawing area vertically

Split the drawing area horizontally

Split the drawing area evenly

Split the drawing area into a grid with specified breakpoints on both X axis and Y axis

Draw a title of the drawing area and return the remaining drawing area

Draw text on the drawing area

Returns the coordinates by value

Returns the coordinates by reference

Returns the coordinates by mutable reference

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts to this type from the input type.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.