Back to bricks list
Introduction Version

BoxPlotView

BoxPlotView

Base class for creating box plots.

:property x_label: The X-axis label :type x_label: str :property y_label: The Y-axis label :type y_label: str :property x_tick_labels: The labels of X-ticks :type x_tick_labels: list[str]

The view model is:

{
    "type": "box-plot-view",
    "title": str,
    "caption": str,
    "data": {
        "x_label": str,
        "y_label": str,
        "x_tick_labels": List[str] | None,
        "series": [
            {
                "data": {
                    "x": List[Float],
                    "max": List[Float],
                    "q1": List[Float],
                    "median": List[Float],
                    "min": List[Float],
                    "q3": List[Float],
                    "lower_whisker": List[Float],
                    "upper_whisker": List[Float],
                    "tags": List[Dict[str,str]] | None
                },
                "name": str
            },
            ...
        ]
    }
}

Attributes

x_label: strx_tick_labels: Listy_label: str

Functions

__INIT__

Initialize self. See help(type(self)) for accurate signature.

ADD_DATA

Add series of raw data.

Parameters:
NameTypeDefault valueDescription
dataList Dataframe or [list[float]]
namestr
tagsList [dict[str, str]]
ADD_DATA_FROM_DATAFRAME
Parameters:
NameTypeDefault valueDescription
dataDataFrame
namestr
tagsList
ADD_SERIES

Add series of pre-computed x and y box values. Vector x is the vector of bin centers and y contains the magnitudes at corresponding x positions.

Parameters:
NameTypeDefault valueDescription
xList List of float
medianList List of float
q1List List of float
q3List List of float
minList List of float
maxList List of float
lower_whiskerList List of float
upper_whiskerList List of float
namestr
tagsList [dict[str, str]]
ADD_TECHNICAL_INFO

Add technical info

Parameters:
NameTypeDefault valueDescription
technical_infoTechnicalInfo
COPY_INFO

Copy the view information from another view

Parameters:
NameTypeDefault valueDescription
viewView View to copy the information from
DATA_TO_DICT

Convert to dictionary

Parameters:
NameTypeDefault valueDescription
paramsConfigParams
Return type:
dict
DISABLE_PAGINATION

Mark the view as not interactive, disable the pagination

GET_STYLE

Get style

Return type:
TypingStyle
GET_TECHNICAL_INFO

Get technical info dict

Parameters:
NameTypeDefault valueDescription
keystr
Return type:
TechnicalInfo
GET_TECHNICAL_INFO_DICT

Get technical info

Return type:
TechnicalInfoDict
GET_TITLE

Get title

Return type:
Optional
GET_TYPE

Get type

Return type:
ViewType
IS_FAVORITE

Is favorite

Return type:
bool
IS_PAGINATION_DISABLED

Is interaction disabled

Return type:
bool
SET_FAVORITE

Set favorite

Parameters:
NameTypeDefault valueDescription
favoritebool
SET_STYLE

Set typing style for this view instance. This overrides the style defines in the view decorator and the default style of the view type With this you can define a custom style for a specific view instance when you view is generic.

Parameters:
NameTypeDefault valueDescription
styleTypingStyle
SET_TECHNICAL_INFO_DICT

Set technical info

Parameters:
NameTypeDefault valueDescription
technical_infoTechnicalInfoDict
SET_TITLE

Set title

Parameters:
NameTypeDefault valueDescription
titlestr
TO_DTO

Convert to DTO

Parameters:
NameTypeDefault valueDescription
paramsConfigParams
Return type:
ViewDTO
GENERATE_RANGE - @classmethod

Generate range list like 0,1,2...length

Parameters:
NameTypeDefault valueDescription
lengthint
Return type:
List
GET_SPECS - @classmethod
Return type:
Dict
JSON_IS_FROM_VIEW - @classmethod

Method that return true is the provided json is a json of a view

Parameters:
NameTypeDefault valueDescription
json_Any
Return type:
bool