I created a component that allows users to build condition trees (nested and/or conditions) that can be used, for example, to filter a dataframe or build a query.
Hello, thank you for very useful component.
I have a question:
Is it possible to set a default tree within your component? I noticed in the https://condition-tree-demo.streamlit.app/ demo that some default conditions are already set. Could you please provide a code example that demonstrates how to achieve this?
Good afternoon @w3hbi, I think what you are looking for is the condition tree.
Once you have defined a key for the component, the tree is accessible through st.session_state[key] (cf readme & demo).
I made a simple script that takes tree result from session_state[key] and make changes to create a new tree that can be displayed on a graph using st_echart i found this is a good solution for me.
I’m using it in a form and am getting an issue with the form cutting off the lower half of the top level buttons upon first load. This issue goes away after interacting with the page.
I’ve posted the issue here. The result looks like this:
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.