EasySci commited on
Commit
2c8b459
·
1 Parent(s): dc8d365

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +5 -20
app2.py CHANGED
@@ -13,28 +13,18 @@ import TLDR
13
  from src.search import Search_Papers
14
 
15
  class MainBody(param.Parameterized):
16
- active_tab = param.Parameter(default="Home")
17
  main_body = param.List(default=[pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'})])
18
 
19
 
20
- @param.depends("active_tab", "main_body")
21
- def update(self):
22
- return pn.Column(self.main_body)
23
 
24
- # @param.depends("main_body")
25
- # def update(self):
26
- # return pn.Column(*self.main_body)
 
27
 
28
  main_body_instance = MainBody()
29
 
30
- # Define the content for each tab
31
- tab1_content = MainBody(main_body=[pn.pane.LaTeX("Home Tab Content", styles={'font-size': '20pt'})])
32
- tab2_content = MainBody(main_body=[pn.pane.LaTeX("My Papers Tab Content", styles={'font-size': '20pt'})])
33
 
34
- tabs = Tabs(
35
- ("Home", tab1_content.update),
36
- ("My Papers", tab2_content.update),
37
- )
38
 
39
 
40
  paper_list = [] # Add this line to initialize paper_list as an empty list
@@ -84,11 +74,6 @@ def toggle_settings(event):
84
  buttons[-1].visible = event.new
85
 
86
 
87
- def switch_tab(event):
88
- main_body_instance.active_tab = event.obj.name
89
-
90
- button1.on_click(switch_tab)
91
- button2.on_click(switch_tab)
92
 
93
  button3.param.watch(toggle_settings, 'value')
94
 
@@ -167,7 +152,7 @@ filter_list = pn.widgets.MultiChoice(
167
  template = pn.template.FastListTemplate(
168
  title="EasySciRead",
169
  header=[pn.Row(header_buttons, width=750, sizing_mode='stretch_width'), pn.Row(filter_list, width=250), pn.Row(add_to_header_button, width=55)],
170
- main=tabs, # Use the Tabs widget here
171
  sidebar=[buttons],
172
  accent_base_color="#88d8b0",
173
  header_background="#FFFFFF",
 
13
  from src.search import Search_Papers
14
 
15
  class MainBody(param.Parameterized):
 
16
  main_body = param.List(default=[pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'})])
17
 
18
 
 
 
 
19
 
20
+
21
+ @param.depends("main_body")
22
+ def update(self):
23
+ return pn.Column(*self.main_body)
24
 
25
  main_body_instance = MainBody()
26
 
 
 
 
27
 
 
 
 
 
28
 
29
 
30
  paper_list = [] # Add this line to initialize paper_list as an empty list
 
74
  buttons[-1].visible = event.new
75
 
76
 
 
 
 
 
 
77
 
78
  button3.param.watch(toggle_settings, 'value')
79
 
 
152
  template = pn.template.FastListTemplate(
153
  title="EasySciRead",
154
  header=[pn.Row(header_buttons, width=750, sizing_mode='stretch_width'), pn.Row(filter_list, width=250), pn.Row(add_to_header_button, width=55)],
155
+ main=main_body_instance.update
156
  sidebar=[buttons],
157
  accent_base_color="#88d8b0",
158
  header_background="#FFFFFF",