Hello everyone, I am trying to place a custom tree in a golden template for a dashboard I am building. However when I place the tree widget in the template, this does not appear. The following is the script I'm trying to run:
from pathlib import Path
import param
import panel as pn
from panel_jstree import FileTree
class MonitrTree(FileTree):
checkbox = param.Boolean(default=False, doc="Whether to show checkboxes next to each node")
path = Path("/Users/marcosf2/Documents/playground/monitr_testing_dat/data_small")
monitr = MonitrTree(str(path))
monitr.select_multiple = False
monitr.show_dots = False
monitr.show_icons = False
button = pn.widgets.Button(name="click me", button_type="primary")
tmpl = pn.template.GoldenTemplate(title="Monitr 2.0",
sidebar=[button])
tmpl.main.append(
monitr
)
pn.serve(tmpl, port=5007)
This is the image that appears from there:
When I simply place the monitr object in the pn.serve(monitr, port=5007), the widget displays correctly.
Hello everyone, I am trying to place a custom tree in a golden template for a dashboard I am building. However when I place the tree widget in the template, this does not appear. The following is the script I'm trying to run:
This is the image that appears from there:
When I simply place the
monitr
object in thepn.serve(monitr, port=5007)
, the widget displays correctly.Any help would be appreciated! thanks!