-
Notifications
You must be signed in to change notification settings - Fork 260
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 table widget example #554
base: master
Are you sure you want to change the base?
Conversation
I choose to use the words entry and attribute instead of row and cell to make it related to the data shown in the table instead of the table structure. Any comment about that ? |
This could be a really nice widget! Though we should think well about its intended purpose. The way that it works now (with widgets even for individual cells) might make this widget potentially "heavy". Whereas I expect that users will put a handful of cells in the new GridLayout, I can imagine that a table can be used for potentially hundreds of rows. Therefore, I think that the data can best be expressed as a single property (a list of lists). An API to manage the rows in the table without having to reset the whole table, with actions like ( I think I'd prefer the terminology of |
I tried to mimic the That's why I was talking about |
It indeed reminded my of the TreeWidget :) But I am not entirely sure whether it's a good idea. (It can also be argued if the treewidget should better have used a list to indicate its rows.) I'm not sure I follow. I think what would make the most sense is a data-oriented widget. Something that can efficiently display tabular data, and which can scale to many rows. As an example have a look at the |
It depends on the way you want to design your library. For now, I see only widgets generating HTML markup with minimal CSS to provide a simple unthemed UI based on the FlexBox layout. It's simple and efficient (I personally dislike tools generating a lot of markup). That's why I chose to give a try to Flexx. But I don't negate the need of a widget to display a lot of tabular data. I think about it as a component based on PyWidget, because of the lack of features supported by PScript (e.g. I failed to create a date object in the But to make this kind of widget, I think we must start by defining a data model API and a data widget API. Then, we can create a data table widget, which can use the It's up to you. If my current implementation does not follow your needs, I can close this PR and use it in my project. Maybe later I will need a widget to display a lot of data, I will try to implement it and make a new PR. 😉 |
The core set of widgets provided by That does not mean that what you're making here cannot be useful to others. I think the best approach for now is to implement this as an example widget in the |
If I may offer opinion as a user, to me the usecase is streaming pandas dataframes / python dictionaries into the table, so I could really benefit from a "classic" table, with flexible selection of coloring or highlighting by cell / column / row. A table of widgets sounds like another way of implementing some sort of grid layout |
Sweet progress. Is this going into 0.8? |
@damienflament is this about ready for merge? |
I tried to implement sorting using third-party JS libraries, but I don't know where to initialize it. |
Why a 3d party lib? Lists (JS arrays) suport |
Is this widget still being added? |
I'm still of the opinion that if we are to add a TableWidget to That does not mean that this code is not useful. As I mentioned earlier, this code would be a great example (in the |
I can confirm this :-) My application includes rows of widgets constructed from data and essentially renders instantaneously for the typical 20 or so rows expected in use. However with a test data set of 500 rows it really lags rendering the layout and throws 'script not responding' warnings in the browser. I think there may be two distinct use cases, one being to render large numbers of display items in a table and the other being to actually render functional widgets in a table format. I rather doubt if there is a single elegant solution that would cover both of these. |
Is there a hack that could be applied to this table widget to make it usable for large numbers of rows/columns? |
I think what would be needed to be able to display a large amount of rows/cols, the widget should not use widgets for rows and cells, but use |
Is this something that could be added to this Widget, or do you think this is requires a new DataTable widget? |
That would be a new widget. |
What's the damage of implementing it? I'm this specific widget away from building a DB-API 2.0 SQL Editor based on flexx (TreeView and MultiLineEdit are others I needed) |
Sorry, what do you mean with "damage"? |
A
TableWidget
to display tabular data.widgets
moduleflex
support likeHBox
layout forTableRow
Allow to horizontally alignTableCells
content like in a spreadsheetAllow to add other widgets in table cells (to display links or buttons)Allow to sort entries by attribute using header cells