Rouji / single_php_filehost

Simple Filehosting Page in a Single PHP File (obvious 0x0 clone)
ISC License
235 stars 35 forks source link

file retention graph #2

Closed pcroland closed 1 month ago

pcroland commented 4 years ago

Hi!

I created a graph for file retention:


360 days ─┬┬────────────────────────────┬─────────────────────────────┐
          │└┐                           │                             │
          │ └┐                          │                             │
          │  └┐                         │                             │
          │   └┐                        │                             │
          │    └┐                       │                             │
          │     └┐                      │                             │
          │      └┐                     │                             │
          │       └┐                    │                             │
          │        └┐                   │                             │
          │         └─┐                 │                             │
          │           └┐                │                             │
          │            └┐               │                             │
          │             └─┐             │                             │
          │               └┐            │                             │
185 days ─┼────────────────┴┬───────────┼─────────────────────────────┤
          │                 └─┐         │                             │
          │                   └─┐       │                             │
          │                     └┐      │                             │
          │                      └─┐    │                             │
          │                        └┐   │                             │
          │                         └─┐ │                             │
          │                           └─┤                             │
          │                             ├─┐                           │
          │                             │ └──┐                        │
          │                             │    └─┐                      │
          │                             │      └──┐                   │
          │                             │         └──┐                │
          │                             │            └───┐            │
          │                             │                └─────┐      │
 10 days ─┼─────────────────────────────┼──────────────────────┴──────┤
         0MB                          512MB                        1024MB```
Feel free to merge it somewhere in the php if you want.
Rouji commented 4 years ago

Neat! Did you manually draw that? To actually merge that in I'd probably want it generated based on the settings inside the .php somehow

pcroland commented 4 years ago

I generated the graph in excel, then manually draw it, yes: https://widevine.is-a.fail/lS9ZXN.png

Rouji commented 4 years ago

Can't really put it in the repo as the static thing that it is, but I've put it on x0.at for now anyway. Looks good on desktop browsers and iOS (maybe a bit large), but somehow goes weird on Android, even inside the <pre>, so it still needs some fiddling though :/

tMV

I guess generating a simple SVG might do the trick for a dynamic graph that looks the same everywhere. But someone would have to be very bored to implement that.

pcroland commented 4 years ago

Just changing the graph values based on the settings should be okay I guess. The slope won't change unless you change the formula.

Rouji commented 4 years ago

The exponent is configurable and will indeed change the slope.

koutsie commented 3 years ago

+1 for merging

Rouji commented 3 years ago

+1 for merging

A static graph does not work for the general case, where the exponent is configurable. Simple example: it's a straight line for $DECAY_EXP=1