Spaces:
Sleeping
Sleeping
Update dashboard.py
Browse files- dashboard.py +4 -2
dashboard.py
CHANGED
@@ -128,8 +128,9 @@ def create_ontology_bar_charts(ents, **kwargs):
|
|
128 |
for i,row in df.iterrows():
|
129 |
button = pn.widgets.Button(name=row['Drug_Ontologies'], width=150)
|
130 |
## Open the associated URL in a new tab when button is clicked
|
|
|
131 |
button.js_on_click(
|
132 |
-
code=f'{
|
133 |
drug_ontolgy_buttons.append(button)
|
134 |
drug_ontology_column = pn.Column(*drug_ontolgy_buttons, sizing_mode='stretch_width')
|
135 |
|
@@ -162,8 +163,9 @@ def create_ontology_bar_charts(ents, **kwargs):
|
|
162 |
for i, row in df.iterrows():
|
163 |
button = pn.widgets.Button(name=row['Condition_Ontologies'], width=150)
|
164 |
## Open the associated URL in a new tab when button is clicked
|
|
|
165 |
button.js_on_click(
|
166 |
-
code=f'{
|
167 |
condition_ontolgy_buttons.append(button)
|
168 |
condition_ontology_column = pn.Column(*condition_ontolgy_buttons, sizing_mode='stretch_width')
|
169 |
# Create bar chart with label as x-axis
|
|
|
128 |
for i,row in df.iterrows():
|
129 |
button = pn.widgets.Button(name=row['Drug_Ontologies'], width=150)
|
130 |
## Open the associated URL in a new tab when button is clicked
|
131 |
+
url = row["url"]
|
132 |
button.js_on_click(
|
133 |
+
code=f'window.open("{url}", "_blank");')
|
134 |
drug_ontolgy_buttons.append(button)
|
135 |
drug_ontology_column = pn.Column(*drug_ontolgy_buttons, sizing_mode='stretch_width')
|
136 |
|
|
|
163 |
for i, row in df.iterrows():
|
164 |
button = pn.widgets.Button(name=row['Condition_Ontologies'], width=150)
|
165 |
## Open the associated URL in a new tab when button is clicked
|
166 |
+
url = row["url"]
|
167 |
button.js_on_click(
|
168 |
+
code=f'window.open("{url}", "_blank");')
|
169 |
condition_ontolgy_buttons.append(button)
|
170 |
condition_ontology_column = pn.Column(*condition_ontolgy_buttons, sizing_mode='stretch_width')
|
171 |
# Create bar chart with label as x-axis
|