Skip to content

Mark

plotynium.marks.Mark

Mark()

Description of what should be a Mark. Since plot takes a list of marks, its attributes will be mixed with other marks in order to generate a plot with single characteristics such as label values, domain values and scaler types.

Source code in plotynium/marks/mark.py
def __init__(self):
    self.x_label: str | None = None
    self.y_label: str | None = None
    self.x_domain: tuple[Number, Number] | list[str] | None = None
    self.y_domain: tuple[Number, Number] | list[str] | None = None
    self.x_scaler_type: Scaler | None = None
    self.y_scaler_type: Scaler | None = None

x_domain instance-attribute

x_domain = None

x_label instance-attribute

x_label = None

x_scaler_type instance-attribute

x_scaler_type = None

y_domain instance-attribute

y_domain = None

y_label instance-attribute

y_label = None

y_scaler_type instance-attribute

y_scaler_type = None

apply abstractmethod

apply(svg, ctx)

Method which is called by plot and which should change svg content.

Parameters:

Name Type Description Default

svg

Selection

SVG content defined by a Selection class from detroit

required

ctx

Context

SVG context containing shared data between marks

required
Source code in plotynium/marks/mark.py
@abstractmethod
def apply(self, svg: Selection, ctx: Context):
    """
    Method which is called by `plot` and which should change `svg` content.

    Parameters
    ----------
    svg : Selection
        SVG content defined by a `Selection` class from `detroit`
    ctx : Context
        SVG context containing shared data between marks
    """
    ...