1414 <!-- Font Awesome -->
1515 < link rel ="stylesheet " href ="https://use.fontawesome.com/releases/v5.8.2/css/all.css ">
1616
17- < title > CaMicroscope Data Table </ title >
17+ < title > caMicroscope - Information Dashboard </ title >
1818
1919 < script src ="https://code.jquery.com/jquery-3.4.1.slim.min.js " integrity ="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n " crossorigin ="anonymous "> </ script >
2020
3838 < link rel ="stylesheet " href ="./table.css " />
3939 < link rel ="stylesheet " href ="./info.css " />
4040 < link rel ="shortcut icon " type ="image/x-icon " href ="/apps/landing/favicon.png ">
41+ < link href ="https://fonts.googleapis.com/icon?family=Material+Icons " rel ="stylesheet ">
42+
43+ < style >
44+ .skip-to-content {
45+ position : absolute;
46+ top : -40px ;
47+ left : 0 ;
48+ background : # 212529 ;
49+ color : white;
50+ padding : 8px ;
51+ z-index : 100 ;
52+ transition : top 0.3s ;
53+ }
54+ .skip-to-content : focus {
55+ top : 0 ;
56+ }
57+ </ style >
58+
4159</ head >
4260
4361< body >
62+ < a href ="#main-content " class ="skip-to-content "> Skip to main content</ a >
4463 < div class ="page-container ">
4564 < div >
4665 < nav class ="navbar navbar-expand-lg navbar-dark fixed-top bg-dark " style ="position: sticky; margin-top: -4em; ">
7089 </ div >
7190 </ nav >
7291
73- < div class ="header text-center text-white bg-info p-4 ">
92+ < main id ="main-content ">
93+ < div class ="header text-center text-white bg-dark p-4 ">
7494 < h1 class ="h1 "> caMicroscope</ h1 >
7595 < p style ="font-weight: bold; font-size: 14pt; "> Digital pathology image viewer with support for human/machine generated annotations and markups.</ p >
7696 < div style ="align-content: center; ">
7797 < div class ="btn-group " role ="group ">
78- < a href ="./table.html "> < button style ="border-color: white; border-radius: 5px 0 0 5px; " type ="button " class ="btn btn-secondary bg-info text-light " title ="Slides Table "> < i class ="fas fa-list-alt "> </ i > Slides</ button > </ a >
98+ < a href ="./table.html "> < button style ="border-color: white; border-radius: 5px 0 0 5px; " type ="button " class ="btn btn-secondary bg-dark text-light " title ="Slides Table "> < i class ="fas fa-list-alt "> </ i > Slides</ button > </ a >
7999 < button type ="button " style ="border-color: white; " class ="btn btn-secondary bg-white text-dark " title ="Information Dashboard "> < i class ="fas fa-info-circle "> </ i > Info</ button >
80100 </ div >
81101 </ div >
@@ -103,6 +123,7 @@ <h4 class="card-title text-center">Synopsis</h4><hr class="mt-0">
103123 </ div >
104124 </ div >
105125 </ div >
126+
106127 < div class ="alert alert-info " role ="alert ">
107128
108129 < h4 style ="text-align:center "> Annotations</ h4 > < hr class ="mt-0 ">
@@ -151,6 +172,8 @@ <h3 class="text-center h3 mb-2" style="margin-top:8px;margin-bottom:10px;">Infor
151172 </ div >
152173</ div >
153174</ div >
175+ </ main >
176+
154177
155178<!-- footer -->
156179< footer id ="footer-layout "> </ footer >
@@ -207,11 +230,37 @@ <h3 class="text-center h3 mb-2" style="margin-top:8px;margin-bottom:10px;">Infor
207230 else {
208231 heatdisp = "<i class='fas fa-check' style='color:green;'></i>"
209232 }
210- var button = `<td> <button class=\"btn btn-primary\" data-id='${ allSlides . length } ' onclick='openDetails(this)'>Details</button></td>`
211- var markup = "<tr><td>" + JSONdata . id + "</td><td>" + JSONdata . name + "</td><td>" + annodisp + "</td><td>" + heatdisp + "</td>" + button + "</tr>"
233+ var button = `<td> <button class=\"btn btn-primary btn-sm\" data-id='${ allSlides . length } ' onclick='openDetails(this)'>Details</button></td>`
234+ const visualization_button = `<td>
235+ <button class="btn btn-success btn-sm" data-id='${ JSONdata . id } ' onclick='openView(this)'>VisualGraph</span></button>
236+ </button></td>`
237+ var markup = "<tr><td>" + JSONdata . id + "</td><td>" + JSONdata . name + "</td><td>" + annodisp + "</td><td>" + heatdisp + "</td><td>" + button + visualization_button + "</td></tr>"
212238 table . append ( markup ) ;
213239}
214240
241+ function openView ( e ) {
242+ const oid = e . dataset . id ;
243+ console . log ( oid ) ;
244+ if ( oid ) {
245+ window . location . href = `./visualization-dashboard.html?slideId=${ sanitize ( oid ) } ` ;
246+ } else {
247+ alert ( 'No Data Id' ) ;
248+ }
249+ }
250+
251+ function sanitize ( string ) {
252+ string = string || '' ;
253+ const map = {
254+ '&' : '&' ,
255+ '<' : '<' ,
256+ '>' : '>' ,
257+ '"' : '"' ,
258+ '\'' : ''' ,
259+ '/' : '/' ,
260+ } ;
261+ const reg = / [ & < > " ' / ] / ig;
262+ return string . replace ( reg , ( match ) => ( map [ match ] ) ) ;
263+ }
215264function openDetails ( tag ) {
216265 document . getElementById ( 'detail-dialog' ) . style . display = 'block' ;
217266 document . getElementById ( 'detail-dialog' ) . style . opacity = '1' ;
@@ -229,9 +278,9 @@ <h3 class="text-center h3 mb-2" style="margin-top:8px;margin-bottom:10px;">Infor
229278 table . append ( content ) ;
230279 addAnnotations ( allSlides [ count ] . annotations ) ;
231280 addHeatmaps ( allSlides [ count ] . heatmap ) ;
232- console . log ( allSlides [ count ] ) ;
281+ console . log ( allSlides [ count ] , count ) ;
233282}
234-
283+
235284function addAnnotations ( content ) {
236285 if ( content . length === 0 ) {
237286 return ;
@@ -441,7 +490,7 @@ <h3 class="text-center h3 mb-2" style="margin-top:8px;margin-bottom:10px;">Infor
441490 addbody ( JSONdata ) ;
442491 } ) ;
443492 } ) ;
444- // console.log(JSONdata);
493+ // console.log(JSONdata);
445494 }
446495 } ) ;
447496}
0 commit comments