-
Notifications
You must be signed in to change notification settings - Fork 144
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
Multi-step wizard #888
Comments
Wow, this is an amazing issue, thank you for taking the time to write everything up so carefully and thoroughly @mohammadaffaneh! 🌟 You are absolutely right about the current strengths and weaknesses in Vizro in providing this functionality. I've actually made very similar Vizro apps to what you describe, with Previous/Next buttons stepping through a form. They're internal dashboards but if you're interested I can try to dig them out and upload a sanitised version. Something similar is already on our roadmap, although it might take a while before we get to something that closely resembles your Here's very roughly where I hope things will go:
Currently the main thing stopping this from being developed is that we're busy reworking the actions system which I think will need to be more robust and flexible to handle this sort of thing. After that it's towards the top of our list of priorities, so no promises but hopefully at least some of this will be possible within a few months 🤞 One challenge here is that we need to develop something that is general enough to be useful across a variety of use cases while specific and powerful enough that it's easy to use for each person's individual use case. e.g. we would like to make it easier for a user to configure machine learning model parameters and then run a pipeline from Vizro. This is quite different from what you're trying to do but would need to use similar wizard/form components. I have a few questions for you, just to understand your requirements a bit better:
What do you mean by this? The sort of thing like form fields appearing/disappearing depending on the values of previously input fields?
Is this achieved just by connecting your
How would you expect this validation logic to be applied? On the server side or clientside? e.g. one good option here might be to use pydantic to do validation. It's not exactly what you describe, but this may be of interest to you: https://community.plotly.com/t/dash-pydantic-form/84435/31 |
@antonymilne Thank you for your prompt and detailed response! I appreciate the insights you've shared and the effort you're putting into enhancing Vizro's capabilities. Regarding your questions:
Thank you again for your efforts and quick reply. I'm excited about the direction Vizro is heading and am happy to assist further or provide feedback on early implementations. |
Thank you for all the answers @mohammadaffaneh, that's very helpful! 🙏 I think it will be a while before we can achieve many of the advanced features you're looking for here, but we'll definitely try and make some progress and refer back to these ideas when we develop the |
Which package?
vizro
What's the problem this feature will solve?
Vizro excels at creating modular dashboards, but as users tackle more sophisticated applications, the need arises for reusable and extensible complex UI components. These include multi-step wizards with dynamic behavior, CRUD operations, and seamless integration with external systems. Currently, building such components requires significant effort, often resulting in custom, non-reusable code. This limits the scalability and maintainability of applications developed with Vizro.
I’m working on applications that require complex workflows, such as multi-step wizards with real-time input validation and CRUD operations. While I’ve managed to achieve this using Dash callbacks and custom Python code, the lack of modularity and reusability makes the process cumbersome. Every new project requires re-implementing these components, which is time-consuming and error-prone.
Describe the solution you'd like
I envision Vizro evolving to support the creation of highly reusable and extensible complex components, which could transform how users approach sophisticated Dash applications. Here’s what this could look like:
Object-Oriented Component Development: Provide the ability to encapsulate UI components and their logic (advanced dynamic callbacks) in Python classes, making them easy to reuse and extend across projects. This could be similar to the component architecture found in frameworks like React.
Modular Multi-Step Wizard: A powerful wizard component with:
Integrated CRUD Operations: Built-in support for Create, Read, Update, and Delete functionality, ensuring data security and consistency:
Dynamic Callback Management: Enable advanced callbacks that can be registered and updated dynamically, reducing the complexity of handling inter-component interactions.
Extensibility Features:
How This Could Enhance Vizro
By introducing such capabilities, Vizro would empower users to go beyond dashboards and build complex, enterprise-level applications more efficiently. These features could help attract a broader audience, including those who require not only dashboards but also robust, interactive data workflows in their data applications.
Similar Solutions for Inspiration
My imagination:
Below is an high-level and simple implementation of the multistep wizard, where all wizard components and functionalities are isolated into a class (
Wizard
) following the Facade Design Pattern, complemented by elements of the Factory Pattern and the State Pattern. This class dynamically creates the logic based on the parameters and integration with the steps. TheStep
class represents individual steps.wizard_module.py
app.py
Explanation:
Isolation of Components and Logic: All wizard functionalities, including rendering and navigation logic, are encapsulated within the
Wizard
class. Each step is represented by aStep
class instance.Dynamic Logic Creation: The
Wizard
class dynamically generates the layout and callbacks based on the steps provided. The validation logic is applied dynamically using thevalidation_rules
defined in eachStep
instance.Ease of Extension: To add more steps or modify existing ones, you simply need to create or update instances of the
Step
class. TheWizard
class handles the integration and navigation between steps without any additional changes.Validation Rules: Each
Step
contains avalidation_rules
list, which specifies which input components need to be validated. This allows for flexible validation logic that can be customized per step.Code of Conduct
The text was updated successfully, but these errors were encountered: