From 0d765f29d4d98cb085d8c067acf4d2249b541c6e Mon Sep 17 00:00:00 2001 From: mguetlein Date: Thu, 26 May 2011 14:15:54 +0200 Subject: fixes in reports for crossvaldiation with few predictions --- report/report_content.rb | 6 ++---- report/xml_report.rb | 16 +++++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/report/report_content.rb b/report/report_content.rb index a554881..d45d736 100755 --- a/report/report_content.rb +++ b/report/report_content.rb @@ -164,8 +164,7 @@ class Reports::ReportContent accept_value, split_set_attribute=nil, image_title = "ROC Plot", - section_text=nil, - image_caption=nil) + section_text="") #section_roc = @xml_report.add_section(@current_section, section_title) section_roc = @current_section @@ -282,8 +281,7 @@ class Reports::ReportContent value_attributes, section_title="Bar Plot", section_text=nil, - image_title="Bar Plot", - image_caption=nil) + image_title="Bar Plot") section_bar = @xml_report.add_section(@current_section, section_title) @xml_report.add_paragraph(section_bar, section_text) if section_text diff --git a/report/xml_report.rb b/report/xml_report.rb index c2dd300..ab3098e 100755 --- a/report/xml_report.rb +++ b/report/xml_report.rb @@ -133,16 +133,18 @@ module Reports return figure end - # bit of a hack to algin the last two elements that have been added to element into one row - def align_last_two_elements( element, title ) + # bit of a hack to algin the last two figures that have been added to element into one row + def align_last_two_figures( element, title ) imgs = [] - element.elements.each do |e| + element.elements.each do |e| imgs[0] = imgs[1] - imgs[1] = e + imgs[1] = e if e.name=="figure" + end + if (imgs[0] and imgs[1]) + element.delete_element imgs[0] + element.delete_element imgs[1] + add_imagefigures_in_row( element, imgs, title ) end - element.delete_element imgs[0] - element.delete_element imgs[1] - add_imagefigures_in_row( element, imgs, title ) end def add_imagefigures_in_row( element, imagefigures, title ) -- cgit v1.2.3