eshan6704 commited on
Commit
9127b91
·
verified ·
1 Parent(s): 8c4ea55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -20
app.py CHANGED
@@ -43,36 +43,37 @@ def fetch_data(mode, req_type, name):
43
 
44
  with gr.Blocks() as iface:
45
 
46
- # CSS for taller row and proper textbox alignment
47
  gr.HTML("""
48
  <style>
49
  .gradio-container { padding-top: 0 !important; }
50
- #topbar { margin: 0; padding: 5px; display: flex; align-items: center; gap: 10px; }
51
- #topbar .gr-input, #topbar .gr-select, #topbar .gr-button {
52
  height: 40px !important;
53
  font-size: 16px;
54
- box-sizing: border-box; /* important to include padding in height */
55
  }
56
- #topbar .gr-input label, #topbar .gr-select label {
57
- display: none; /* optional: hide labels to save vertical space */
58
  }
59
  </style>
60
  """)
61
 
62
- # Top row
63
- with gr.Row(elem_id="topbar"):
64
- mode_input = gr.Textbox(label="Mode", value="stock", scale=2)
65
- symbol = gr.Textbox(label="Stock symbol", value="PNB", scale=2)
66
- req_type = gr.Dropdown(
67
- label="req_type",
68
- choices=[
69
- "info","intraday","daily","qresult","result","balance","cashflow",
70
- "dividend","split","index","open","preopen","ce","pe","future","bhav","highlow"
71
- ],
72
- value="info",
73
- scale=3
74
- )
75
- btn = gr.Button("Submit", scale=2)
 
76
 
77
  # Output area
78
  output = gr.HTML()
 
43
 
44
  with gr.Blocks() as iface:
45
 
46
+ # CSS for proper spacing and full textbox visibility
47
  gr.HTML("""
48
  <style>
49
  .gradio-container { padding-top: 0 !important; }
50
+ #topblock { margin: 0; padding: 5px; }
51
+ #topblock .gr-input, #topblock .gr-select, #topblock .gr-button {
52
  height: 40px !important;
53
  font-size: 16px;
54
+ box-sizing: border-box;
55
  }
56
+ #topblock .gr-input label, #topblock .gr-select label {
57
+ display: none; /* optional: hide labels to save space */
58
  }
59
  </style>
60
  """)
61
 
62
+ # Top inputs in a block
63
+ with gr.Block(elem_id="topblock"):
64
+
65
+ mode_input = gr.Textbox(label="Mode", value="stock", scale=2, placeholder="Mode")
66
+ symbol = gr.Textbox(label="Stock symbol", value="PNB", scale=2, placeholder="Symbol")
67
+ req_type = gr.Dropdown(
68
+ label="req_type",
69
+ choices=[
70
+ "info","intraday","daily","qresult","result","balance","cashflow",
71
+ "dividend","split","index","open","preopen","ce","pe","future","bhav","highlow"
72
+ ],
73
+ value="info",
74
+ scale=3
75
+
76
+ btn = gr.Button("Submit", scale=2)
77
 
78
  # Output area
79
  output = gr.HTML()