@@ -72,15 +72,29 @@ const AnalysisDataComponent: FunctionComponent<IAnalysisDataProps> = ({ data })
7272 const formatCoverageData = ( ) => {
7373 const refs = [ ...new Set ( coverageData . map ( d => d . reference ) ) ] ;
7474 const times = [ ...new Set ( coverageData . map ( d => d . timestamp ) ) ] . sort ( ) ;
75- const header = [ "Time" , ...refs ] ;
75+ const startTime = new Date ( times [ 0 ] ) . getTime ( ) ; // Earliest timestamp in milliseconds
76+
77+ // Define the header with column types and roles
78+ const header = [ { type : 'number' , label : 'Elapsed Time (s)' } ] ;
79+ refs . forEach ( ref => {
80+ header . push ( { type : 'number' , label : ref } ) ;
81+ header . push ( { type : 'string' , role : 'tooltip' } ) ;
82+ } ) ;
83+
84+ // Create data rows with elapsed time and tooltips
7685 const rows = times . map ( time => {
77- const row = [ time ] ;
86+ const elapsedSeconds = ( new Date ( time ) . getTime ( ) - startTime ) / 1000 ; // Convert to seconds
87+ const row = [ elapsedSeconds ] ;
7888 refs . forEach ( ref => {
7989 const entry = coverageData . find ( d => d . timestamp === time && d . reference === ref ) ;
80- row . push ( entry ? entry [ metric ] : 0 ) ;
90+ const y = entry ? entry [ metric ] : 0 ;
91+ const tooltip = `Time: ${ time } \n${ ref } : ${ y . toFixed ( 2 ) } ` ;
92+ row . push ( y ) ;
93+ row . push ( tooltip ) ;
8194 } ) ;
8295 return row ;
8396 } ) ;
97+
8498 return [ header , ...rows ] ;
8599 } ;
86100
@@ -137,7 +151,7 @@ const AnalysisDataComponent: FunctionComponent<IAnalysisDataProps> = ({ data })
137151 </ div >
138152 < div className = "nano-info-item" >
139153 < span className = "nano-info-label" > MinION Path</ span >
140- < span className = "nano-info-value" > { analysisData . data . minion } </ span >
154+ < span className = "nano-info-value" > { analysisData . data . minion . split ( "/" ) . filter ( component => component !== '' ) . join ( ' ➩ ' ) } </ span >
141155 </ div >
142156 < div className = "nano-info-item" >
143157 < span className = "nano-info-label" > Device</ span >
@@ -154,11 +168,11 @@ const AnalysisDataComponent: FunctionComponent<IAnalysisDataProps> = ({ data })
154168 < div className = "nano-actions" >
155169 { listenerRunning ? (
156170 < button className = "btn btn-danger nano-btn" onClick = { handleStopFileListener } >
157- < i className = "fas fa-stop" > </ i > Stop File Listener
171+ < i className = "fas fa-stop" > </ i > Stop Analysis
158172 </ button >
159173 ) : (
160174 < button className = "btn btn-primary nano-btn" onClick = { handleStartFileListener } >
161- < i className = "fas fa-play" > </ i > Start File Listener
175+ < i className = "fas fa-play" > </ i > Start Analysis
162176 </ button >
163177 ) }
164178 < button className = "btn btn-outline-danger nano-btn" onClick = { handleRemoveAnalysis } >
@@ -188,13 +202,13 @@ const AnalysisDataComponent: FunctionComponent<IAnalysisDataProps> = ({ data })
188202 data = { formatCoverageData ( ) }
189203 options = { {
190204 title : metric === 'avg_depth' ? 'Average Coverage Depth Over Time' : 'Breadth of Coverage Over Time' ,
191- hAxis : { title : " Time" } ,
205+ hAxis : { title : 'Elapsed Time (s)' } ,
192206 vAxis : {
193207 title : metric === 'avg_depth' ? 'Average Depth (reads/position)' : 'Breadth (%)' ,
194208 minValue : 0 ,
195209 maxValue : metric === 'breadth' ? 100 : undefined
196210 } ,
197- legend : { position : " bottom" } ,
211+ legend : { position : ' bottom' } ,
198212 colors : [ '#00B0BD' , '#004E5A' , '#FF6A45' , '#27AE60' ] ,
199213 chartArea : { width : '80%' , height : '70%' } ,
200214 animation : { startup : true , duration : 1000 , easing : 'out' }
0 commit comments