-
-
Notifications
You must be signed in to change notification settings - Fork 72
V2 filtering_settings #169
Comments
How can we make it easier for backend authors to write queries? For example, in the docs, front-end filtering only supports:
whereas backend filtering only supports:
|
Could we provide some way to automatically convert these expressions into expressions in the NumExpr DSL (https://numexpr.readthedocs.io/en/latest/user_guide.html#casting-rules)? This DSL is directly support by pandas in the Update: |
That's a really great idea 👍 |
In addition to the NumExpr DSL, I'd like for us to consider how this would scale for additional datatypes beyond
Also, we should consider what the default "operator" is in the UI. Users shouldn't have to always specify an operator like Here's a proposal that I worked on previously. Perhaps this can be updated to be more compatible with the With the introduction of datatypes, the following changes could be made:
|
I've used RStudio's implementation of DataTable, and I think they have a very nice solution for filtering visually, especially for a non-tech audience I think it's a great idea to provide filters for different data types, especially dates. If this solution makes sense, then it might probably boil down to utilizing dash-core-components elements within the filtering cells somehow, and that would make a beautiful easy-to-use solution. By automatically detecting the data type of the column, the appropriate filter would be provided. Or maybe even give the developer the option to determine which filter they want to add per column.
|
It doesn't sound like the exact NumExpr/df.query DSLs are going to cover exactly what you're talking about here, especially when considering the idea of a default operator. So it probably does make sense to still define a dash table DSL, but it would be nice to do it in such a way that the combination of all filtering operations can be transformed into a single pandas Here are a few example expressions that I was playing around with: For the numerical column df.query('a == 1')
df.query('a > 0')
df.query('0 < a and a < 2') For the string or categorical column df.query('c.str.contains("Tw")')
df.query('c.str.startswith("T")')
df.query('c.str.match("\w*o")')
df.query('c.str.count("([a-g])") > 1') For the datetime column df.query('d.dt.year == 2018')
df.query('d >= "2018-04"')
df.query('d.dt.day_name() == "Monday"')
df.query('d.dt.is_month_start') So my thought is that if a table has filter expressions on columns df.query('a > 0 and c.str.match("\w*o") and d >= "2018-04"') |
Another thing to consider is how this relates to conditional formatting. For conditional formatting, we use the same filtering DSL (see https://dash.plot.ly/datatable/style). It's not clear to me if pandas uses the NumExpr/df.query DSL for their conditional formatting, their docs mostly show an imperative workflow (https://pandas.pydata.org/pandas-docs/stable/style.html) |
@eliasdabbas I am also looking forward to have a filter with RangeSlider and/or dropdown. The datatable video in your comment is of great interest to me. One thing that I am looking for beyond the video is a backend filtering option even when using dropdown/RangeSlider filter. Really looking forward to have this feature in the dash table in the future! |
This comment has been minimized.
This comment has been minimized.
I appreciate the discussion here, but implementing all this really looks like an epic endeavor, and I wonder if its really necessary for the average user? When I first stumbled on upon the Wouldn't it cover about 95% of all cases, if any column (even numerical ones) could be filtered by simply typing a few letters or numbers into their filter field, which are then matched anywhere and without case. In this datatable implementation IMHO, simplicity, intuitiveness and responsiveness are more valuable than being able to "program" a filter with lots of conditions and operators. Perhaps such a simple, alternative filtering interface could be implemented quickly, as an option? The RStudio example is certainly fancy, but as an interface for the typical non-programmer user it's probably a little bit over the top. Just my two cents. |
Thanks @marfel |
I totally agree with @marfel that the current filtering feature in dash_table is not quite user-friendly. But the one in the video shared by @eliasdabbas seems really intuitive to me. It does not require users to type any programming-like strings or so. Still, implementing a similar feature as the one in the video would be an epic endeavor for sure... |
I agree with @marfel Is the code used in dash-table-experiments not compatible with the new DashTable? |
That's what I've proposed in this issue (#169 (comment)) and what we're planning on doing. we're working on it! |
Thanks, great to hear that! Sorry I did not see that in your previous post. |
That's the goal. Also, as always, if your organization has budget for software, then certain features (like this one) can be prioritized and sponsored (https://plot.ly/products/consulting-and-oem/). It's really just a question of bandwidth :) |
I hear you. I am an independent consultant but would like to contribute financially to plotly dash development once my cashflow is up as a way of thanking you all. |
Same story here as @JeroneGagliano , I just wanted to chime in and say that the Dash-Table-Experiments was a real joy to use for filtering / sorting. It'd be awesome if there's any current way of getting DataTable to operate like that! |
I'm currently using the data table, and overall I think it's great, but the lack of filtering options is killing me. I understand this is being worked on, but I'd like to suggest that for the backend filtering For me I'd like a contains, that accepts a list of options like contains (John, Mary). It would be pretty easy to do this if you didn't pre-filter. |
Done in #397 and #410. Documented in https://dash.plot.ly/datatable/filtering |
It's very strange that this is a closed issue, while the documentation at https://dash.plot.ly/datatable/filtering and https://dash.plot.ly/datatable/callbacks still highlights to follow this Issue for improved syntax, so either this is not completely closed, or the documentation was not updated properly. callback pagefiltering documentation page |
All, I am still trying to use the Filtering = True without a callback and the filtering is not working. Has there been a solution that has been implemented? |
@newuser357 Taken from that documentation:
|
If i want to filter on the word negative, datatable is considering it to be |
@sumelinadar do you have the latest release? |
In case I missed, is there a way to filter whole table in Dash just like there is in R? Hi @eliasdabbas , I would appreciate your comment in this regard. |
I believe it's column based, but should be easy to make the search go through all the columns if that is what you want? The filtering documentation shows how you can also filter with Python. Hope that helps. |
Many of these props will change in the future, I’ve linked properties to the following issues: - plotly/dash-table#166 - plotly/dash-table#167 - plotly/dash-table#168 - plotly/dash-table#168 - plotly/dash-table#167 - plotly/dash-table#169 - plotly/dash-table#169 - plotly/dash-table#169 - plotly/dash-table#170 - plotly/dash-table#171
Many of these props will change in the future, I’ve linked properties to the following issues: - plotly/dash-table#166 - plotly/dash-table#167 - plotly/dash-table#168 - plotly/dash-table#168 - plotly/dash-table#167 - plotly/dash-table#169 - plotly/dash-table#169 - plotly/dash-table#169 - plotly/dash-table#170 - plotly/dash-table#171
Hi. Is Thanks. |
a placeholder issue to discuss the next version of the
filtering_settings
property. In particular:country eq("Canada")
orcountry is Canada
orcountry == Canada
orcountry = Canada
, etcRelated issues
#252
#301
The text was updated successfully, but these errors were encountered: