hysts HF staff commited on
Commit
bdb0427
·
1 Parent(s): ab176cb
Files changed (3) hide show
  1. app.py +9 -2
  2. requirements.txt +1 -0
  3. style.css +16 -0
app.py CHANGED
@@ -1,9 +1,16 @@
1
  #!/usr/bin/env python
2
 
3
  import gradio as gr
 
 
 
4
 
5
- with gr.Blocks() as demo:
6
- pass
 
 
 
 
7
 
8
  if __name__ == "__main__":
9
  demo.queue().launch()
 
1
  #!/usr/bin/env python
2
 
3
  import gradio as gr
4
+ import numpy as np
5
+ import pandas as pd
6
+ import plotly.express as px
7
 
8
+ np.random.seed(1)
9
+ data = np.random.normal(size=(1000, 5)).cumsum(axis=0)
10
+ df = pd.DataFrame(data, columns=["A", "B", "C", "D", "E"])
11
+
12
+ with gr.Blocks(css="style.css") as demo:
13
+ gr.Plot(px.line(df))
14
 
15
  if __name__ == "__main__":
16
  demo.queue().launch()
requirements.txt CHANGED
@@ -0,0 +1 @@
 
 
1
+ plotly==5.18.0
style.css CHANGED
@@ -8,3 +8,19 @@ h1 {
8
  background: #1565c0;
9
  border-radius: 100vh;
10
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  background: #1565c0;
9
  border-radius: 100vh;
10
  }
11
+
12
+ .js-plotly-plot .plotly {
13
+ padding-top: 30px !important;
14
+ background-color: white;
15
+ }
16
+
17
+ .js-plotly-plot .plotly .modebar {
18
+ top: -30px !important;
19
+ right: 10px !important;
20
+ }
21
+
22
+ .modebar-group {
23
+ display: flex;
24
+ flex-direction: row;
25
+ align-items: center;
26
+ }