zavavan commited on
Commit
26805b1
·
verified ·
1 Parent(s): 72c17f7

Update dashboard.py

Browse files
Files changed (1) hide show
  1. dashboard.py +20 -9
dashboard.py CHANGED
@@ -40,7 +40,7 @@ data = './data'
40
 
41
  def read_freq_map(filename):
42
  df = pd.read_csv(os.path.join(data,filename), sep=' ')
43
- df = df.head(10)
44
  if 'Unnamed: 0' in df.columns:
45
  df = df.drop('Unnamed: 0', axis=1)
46
  column_0 = df.columns[0]
@@ -63,7 +63,7 @@ def read_ont_freq_dataframe(filename):
63
  entityTypesFreqMap = read_freq_map('entityTypes.tsv')
64
  relationTypesFreqMap = read_freq_map('relationTypes.tsv')
65
  topDrugEntities = read_freq_map('topDrugs.tsv')
66
- print(topDrugEntities)
67
  topConditionEntities = read_freq_map('topConditions.tsv')
68
  topDrugOnts_df = pd.read_csv(os.path.join(data,'topDrugOntologies.tsv'), sep='\t')
69
  topConditionOnts_df = pd.read_csv(os.path.join(data,'topConditionOntologies.tsv'), sep='\t')
@@ -222,13 +222,24 @@ button3 = pn.widgets.Button(name="Entity/Relation Types:", button_type="warning"
222
  button4 = pn.widgets.Button(name="Ontology Coverage", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
223
  #button5 = pn.widgets.Button(name="Causal Relation Chord Diagrams", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
224
 
225
- button5 = pn.pane.Markdown(
226
- "<div style='background-color:#f0f0f0; padding:8px 16px; border:1px solid #ccc; "
227
- "border-radius:6px; text-align:center; width:100px;'>Causal Relation Chord Diagrams</div>",
228
- width=120,
229
- height=40,
230
- margin=(5, 5)
231
- )
 
 
 
 
 
 
 
 
 
 
 
232
  # Define child buttons
233
  child_button_1 = pn.widgets.Button(name="Cause", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
234
  child_button_2 = pn.widgets.Button(name="Enable", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
 
40
 
41
  def read_freq_map(filename):
42
  df = pd.read_csv(os.path.join(data,filename), sep=' ')
43
+ #df = df.head(10)
44
  if 'Unnamed: 0' in df.columns:
45
  df = df.drop('Unnamed: 0', axis=1)
46
  column_0 = df.columns[0]
 
63
  entityTypesFreqMap = read_freq_map('entityTypes.tsv')
64
  relationTypesFreqMap = read_freq_map('relationTypes.tsv')
65
  topDrugEntities = read_freq_map('topDrugs.tsv')
66
+ #print(topDrugEntities)
67
  topConditionEntities = read_freq_map('topConditions.tsv')
68
  topDrugOnts_df = pd.read_csv(os.path.join(data,'topDrugOntologies.tsv'), sep='\t')
69
  topConditionOnts_df = pd.read_csv(os.path.join(data,'topConditionOntologies.tsv'), sep='\t')
 
222
  button4 = pn.widgets.Button(name="Ontology Coverage", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
223
  #button5 = pn.widgets.Button(name="Causal Relation Chord Diagrams", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
224
 
225
+ markdown_button_style = """
226
+ <div style="
227
+ background-color: #f0ad4e; /* Matches 'warning' button type */
228
+ color: white;
229
+ font-weight: bold;
230
+ padding: 8px 12px;
231
+ border-radius: 4px;
232
+ text-align: center;
233
+ width: 100%;
234
+ ">
235
+ Causal Relation Chord Diagrams
236
+ </div>
237
+ """
238
+ button5 = pn.pane.Markdown(markdown_button_style, width_policy="max")
239
+
240
+ #button5 = pn.pane.Markdown("<div style='background-color:#f0f0f0; padding:8px 16px; border:1px solid #ccc; " "border-radius:6px; text-align:center; width:100px;'>Causal Relation Chord Diagrams</div>", width=120, height=40, margin=(5, 5))
241
+
242
+
243
  # Define child buttons
244
  child_button_1 = pn.widgets.Button(name="Cause", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})
245
  child_button_2 = pn.widgets.Button(name="Enable", button_type="warning", icon="chart-dots-filled", styles={"width": "100%"})