ZahirJS commited on
Commit
55cab16
·
verified ·
1 Parent(s): b33e196

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -54,10 +54,13 @@ def generate_concept_map(json_input: str) -> str:
54
  name='ConceptMap',
55
  format='png',
56
  graph_attr={
57
- 'rankdir': 'TB', # Top-to-Bottom
58
- 'splines': 'ortho', # Straight lines
59
- 'bgcolor': 'white', # Fondo blanco
60
- 'pad': '0.5' # ¡Este es el margen! 0.5 pulgadas
 
 
 
61
  }
62
  )
63
 
@@ -102,7 +105,7 @@ def generate_concept_map(json_input: str) -> str:
102
 
103
  # Edge colors can remain constant or change. Let's make them slightly visible.
104
  edge_color = '#4a4a4a' # Un gris oscuro para las líneas
105
- font_size = max(9, 14 - current_depth ) # Adjust font size based on depth
106
  edge_font_size = max(7, 10 - (current_depth * 1))
107
 
108
  for node in nodes_list:
 
54
  name='ConceptMap',
55
  format='png',
56
  graph_attr={
57
+ 'rankdir': 'TB', # Top-to-Bottom
58
+ 'splines': 'ortho', # Straight lines
59
+ 'bgcolor': 'white', # Fondo blanco
60
+ 'pad': '0.5', # Margen alrededor del gráfico
61
+ 'size': '8,12!', # ¡Nuevo! Tamaño deseado (ancho, alto en pulgadas). El '!' es importante.
62
+ 'ranksep': '1.0' # ¡Nuevo! Aumenta la separación vertical entre niveles
63
+ # 'ratio': 'fill' # Podría usarse con 'size' para forzar a rellenar el espacio
64
  }
65
  )
66
 
 
105
 
106
  # Edge colors can remain constant or change. Let's make them slightly visible.
107
  edge_color = '#4a4a4a' # Un gris oscuro para las líneas
108
+ font_size = max(9, 14 - (current_depth * 2)) # Adjust font size based on depth
109
  edge_font_size = max(7, 10 - (current_depth * 1))
110
 
111
  for node in nodes_list: