GOffice.GraphRenderer

g GObject.Object GObject.Object GOffice.GraphRenderer GOffice.GraphRenderer GObject.Object->GOffice.GraphRenderer

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (graph)

draw_circle (x, y, r)

draw_color_map (map, discrete, horizontal, rect)

draw_data_label (elt, pos, anchor, legend_style)

draw_gostring (str, pos, anchor, justification, width)

draw_grip (x, y)

draw_marker (x, y)

draw_rectangle (rect)

draw_rotated_rectangle (rect, rotate_bg)

draw_selection_rectangle (rectangle)

draw_shape (path)

draw_text (text, pos, anchor, use_markup, justification, width)

export_image (format, output, x_dpi, y_dpi)

fill_circle (x, y, r)

fill_rectangle (rect)

fill_serie (path, close_path)

fill_shape (path)

get_cairo_surface ()

get_gostring_AABR (str, aabr, max_width)

get_gostring_OBR (str, obr, max_width)

get_hairline_width_pts ()

get_pixbuf ()

get_scale ()

get_text_AABR (text, use_markup, aabr, max_width)

get_text_OBR (text, use_markup, obr, max_width)

line_size (width)

pop_clip ()

pop_style ()

pt2r (d)

pt2r_x (d)

pt2r_y (d)

push_clip (path)

push_clip_rectangle (x, y, w, h)

push_style (style)

render_to_cairo (cairo, width, height)

request_update ()

stroke_circle (x, y, r)

stroke_rectangle (rect)

stroke_serie (path)

stroke_shape (path)

update (w, h)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

model

GOffice.GraphGraph

r/w

The GOffice.GraphGraph this renderer displays

view

GOffice.GraphView

r

the GOffice.GraphView this renderer is displaying

Signals

Inherited:

GObject.Object (1)

Name

Short Description

request-update

Fields

Inherited:

GObject.Object (1)

Class Details

class GOffice.GraphRenderer(**kwargs)
Bases:

GObject.Object

Abstract:

No

classmethod new(graph)
Parameters:

graph (GOffice.GraphGraph) – graph model

Returns:

a new GOffice.GraphRenderer which can render into a pixbuf, and sets graph as its model.

Return type:

GOffice.GraphRenderer

draw_circle(x, y, r)
Parameters:
draw_color_map(map, discrete, horizontal, rect)
Parameters:
draw_data_label(elt, pos, anchor, legend_style)
Parameters:
draw_gostring(str, pos, anchor, justification, width)
Parameters:

Have self draw layout in the at pos.{x,y} anchored by the anchor corner. If pos.w or pos.h are >= 0 then clip the results to less than that size.

draw_grip(x, y)
Parameters:
  • x (float) – x position of grip

  • y (float) – y position of grip

Draw a grip, used for moving/resizing of objects.

draw_marker(x, y)
Parameters:
  • x (float) – X-coordinate

  • y (float) – Y-coordinate

draw_rectangle(rect)
Parameters:

rect (GOffice.GraphViewAllocation) – position and extent of rectangle

A utility routine to build a closed rectangle vpath.

draw_rotated_rectangle(rect, rotate_bg)
Parameters:
draw_selection_rectangle(rectangle)
Parameters:

rectangle (GOffice.GraphViewAllocation) –

draw_shape(path)
Parameters:

path (GOffice.Path) –

draw_text(text, pos, anchor, use_markup, justification, width)
Parameters:

Have self draw text in the at pos.{x,y} anchored by the anchor corner. If pos.w or pos.h are >= 0 then clip the results to less than that size.

export_image(format, output, x_dpi, y_dpi)
Parameters:
Returns:

True if export succeed.

Return type:

bool

Exports an image of graph in given format, writing results in a Gsf.Output stream. If export format type is a bitmap one, it computes image size with x_dpi, y_dpi and graph size (see GOffice.GraphGraph.get_size()).

fill_circle(x, y, r)
Parameters:
fill_rectangle(rect)
Parameters:

rect (GOffice.GraphViewAllocation) –

fill_serie(path, close_path)
Parameters:
fill_shape(path)
Parameters:

path (GOffice.Path) –

get_cairo_surface()
Return type:

cairo.Surface

get_gostring_AABR(str, aabr, max_width)
Parameters:
get_gostring_OBR(str, obr, max_width)
Parameters:
get_hairline_width_pts()
Returns:

the hairline width in pts.

Return type:

float

get_pixbuf()
Returns:

current pixbuf buffer from a renderer that can render into a pixbuf. or None on error.

Return type:

GdkPixbuf.Pixbuf

get_scale()
Return type:

float

get_text_AABR(text, use_markup, aabr, max_width)
Parameters:
get_text_OBR(text, use_markup, obr, max_width)
Parameters:
line_size(width)
Parameters:

width (float) –

Return type:

float

pop_clip()

End the current clipping.

pop_style()
pt2r(d)
Parameters:

d (float) –

Return type:

float

pt2r_x(d)
Parameters:

d (float) –

Return type:

float

pt2r_y(d)
Parameters:

d (float) –

Return type:

float

push_clip(path)
Parameters:

path (GOffice.Path) – a GOffice.Path

Defines the current clipping region.

push_clip_rectangle(x, y, w, h)
Parameters:
  • x (float) – left coordinate

  • y (float) – top coordinate

  • w (float) – width of clipping rectangle

  • h (float) – height of clipping rectangle

Defines a rectangular clipping region. For efficient screen rendering, this function takes care to round the coordinates.

push_style(style)
Parameters:

style (GOffice.Style) –

render_to_cairo(cairo, width, height)
Parameters:
Return type:

bool

request_update()
stroke_circle(x, y, r)
Parameters:
stroke_rectangle(rect)
Parameters:

rect (GOffice.GraphViewAllocation) –

stroke_serie(path)
Parameters:

path (GOffice.Path) –

stroke_shape(path)
Parameters:

path (GOffice.Path) –

update(w, h)
Parameters:
  • w (float) – requested width

  • h (float) – requested height

Returns:

True if a redraw is necessary.

Return type:

bool

Requests a renderer update, only useful for pixbuf based renderer.

Signal Details

GOffice.GraphRenderer.signals.request_update(graph_renderer)
Signal Name:

request-update

Flags:

RUN_LAST

Parameters:

graph_renderer (GOffice.GraphRenderer) – The object which received the signal

Property Details

GOffice.GraphRenderer.props.model
Name:

model

Type:

GOffice.GraphGraph

Default Value:

None

Flags:

READABLE, WRITABLE

The GOffice.GraphGraph this renderer displays

GOffice.GraphRenderer.props.view
Name:

view

Type:

GOffice.GraphView

Default Value:

None

Flags:

READABLE

the GOffice.GraphView this renderer is displaying