Skip to content

Commit acf05c4

Browse files
committed
Update README.md
1 parent 3cc6cc6 commit acf05c4

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

22
Based on [react-awesome-query-builder](https://github.com/ukrbublik/react-awesome-query-builder)
33

4-
Check out [live demo](https://app-condition-tree-demo-dkclrsnqxpcgzkjzlv3mqu.streamlit.app/) !
4+
Check out [live demo](https://condition-tree-demo.streamlit.app/) !
5+
6+
This component allows users to build complex condition trees that can be used, for example, to filter a dataframe or build a query.
57

68
<img src="preview.jpg" width="500" alt="preview">
79

@@ -43,17 +45,15 @@ config = {
4345
'type': 'text',
4446
},
4547
'qty': {
46-
'label': "Age",
47-
'type': "number",
48+
'label': 'Age',
49+
'type': 'number',
4850
'fieldSettings': {
4951
'min': 0
5052
},
51-
'preferWidgets': ['number']
5253
},
5354
'like_tomatoes': {
5455
'label': 'Likes tomatoes',
55-
'type': "boolean",
56-
'operators': ["equal"],
56+
'type': 'boolean',
5757
}
5858
}
5959
}
@@ -93,22 +93,37 @@ def condition_tree(
9393
- spel
9494
- elasticSearch
9595
- jsonLogic
96+
97+
Default : queryString
9698

9799

98100
- **tree**: Input condition tree (see section below)
101+
102+
Default : None
99103

100104

101105
- **min_height**: Minimum height of the component frame
106+
107+
Default : 400
102108

103109

104110
- **placeholder**: Text displayed when the condition tree is empty
111+
112+
Default : None
105113

106114

107115
- **key**: Fixed identity if you want to change its arguments over time and not have it be re-created.
108116
Can also be used to access the generated condition tree (see section below).
109117

118+
Default : None
119+
110120

111121
### Export & import a condition tree
112122

113123
When a key is defined for the component, the condition tree generated is accessible through `st.session_state[key]` as a dictionary.
114124
It can be loaded as an input tree through the `tree` parameter.
125+
126+
127+
## Potential future improvements
128+
- **Dataframe filtering support**: automatically build config from dataframe and return a query string adapted to `pandas.DataFrame.query`
129+
- **Javascript support**: allow injection of javascript code in the configuration (e.g. validators)

0 commit comments

Comments
 (0)