for i in range(0,len(self.listlabel)):
self.keys[self.listcle[i]] = self.listspin[i].GetValue()
DoConf().makeoptions(['KEY'], [self.keys], outfile = self.parent.parent.ira.ConfigPath['key'])
- self.Disable()
- return
+ #self.Disable()
+ self.Destroy()
+ #return
class ListView(wx.Dialog):
self.packages(['wordcloud'])
bg_col = Rcolor(self.parametres['col_bg'])
txt_col = Rcolor(self.parametres['col_text'])
+ if self.parametres['svg'] :
+ svg = 'TRUE'
+ else :
+ svg = 'FALSE'
txt = """
+ svg <- %s
+ """ % svg
+ txt += """
act <- read.csv2("%s", header = FALSE, row.names=1, sep='\t')
selected.col <- read.table("%s")
toprint <- as.matrix(act[selected.col[,1] + 1,])
toprint <- as.matrix(toprint[order(toprint[,1], decreasing=TRUE),])
toprint <- as.matrix(toprint[1:maxword,])
}
- open_file_graph("%s", width = %i, height = %i)
+ open_file_graph("%s", width = %i, height = %i , svg = svg)
par(bg=rgb%s)
wordcloud(row.names(toprint), toprint[,1], scale=c(%f,%f), random.order=FALSE, colors=rgb%s)
dev.off()
author = Pierre Ratinaud
gpl-fr = gpl-2.0-fr.txt
dev = Pierre Ratinaud (ratinaud@univ-tlse2.fr);Sebastien Dejean
-version = 0.6 alpha 1
+version = 0.6 alpha 2
licence = GNU GPL (v2)
-version_nb = 0.6.a1
+version_nb = 0.6.a2
guilanguage=french
R_mem = false
R_max_mem = 1535
-version_nb = 0.6.a1
+version_nb = 0.6.a2
rlibs = false
libsvdc = false
libsvdc_path = /usr/bin/svd
dial = AlcOptFrame(self, self.parent.parent)
dial.CenterOnParent()
dial.ShowModal()
- dial.Destroy()
- print 'zerazer'
+ #dial.Destroy()
class LexDialog( 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_staticText11 = wx.StaticText( self, wx.ID_ANY, u"Format de l'image", wx.DefaultPosition, wx.DefaultSize, 0 )
+ self.m_staticText11.Wrap( -1 )
+ fgSizer1.Add( self.m_staticText11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+
+ formatChoices = [ u"png", u"svg" ]
+ self.format = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, formatChoices, 0 )
+ self.format.SetSelection( 0 )
+ fgSizer1.Add( self.format, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+
+ self.m_staticline13 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+ fgSizer1.Add( self.m_staticline13, 0, wx.EXPAND |wx.ALL, 5 )
+
+ self.m_staticline14 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+ fgSizer1.Add( self.m_staticline14, 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.deb = wx.StaticText(self, -1, txt)
for i in range(0,len(list_graph)):
if os.path.exists(os.path.join(self.dirout,list_graph[i][0])) :
- self.listimg.append(wx.StaticBitmap(self, -1, wx.Bitmap(os.path.join(self.dirout,list_graph[i][0]), wx.BITMAP_TYPE_ANY)))
+ filename, ext = os.path.splitext(list_graph[i][0])
+ if ext == '.svg' :
+ self.listimg.append(hl.HyperLinkCtrl(self, -1, os.path.join(self.dirout,list_graph[i][0]), URL=os.path.join(self.dirout,list_graph[i][0])))
+ else :
+ self.listimg.append(wx.StaticBitmap(self, -1, wx.Bitmap(os.path.join(self.dirout,list_graph[i][0]), wx.BITMAP_TYPE_ANY)))
self.labels.append(wx.StaticText(self, -1, list_graph[i][1]))
self.__set_properties()
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']]
+ if self.parametres['svg'] :
+ list_graph = [['nuage_1.svg', 'Nuage']]
+ else :
+ 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
dial.CenterOnParent()
res = dial.ShowModal()
if res == wx.ID_OK :
+ if dial.format.GetSelection() == 0 :
+ svg = 0
+ else :
+ svg = 1
self.parametres['width'] = dial.spin_L.GetValue()
self.parametres['height'] = dial.spin_H.GetValue()
self.parametres['maxword'] = dial.spin_maxword.GetValue()
self.parametres['col_text'] = dial.color_text.GetColour()
self.parametres['col_bg'] = dial.color_bg.GetColour()
self.parametres['mode'] = dial.typeformeschoice.GetSelection()
+ self.parametres['svg'] = svg
outgraph = os.path.join(os.path.dirname(self.pathout['zipf.png']), 'nuage_')
nb = 1
- while os.path.exists(outgraph + str(nb) + '.png') :
+ if svg :
+ end = '.svg'
+ else :
+ end = '.png'
+ while os.path.exists(outgraph + str(nb) + end) :
nb += 1
- self.parametres['graphout'] = outgraph + str(nb) + '.png'
+ self.parametres['graphout'] = outgraph + str(nb) + end
dial.Destroy()
return res
-
def make_wordcloud(self) :
act = ['\t'.join([act, `self.corpus.getlemeff(act)`]) for act in self.actives]
with open(self.pathout['actives_eff.csv'], 'w') as f :