plotynium.context
plotynium.context.Context
Context(canvas_properties, legend_properties, x_options, y_options, color_options, style_options, symbol_options, x_scale, y_scale, x_label=None, y_label=None)
The Context
holds all information shared to Mark
objects and Legend
object. These information are computed dimensions, options, scalers and
labels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
CanvasProperties
|
Canvas properties (width, height and margin) |
required |
|
LegendProperties
|
Legend properties (width, height and margin) |
required |
|
XOptions
|
X axis options |
required |
|
YOptions
|
Y axis options |
required |
|
ColorOptions
|
Color options |
required |
|
StyleOptions
|
Style options |
required |
|
SymbolOptions
|
Symbol options |
required |
|
Scaler
|
X scale from |
required |
|
Scaler
|
Y scale from |
required |
|
str | None
|
X label |
None
|
|
str | None
|
Y label |
None
|
Source code in plotynium/context.py
background
property
Returns the background value.
Returns:
Type | Description |
---|---|
str
|
Background value |
canvas_translate
property
Returns the canvas translation value. For instance,
"translate(15, 12)"
and if x
and y
values of the translation
equal zero, it returns None
.
Returns:
Type | Description |
---|---|
str | None
|
Translation value of the canvas |
color_mapping
property
Returns color mapping collected after the application of marks.
Returns:
Type | Description |
---|---|
list[tuple[str, str]]
|
List of pairs (label, color) |
color_scheme
property
Returns the color scheme value.
Returns:
Type | Description |
---|---|
ColorScheme
|
Color scheme value |
font_family
property
Returns the font family.
Returns:
Type | Description |
---|---|
str
|
Font family value |
height
property
Returns height size of the canvas.
Returns:
Type | Description |
---|---|
int
|
Height size of the canvas |
labels
property
Returns the definition of user labels.
Returns:
Type | Description |
---|---|
dict[int, str]
|
Dictionary where keys are indices of labels and values are label values |
legend_properties
property
margin
property
Returns margin values of the canvas.
Returns:
Type | Description |
---|---|
int
|
Margin values of the canvas |
symbol_mapping
property
Returns symbol mapping collected after the application of marks.
Returns:
Type | Description |
---|---|
list[tuple[str, str]]
|
List of pairs (label, symbol path) |
width
property
Returns width size of the canvas.
Returns:
Type | Description |
---|---|
int
|
Width size of the canvas |
update_color_mapping
Sets the color mapping by prioritizing the longest color mapping list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
tuple[list[tuple[str, str]]]
|
Several list of pairs (label, color) |
()
|
Source code in plotynium/context.py
update_symbol_mapping
Sets the symbol mapping by prioritizing the longest symbol mapping list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
tuple[list[tuple[str, str]]]
|
Several list of pairs (label, symbol path) |
()
|