dataframe-api icon indicating copy to clipboard operation
dataframe-api copied to clipboard

API for viewing the frame

Open tdimitri opened this issue 5 years ago • 5 comments

Interactive users will want to control how the data is displayed. This might include sorting the view; coloring cells, columns, or rows; precision digits; or moving columns to the left. It may also interact with auto complete.

It is common practice to separate the view from the data (many applications can display data in a SQL database in different ways).

I believe that we need to define an interface to the display data class (for instance, an ordered dictionary of strings containing arrays is the simplest interface. additional kwargs might include display attributes for rows or columns, there might be header or footer information).

Thus, believe it is in scope to define an interface so that multiple developers can write their own display data class. Almost every demonstration needs a way to display large amount of data well.

tdimitri avatar Jun 17 '20 18:06 tdimitri

@tdimitri - could you elaborate a bit more on a proposed API? This seem related to #1, about data exchange.

scopatz avatar Jun 18 '20 16:06 scopatz

Indeed, many people will want to make 'dataframe viewers', we just saw a new one recently: https://github.com/mariobuikhuizen/ipyvuetify/issues/71

If the exchange API is good, this would work with any dataframe (i.e. the dataframe libraries don't have to include it)

maartenbreddels avatar Jun 18 '20 17:06 maartenbreddels

Sure.. when repr_html is called there should be a list of options on how to display the table.

Here is one in HTML that we do... Notice how badrows or badcols (in this example) might be color marked for the user pick up easier.

image

Here is one in ANSI colored text

image

To me, how the data is displayed is left to another module/class. But then how does a user tag a column as "red" or make the header "bold". I can write more on this.

tdimitri avatar Jun 18 '20 17:06 tdimitri

Viewing the dataframe is a form of visualization. This is an important topic but should be handled at the same time as visualization, which should probably be later.

devin-petersohn avatar Jun 18 '20 20:06 devin-petersohn

Yeah, my assumption is that __str__, __repr__ and all Jupyter mimetype outputs would be not standardized... At least to start.

saulshanabrook avatar Jun 22 '20 13:06 saulshanabrook