zui icon indicating copy to clipboard operation
zui copied to clipboard

GUI for creating Zed filters (like Tad)

Open SoftTools59654 opened this issue 2 years ago • 3 comments

Filter gui for searching aaa

Is it possible to add such a feature to Zui?

To filter faster instead of typing?

SoftTools59654 avatar Nov 10 '23 08:11 SoftTools59654

Hello @SoftTools59654! Thanks for taking an interest in Zui.

There's actually some functionality in Zui similar to what you describe. You can right-click on a value and it will append the active Zed pipeline with the necessary filter. Right now it only covers == and != as shown in the attached video. Your inquiry is timely because I've recently recognized that this part of the app is overdue for some better documentation and maybe some further enhancements. I'd be interested to hear your feedback after you've tried what's there today.

https://github.com/brimdata/zui/assets/5934157/f812206d-bb96-4df9-b211-bf9ab28778af

Here's a couple specific questions.

  1. What is the app you showed in your screenshots above? Since it's the one you've used for reference I assume it's one you like for this kind of functionality, so if there's things you particularly like (or don't) about it that you'd like to see replicated in Zui (or not) please describe.
  2. For the set in that screenshot, do you find yourself using some of the filter options much more than others? Are there ones you never use? Since the Zed language has ways to perform all the kinds of filtering operations shown there, it would be technically feasible to add this full set. However, if added to the full set to the existing list of right-click operations (which currently includes many other things besides filtering), it would become quite crowded, so if the full set is what users require then we might look at putting them in their own place, e.g., inside some sub/separate menu, as opposed to the minimal set we have today. So I'd also be interested to hear if you have any thoughts there.

philrz avatar Nov 13 '23 17:11 philrz

Thanks for your reply

  1. I use the Tad tool to view some large csv files, which works based on duckdb and has a functional filter section.

which is not located in the right click and is a separate section

  1. Some filter options are better used when the number of records is very large and increase the search speed. Especially when two or more filters are applied and one of the filters can be easily deleted or edited

I think the graphical representation of the filter section is better than the textual search

In the end, the trouble of writing the code and developing the software, and I know that any request for change requires effort and time on your part.

Special thanks for developing this useful tool

SoftTools59654 avatar Nov 13 '23 19:11 SoftTools59654

@SoftTools59654: Thanks for the pointer to Tad. I've played around with it a bit and I have a better understanding now. I agree that the current approach in Zui of assembling the filters via right-clicks has its shortcomings. Even if it helps you add a syntactically-correct Zed filter, now that filter text is just another part of the overall Zed query in the editor. That means there's no clickable way for users to modify/remove the filters once they're made part of what's in the editor. Tad's interface also makes it clearer when multiple filter terms are adding up to a whole.

One of the other ways we've rationalized Zui's current approach is that it makes the Zed language syntax visible for learning purposes. I can see Tad does a nice job there as well since it also still shows what the assembled SQL filter looks like. For instance, here's a multi-part filter I made using their example CSV.

image

This actually now reminded me of something that does exist in Zui already that's got some similarities, albeit for a much narrower use case. If working with data that's keyed by the Zed time time, dragging the stacked bar chart to zoom in on a subset of the data adds a "Time Range" pin (such a pin can also be created from scratch via the thumbtack icon to the left of the pins above the editor). The pin is basically a placeholder for the filter in the Zed language (e.g., ts > 2020-02-25T16:03:07.177Z and ts < 2020-02-25T16:03:16.370Z) but in addition to the click/drag that initially creates it, it can be clicked and edited. We could perhaps take a similar approach to creating filters using a GUI very similar to Tad's and have it work within the pin approach that's already in Zui. The short video below shows it being used.

https://github.com/brimdata/zui/assets/5934157/cffbc33a-2b2c-4253-877d-4df6e0d554b5

Thanks for expressing your understanding that the effort for such features means they may not arrive right away. 😄 As it turns out, there's some active research going on right now about improving some other parts of Zui related to pins, so I'll make this topic part of those discussions and see if it's something we might get to soon.

philrz avatar Nov 16 '23 22:11 philrz