-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3D-Visualization.html
More file actions
executable file
·159 lines (143 loc) · 5.68 KB
/
3D-Visualization.html
File metadata and controls
executable file
·159 lines (143 loc) · 5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!-- Copyright (c) 2023, Gonçalo Lopes -->
<!-- Contact: galopes@dei.uc.pt -->
<!-- All rights reserved. -->
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="3D Visualization of Non-dominated Solutions - Interactive Plotly visualization for multi-objective optimization">
<title>3D Visualizer | Pareto Front Explorer</title>
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
rel="stylesheet">
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="style/style.css">
<!-- Plotly -->
<script src="https://cdn.plot.ly/plotly-2.27.0.min.js"></script>
</head>
<body>
<!-- Toast Container -->
<div id="toast-container" class="toast-container" aria-live="polite" aria-atomic="true"></div>
<!-- Header -->
<header class="header">
<h1>3D Visualizer</h1>
<p class="subtitle">Explore non-dominated solutions in 3D space</p>
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme" title="Toggle dark/light mode">
🌙
</button>
</header>
<!-- Main Container -->
<main class="container">
<!-- Controls Panel -->
<aside class="controls">
<!-- Points Display -->
<section class="glass-card">
<h2 class="card-header">Points Overview</h2>
<div class="scroll-views">
<div class="scroll-view-container">
<h3 class="scroll-view-header">Reference Points</h3>
<div id="ref_points" class="scroll-view" role="list" aria-label="Reference points list">
<!-- Reference points will be populated here -->
</div>
</div>
<div class="scroll-view-container">
<h3 class="scroll-view-header">Solution Points</h3>
<div id="sol_points" class="scroll-view" role="list" aria-label="Solution points list">
<!-- Solution points will be populated here -->
</div>
</div>
</div>
</section>
<!-- Solution Input -->
<section class="glass-card">
<h2 class="card-header">Add Solution</h2>
<div class="input-group">
<div class="input-row">
<div class="input-wrapper">
<label for="size_x">X Axis</label>
<input type="number" id="size_x" value="50" min="0" max="100" step="1" aria-describedby="input-help">
</div>
<div class="input-wrapper">
<label for="size_y">Y Axis</label>
<input type="number" id="size_y" value="50" min="0" max="100" step="1">
</div>
<div class="input-wrapper">
<label for="size_z">Z Axis</label>
<input type="number" id="size_z" value="50" min="0" max="100" step="1">
</div>
</div>
<p id="input-help" class="visually-hidden">Enter values between 0 and 100 for each axis</p>
</div>
<div class="button-group" style="margin-top: 1rem;">
<button id="update_button" class="btn-primary" type="button">
<span>➕</span> Add Solution
</button>
<button id="remove_button" class="btn-danger" type="button">
<span>↩️</span> Remove Previous
</button>
</div>
</section>
<!-- File Import -->
<section class="glass-card">
<h2 class="card-header">Import Data</h2>
<div class="file-input-wrapper">
<input type="file" id="file_input" accept=".csv,.txt" aria-label="Import CSV file">
<label for="file_input" class="file-input-label">
<span>📁</span> Choose CSV File
</label>
</div>
<p style="font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; text-align: center;">
Format: x,y,z per line
</p>
</section>
<!-- Clear All -->
<button id="clear_button" class="btn-secondary" type="button" style="width: 100%;">
<span>🗑️</span> Clear All Solutions
</button>
</aside>
<!-- 3D Plot -->
<section class="plot-container">
<!-- View Controls -->
<div class="view-controls">
<button id="view-3d" class="view-btn active" title="Default 3D perspective">🎲 3D</button>
<button id="view-xy" class="view-btn" title="View from Z axis (X-Y plane)">⬆️ Top (XY)</button>
<button id="view-xz" class="view-btn" title="View from Y axis (X-Z plane)">➡️ Front (XZ)</button>
<button id="view-yz" class="view-btn" title="View from X axis (Y-Z plane)">⬅️ Side (YZ)</button>
</div>
<!-- Plot Wrapper -->
<div class="plot-wrapper">
<div id="plotly_3d_cube" role="img" aria-label="3D visualization of non-dominated solutions"></div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="footer">
<p>© 2023-2024 <a href="mailto:galopes@dei.uc.pt">Gonçalo Lopes</a>. Built with Plotly.</p>
</footer>
<!-- Scripts -->
<script src="script/Point.js"></script>
<script src="script/State.js"></script>
<script src="script/Utils.js"></script>
<script src="script/App.js"></script>
<script src="script/Plotly.js"></script>
<!-- Accessibility: Visually hidden class -->
<style>
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
</style>
</body>
</html>