Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save_html Method Not Saving Custom Tab in DashboardExplainer #303

Open
bocejo5 opened this issue May 24, 2024 · 0 comments
Open

save_html Method Not Saving Custom Tab in DashboardExplainer #303

bocejo5 opened this issue May 24, 2024 · 0 comments

Comments

@bocejo5
Copy link

bocejo5 commented May 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant