hesamation commited on
Commit
278f515
·
1 Parent(s): 1df1529
Files changed (3) hide show
  1. css/style.css +16 -7
  2. index.html +1 -1
  3. js/main.js +39 -2
css/style.css CHANGED
@@ -504,16 +504,25 @@ canvas#sigma_bg_1 {
504
  }
505
 
506
  #attributepane .text .returntext {
507
- color: #007AFF;
508
  cursor: pointer;
509
- margin: 10px 0;
510
- padding: 10px 10px 5px 10px;
511
  font-weight: bold;
512
- border-bottom: 1px solid #ddd;
 
 
 
 
 
 
 
 
513
  }
514
 
515
  #attributepane .text .nodeattributes .nodetype {
516
- font-style: italic;
517
- color: #666;
518
- margin-bottom: 8px;
 
519
  }
 
504
  }
505
 
506
  #attributepane .text .returntext {
507
+ color: #ffffff;
508
  cursor: pointer;
509
+ margin: 10px 0 20px 0;
510
+ padding: 12px;
511
  font-weight: bold;
512
+ font-size: 14px;
513
+ text-align: center;
514
+ background-color: #007AFF;
515
+ border-radius: 4px;
516
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
517
+ }
518
+
519
+ #attributepane .text .returntext:hover {
520
+ background-color: #0056b3;
521
  }
522
 
523
  #attributepane .text .nodeattributes .nodetype {
524
+ color: #333;
525
+ margin-bottom: 12px;
526
+ font-size: 13px;
527
+ display: block;
528
  }
index.html CHANGED
@@ -75,7 +75,7 @@
75
  <div class="returntext">Return to the full network</div>
76
  <div class="nodeattributes">
77
  <div class="name">Select a node to see details</div>
78
- <div class="nodetype"></div>
79
  <div class="data"></div>
80
  <div class="p">Connections:</div>
81
  <div class="link">
 
75
  <div class="returntext">Return to the full network</div>
76
  <div class="nodeattributes">
77
  <div class="name">Select a node to see details</div>
78
+ <div class="nodetype" style="margin-bottom: 12px;"></div>
79
  <div class="data"></div>
80
  <div class="p">Connections:</div>
81
  <div class="link">
js/main.js CHANGED
@@ -171,6 +171,11 @@ function initializeGraph(data) {
171
  color: nodeColor,
172
  type: node.type
173
  });
 
 
 
 
 
174
  }
175
 
176
  // Add edges to the graph
@@ -480,8 +485,40 @@ function nodeActive(nodeId) {
480
  // Set the node name/title
481
  $('.nodeattributes .name').text(selected.label || selected.id);
482
 
483
- // Display the node type
484
- $('.nodeattributes .nodetype').text(selected.type ? 'Type: ' + selected.type : '');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
485
 
486
  // Simplify data display to only show degree
487
  let dataHTML = '';
 
171
  color: nodeColor,
172
  type: node.type
173
  });
174
+
175
+ // Debug output for a few nodes to verify type is set
176
+ if (i < 3) {
177
+ console.log("Added node:", node.id, "with type:", node.type);
178
+ }
179
  }
180
 
181
  // Add edges to the graph
 
485
  // Set the node name/title
486
  $('.nodeattributes .name').text(selected.label || selected.id);
487
 
488
+ // Debug the node object to see what fields are available
489
+ console.log("Selected node:", selected);
490
+ console.log("Node properties:");
491
+ for (let prop in selected) {
492
+ console.log(`- ${prop}: ${selected[prop]}`);
493
+ }
494
+
495
+ // Display the node type by parsing the ID
496
+ let nodeType = null;
497
+
498
+ // Try to parse the node type from the ID (format: type_number)
499
+ if (selected.id && selected.id.includes('_')) {
500
+ const idParts = selected.id.split('_');
501
+ if (idParts.length >= 2) {
502
+ nodeType = idParts[0];
503
+ console.log("Extracted type from ID:", nodeType);
504
+ }
505
+ }
506
+ // Fallbacks if we couldn't get the type from ID
507
+ else if (selected.type) {
508
+ nodeType = selected.type;
509
+ console.log("Node has type directly:", selected.type);
510
+ } else if (selected.attr && selected.attr.type) {
511
+ nodeType = selected.attr.type;
512
+ console.log("Node has type in attr:", selected.attr.type);
513
+ }
514
+
515
+ // Format the type nicely - capitalize first letter
516
+ if (nodeType) {
517
+ nodeType = nodeType.charAt(0).toUpperCase() + nodeType.slice(1);
518
+ $('.nodeattributes .nodetype').text('Type: ' + nodeType).show();
519
+ } else {
520
+ $('.nodeattributes .nodetype').hide();
521
+ }
522
 
523
  // Simplify data display to only show degree
524
  let dataHTML = '';