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

More extensive documentation request and some user questions. #68

Open
cmartinotti opened this issue Jan 10, 2022 · 2 comments
Open

More extensive documentation request and some user questions. #68

cmartinotti opened this issue Jan 10, 2022 · 2 comments
Labels
backlog Issues that haven't been categorized or are not yet ready for work feature Feature requests or improvements

Comments

@cmartinotti
Copy link

cmartinotti commented Jan 10, 2022

This seems an amazing library, but nowhere is clearly explained exactly how you are supposed to update the data in the table, how to access the underlying data structures, and much more. As an example, I'm trying to display the table inside an ipywidget box, and I don't know if it's possible and which function should I use. A practical example of how to construct DataModel class would be very useful too.
Lastly I am using get_state() and setData() to get the data from the table w and to change em, is there any easier way to get the data from the table if using pandas DataFrames like for example a w.to_dataframe() method?

EDIT: I see that using w.datamodel._data i can access the underlying dataframe, but if I change it the table widget doesn't update,is there a way to the refresh the view programmatically?

@cmartinotti cmartinotti changed the title More extensive documentation. More extensive documentation request and some user questions. Jan 10, 2022
@timkpaine
Copy link
Member

Best bet is to start with the examples:
https://github.com/jpmorganchase/ipyregulartable/tree/main/docs/examples

There is a relatively simple example of a data models here:
https://github.com/jpmorganchase/ipyregulartable/blob/main/ipyregulartable/datamodel/demo.py

The best way to force an update on the frontend is by calling draw on the widget (should happen automatically if the data model changes):
https://github.com/jpmorganchase/ipyregulartable/blob/main/ipyregulartable/widget.py#L110

I haven't written much documentation as the codebase is still pretty alpha, I have a major overhaul in progress in #59 to add some nice defaults like striping, cursor navigation of cells, column/row/both selection, sortable headers, etc. Once that overhaul is done I think the codebase will be in a much better and more stable place and then can have some more extensive docs written.

@cmartinotti
Copy link
Author

Thanks for the reply and amazing work! Is ipyregulartable compatible with ipywidgets boxes or will it be in the future? I tried to capture it with a box and with an Output widget but had no luck.

@timkpaine timkpaine added feature Feature requests or improvements backlog Issues that haven't been categorized or are not yet ready for work labels Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issues that haven't been categorized or are not yet ready for work feature Feature requests or improvements
Projects
None yet
Development

No branches or pull requests

2 participants