From 29ff8062342bbbf36f465704ca096c0abdc0366e Mon Sep 17 00:00:00 2001 From: Tomaz Hocevar Date: Mon, 23 Jul 2018 12:57:20 +0200 Subject: [PATCH] OWWordCloud: Add the word cloud image to the report. --- orangecontrib/text/widgets/owwordcloud.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/orangecontrib/text/widgets/owwordcloud.py b/orangecontrib/text/widgets/owwordcloud.py index 53db64a7b..6110fce4b 100644 --- a/orangecontrib/text/widgets/owwordcloud.py +++ b/orangecontrib/text/widgets/owwordcloud.py @@ -297,6 +297,16 @@ def commit(self): self.Outputs.selected_words.send(topic) def send_report(self): + html = self.webview.html() + start = html.index('>', html.index('') + body = html[start:end] + # create an empty div of appropriate height to compensate for + # absolute positioning of words in the html + height = self.webview._evalJS("document.getElementById('canvas').clientHeight") + self.report_html += '
{}
'.format( + height, body) + self.report_table(self.tableview)