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

Interactive tables using react #4386

Merged
merged 63 commits into from
Mar 13, 2023
Merged

Interactive tables using react #4386

merged 63 commits into from
Mar 13, 2023

Conversation

jose-donato
Copy link
Contributor

@jose-donato jose-donato commented Mar 2, 2023

demo

This PR adds the functionality to spin up a pywry window containing react (or any frontend library code).

  • sets foundation for adding more web components
  • adds interactive tables

todo:

  • add docs on how to change and how it is structured
  • move all formatting code inside print_rich_table
  • do the formatting inside (after sending the raw df to the pywry window)
  • style with our components

@reviewpad reviewpad bot added the feat XL Extra Large feature label Mar 2, 2023
@jose-donato jose-donato requested a review from tehcoderer March 2, 2023 23:33
@JerBouma
Copy link
Contributor

JerBouma commented Mar 3, 2023

Would it be possible to include an export button? In which you can filter and then export that sub-selection?

@jose-donato
Copy link
Contributor Author

Would it be possible to include an export button? In which you can filter and then export that sub-selection?

Yuuup for sure.

Keep those suggestions coming

@JerBouma
Copy link
Contributor

JerBouma commented Mar 3, 2023

Another must have in my opinion is being able to filter by dates. I think this change will actually allow the limit flag to be removed. Due to how easy it is to search, we don't need that flag anymore. For a lot of functionality the limit flag is just there to reduce clutter while with this table functionality it no longer is clutter since you can filter so well.

In my opinion just nice to have not necessarily must-have:

1. It would be nice if we can have clickable URLs as seen in the screenshot below. Here it is getting cut-off (and thus not usable). We got that complaint a couple of times, also happens in stocks/fa/mgmt.

image

2. What's powerful is that you can plot a series within this table. So for example if I obtain the income statement as you see here, if I could click a row and press plot that's powerful. Then you can see revenue growth over time with ease etcetera. Probably a lot more use cases outside of this one.

image

@jose-donato
Copy link
Contributor Author

Another must have in my opinion is being able to filter by dates. I think this change will actually allow the limit flag to be removed. Due to how easy it is to search, we don't need that flag anymore. For a lot of functionality the limit flag is just there to reduce clutter while with this table functionality it no longer is clutter since you can filter so well.

In my opinion just nice to have not necessarily must-have:

1. It would be nice if we can have clickable URLs as seen in the screenshot below. Here it is getting cut-off (and thus not usable). We got that complaint a couple of times, also happens in stocks/fa/mgmt.

image

2. What's powerful is that you can plot a series within this table. So for example if I obtain the income statement as you see here, if I could click a row and press plot that's powerful. Then you can see revenue growth over time with ease etcetera. Probably a lot more use cases outside of this one.

image

yea we increase the limit to 500 for now 😃

  1. is easy peasy
  2. is very interesting. gonna try it

@JerBouma
Copy link
Contributor

JerBouma commented Mar 3, 2023

Do limit even higher if possible, some data series are based on dates that can go all the way back to e.g. 1980 and offer daily data. Unless this would slow everything down a lot of course!

@jose-donato
Copy link
Contributor Author

Do limit even higher if possible, some data series are based on dates that can go all the way back to e.g. 1980 and offer daily data. Unless this would slow everything down a lot of course!

what limit number do you think is reasonable in the meantime?

it wouldn't be a problem because of pagination, and everything is virtualized (only rows present on the screen are rendered)

@JerBouma
Copy link
Contributor

JerBouma commented Mar 3, 2023

I'd say go with a thousand for now. Little bit worried we might cut-off some data in due time so there needs to be a more dynamic solution at some point in time (basically no limit).

image

@jose-donato
Copy link
Contributor Author

I'd say go with a thousand for now. Little bit worried we might cut-off some data in due time so there needs to be a more dynamic solution at some point in time (basically no limit).

image

I like the no limit but have to talk with @jmaslek for the best way to do this without breaking anything

@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

❗ No coverage uploaded for pull request base (develop@723a395). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #4386   +/-   ##
==========================================
  Coverage           ?   54.42%           
==========================================
  Files              ?      596           
  Lines              ?    53657           
  Branches           ?        0           
==========================================
  Hits               ?    29202           
  Misses             ?    24455           
  Partials           ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jmaslek jmaslek added this pull request to the merge queue Mar 13, 2023
Merged via the queue into develop with commit 40cfe81 Mar 13, 2023
@piiq piiq deleted the feature/tables branch March 22, 2023 14:03
jmaslek added a commit that referenced this pull request Apr 13, 2023
* feat: experimenting tables with react

* feat: adding new interactive tables

* feat: adding more table features

* small changes

* update

* Update backend.py

* Update backend.py

* fix: dark mode?

* feat: lot of table improvements

* fix: my b

* fix: load only when prod

* feat: naive detect links and dates

* handle index and column names

* increased min width

* codespell

* mypy, pylint

* fix: added new chart, export, etc

* testing

* updates

* fix : add PLOT_OPEN_EXPORT,  USE_INTERACTIVE_DF to user dataclass

* bump pywry version, readd removed `plots_backend().start()`

* req files

* Update unit-test.yml

* Update unit-test.yml

* Update unit-test.yml

* updates

* fixing some date things

* update table

* fix formatting with timezones

* fixing some long prints and tables

* Mickey Mouse

Co-authored-by: teh_coderer <[email protected]>
Co-authored-by: jose-donato <[email protected]>

* fix: ?!?!?

* adding limit arg to all print_rich_table

* tests

* lint

* simple by Default on interactive charts

* playing with some css (thks jose)

* Fix #4426

* Edit some structure

* fix sdk generation

* Update backend.py

* fa menu tested and working

* fix #4460

* fix #4460 drop indices

* update tests

* update tests

* Update helper_funcs.py

* tests

* Update unit-test.yml

* Update etf.ipynb

---------

Co-authored-by: teh_coderer <[email protected]>
Co-authored-by: andrewkenreich <[email protected]>
Co-authored-by: teh_coderer <[email protected]>
Co-authored-by: jose-donato <[email protected]>
Co-authored-by: James Maslek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat XL Extra Large feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants