widgetastic_patternfly4.bulletchart module

class widgetastic_patternfly4.bulletchart.BulletChart(parent=None, id=None, locator=None, logger=None, *args, **kwargs)

Bases: widgetastic.widget.base.View

Represents the Patternfly Bullet Chart.

https://www.patternfly.org/v4/documentation/react/charts/chartbullet

Parameters:
  • id – If you want to look the input up by id, use this parameter, pass the id.
  • locator – If you have specific locator else it will take pf-chart.
  • offset_denominator – Denominator for offset value calculation.
APPLY_OFFSET = True
DEFAULT_LOCATOR = ".//div[contains(@class, 'chartbullet')]"
ITEMS = ".//*[name()='g']/*[name()='path' and not(contains(@style, 'type:square'))]"
LEGEND_ICON = ".//*[name()='g' or name()='svg']/*[name()='rect']/following-sibling::*[name()='path']"
LEGEND_ITEM_REGEX = re.compile('(\\d+)\\s(\\w.*)|(\\w.*)\\s(\\d+)')
LEGEND_TEXT = ".//*[name()='text' and contains(@id, 'legend-labels')]"
ROOT

ParametrizedString modified to return instances of smartloc.Locator

TOOLTIP_REGEX = re.compile('(.*?): ([\\d]+)')
data

Read graph and returns all Data Point objects.

get_data_point(label)

Get specific data point object.

Parameters:label – Name of respective data point label.
get_legend(label)

Get specific Legend object.

Parameters:label – Name of legend label.
legend_names

Return all legend names.

legends

Return all Legend objects.

read()

Read graph and returns label, value dict.

tooltip

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class widgetastic_patternfly4.bulletchart.DataPoint(label, value=None, color=None, element=None)

Bases: widgetastic_patternfly4.bulletchart.Legend

Represents DataPoint on chart.

class widgetastic_patternfly4.bulletchart.Legend(label, value=None, color=None, element=None)

Bases: object

Represents Legend of chart.

click()