oceanprotocol / pdr-backend

Instructions & code to run predictoors, traders, more.
Apache License 2.0
28 stars 22 forks source link

[Epic][Lake][Analytics] Create Analytics Dapp with Predictoor Income plot #618

Closed idiom-bytes closed 3 months ago

idiom-bytes commented 8 months ago

Motivation

We want to go from tables and etl, to apps with interactive plots. The two frameworks we may consider right now are Streamlit and Dash.

Framework Considerations

Dash is OSS, fully fledged so, it delivers things like url routing out of the box. It also has enterprise support, so there is that potentially unblocking limitations we may hit. Dash is known for requiring you to know the framework (which makes sense). https://dash.plotly.com/

Streamlit is leaner, w/ more community projects/plugins used to solve individual needs Things like routing are additional, and require development. https://discuss.streamlit.io/t/is-there-a-way-to-have-multiple-pages-like-flask/16823

I originally used Streamlit because I like it's native matplotlib and python graphing library support. However, I'm not sure how much of an uphill battle and duck tape it will take to achieve basic web-app functionality such as: routing, caching, etc... Due to previous usage w/ Svelte (dao) by the team and then react (predictoor), I would expect the team to perhaps lean more towards Dash.

The lowest cost/friction would be plotly/streamlit. The most enterprise/mature solution is plotly/dash. The most community/open solution is matplotlib/streamlit.

Data Outline

image

DoD:

Prepare Data:

[Moving from silver-table to streamlit]

Create Net Income Plot + Single Page App:

Create Revenue + Expense Plot + Single Page App:

Display Feeds and Predictoors tables

We should now have a single-page app (SPA), first-cut dapp completed, having Predictoor Income plot, running locally w/ 3 charts. There are 2 simple UI elements for filtering, and everything is updating.

We should now consider:

trentmc commented 8 months ago

pdr analytics prototypes in GSlides: https://docs.google.com/presentation/d/18y_nfpc3e-dop5NtfIisgUkc-oPt8dft9WyAnqhSqZg/edit#slide=id.g20f5357f625_0_1545

idiom-bytes commented 8 months ago

[Frameworks & Plots] Based on previous history, I estimate the team will feel that:

As I mentioned in chats, I'm recommending the least amount of time getting a basic plot/app in place to stress test it.

This means plotly/streamlit.

idiom-bytes commented 8 months ago

@KatunaNorbert please note that I updated the table design/schema, such that the calculated tables + aggregates are taking place at the silver-level.

This is such that our bronze_tables remain: "close-to-raw, clean" While silver tables remain: "enriched + aggregated"

KatunaNorbert commented 8 months ago

Got it, sound good @idiom-bytes

trentmc commented 8 months ago

Recall our recent conversation why we don't want to use "Dashboard" label:

Accordingly, in this issue's title and description, I replaced "Dashboard" with "dapp" & "dapp with plots". Please ensure other issues follow this too. Thank you:)

idiom-bytes commented 5 months ago

Updating tickets...