zavavan commited on
Commit
e380a56
·
verified ·
1 Parent(s): ede3671

Update dashboard.py

Browse files
Files changed (1) hide show
  1. dashboard.py +20 -7
dashboard.py CHANGED
@@ -317,8 +317,9 @@ def generate_radio_buttons(value):
317
 
318
 
319
  # https://tabler-icons.io/
320
- button1 = pn.widgets.Button(name="Introduction", button_type="warning", icon="file-info", styles={"width": "100%"})
321
- button2 = pn.widgets.Button(name="AECO Macro Topics", button_type="warning", icon="chart-histogram", styles={"width": "100%"})
 
322
  button3 = pn.widgets.Button(name="Research Collaboration Networks: Institutes", button_type="warning", icon="chart-dots-3", styles={"width": "100%"})
323
  button4 = pn.widgets.Button(name="Research Collaboration Networks: Countries", button_type="warning", icon="chart-dots-3", styles={"width": "100%"})
324
  #button5 = pn.widgets.Button(name="Entity Chord Diagrams", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
@@ -364,7 +365,8 @@ region_radio_button.param.watch(update_holomap, 'value')
364
  def show_page(page_key):
365
  main_area.clear()
366
  main_area.append(mapping[page_key])
367
-
 
368
  button1.on_click(lambda event: show_page("Page1"))
369
  button2.on_click(lambda event: show_page("Page2"))
370
  button3.on_click(lambda event: show_page("Page3"))
@@ -374,8 +376,7 @@ button4.on_click(lambda event: show_page("Page4"))
374
 
375
 
376
  ### CREATE PAGE LAYOUTS
377
-
378
- def CreatePage1():
379
  return pn.Column(pn.pane.Markdown("""
380
 
381
  This is a dashboard for a Research Analysis project regarding research and technology in the AECO domain. The source data consists of around
@@ -394,7 +395,18 @@ for the 16 macro-topics automatically detected by an optimized BerTopic model an
394
  """, width=800), align="center")
395
 
396
 
397
- #width="1200px" height="1500px"
 
 
 
 
 
 
 
 
 
 
 
398
  def CreatePage2():
399
  # Load the HTML content from the local file
400
  #with open(AECO_topics_over_time_file_path, 'r', encoding='utf-8') as file:
@@ -442,6 +454,7 @@ def CreatePage6():
442
 
443
 
444
  mapping = {
 
445
  "Page1": CreatePage1(),
446
  "Page2": CreatePage2(),
447
  "Page3": CreatePage3(),
@@ -451,7 +464,7 @@ mapping = {
451
  }
452
 
453
  #################### SIDEBAR LAYOUT ##########################
454
- sidebar = pn.Column(pn.pane.Markdown("## Pages"), button1,button2,button3,button4,
455
  #button5,
456
  #button6,
457
  styles={"width": "100%", "padding": "15px"})
 
317
 
318
 
319
  # https://tabler-icons.io/
320
+ button0 = pn.widgets.Button(name="Introduction", button_type="warning", icon="file-info", styles={"width": "100%"})
321
+ button1 = pn.widgets.Button(name="AECO Macro Topics Hierarchy", button_type="warning", icon="file-info", styles={"width": "100%"})
322
+ button2 = pn.widgets.Button(name="AECO Macro Topics Trends", button_type="warning", icon="chart-histogram", styles={"width": "100%"})
323
  button3 = pn.widgets.Button(name="Research Collaboration Networks: Institutes", button_type="warning", icon="chart-dots-3", styles={"width": "100%"})
324
  button4 = pn.widgets.Button(name="Research Collaboration Networks: Countries", button_type="warning", icon="chart-dots-3", styles={"width": "100%"})
325
  #button5 = pn.widgets.Button(name="Entity Chord Diagrams", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
 
365
  def show_page(page_key):
366
  main_area.clear()
367
  main_area.append(mapping[page_key])
368
+
369
+ button0.on_click(lambda event: show_page("Page0"))
370
  button1.on_click(lambda event: show_page("Page1"))
371
  button2.on_click(lambda event: show_page("Page2"))
372
  button3.on_click(lambda event: show_page("Page3"))
 
376
 
377
 
378
  ### CREATE PAGE LAYOUTS
379
+ def CreatePage0():
 
380
  return pn.Column(pn.pane.Markdown("""
381
 
382
  This is a dashboard for a Research Analysis project regarding research and technology in the AECO domain. The source data consists of around
 
395
  """, width=800), align="center")
396
 
397
 
398
+
399
+ def CreatePage1():
400
+ # Load the HTML content from the local file
401
+ #with open(AECO_topics_over_time_file_path, 'r', encoding='utf-8') as file:
402
+ # html_content = file.read()
403
+ # Use an iframe to load the local HTML file
404
+ iframe_html = f'<iframe src="{AECO_topics_over_time_file_path}" width="1200px" height="1800px"></iframe>'
405
+ # Create an HTML pane to render the content
406
+ html_pane = pn.pane.HTML(iframe_html , sizing_mode='stretch_both')
407
+ return pn.Column(pn.pane.Markdown(" ## AECO Macro Topics Dendogram "), html_pane, align="center")
408
+
409
+
410
  def CreatePage2():
411
  # Load the HTML content from the local file
412
  #with open(AECO_topics_over_time_file_path, 'r', encoding='utf-8') as file:
 
454
 
455
 
456
  mapping = {
457
+ "Page0": CreatePage0(),
458
  "Page1": CreatePage1(),
459
  "Page2": CreatePage2(),
460
  "Page3": CreatePage3(),
 
464
  }
465
 
466
  #################### SIDEBAR LAYOUT ##########################
467
+ sidebar = pn.Column(pn.pane.Markdown("## Pages"),button0,button1,button2,button3,button4,
468
  #button5,
469
  #button6,
470
  styles={"width": "100%", "padding": "15px"})