enable.markers module

Defines markers classes, used by a variety of renderers.

class enable.markers.AbstractMarker[source]

Bases: traits.has_traits.HasTraits

Abstract class for markers.

add_to_path(path, size)[source]

Adds this marker’s representation to path, scaled appropriately for size.

Parameters
  • path (GraphicsContext) – The target for drawing the marker.

  • size (number) – Size of the marker, in pixels

antialias = Bool(True)

Render the marker antialiased? Some markers render faster and look better if they are not anti-aliased.

close_path = Bool(True)

Close the path object after drawing this marker?

draw_mode = 4

How this marker is to be stroked (from kiva.api). This is a class variable and the available options are (FILL, EOF_FILL, STROKE, FILL_STROKE, EOF_FILL_STROKE).

get_compiled_path(size)[source]

Returns a compiled path object that represents this marker, scaled appropriately for size.

kiva_marker = 0

The kiva marker type (from kiva.api).

class enable.markers.CircleMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a circle.

circle_points = array([[ 1. , 0. ], [ 0.966, 0.259], [ 0.866, 0.5 ], [ 0.707, 0.707], [ 0.5 , 0.866], [ 0.259, 0.966], [ 0. , 1. ], [-0.259, 0.966], [-0.5 , 0.866], [-0.707, 0.707], [-0.866, 0.5 ], [-0.966, 0.259], [-1. , 0. ], [-0.966, -0.259], [-0.866, -0.5 ], [-0.707, -0.707], [-0.5 , -0.866], [-0.259, -0.966], [ 0. , -1. ], [ 0.259, -0.966], [ 0.5 , -0.866], [ 0.707, -0.707], [ 0.866, -0.5 ], [ 0.966, -0.259], [ 1. , 0. ]])

Array of points in a circle

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 3

The Kiva marker type. (Overrides AbstractMarker.)

class enable.markers.CrossMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is an X.

antialias = False

Do not render anti-aliased. (Overrides AbstractMarker.)

draw_mode = 4

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 5

The Kiva marker type. (Overrides AbstractMarker.)

class enable.markers.CrossPlusMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is an X and a + superimposed.

draw_mode = 4

How this marker is to be stroked. (Overrides AbstractMarker.)

class enable.markers.CustomMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a custom shape.

draw_mode = 4

How this marker is to be stroked. (Overrides AbstractMarker.)

get_compiled_path(size)[source]

Returns a path instance.

If scale_path is True, then the returned path is a new compiled path that is scaled based on size. If scaled_path is False, then this method just returns the current path.

kiva_marker = 0

The Kiva marker type. (Overrides AbstractMarker.)

path = Instance(CompiledPath)

The custom path that represents this marker.

scale_path = Bool(True)

Automatically scale path based on the input size parameter? If False, then the path does not respond to the ‘size’ parameter!

class enable.markers.DiamondMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a diamond.

antialias = False

Do not render anti-aliased. (Overrides AbstractMarker.)

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 2

The Kiva marker type. (Overrides AbstractMarker.)

class enable.markers.DotMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a dot.

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 9

The Kiva marker type. (Overrides AbstractMarker.)

class enable.markers.Hexagon1Marker[source]

Bases: enable.markers.AbstractMarker

A marker that is a hexagon, with the flat sides on the sides.

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

class enable.markers.Hexagon2Marker[source]

Bases: enable.markers.AbstractMarker

A marker that is a hexagon, with the flat sides on the top and bottom.

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

class enable.markers.Inverted_TriangleMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a triangle with one apex pointing down.

antialias = False

Do not render anti-aliased. (Overrides AbstractMarker.)

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 7

The Kiva marker type. (Overrides AbstractMarker.)

class enable.markers.LeftTriangleMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a triangle with one apex pointing left.

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

enable.markers.MarkerNameDict = {'circle': <class 'enable.markers.CircleMarker'>, 'cross': <class 'enable.markers.CrossMarker'>, 'cross_plus': <class 'enable.markers.CrossPlusMarker'>, 'custom': <class 'enable.markers.CustomMarker'>, 'diamond': <class 'enable.markers.DiamondMarker'>, 'dot': <class 'enable.markers.DotMarker'>, 'hexagon': <class 'enable.markers.Hexagon1Marker'>, 'hexagon2': <class 'enable.markers.Hexagon2Marker'>, 'inverted_triangle': <class 'enable.markers.Inverted_TriangleMarker'>, 'left_triangle': <class 'enable.markers.LeftTriangleMarker'>, 'pentagon': <class 'enable.markers.PentagonMarker'>, 'pixel': <class 'enable.markers.PixelMarker'>, 'plus': <class 'enable.markers.PlusMarker'>, 'right_triangle': <class 'enable.markers.RightTriangleMarker'>, 'square': <class 'enable.markers.SquareMarker'>, 'star': <class 'enable.markers.StarMarker'>, 'triangle': <class 'enable.markers.TriangleMarker'>}

Mapping of marker string names to classes.

enable.markers.MarkerTrait = <traits.ctrait.CTrait object>

A mapped trait that allows string naming of marker classes.

class enable.markers.PentagonMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a pentagon.

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

class enable.markers.PixelMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a pixel.

antialias = False

Do not render anti-aliased. (Overrides AbstractMarker.)

draw_mode = 4

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 10

The Kiva marker type. (Overrides AbstractMarker.)

class enable.markers.PlusMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a plus-sign.

antialias = False

Do not render anti-aliased. (Overrides AbstractMarker.)

draw_mode = 4

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 8

The Kiva marker type. (Overrides AbstractMarker.)

class enable.markers.RightTriangleMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a triangle with one apex pointing right.

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

class enable.markers.SquareMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a square.

antialias = False

Do not render anti-aliased. (Overrides AbstractMarker.)

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 1

The Kiva marker type. (Overrides AbstractMarker.)

class enable.markers.StarMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a (filled) star.

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

class enable.markers.TriangleMarker[source]

Bases: enable.markers.AbstractMarker

A marker that is a triangle with one apex pointing up.

antialias = False

Do not render anti-aliased. (Overrides AbstractMarker.)

draw_mode = 5

How this marker is to be stroked. (Overrides AbstractMarker.)

kiva_marker = 6

The Kiva marker type. (Overrides AbstractMarker.)

enable.markers.marker_names = ('square', 'circle', 'triangle', 'inverted_triangle', 'left_triangle', 'right_triangle', 'pentagon', 'hexagon', 'hexagon2', 'plus', 'cross', 'star', 'cross_plus', 'diamond', 'dot', 'pixel')

String names for marker types.