Skip to content

contango.trading.analysis.graph_type

contango.trading.analysis.graph_type

GraphType

GraphType(config: C)

Bases: ABC, Generic[C]

A generic abstract class that all graphs should implement.

Attributes:

Name Type Description
C

The GraphConfig for the class.

graph_name str

The unique name for the graph.

Initializes GraphType.

Parameters:

Name Type Description Default
config C

The matching configuration for the graph type.

required
Source code in src\contango\trading\analysis\graph_type.py
26
27
28
29
30
31
32
33
def __init__(self, config: C) -> None:
    """
    Initializes `GraphType`.

    Args:
        config: The matching configuration for the graph type.
    """
    self._config = config

config property

config: C

The config for the graph type.

build abstractmethod

build(df: DataFrame) -> go.Figure

Builds the graph type.

Parameters:

Name Type Description Default
df DataFrame

The pre-validated experiments dataframe.

required

Returns:

Type Description
Figure

go.Figure: A plotly graph figure.

Source code in src\contango\trading\analysis\graph_type.py
43
44
45
46
47
48
49
50
51
52
53
54
@abstractmethod
def build(self, df: pd.DataFrame) -> go.Figure:
    """
    Builds the graph type.

    Args:
        df: The pre-validated experiments dataframe.

    Returns:
        go.Figure: A plotly graph figure.
    """
    ...