-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
191 lines (167 loc) · 8.29 KB
/
index.html
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Incident Analysis</title>
<link rel="icon" href="https://raw.githubusercontent.com/gramener/assets/main/straive-favicon.svg">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" crossorigin="anonymous">
<!-- Bootstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Navigation Bar -->
<nav class="navbar navbar-expand-lg bg-body-tertiary" data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href=".">Incident Analysis</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="btn-group ms-auto">
<a href="#" class="btn btn-outline-primary active" aria-current="page">Incident Analysis</a>
<a href="service_insights.html" class="btn btn-outline-primary">Service Insights</a>
</div>
<div class="nav-item dropdown ms-auto" role="group" aria-label="Toggle dark mode" title="Toggle Dark Mode">
<button class="dark-theme-toggle btn btn-outline-light dropdown-toggle" type="button" data-bs-toggle="dropdown"
aria-expanded="false" aria-label="Toggle theme (auto)">
<i class="bi bi-circle-half"></i> <span class="d-lg-none ms-2">Toggle theme</span>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><button class="dropdown-item" data-bs-theme-value="light"><i class="me-2 bi bi-sun-fill"></i> Light</button></li>
<li><button class="dropdown-item" data-bs-theme-value="dark"><i class="me-2 bi bi-moon-stars-fill"></i> Dark</button></li>
<li><button class="dropdown-item" data-bs-theme-value="auto"><i class="me-2 bi bi-circle-half"></i> Auto</button></li>
</ul>
</div>
</div>
</div>
</nav>
<!-- Main Container -->
<div class="container-fluid">
<!-- Header Section -->
<h1 class="display-1 my-4 text-center">Incident Analysis</h1>
<h2 class="display-6 text-center">What are the main drivers of incidents?</h2>
<!-- Narrative Section -->
<div class="mx-auto my-3 narrative">
<p>This application is designed for incident analysis, allowing users to upload CSV files containing incident data and service impact data.</p>
<p>It visualizes the relationships between different incidents and their impacts using Sankey diagrams and network graphs.</p>
<p>You can use sample data from <a href="https://drive.google.com/drive/folders/1qJXojKTsVfXAPVLApNV17tvY1Keexc0C">this folder</a> if you have access.</p>
</div>
<!-- Upload Form -->
<form id="upload" class="container mt-5">
<div class="row">
<div class="col-md mb-3">
<label for="incidents" class="form-label">Upload <strong>Incidents</strong> .CSV</label>
<input class="form-control" type="file" id="incidents" name="incidents" accept=".csv" />
<p class="form-text"><em>Columns</em>: Service, Shift, Region, Team, Count, Hours, Date</p>
</div>
<div class="col-md mb-3">
<label for="relations" class="form-label">Upload <strong>Service Impact</strong> .CSV</label>
<input class="form-control" type="file" id="relations" name="relations" accept=".csv" />
<p class="form-text"><em>Columns</em>: Source, Target</p>
</div>
</div>
</form>
<!-- Filters Section -->
<div id="filters" class="row mb-5">
<!-- Filter Dropdowns will be dynamically generated here -->
</div>
<!-- Result Section (Initially Hidden) -->
<div id="result" class="d-none">
<div class="container">
<div class="row g-2 mb-4">
<!-- Toggle Links Checkbox -->
<div class="col-md flex-grow-0">
<label class="form-check-label text-nowrap" for="show-links">Show links</label>
<div class="form-check form-switch mt-2">
<input class="form-check-input" type="checkbox" role="switch" id="show-links">
</div>
</div>
<!-- Threshold Slider -->
<div class="col-md">
<label for="threshold" class="form-label">Filter by incident duration (hours)</label>
<input type="range" class="form-range" id="threshold" min="0" max="10" step="0.1" value="3" list="tickmarks">
<div id="threshold-value">Threshold: <span id="threshold-display">3</span> hours</div>
</div>
<!-- Reset Filters Button -->
<div class="col-md flex-grow-0">
<button class="btn btn-outline-primary" id="reset-filters" title="Reset Filters">
<i class="bi bi-arrow-clockwise"></i>
</button>
</div>
</div>
<!-- Tick Marks for Threshold Slider -->
<datalist id="tickmarks">
<option value="0" label="0h"></option>
<option value="1" label="1h"></option>
<option value="2" label="2h"></option>
<option value="3" label="3h"></option>
<option value="4" label="4h"></option>
<option value="5" label="5h"></option>
<option value="6" label="6h"></option>
<option value="7" label="7h"></option>
<option value="8" label="8h"></option>
<option value="9" label="9h"></option>
<option value="10" label="10h"></option>
</datalist>
</div>
<!-- Sankey Diagram -->
<svg width="1000" height="400" id="sankey" fill="currentColor" class="d-block mx-auto"></svg>
<!-- Network Graph -->
<svg width="1000" height="1000" id="network" fill="currentColor" class="d-block mx-auto">
<defs>
<marker
id="triangle"
viewBox="0 0 10 10"
refX="20"
refY="5"
markerUnits="strokeWidth"
markerWidth="5"
markerHeight="5"
orient="auto">
<path d="M 0 0 L 10 5 L 0 10 z" fill="rgba(128,0,0,0.2)" />
</marker>
</defs>
</svg>
<!-- Ask a Question Section -->
<div class="container mt-5">
<div class="mb-3">
<label for="user-question" class="form-label">Ask a Question:</label>
<textarea class="form-control" id="user-question" rows="3" placeholder="Type your question here..."></textarea>
</div>
<button class="btn btn-secondary btn-lg d-block mx-auto mb-4" id="ask-question">Ask Question</button>
</div>
<!-- Summarize Button -->
<button class="btn btn-primary btn-lg d-block mx-auto" id="summarize">Analyze and Summarize</button>
<!-- Summary Section -->
<section id="summary" class="narrative mx-auto mt-5"></section>
</div>
<!-- Footer -->
<footer class="my-5 vh-100 d-flex align-items-center justify-content-center">
<h1 class="display-4">Designed by <a href="https://gramener.com/" class="text-reset link-offset-3 link-underline link-underline-opacity-25">Gramener</a></h1>
</footer>
<!-- Modal (If Needed) -->
<div class="modal" tabindex="-1" id="snippet-modal">
<div class="modal-dialog">
<div class="modal-content" id="snippet-modal">
<div class="modal-header">
<h5 class="modal-title" id="snippet-modal-title"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="snippet-modal-body"></div>
</div>
</div>
</div>
</div>
<!-- Bootstrap Bundle JS (includes Popper) -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" type="module"></script>
<!-- Dark Theme Toggle (from @gramex/ui) -->
<script src="https://cdn.jsdelivr.net/npm/@gramex/[email protected]/dist/dark-theme.js" type="module"></script>
<!-- Custom Script -->
<script src="script.js" type="module"></script>
</body>
</html>