fix: improve label readability — remove index from labels, larger min font/node size
Browse files- build_network.py +4 -4
build_network.py
CHANGED
|
@@ -98,7 +98,7 @@ def generate_network_html(network_data, threshold, max_l1_nodes,
|
|
| 98 |
cat_idx = attr_to_cat_idx.get(selected, 100)
|
| 99 |
nodes.append({
|
| 100 |
'id': selected,
|
| 101 |
-
'label': wrap_label(selected)
|
| 102 |
'level': 0, 'value': int(cat_idx),
|
| 103 |
'title': selected + ' — Category Index: ' + str(int(cat_idx)),
|
| 104 |
'color': get_node_colors(selected, is_driver=True),
|
|
@@ -117,7 +117,7 @@ def generate_network_html(network_data, threshold, max_l1_nodes,
|
|
| 117 |
l1_nodes.append(attr)
|
| 118 |
cat = attr_to_cat_idx.get(attr, 100)
|
| 119 |
nodes.append({
|
| 120 |
-
'id': attr, 'label': wrap_label(attr)
|
| 121 |
'level': 1, 'value': int(cat),
|
| 122 |
'title': attr + ' — Category Index: ' + str(int(cat)) + ', Correlation: ' + f'{val:.1f}',
|
| 123 |
'color': get_node_colors(attr),
|
|
@@ -146,7 +146,7 @@ def generate_network_html(network_data, threshold, max_l1_nodes,
|
|
| 146 |
if attr not in l2_added:
|
| 147 |
cat = attr_to_cat_idx.get(attr, 100)
|
| 148 |
nodes.append({
|
| 149 |
-
'id': attr, 'label': wrap_label(attr)
|
| 150 |
'level': 2, 'value': int(cat),
|
| 151 |
'title': attr + ' — Category Index: ' + str(int(cat)) + ', Correlation: ' + f'{val:.1f}',
|
| 152 |
'color': get_node_colors(attr),
|
|
@@ -289,7 +289,7 @@ function draw(id) {{
|
|
| 289 |
var options = {{
|
| 290 |
nodes: {{
|
| 291 |
shape: 'box',
|
| 292 |
-
scaling: {{ min:
|
| 293 |
font: {{ size: 14, face: '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif', multi: 'md' }},
|
| 294 |
margin: {{ top: 8, bottom: 8, left: 12, right: 12 }},
|
| 295 |
shadow: {{ enabled: true, color: 'rgba(0,0,0,0.08)', size: 6, x: 0, y: 2 }},
|
|
|
|
| 98 |
cat_idx = attr_to_cat_idx.get(selected, 100)
|
| 99 |
nodes.append({
|
| 100 |
'id': selected,
|
| 101 |
+
'label': wrap_label(selected),
|
| 102 |
'level': 0, 'value': int(cat_idx),
|
| 103 |
'title': selected + ' — Category Index: ' + str(int(cat_idx)),
|
| 104 |
'color': get_node_colors(selected, is_driver=True),
|
|
|
|
| 117 |
l1_nodes.append(attr)
|
| 118 |
cat = attr_to_cat_idx.get(attr, 100)
|
| 119 |
nodes.append({
|
| 120 |
+
'id': attr, 'label': wrap_label(attr),
|
| 121 |
'level': 1, 'value': int(cat),
|
| 122 |
'title': attr + ' — Category Index: ' + str(int(cat)) + ', Correlation: ' + f'{val:.1f}',
|
| 123 |
'color': get_node_colors(attr),
|
|
|
|
| 146 |
if attr not in l2_added:
|
| 147 |
cat = attr_to_cat_idx.get(attr, 100)
|
| 148 |
nodes.append({
|
| 149 |
+
'id': attr, 'label': wrap_label(attr),
|
| 150 |
'level': 2, 'value': int(cat),
|
| 151 |
'title': attr + ' — Category Index: ' + str(int(cat)) + ', Correlation: ' + f'{val:.1f}',
|
| 152 |
'color': get_node_colors(attr),
|
|
|
|
| 289 |
var options = {{
|
| 290 |
nodes: {{
|
| 291 |
shape: 'box',
|
| 292 |
+
scaling: {{ min: 40, max: 90, label: {{ enabled: true, min: 14, max: 18 }} }},
|
| 293 |
font: {{ size: 14, face: '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif', multi: 'md' }},
|
| 294 |
margin: {{ top: 8, bottom: 8, left: 12, right: 12 }},
|
| 295 |
shadow: {{ enabled: true, color: 'rgba(0,0,0,0.08)', size: 6, x: 0, y: 2 }},
|