GOffice.GraphAxisColorMap

g GObject.GInterface GObject.GInterface GOffice.Persist GOffice.Persist GObject.GInterface->GOffice.Persist GObject.Object GObject.Object GOffice.GraphAxisColorMap GOffice.GraphAxisColorMap GObject.Object->GOffice.GraphAxisColorMap GOffice.Persist->GOffice.GraphAxisColorMap

Subclasses:

None

Methods

Inherited:

GObject.Object (37), GOffice.Persist (2)

Structs:

GObject.ObjectClass (5)

class

foreach (handler, *user_data)

class

from_colors (name, nb, colors, type)

class

get_from_id (id)

delete ()

dup ()

edit (cc)

get_color (x)

get_id ()

get_max ()

get_name ()

get_resource_type ()

get_snapshot (discrete, horizontal, width, height)

to_cairo (cr, discrete, horizontal, width, height)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

resource-type

GOffice.ResourceType

r/w/co

The resource type for the color map

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class GOffice.GraphAxisColorMap(**kwargs)
Bases:

GObject.Object, GOffice.Persist

Abstract:

No

classmethod foreach(handler, *user_data)
Parameters:

Executes handler to each color map installed on the system or loaded from a document.

classmethod from_colors(name, nb, colors, type)
Parameters:
Returns:

the newly created color map.

Return type:

GOffice.GraphAxisColorMap

Creates a color map using colors.

classmethod get_from_id(id)
Parameters:

id (str) – the color map identifier to search for

Returns:

the found color map.

Return type:

GOffice.GraphAxisColorMap

Retrieves the color map whose identifier is id.

delete()
Returns:

True on success.

Return type:

bool

Destroys the color map and remove it from the user directory and from the database.

dup()
Returns:

the new color map.

Return type:

GOffice.GraphAxisColorMap

Duplicates the color map.

edit(cc)
Parameters:

cc (GOffice.CmdContext) – a GOffice.CmdContext or None

Returns:

the edited color map.

Return type:

GOffice.GraphAxisColorMap

Opens a dialog to edit the color map. If self is None, creates a new one unless the user cancels the edition.

get_color(x)
Parameters:

x (float) – the GOffice.value to map

Returns:

the found color.

Return type:

int

Maps x to a color.

get_id()
Returns:

the map name.

Return type:

str

Retrieves the color map name.

get_max()
Returns:

the maximum GOffice.value.

Return type:

int

Retrieves the GOffice.value corresponding to the last color in the map. The first always corresponds to 0.

get_name()
Returns:

the map name.

Return type:

str

Retrieves the color map localized name.

get_resource_type()
Returns:

the resource type.

Return type:

GOffice.ResourceType

Retrieves the resource type for self.

get_snapshot(discrete, horizontal, width, height)
Parameters:
  • discrete (bool) – whether to use constant colors between each stop or a gradient.

  • horizontal (bool) – whether to get an horizontal or a vertical snapshot.

  • width (int) – the pixbuf width.

  • height (int) – the pixbuf height.

Returns:

the new GdkPixbuf.Pixbuf.

Return type:

GdkPixbuf.Pixbuf

Builds a snapshot of the color map.

to_cairo(cr, discrete, horizontal, width, height)
Parameters:
  • cr (cairo.Context) – a cairo context.

  • discrete (int) – whether to use constant colors between each stop or a gradient.

  • horizontal (bool) – whether to get an horizontal or a vertical snapshot.

  • width (float) – the rectangle width.

  • height (float) – the rectangle height.

When discrete is larger than 1, it will be interpreted as the number of major ticks used. The number of colors will then be discrete − 1. Draws a snapshot of the color map inside the rectangle.

Property Details

GOffice.GraphAxisColorMap.props.resource_type
Name:

resource-type

Type:

GOffice.ResourceType

Default Value:

GOffice.ResourceType.INVALID

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The resource type for the color map