logger instead of print, prettier sample
This commit is contained in:
parent
794bac9231
commit
58c98b0119
2 changed files with 15 additions and 11 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import json
|
||||
import panel
|
||||
|
||||
from watt42_viewlib import attach_w42_state
|
||||
|
|
@ -5,12 +6,12 @@ from watt42_viewlib import attach_w42_state
|
|||
w42_state = panel.rx(None)
|
||||
attach_w42_state(rx_var=w42_state, system_id="fb2b91ce-383e-4356-96b3-b6405dacb353")
|
||||
|
||||
state_as_text = panel.bind(lambda s: f"State is {s}", w42_state)
|
||||
state_as_text = panel.bind(lambda s: f"W42 State:\n\n```\n{json.dumps(s, indent=2)}\n```\n\nReplace this with some awesome visuals", w42_state)
|
||||
|
||||
state_pane = panel.pane.Markdown(state_as_text, sizing_mode='stretch_width')
|
||||
|
||||
_ = panel.template.FastListTemplate(
|
||||
title="Sample W42 View App",
|
||||
sidebar=[panel.pane.Markdown("This is a sample sidebar.")],
|
||||
main=[panel.pane.Markdown("Welcome to the main content area!"), state_pane],
|
||||
main=[panel.pane.Markdown("# Welcome to the Main Content Area"), state_pane],
|
||||
).servable()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue