...
authorPierre <ratinaud@univ-tlse2.fr>
Sun, 7 Oct 2012 20:38:29 +0000 (22:38 +0200)
committerPierre <ratinaud@univ-tlse2.fr>
Sun, 7 Oct 2012 20:38:29 +0000 (22:38 +0200)
15 files changed:
PrintRScript.py
agw/__init__.pyc
agw/aui/__init__.pyc
agw/aui/aui_constants.pyc
agw/aui/aui_utilities.pyc
agw/aui/auibar.pyc
agw/aui/auibook.pyc
agw/aui/dockart.pyc
agw/aui/framemanager.pyc
agw/aui/tabart.pyc
agw/aui/tabmdi.pyc
dialog.py
layout.py
openanalyse.py
textwordcloud.py

index 1bb0af1..7a847a6 100644 (file)
@@ -919,7 +919,8 @@ class WordCloudRScript(PrintRScript) :
         txt = """
         act <- read.csv2("%s", header = FALSE, row.names=1, sep='\t')
         selected.col <- read.table("%s")
-        toprint <- act[selected.col[,1] + 1,]
+        toprint <- as.matrix(act[selected.col[,1] + 1,])
+        rownames(toprint) <- rownames(act)[selected.col[,1] + 1]
         open_file_graph("%s", width = %i, height = %i)
         par(bg=rgb%s)
         wordcloud(row.names(toprint), toprint[,1], scale=c(%f,%f), random.order=FALSE, colors=rgb%s)
index 6a5d9da..8d7fb76 100644 (file)
Binary files a/agw/__init__.pyc and b/agw/__init__.pyc differ
index 7cdf89c..f0da19d 100644 (file)
Binary files a/agw/aui/__init__.pyc and b/agw/aui/__init__.pyc differ
index e0b3970..23a2fce 100644 (file)
Binary files a/agw/aui/aui_constants.pyc and b/agw/aui/aui_constants.pyc differ
index 668e991..d858021 100644 (file)
Binary files a/agw/aui/aui_utilities.pyc and b/agw/aui/aui_utilities.pyc differ
index a1d1e83..39cc8c3 100644 (file)
Binary files a/agw/aui/auibar.pyc and b/agw/aui/auibar.pyc differ
index 4ebed30..bb381c8 100644 (file)
Binary files a/agw/aui/auibook.pyc and b/agw/aui/auibook.pyc differ
index a37845f..46905c7 100644 (file)
Binary files a/agw/aui/dockart.pyc and b/agw/aui/dockart.pyc differ
index 5e3b7ad..8d18ab2 100644 (file)
Binary files a/agw/aui/framemanager.pyc and b/agw/aui/framemanager.pyc differ
index 9d1d42e..f5d1564 100644 (file)
Binary files a/agw/aui/tabart.pyc and b/agw/aui/tabart.pyc differ
index 5d41692..d16d22c 100644 (file)
Binary files a/agw/aui/tabmdi.pyc and b/agw/aui/tabmdi.pyc differ
index d85a241..79ad5f9 100755 (executable)
--- a/dialog.py
+++ b/dialog.py
@@ -2494,18 +2494,18 @@ class PrefWordCloud ( wx.Dialog ):
         fgSizer1.SetFlexibleDirection( wx.BOTH )
         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
         
-        self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les formes", wx.DefaultPosition, wx.DefaultSize, 0 )
-        self.m_staticText1.Wrap( -1 )
-        fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
+        #self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les formes", wx.DefaultPosition, wx.DefaultSize, 0 )
+        #self.m_staticText1.Wrap( -1 )
+        #fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
         
-        self.but_selectcol = wx.Button( self, wx.ID_ANY, u"Sélectionner", wx.DefaultPosition, wx.DefaultSize, 0 )
-        fgSizer1.Add( self.but_selectcol, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        #self.but_selectcol = wx.Button( self, wx.ID_ANY, u"Sélectionner", wx.DefaultPosition, wx.DefaultSize, 0 )
+        #fgSizer1.Add( self.but_selectcol, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
         
-        self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
-        fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 )
+        #self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        #fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 )
         
-        self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
-        fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 )
+        #self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        #fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 )
         
         bSizer1 = wx.BoxSizer( wx.HORIZONTAL )
         
@@ -2535,18 +2535,18 @@ class PrefWordCloud ( wx.Dialog ):
         self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
         fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
         
-        self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Nombre maximum de formes", wx.DefaultPosition, wx.DefaultSize, 0 )
-        self.m_staticText5.Wrap( -1 )
-        fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
+        #self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Nombre maximum de formes", wx.DefaultPosition, wx.DefaultSize, 0 )
+        #self.m_staticText5.Wrap( -1 )
+        #fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
         
-        self.spin_maxword = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10000, 600 )
-        fgSizer1.Add( self.spin_maxword, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        #self.spin_maxword = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10000, 600 )
+        #fgSizer1.Add( self.spin_maxword, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
         
-        self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
-        fgSizer1.Add( self.m_staticline5, 0, wx.EXPAND |wx.ALL, 5 )
+        #self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        #fgSizer1.Add( self.m_staticline5, 0, wx.EXPAND |wx.ALL, 5 )
         
-        self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
-        fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
+        #self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        #fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
         
         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
         self.m_staticText6.Wrap( -1 )
index 669b278..361c1b0 100644 (file)
--- a/layout.py
+++ b/layout.py
@@ -758,21 +758,7 @@ class GraphPanelDendro(wx.Panel):
             self.make_param(dial)
             self.make_dendro()
 
-class WordCloudLayout:
-    def __init__(self, ira, parent, filename):
-        self.dictpathout = parent.corpus.dictpathout
-        self.pathout = os.path.dirname(filename)
-        self.corpus = parent.corpus
-    #    self.read_result()
-        self.Tab = aui.AuiNotebook(ira.nb, -1, wx.DefaultPosition)
-        list_graph = [['nuage_1.png', 'Nuage']]
-        self.TabStatTot = GraphPanel(ira.nb, self.dictpathout, list_graph)
-        #self.TabStatTot.write(self.result['glob'])
-        self.Tab.AddPage(self.TabStatTot, 'Nuage')
-        self.Tab.corpus = parent.corpus
-        ira.nb.AddPage(self.Tab, 'WordCloud %s' % parent.conf.get('wordcloud','corpus_name'))
-        ira.nb.SetSelection(ira.nb.GetPageCount() - 1)
-        ira.ShowAPane("Tab_content")
+
 
 class OpenCorpus :
     def __init__(self, ira, parametres) :
@@ -911,6 +897,28 @@ class DefaultTextLayout :
     def dolayout(self) :
         log.info('no layout yet')
 
+class WordCloudLayout(DefaultTextLayout):
+    def dolayout(self):
+        #self.dictpathout = parent.corpus.dictpathout
+        #self.pathout = os.path.dirname(filename)
+        #self.corpus = parent.corpus
+    #    self.read_result()
+        self.pathout.basefiles(simipath)
+        self.Tab = aui.AuiNotebook(self.ira.nb, -1, wx.DefaultPosition)
+#        if os.path.exists(self.pathout['liste_graph']) :
+#            list_graph = read_list_file(self.pathout['liste_graph'])
+#        else : 
+#            list_graph = [['','']]
+        list_graph = [['nuage_1.png', 'Nuage']]
+        self.TabStatTot = GraphPanel(self.ira.nb, self.pathout, list_graph)
+        #self.TabStatTot.write(self.result['glob'])
+        self.Tab.AddPage(self.TabStatTot, 'Nuage')
+        self.Tab.corpus = self.corpus
+        self.Tab.parametres = self.parametres
+        self.ira.nb.AddPage(self.Tab, 'WordCloud %s' % self.parametres.get('corpus_name','corpus_name'))
+        self.ira.nb.SetSelection(self.ira.nb.GetPageCount() - 1)
+        self.ira.ShowAPane("Tab_content")
+
 class SimiLayout(DefaultTextLayout) :
     def dolayout(self) :
         self.pathout.basefiles(simipath)
index 3290bc4..2678a3a 100644 (file)
@@ -63,6 +63,9 @@ class OpenAnalyse():
         elif self.conf['type'] == 'simitxt' :
             self.parent.ShowMenu(_("Text analysis"))
             SimiLayout(self.parent, corpus, self.conf)
+        elif self.conf['type'] == 'wordcloud' :
+            self.parent.ShowMenu(_("Text analysis"))
+            WordCloudLayout(self.parent, corpus, self.conf)
             #self.tableau = Tableau(self.parent, self.conf['ira'])
             #self.DictPathOut=construct_simipath(self.conf['pathout'])
             #self.tableau.dictpathout = self.DictPathOut
index b31e940..9e35872 100644 (file)
@@ -4,8 +4,6 @@
 #Copyright (c) 2008-2009 Pierre Ratinaud
 #Lisense: GNU/GPL
 
-from chemins import ConstructPathOut, StatTxtPathOut, ffr, FFF
-#from corpus import Corpus
 from analysetxt import AnalyseText
 from guifunct import getPage, getCorpus, SelectColumn
 from ConfigParser import RawConfigParser