AnnotationData module

class lys.widgets.canvas.interface.AnnotationData.AnnotationData(canvas, name, axis)[source]

Bases: CanvasPart

getAxis()[source]

Get axis to which the annotation is added.

Returns

The axis (‘BottomLeft’, ‘BottomRight’, ‘TopLeft’, or ‘TopRight’)

Return type

str

getName()[source]

Get the name of the annotation.

Returns

The name of annotation

Return type

str

getVisible()[source]

Get the visibility of the annotaion.

Returns

When it is True, the annotation is shown.

Return type

bool

getZOrder()[source]

Get the z order of the annotaion.

Returns

The z order of the annotation.

Return type

int

loadAppearance(appearance)[source]

Load appearnce from dictionary.

Parameters

appearance (dict) – The dictionary that include appearance information, which is usually generated by saveAppearance() method.

saveAppearance()[source]

Save appearnce as dictionary.

Returns

The dictionary that include appearance information, which is usually used by loadAppearance() method.

Return type

dict

setName(name)[source]

Set the name of the annotation.

Parameters

name (str) – The name of annotation.

setVisible(visible)[source]

Set the visibility of the annotaion.

Parameters

visible (bool) – When it is True, the annotation is shown.

setZOrder(z)[source]

Set the z order of the annotaion.

Parameters

z (int) – The z order of the annotation.

class lys.widgets.canvas.interface.AnnotationData.AnnotationWithLine(canvas, name, axis)[source]

Bases: AnnotationData

getLineColor()[source]

Get the color of the line.

Returns

The color string such as ‘#ff0000’

Return type

str

getLineStyle()[source]

Get the style of the line.

Returns

The line style (‘solid’, ‘dashed’, ‘dashdot’, ‘dotted’, or ‘none’).

Return type

str

getLineWidth()[source]

Get the width of the line.

Returns

The width of the line.

Return type

int

setLineColor(color)[source]

Set the color of the line.

Parameters

color (str) – The color string such as ‘#ff0000’

setLineStyle(style)[source]

Set the style of the line.

Parameters

style ('solid', 'dashed', 'dashdot', 'dotted', or 'none') – The line style.

setLineWidth(width)[source]

Set the width of the line.

Parameters

width (int) – The width of the line.