GOffice.GraphAxisMap

Fields

None

Methods

class new (axis, offset, length)
  _ (value)
  derivative_to_view (value)
  finite (value)
  free ()
  from_view (value)
  get_baseline ()
  get_bounds ()
  get_extents ()
  get_real_bounds ()
  get_real_extents ()
  is_discrete ()
  is_inverted ()
  is_valid ()
  to_view (value)

Details

class GOffice.GraphAxisMap
classmethod new(axis, offset, length)
Parameters:
Returns:

a newly allocated GOffice.GraphAxisMap.

Return type:

GOffice.GraphAxisMap

Creates a GOffice.GraphAxisMap for data mapping to plot window. offset and length are optional parameters to be used with GOffice.GraphAxisMap.to_view in order to translates data coordinates into canvas space.

_(value)
Parameters:value (float) – GOffice.value to map to plot space.
Returns:mapped GOffice.value.
Return type:float

Converts value to plot coordinates. A GOffice.value in [0,1.0] range means a data within axis bounds.

derivative_to_view(value)
Parameters:value (float) – GOffice.value to map to canvas space
Returns:the derivative of the mapping expression at GOffice.value.
Return type:float
finite(value)
Parameters:value (float) – GOffice.value to test
Returns:True if GOffice.value means something
Return type:bool

Tests whether value is valid for the given self.

free()

Frees GOffice.GraphAxisMap object.

from_view(value)
Parameters:value (float) – GOffice.value to unmap from canvas space.
Returns:GOffice.value in data coordinates
Return type:float

Converts GOffice.value from canvas space to data space.

get_baseline()
Returns:the baseline for self, in view coordinates, clipped to offset and offset+length, where offset and length are the parameters of GOffice.GraphAxisMap.new.
Return type:float
get_bounds()
Returns:
minimum:location to store minimum for this axis
maximum:location to store maximum for this axis
Return type:(minimum: float, maximum: float)

Gets bounds for the whole chart relative to the given axis map in data coordinates. If axis is invalid, it’ll return arbitrary bounds.

get_extents()
Returns:
start:location to store start for this axis
stop:location to store stop for this axis
Return type:(start: float, stop: float)

Gets start and stop for the whole chart relative to the given axis map in data coordinates. If axis is not inverted, start = minimum and stop = maximum. If axis is invalid, it’ll return arbitrary bounds.

get_real_bounds()
Returns:
minimum:location to store minimum for this axis
maximum:location to store maximum for this axis
Return type:(minimum: float, maximum: float)

Gets bounds for the given axis map in data coordinates. If axis is invalid, it’ll return arbitrary bounds.

get_real_extents()
Returns:
start:location to store start for this axis
stop:location to store stop for this axis
Return type:(start: float, stop: float)

Gets start and stop for the given axis map in data coordinates. If axis is not inverted, start = minimum and stop = maximum. If axis is invalid, it’ll return arbitrary bounds.

is_discrete()
Returns:True is the axis is discrete;
Return type:bool
is_inverted()
Returns:True is the axis is inverted;
Return type:bool
is_valid()
Returns:True if map is valid
Return type:bool

Tests if self was correctly initialized, i.e. if bounds are valid.

to_view(value)
Parameters:value (float) – GOffice.value to map to canvas space
Returns:a GOffice.value in canvas coordinates
Return type:float

Converts GOffice.value from data space to canvas space, using offset and length parameters given to GOffice.GraphAxisMap.new.