@@ -229,12 +229,21 @@ string SortOn(int column, string type)
229229 buffer . AppendLine ( "</table></div>" ) ;
230230 }
231231
232- public static void SequenceConsensusOverview ( StringBuilder buffer , List < Dictionary < string , double > > diversity , HelperFunctionality . Annotation [ ] annotation = null )
232+ public static void SequenceConsensusOverview ( StringBuilder buffer , List < Dictionary < string , double > > diversity , string title = null , string help = null , HelperFunctionality . Annotation [ ] annotation = null )
233233 {
234234 const double threshold = 0.05 ;
235235 const int height = 35 ;
236236 const int fontsize = 30 ;
237237
238+ var data_buffer = new StringBuilder ( ) ;
239+ buffer . Append ( "<div class='graph'>" ) ;
240+ if ( title != null )
241+ if ( help != null )
242+ buffer . Append ( CommonPieces . TagWithHelp ( "h2" , title , help ) ) ;
243+ else
244+ buffer . Append ( $ "<h2 class='title'>{ title } </h2>") ;
245+ if ( title != null ) // Bad way of only doing this in the asides and not in the CDR tables
246+ buffer . Append ( "<div class='copy-data' onclick='CopyGraphData()'>Copy Data</div>" ) ;
238247 buffer . Append ( $ "<div class='sequence-logo' style='--sequence-logo-height:{ height } px;--sequence-logo-fontsize:{ fontsize } px;'>") ;
239248 for ( int i = 0 ; i < diversity . Count ; i ++ )
240249 {
@@ -244,6 +253,7 @@ public static void SequenceConsensusOverview(StringBuilder buffer, List<Dictiona
244253 double sum = diversity [ i ] . Values . Sum ( ) ;
245254 var sorted = diversity [ i ] . ToList ( ) ;
246255 sorted . Sort ( ( a , b ) => a . Value . CompareTo ( b . Value ) ) ;
256+ data_buffer . Append ( $ "{ i } ") ;
247257
248258 bool placed = false ;
249259 foreach ( var item in sorted )
@@ -255,13 +265,18 @@ public static void SequenceConsensusOverview(StringBuilder buffer, List<Dictiona
255265 buffer . Append ( $ "<span style='font-size:{ size } px;transform:scaleX({ inverse_size } )'>{ item . Key } </span>") ;
256266 placed = true ;
257267 }
268+ data_buffer . Append ( $ "\t { item . Key } \t { item . Value . ToString ( System . Globalization . CultureInfo . GetCultureInfo ( "en-GB" ) ) } ") ;
258269 }
259270 if ( ! placed )
260271 buffer . Append ( $ "<span>.</span>") ;
261272
262273 buffer . Append ( "</div>" ) ;
274+ data_buffer . Append ( "\n " ) ;
263275 }
264276 buffer . Append ( "</div>" ) ;
277+ if ( title == null ) // Bad way of only doing this in the CDR tables and not in the asides
278+ buffer . Append ( "<div class='copy-data' onclick='CopyGraphData()'>Copy Data</div>" ) ;
279+ buffer . Append ( $ "<textarea type='text' class='graph-data' aria-hidden='true'>{ data_buffer . ToString ( ) } </textarea></div>") ;
265280 }
266281
267282 public static void TableHeader ( StringBuilder buffer , List < Template > templates , int totalReads )
0 commit comments