class documentation

class ACMEContainerDiagram(Container):

Constructor: ACMEContainerDiagram(refreshCallback, id)

View In Hierarchy

The Diagram view for Container resources for the ACME text UI.

Method __init__ Initialize the Diagram view.
Method barButtonExecute Callback to switch to the bar diagram.
Method compose Compose the diagram view.
Method graphButtonExecute Callback to switch to the graph diagram.
Method lineButtonExecute Callback to switch to the line diagram.
Method on_checkbox_changed Callback to refresh the diagram.
Method on_hide Callback when the view is hidden.
Method on_mount Callback when the view is mounted.
Method on_show Callback when the view is shown.
Method plotGraph Plot the graph.
Method refreshButtonExecute Callback to refresh the diagram.
Method refreshPlot Refresh the diagram.
Method scatterButtonExecute Callback to switch to the scatter diagram.
Method setData Set the data to be displayed in the diagram.
Method timeLineButtonExecute Callback to switch to the timeline diagram.
Instance Variable autoRefresh Whether the diagram should be refreshed automatically.
Instance Variable buttons The buttons to switch between the diagram types.
Instance Variable color The color of the diagram.
Instance Variable dates The dates for the values.
Instance Variable plot The plot widget.
Instance Variable plotContainer The container widget for the plot.
Instance Variable refreshCallback The callback to refresh the diagram.
Instance Variable refreshCheckbox The checkbox to enable/disable the automatic refresh.
Instance Variable refreshTimer The timer for the automatic refresh.
Instance Variable type The type of the diagram.
Instance Variable values The values to be displayed in the diagram.
Method _activateButton Activate a button.
Method _newPlot Create a new plot instance and update the container.
Method _refreshChart Refresh the chart.
Method _startRefreshTimer Start the refresh timer.
Method _stopRefreshTimer Stop the refresh timer.
def __init__(self, refreshCallback: Callable, id: str):

Initialize the Diagram view.

Parameters
refreshCallback:CallableThe callback to refresh the diagram.
id:strThe ID of the view.
@on(Button.Pressed, '#diagram-bar-button')
def barButtonExecute(self):

Callback to switch to the bar diagram.

def compose(self) -> ComposeResult:

Compose the diagram view.

@on(Button.Pressed, '#diagram-graph-button')
def graphButtonExecute(self):

Callback to switch to the graph diagram.

@on(Button.Pressed, '#diagram-line-button')
def lineButtonExecute(self):

Callback to switch to the line diagram.

def on_checkbox_changed(self, event: Checkbox.Changed):

Callback to refresh the diagram.

def on_hide(self):

Callback when the view is hidden.

def on_mount(self):

Callback when the view is mounted.

def on_show(self):

Callback when the view is shown.

def plotGraph(self):

Plot the graph.

@on(Button.Pressed, '#diagram-refresh-button')
def refreshButtonExecute(self):

Callback to refresh the diagram.

def refreshPlot(self):

Refresh the diagram.

@on(Button.Pressed, '#diagram-scatter-button')
def scatterButtonExecute(self):

Callback to switch to the scatter diagram.

def setData(self, values: list[float], dates: list[str] | None = None):

Set the data to be displayed in the diagram.

Parameters
values:list[float]The data to be displayed.
dates:list[str] | NoneThe dates for the data. If not given, the current time is used.
@on(Button.Pressed, '#diagram-timeline-button')
def timeLineButtonExecute(self):

Callback to switch to the timeline diagram.

autoRefresh =

Whether the diagram should be refreshed automatically.

buttons =

The buttons to switch between the diagram types.

color: tuple[int, ...] =

The color of the diagram.

dates: list[str] | None =

The dates for the values.

plot: PlotextPlot =

The plot widget.

plotContainer: Container =

The container widget for the plot.

refreshCallback =

The callback to refresh the diagram.

refreshCheckbox =

The checkbox to enable/disable the automatic refresh.

refreshTimer: Timer =

The timer for the automatic refresh.

type =

The type of the diagram.

values: list[float] =

The values to be displayed in the diagram.

def _activateButton(self, type: DiagramTypes):

Activate a button.

Parameters
type:DiagramTypesThe button to activate.
def _newPlot(self):

Create a new plot instance and update the container.

def _refreshChart(self):

Refresh the chart.

def _startRefreshTimer(self):

Start the refresh timer.

def _stopRefreshTimer(self):

Stop the refresh timer.