Skip to content

Commit 2ddb3b0

Browse files
committed
Add mock plots
1 parent 80477be commit 2ddb3b0

File tree

6 files changed

+477
-228
lines changed

6 files changed

+477
-228
lines changed

css/styles.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,42 @@ body.dark-mode circle[class*="selection"] {
338338
margin: 20px;
339339
break-inside: avoid;
340340
}
341+
}
342+
343+
.history-plot {
344+
background: white;
345+
border: 1px solid #ddd;
346+
border-radius: 4px;
347+
padding: 15px;
348+
margin: 10px 0;
349+
overflow: hidden;
350+
}
351+
352+
.history-plot svg {
353+
width: 100%;
354+
height: auto;
355+
min-height: 200px;
356+
}
357+
358+
/* Dark mode support */
359+
body.dark-mode .history-plot {
360+
background: #2d2d2d;
361+
border-color: #404040;
362+
}
363+
364+
body.dark-mode .history-plot svg {
365+
filter: invert(1) hue-rotate(180deg);
366+
}
367+
368+
/* Make sure SVG text remains readable in dark mode */
369+
body.dark-mode .history-plot svg text {
370+
fill: #fff;
371+
}
372+
373+
/* Print optimization */
374+
@media print {
375+
.history-plot {
376+
break-inside: avoid;
377+
border: 1px solid #999;
378+
}
341379
}

index-mock.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<!-- index-mock.html (mock data) -->
21
<!DOCTYPE html>
32
<html lang="en">
43
<head>
@@ -28,10 +27,13 @@
2827
window.USE_MOCK_DATA = true;
2928
</script>
3029

30+
<!-- Load the combined mock data generator first -->
31+
<script src="js/MockDataGenerator.js"></script>
32+
33+
<!-- Then load the rest of the application -->
3134
<script src="js/DetailsPanelManager.js"></script>
3235
<script src="js/NetworkStats.js"></script>
3336
<script src="js/NetworkVisualizer.js"></script>
34-
<script src="js/MockNetworkDataGenerator.js"></script>
3537
<script src="js/init.js"></script>
3638
</body>
3739
</html>

js/DetailsPanelManager.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ class DetailsPanelManager {
129129
</tr>
130130
</table>
131131
</div>
132+
<div class="detail-section">
133+
<h3>${metricTitle} History</h3>
134+
<div class="history-plot">
135+
${node.metrics.historyPlot || 'No historical data available'}
136+
</div>
137+
</div>
132138
<div class="detail-section">
133139
<h3>Cluster ${metricTitle} Summary</h3>
134140
<table>
@@ -154,7 +160,6 @@ class DetailsPanelManager {
154160
`;
155161
}
156162

157-
158163
updateLeafNodeDetails(node) {
159164
const metricName = this.config.visualization.metric;
160165
const metricTitle = metricName.charAt(0).toUpperCase() + metricName.slice(1);
@@ -178,9 +183,9 @@ class DetailsPanelManager {
178183
</table>
179184
</div>
180185
<div class="detail-section">
181-
<h3>Historical ${metricTitle}</h3>
182-
<div class="chart-container">
183-
[Historical ${metricTitle.toLowerCase()} chart placeholder]
186+
<h3>${metricTitle} History</h3>
187+
<div class="history-plot">
188+
${node.metrics.historyPlot || 'No historical data available'}
184189
</div>
185190
</div>
186191
`;
@@ -214,8 +219,8 @@ class DetailsPanelManager {
214219
</div>
215220
<div class="detail-section">
216221
<h3>${metricTitle} History</h3>
217-
<div class="chart-container">
218-
[${metricTitle} history chart placeholder]
222+
<div class="history-plot">
223+
${link.metrics.historyPlot || 'No historical data available'}
219224
</div>
220225
</div>
221226
`;

0 commit comments

Comments
 (0)