Spaces:
Running
Running
Update templates/index.html
Browse files- templates/index.html +5 -2
templates/index.html
CHANGED
@@ -61,7 +61,7 @@
|
|
61 |
const y = vector[1] * 10; // level
|
62 |
const z = vector[2] * 100; // center_pos
|
63 |
positions.push(x, y, z);
|
64 |
-
colors.push(1, 0.5, 0); // Orange points
|
65 |
part.pointIndex = index * 3; // Store index for lookup
|
66 |
});
|
67 |
|
@@ -80,7 +80,6 @@
|
|
80 |
canvas.addEventListener('mousedown', onMouseDown);
|
81 |
canvas.addEventListener('mousemove', onMouseMove);
|
82 |
canvas.addEventListener('mouseup', onMouseUp);
|
83 |
-
animate();
|
84 |
}
|
85 |
|
86 |
function animate() {
|
@@ -112,6 +111,8 @@
|
|
112 |
const part = window.parts.find(p => p.pointIndex === index * 3);
|
113 |
if (part && hoveredPoint !== part) {
|
114 |
hoveredPoint = part;
|
|
|
|
|
115 |
pointDetails.innerHTML = `
|
116 |
<div class="text-gray-200">
|
117 |
<strong>Category:</strong> ${part.category}<br>
|
@@ -119,6 +120,8 @@
|
|
119 |
<strong>Parent Path:</strong> ${part.parent_path}<br>
|
120 |
<strong>Level:</strong> ${part.level}<br>
|
121 |
<strong>Location:</strong> Lines ${part.location[0]} to ${part.location[1]}<br>
|
|
|
|
|
122 |
<strong>Vector:</strong> [${part.vector.join(', ')}]<br>
|
123 |
<strong>Code:</strong><pre class="text-xs text-gray-300">${part.source}</pre>
|
124 |
</div>
|
|
|
61 |
const y = vector[1] * 10; // level
|
62 |
const z = vector[2] * 100; // center_pos
|
63 |
positions.push(x, y, z);
|
64 |
+
colors.push(1, 0.5, 0); // Orange points (can vary by category)
|
65 |
part.pointIndex = index * 3; // Store index for lookup
|
66 |
});
|
67 |
|
|
|
80 |
canvas.addEventListener('mousedown', onMouseDown);
|
81 |
canvas.addEventListener('mousemove', onMouseMove);
|
82 |
canvas.addEventListener('mouseup', onMouseUp);
|
|
|
83 |
}
|
84 |
|
85 |
function animate() {
|
|
|
111 |
const part = window.parts.find(p => p.pointIndex === index * 3);
|
112 |
if (part && hoveredPoint !== part) {
|
113 |
hoveredPoint = part;
|
114 |
+
const variableRole = part.vector[6] === 0 ? '-' : ['Input', 'Assigned', 'Returned'][part.vector[6] - 1];
|
115 |
+
const variableName = part.vector[7] === 0 ? '-' : (part.vector[7] * 1000).toFixed(3); // Reconstruct hash
|
116 |
pointDetails.innerHTML = `
|
117 |
<div class="text-gray-200">
|
118 |
<strong>Category:</strong> ${part.category}<br>
|
|
|
120 |
<strong>Parent Path:</strong> ${part.parent_path}<br>
|
121 |
<strong>Level:</strong> ${part.level}<br>
|
122 |
<strong>Location:</strong> Lines ${part.location[0]} to ${part.location[1]}<br>
|
123 |
+
<strong>Variable Role:</strong> ${variableRole}<br>
|
124 |
+
<strong>Variable Name:</strong> ${variableName}<br>
|
125 |
<strong>Vector:</strong> [${part.vector.join(', ')}]<br>
|
126 |
<strong>Code:</strong><pre class="text-xs text-gray-300">${part.source}</pre>
|
127 |
</div>
|