infograph#
- class predict_backend.page.elements.infograph.InfographData(label, main_text, supporting_text='', icon='', _type=InfographDataType.INFO, unit=None, display_compact=False)#
Bases:
object
The information to show in an infographic block.
- Parameters:
label (
str
) – The label at the top of the infographic block.main_text (
str
) – The main bolded text in this infographic block.supporting_text (
str
) – The supporting text underneath the main text for the infographic, defaults to ‘’.icon (
str
) – An optional icon to show at the top-right of the infographic. Must be one of the Google Icons, defaults to ‘’._type (
InfographDataType
) – The type of infographic to show. Sets the themes/colors for this block, defaults to InfographDataType.INFO.unit (
Optional
[str
]) – The unit to show alongside the main text, defaults to None.display_compact (
bool
) – If true, each tile takes up less space than a standard Infograph tile, defaults to False.
- Raises:
ValueError – If the icon is an invalid choice.
- to_json()#
Returns:
- class predict_backend.page.elements.infograph.InfographDataType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
Bases:
Enum
- INFO = 'info'#
- NEGATIVE = 'negative'#
- NEUTRAL = 'neutral'#
- POSITIVE = 'positive'#
- WARNING = 'warning'#
- class predict_backend.page.elements.infograph.Infographic(title='', description='', data=None, recommendation=None, layout=InfographicOrientation.ROW, show_title=True, show_description=True, event=None)#
Bases:
Element
An Infographic Element.
- Parameters:
title (
str
) – The title of the infographic element.description (
str
) – The description of the infographic element.data (
Optional
[List
[InfographData
]]) – Optional list of information blocks to show, defaults to None.recommendation (
Optional
[List
[InfographData
]]) – Optional list of recommendation blocks to show, defaults to None.layout (
InfographicOrientation
) – This attribute is now deprecated and has no effect on how the infographic gets rendered.show_title (
bool
) – Whether to show the title on the page when rendered, defaults to True.show_description (
bool
) – Whether to show the description to the page when rendered, defaults to True.
- Raises:
ValueError – If no data exists in the infographic.