Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSV table preview and CSV highlighting #680

Merged
merged 2 commits into from
Jul 10, 2022

Conversation

Bartimaeus-
Copy link
Contributor

CSV Table Preview
-CSV data loader updated with new table view widget for file preview
-Table view updates when user changes delimiter
-Tab widget added to the CSV data loader to switch between raw text view and table view

plotjuggler_CSV_table_view_demo.mp4

image

CSV Highlighting
-Add QCSVHighlighter to apply syntax highlighting to the selected delimiter in the csv raw text preview
-Highlighting updates when user changes delimiter

image

@Bartimaeus-
Copy link
Contributor Author

Added an update to have checkboxes for enabling these new features. These are disabled by default so the original behavior and performance of the CSVloader is retained.

image

image

image

@facontidavide
Copy link
Owner

Thnaks a lot. I will remove the enable button. 100 rows is not a problem

@facontidavide facontidavide merged commit 146d744 into facontidavide:main Jul 10, 2022
@Bartimaeus-
Copy link
Contributor Author

Bartimaeus- commented Jul 10, 2022 via email

@Bartimaeus-
Copy link
Contributor Author

Bartimaeus- commented Jul 10, 2022 via email

@facontidavide
Copy link
Owner

In that case, I will reduce the number of lines to 50 and call it a day.

Can you give me one of those CSV files that you use for stress test?

image

@Bartimaeus-
Copy link
Contributor Author

Here is an example file plus python script to generate csv files with fake data
csv_generator.zip

facontidavide added a commit that referenced this pull request Jul 10, 2022
@facontidavide
Copy link
Owner

Please try the latest commit 0ff9135

On my computer it is pretty fast, even with your test CSV and compiled in Debug mode.

@facontidavide
Copy link
Owner

By the way:
image

@Bartimaeus-
Copy link
Contributor Author

Please try the latest commit 0ff9135

On my computer it is pretty fast, even with your test CSV and compiled in Debug mode.

Just ran it, I think it's tolerable for a single file. The loading times are more noticeable imo if you make 2-3 copies of the csv and try to open them all at once. My screen recorder seems to jump past the loading times in the captured video (the mouse pointer even jumps from one spot to another on the screen) so it's not easy to show a side-by-side against the original loader.

I think an upper limit on the columns displayed would be a good idea, even if that number is large. I'd hate for the preview to be the bottleneck for someone's use case, the rest of PJ seems to rip through large datasets with ease. The most likely use case that comes to mind is using PJ to combine multiple input files into larger CSVs and then loading those larger csvs.

I don't think it's worth the effort but a fancy way to cap things would be to cap the total number of cells that are added to the table, so as columns increases rows decrease. Capping the column count seems just as effective and a lot simpler though.

@Bartimaeus-
Copy link
Contributor Author

This is definitely fun to work on, and I'm stoked to try out the new features you just added!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants