oceanprotocol / pdr-backend

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

[Sim plots] Too many plots at once; fix via >1 page selectable via sidebar #1021

Closed trentmc closed 4 weeks ago

trentmc commented 1 month ago

TODOs

Specifics: using the same style as "inspiration" below, group the plots with the following Sidebar label -> plots:

Background / motivation

From matplotlib -> streamlit work #749 then streamlit -> dash work #906 we now have beautiful sim plots in a webapp, great. See "status quo screenshot" below.

However there's already a lot of plots in one webapp. They could readily be grouped, each into their own screen, giving them more "space to breathe" with more interactivity etc. For example, impacts + sweeps could go into their own screen.

Towards a solution

What we want is a Plotly/Dash "Multi-Page App", where:

Resources

Inspiration

Screenshot 2024-05-11 at 09 03 02 2

Status quo screenshot

FireShot Capture 017 - Dash - 127 0 0 1

KatunaNorbert commented 1 month ago

Do we really need multiple pages for this? I suggest using tabs, this will allow to keep common components such as: SimulationID, State visible on the top and only change the displayed plots.

trentmc commented 1 month ago

I suggest using tabs, this will allow to keep common components such as: SimulationID, State visible on the top and only change the displayed plots.

I agree.

Do we really need multiple pages for this?

"Multiple pages" has two meanings:

  1. the general idea of an app that has >1 pages, versus different tabs
  2. a Plotly/Dash "Multi-Page App", which is how you implement >1 pages OR different tabs

We are in category (2). We want to implement different tabs, but how you do it with Plotly/Dash is via a "Multi-Page App". (At least that's my understanding of it! If you see a simpler way, go for it.)

KatunaNorbert commented 1 month ago

This is what I mean: https://dash.plotly.com/dash-core-components/tab

trentmc commented 1 month ago

This is what I mean: https://dash.plotly.com/dash-core-components/tab

Thank you for finding that. I think I'd been confused, it had looked like tabs had been deprecated, but digging around right now, it looks like they're still properly supported.

Therefore: yes do go with the "tab" core component.

KatunaNorbert commented 1 month ago

Ok