Return the app as html #560
Replies: 1 comment
-
|
Hello, Sorry for the delay. Did you manage to find a solution, or could you provide more details on what you're expecting? If you're looking to render the 1. Generate a Shapash Report (Recommended)Shapash provides a built-in way to generate a report in a structured format. Instead of running the interactive Dash app, you can create an HTML report that can be easily embedded in your frontend. xpl.generate_report(output_file='shapash_report.html')Once generated, you can serve this file in your backend and embed it in your frontend using: <iframe src="path/to/shapash_report.html" width="100%" height="600px"></iframe>This approach is useful if you want to provide a static, shareable version of the insights without running a live Dash app. 📌 More details: You can check the official Shapash tutorial on report generation here 2. Running the Shapash App DynamicallyIf you prefer to serve the interactive app, you can use app_url = xpl.run_app()
print(f"Shapash app running at: {app_url}")Then, in your frontend: <iframe src="http://127.0.0.1:5000" width="100%" height="600px"></iframe>Note:
3. Customizing & Extending Shapash (Advanced)If you need more customization, you can look at the nvidia-xai project, which tweaks Shapash for a different use case: 🔗 Repo: https://github.com/danton267/nvidia-xai/tree/main This project extends Shapash's capabilities with a customized Dash UI. If you need a similar approach, you can fork the repository and modify the layout or components according to your needs. Which Solution is Best for You?
Let us know which approach fits your use case, and we can help further! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How to return the shap app = xpl.run_app() as HTML so it can be rendered at the frontend as needed
Beta Was this translation helpful? Give feedback.
All reactions