Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
A control for displaying interactive Plotly charts and graphs.
Plotly()
from mirmod.controls import Plotly from mirmod import miranda import json import plotly.express as px @wob.init() def init(self): self.df = None @wob.receiver("data", "Dataset") def set_dataset(self, i): self.df = i @wob.receiver("state", "plotly", control=Plotly(), hidden=True, connectable=False) def get_plotly(self, plotly_data): pass @wob.execute() def execute(self): # Create a Plotly figure fig = px.bar(self.df) fig_json = fig.to_json() # Get execution context ecx = miranda.get_execution_context() ob = ecx.get_current_wob() sc = ecx.get_security_context() # Update the control with the chart data miranda.update_api( sc, ob, "RECEIVER", "plotly", "state", value=fig_json, connectable=False, hidden=True ) # Notify the GUI to refresh the display miranda.notify_gui(sc, json.dumps({ "action": "update[VIEW]", "data": { "id": ob.id, "metadata_id": ob.metadata_id } }))