thearn commited on
Commit
5044d19
·
1 Parent(s): 2293b42

dakr mode

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -158,7 +158,8 @@ def create_hierarchical_view(graph: Dict[str, Any], root_id: int, max_depth: int
158
  color=color,
159
  title=f"Name: {name}\nYear: {node.get('year', 'N/A')}\nInstitution: {node.get('institution', 'N/A')}",
160
  x=x_pos,
161
- y=y_pos
 
162
  )
163
  nodes_list.append(ag_node)
164
 
@@ -418,6 +419,7 @@ def main():
418
  nodes_list, edges_list = create_hierarchical_view(graph, root_id, depth_filter)
419
 
420
  if nodes_list:
 
421
  config = Config(
422
  width=800,
423
  height=600,
@@ -426,7 +428,17 @@ def main():
426
  hierarchical=True,
427
  nodeHighlightBehavior=True,
428
  highlightColor="#F7A7A6",
429
- collapsible=False
 
 
 
 
 
 
 
 
 
 
430
  )
431
 
432
  agraph(nodes=nodes_list, edges=edges_list, config=config)
 
158
  color=color,
159
  title=f"Name: {name}\nYear: {node.get('year', 'N/A')}\nInstitution: {node.get('institution', 'N/A')}",
160
  x=x_pos,
161
+ y=y_pos,
162
+ font={"color": "white", "size": 12}
163
  )
164
  nodes_list.append(ag_node)
165
 
 
419
  nodes_list, edges_list = create_hierarchical_view(graph, root_id, depth_filter)
420
 
421
  if nodes_list:
422
+ # configure for better dark mode compatibility
423
  config = Config(
424
  width=800,
425
  height=600,
 
428
  hierarchical=True,
429
  nodeHighlightBehavior=True,
430
  highlightColor="#F7A7A6",
431
+ collapsible=False,
432
+ # dark mode friendly settings
433
+ node={
434
+ "font": {
435
+ "color": "black", # ensure text is always black for readability
436
+ "size": 12,
437
+ "face": "arial"
438
+ },
439
+ "borderWidth": 2,
440
+ "borderWidthSelected": 3
441
+ }
442
  )
443
 
444
  agraph(nodes=nodes_list, edges=edges_list, config=config)