transport-data / tdc-data-portal

https://tdc-data-portal.vercel.app
0 stars 0 forks source link

Implement Tabular Preview for Dataset Details Page #171

Open Uchechukwu-Onye-Igbo opened 1 week ago

Uchechukwu-Onye-Igbo commented 1 week ago

As a user of the TDC portal, I want to preview tabular data within the dataset details page, so that I can get an overview of the data before deciding whether to download or interact with it.

Tasklist (TBD - to be updated by the developer)

Acceptance Criteria

Given that I am viewing the details page of a dataset with structured data uploaded to the db,

luccasmmg commented 4 days ago

A couple of thoughts on this

Demenech idea of what you guys want being a pivot table makes sense, what i did was that i grabbed that CSV, added a couple of integer columns and checked how it looked on google sheets and it seems to work image

After that i loaded the csv into a sql database and started looking into how we could retrieve the data, shouldnt be too hard with something like this, the main tricky part is that we need to retrieve all the possible values for the column field, so in this example before we build the query we need to fetch all possible values for the Time column image

One thing to keep in mind is that we are assuming that even tough in the mockup Columns and Rows and Values are in the plural, we think its better to simplify things and only have the user be able to select one of each, selecting multiple of those would greatly complicate things without much benefit (After all the user can always just download the csv and put it in whateaver tool he wants)

One weird thing in the mockup is that here it appears as if multiple values are being selected, even tough the table only shows one, which leads me to believe that these are actually filters, which we can of course implement image

This is for example the same sql for the pivot table, but filtering by the column Service = Passenger image

One final thing is that the mockup doesnt seem to provide a way to select the aggregation function that is going to be used, for example, the values could be joined by Sum by Mean by Aggregate by Count etc

Besides that these dropdowns altough they make sense if we are talking about filters, they do not seem to make sense when it comes to the Columns and Rows sections

image

This is for the table preview as a whole, leaving a comment below about the footnotes

luccasmmg commented 4 days ago

I want to talk about this footnotes here image

If we are understanding the data correctly, essentially what we have here is

Give me an aggregation of X value for every row in which the country is Afeghanistan and the time is 1998 which in by looking at the table would mean something like this

image

As you can see, we have 4 rows, each with potentially 4 different metadata fields, we cant really join together text in a way that makes sense, so the only logical way to choose one of those 4 is to grab the first one, unless there is some other way i cant think of something better, any thoughts?

luccasmmg commented 4 days ago

Finally i think this dropdown would be better of not being done, given the deadline and the fact that it doesnt seem to provide that much more clarity and the fact that i expect quite a few issues related to it image

luccasmmg commented 4 days ago

As shown in these comments i think the main contraints that we should follow is

  1. Single column between the available ones
  2. Single row between the available ones
  3. Single value between the available ones
  4. Multiple filters, which i think would be better if we used an UI like this one, which is more powerful and we already have most of the code for it image
  5. Unless provided with a better solution, to use the first possible value for the metadata popup
  6. For special columns (eg. Metadata column) they should always have the same name