alexanderHSG commited on
Commit
c80bd26
·
1 Parent(s): 1b062b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -13
app.py CHANGED
@@ -230,12 +230,15 @@ def construct_hmtl(highest_similarities, nodes_to_show=["SLIDE_DECK", "SLIDE", "
230
  <title>DataViz</title>
231
  <style type="text/css">
232
  body {{
233
- background-color: #f5f5f5; /* Light grey background for the entire page */
 
 
 
 
234
  }}
235
  #viz {{
236
  width: 1200px;
237
  height: 700px;
238
- border: 2px solid black; /* Adds a border around the viz div */
239
  background-color: #f0f0f0; /* Lighter grey background for the viz div */
240
  padding: 10px; /* Adds padding inside the div */
241
  }}
@@ -250,7 +253,6 @@ def construct_hmtl(highest_similarities, nodes_to_show=["SLIDE_DECK", "SLIDE", "
250
  </style>
251
  </head>
252
  <body>
253
- <h1 class="heading">Visualization of Your Retrieved Slide Graph</h1>
254
  <div id="viz">
255
  <p id="queryCypher">{query}</p>
256
  </div>
@@ -477,8 +479,8 @@ console.log("Observer is set to monitor changes in the document body.");
477
  ## ---------------------------------------------------------------------------------------------------------------------
478
  graphVisual = gr.HTML()
479
  highest_similarities_gradio_list = gr.List(type="array", interactive=False, visible=False)
480
- nodeSelector = gr.Dropdown(label="Filter for nodes", choices=["SLIDE_DECK", "SLIDE", "STORYPOINT"], value=["SLIDE_DECK", "SLIDE", "STORYPOINT"], multiselect=True, scale=1)
481
- filterBTN = gr.Button("Filter Graph")
482
 
483
  with gr.Blocks(title='Slide Inspo', theme='Soft', js=scripts, head = js_click).queue(default_concurrency_limit=1) as demo:
484
 
@@ -516,14 +518,15 @@ with gr.Blocks(title='Slide Inspo', theme='Soft', js=scripts, head = js_click).q
516
 
517
 
518
  with gr.Row():
519
- with gr.Column(scale=1):
520
- nodeSelector.render()
521
- with gr.Column(scale=1):
522
- filterBTN.render()
523
- filterBTN.click(fn= construct_hmtl, inputs=[highest_similarities_gradio_list, nodeSelector], outputs=[graphVisual]).then(js = js_click)
524
-
525
- with gr.Row():
526
- graphVisual.render()
 
527
 
528
 
529
 
 
230
  <title>DataViz</title>
231
  <style type="text/css">
232
  body {{
233
+ display: flex; /* Use flexbox to align children */
234
+ justify-content: center; /* Center horizontally in the flex container */
235
+ align-items: center; /* Center vertically if desired */
236
+ min-height: 100vh; /* Ensure the body takes at least the height of the viewport */
237
+ margin: 0; /* Remove default margin */
238
  }}
239
  #viz {{
240
  width: 1200px;
241
  height: 700px;
 
242
  background-color: #f0f0f0; /* Lighter grey background for the viz div */
243
  padding: 10px; /* Adds padding inside the div */
244
  }}
 
253
  </style>
254
  </head>
255
  <body>
 
256
  <div id="viz">
257
  <p id="queryCypher">{query}</p>
258
  </div>
 
479
  ## ---------------------------------------------------------------------------------------------------------------------
480
  graphVisual = gr.HTML()
481
  highest_similarities_gradio_list = gr.List(type="array", interactive=False, visible=False)
482
+ nodeSelector = gr.Dropdown(label="Filter nodes", choices=["SLIDE_DECK", "SLIDE", "STORYPOINT"], value=["SLIDE_DECK", "SLIDE", "STORYPOINT"], multiselect=True, scale=1)
483
+ filterBTN = gr.Button("Apply Filter")
484
 
485
  with gr.Blocks(title='Slide Inspo', theme='Soft', js=scripts, head = js_click).queue(default_concurrency_limit=1) as demo:
486
 
 
518
 
519
 
520
  with gr.Row():
521
+ with gr.Group():
522
+ with gr.Column(scale=1):
523
+ nodeSelector.render()
524
+ with gr.Column(scale=1):
525
+ filterBTN.render()
526
+ filterBTN.click(fn= construct_hmtl, inputs=[highest_similarities_gradio_list, nodeSelector], outputs=[graphVisual]).then(js = js_click)
527
+
528
+ with gr.Row():
529
+ graphVisual.render()
530
 
531
 
532