-
-
Notifications
You must be signed in to change notification settings - Fork 345
Description
I am encountering an issue with the save_html method of the DashboardExplainer class. The problem is that this method does not save the custom tab that I have added to a DashboardExplainer object in the generated HTML file.
When I add a custom tab to a DashboardExplainer and then use the save_html method to save the dashboard as an HTML file, the custom tab does not appear in the resulting file. However, this behavior is not observed when using the run method, which correctly displays the custom tab.
from explainerdashboard import ClassifierExplainer, ExplainerDashboard
explainer = ClassifierExplainer(model, X_test, y_test)
class CustomTab(ExplainerComponent):
def __init__(self, explainer, title="Custom Tab", name=None):
super().__init__(explainer, title, name)
def layout(self):
return dbc.Container(
[
dbc.Row(
[
dbc.Col(
[
html.H3("Questo è un tab custom!"),
dcc.Markdown(
"""
Puoi aggiungere contenuti personalizzati qui,
come tabelle, grafici, testi e altro.
"""
),
]
)
]
)
]
)
dashboard = ExplainerDashboard(explainer, tabs=[CustomTab, 'importances', 'model_summary'])
dashboard.save_html("dashboard.html")
# Running the dashboard works fine and displays the custom tab
# dashboard.run()
Expected Behavior
The custom tab "My Custom Tab" should appear in the "dashboard.html" file.
Actual Behavior
The custom tab "My Custom Tab" does not appear in the "dashboard.html" file.
Environment
explainerdashboard version: 0.4.5
Python version: 3.11.5
Operating system: Windows11
Additional Context
I have checked the documentation and tried different approaches to ensure the custom tab is correctly added before saving, but the issue persists. This functionality is critical for my use case, and any assistance would be greatly appreciated.