infograph

class virtualitics_sdk.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 available Google icons which be viewed at fonts. 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.

class virtualitics_sdk.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 virtualitics_sdk.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.

  • event (Optional[CustomEvent]) – The CustomEvent that can be optionally added to this Infographic, defaults to None

Raises:

ValueError – If no data exists in the infographic.

EXAMPLE:

# Imports 
from virtualitics_sdk.elements.infograph import InfographData, Infographic
. . .
# Example usage
class ExampleStep(Step):
  def run(self, flow_metadata):
    . . . 
    pred_failure = InfographData("Predicted Failures", 
                                 "6", 
                                 "Predicted degradation failures...",
                                 "error", 
                                 InfographDataType.NEGATIVE, 
                                 display_compact=True)
    . . . 
    # multiple other InfographData elements 
    info_w_rec = Infographic("Additional Fixed Ratio Gearboxes need to be ordered",
                             "There is sufficient time to...",
                             [pred_failure, avg_downtime, inventory, ship_estimate], 
                             [recommendation])

The above Infographic will be displayed as:

class virtualitics_sdk.elements.infograph.InfographicOrientation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

COLUMN = 'column'
ROW = 'row'