shshemi / tabiew

A lightweight TUI application to view and query tabular data files, such as CSV, TSV, or parquet.
MIT License
541 stars 14 forks source link

Feature/data visualization #14

Open vohai611 opened 1 month ago

vohai611 commented 1 month ago

Hi @shshemi, Do you open to add simple visualization feature into this project? I find the case when I want to quickly view data files in charts (open chart mode with c key) The code is not polish, but I think enough for POC. If possible, please give me some guideline.

shshemi commented 1 month ago

Hi @vohai611, I was thinking of adding visualization features. However, I haven't fully decided on the UX. There are a couple of shortcomings with your implementation:

  1. First of all, the feature branch is so behind the main (it cannot be merged).
  2. Selecting chart aspects through UI is not the best UX, IMO. Users usually select them once and then start using the chart. So, they just take up some space that could be used for the main content, which is the chart itself. Therefore, I would say remove the column select components and add a command instead. For instance, :chart hist price could be the command to show the histogram of prices.
  3. I tried multiple charts for housing.csv, and I didn't find the charts as expressive as they should be. Just passing the ratatui::widgets::Chart inputs to the user is not the best UX, again. Try to implement meaningful charts. (Take a look at SeaBorn's gallery to get some inspiration).
  4. There is another UX question: should a chart open in a new tab or on top of the table (like sheets)? The reason that sheets are opened on top of the tables is that they interact with the table data, with operations such as prev, next, first, or last item. Moving to the next item in the sheet view causes the table to select the next item as well. However, charts do not necessarily interact with the table data. They compute the content once and display it to the user. I would like your opinion on this one.