From: Mathieu MD <mat...@gm...> - 2012-04-16 22:29:02
|
Hello, I work little by little on the Graphview addon, with the objective to get the bold line from the current person down/up to the home person. However its still too far from my skills, so I gave a smaller try by adding a configuration menu (for date and images). Could you give it a quick look for any suggestion? Bests, Mathieu Index: contrib/GraphView/graphview.py =================================================================== --- contrib/GraphView/graphview.py (revision 1232) +++ contrib/GraphView/graphview.py (working copy) @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # @@ -6,6 +7,9 @@ # DotGenerator is based on the relationship graph # report. # Mouse panning is derived from the pedigree view +# Copyright (C) 2012 Mathieu MD +# - Configuration menu (custom date format, etc.) +# - Bold lines from current to home person # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -54,6 +58,9 @@ from gui.editors import EditPerson, EditFamily import Errors +import logging +_LOG = logging.getLogger('.addon-graphview') + try: import cairo except ImportError: @@ -74,6 +81,17 @@ raise Exception("GraphViz (http://www.graphviz.org) is " "required for this view to work") +from config import config + +#--------------------------------------------------------------- +# +# Local config and functions +# +#--------------------------------------------------------------- +cm = config.register_manager("graphview") +cm.register("interface.full-date", False) +cm.register("interface.show-images", True) +cm.init() #------------------------------------------------------------------------- # @@ -169,6 +187,7 @@ else: self.dirty = True + #------------------------------------------------------------------------- # # GraphWidget @@ -205,17 +224,58 @@ zoom_label = gtk.Label("Zoom:") hbox.pack_start (zoom_label, False, False, 0) - adj = gtk.Adjustment (1.00, 0.05, 10.00, 0.05, 0.50, 0.50) + adj = gtk.Adjustment (1.00, 0.1, 2.5, 0.05, 0.50, 0.50) scale = gtk.HScale(adj) adj.connect("value_changed", self.zoom_changed) hbox.pack_start(scale, True, True, 0) self.vbox.pack_start(scrolled_win, True, True, 0) + def build_menu(self, event): + menu = gtk.Menu() + menu.set_title(_('Settings Menu')) + menu.append(self.create_menu_item(_("Full date"), + cm.get("interface.full-date"), + self.change_full_date_cb) ) + menu.append(self.create_menu_item(_("Show images"), + cm.get("interface.show-images"), + self.change_show_images_cb) ) + menu.popup(None, None, None, 0, event.time) + return 1 + def create_menu_item(self, text, currValue, callback): + entry = gtk.ImageMenuItem(text) + if currValue: + current_image = gtk.image_new_from_stock(gtk.STOCK_APPLY, gtk.ICON_SIZE_MENU) + current_image.show() + entry.set_image(current_image) + entry.connect("activate", callback) + entry.show() + return entry + def change_full_date_cb(self, event): + cm.set("interface.full-date", not cm.get("interface.full-date")) + self.save_config() + def change_show_images_cb(self, event): + cm.set("interface.show-images", not cm.get("interface.show-images")) + self.save_config() + def save_config(self): + cm.save() + # Must find a nicer way to redraw the layout!! + # Now, it just sets temporarily the active person to a parent, and + # sets it back to the current person... + handle_0 = self.active_person_handle + parent_handle = self.find_a_parent(handle_0) + if parent_handle: + handle_1 = parent_handle + else: + # However, I don't know how to "redraw" when there is no parent... + return 0 + self.view.change_active(handle_1) + self.view.change_active(handle_0) + def populate(self, active_person): """ Populate the graph with widgets derived from Graphviz """ - dot = DotGenerator(self.dbstate) + dot = DotGenerator(self.dbstate, active_person) self.active_person_handle = active_person dot.build_graph(active_person) @@ -264,6 +324,9 @@ self._last_y = event.y_root self._in_move = True return False + elif event.button == 3 and event.type == gtk.gdk.BUTTON_PRESS \ + and item == self.canvas.get_root_item(): + self.build_menu(event) return False def button_release(self, item, target, event): @@ -577,16 +640,26 @@ Parse <path> tags. These define the links between nodes. Solid lines represent birth relationships and dashed lines are used when a child has a non-birth relationship to a parent. + + A bold line link the "active" person down/up to the "home" person """ p_data = attrs.get('d') style = attrs.get('style') + _LOG.debug('attrs: '+str(attrs)) + + line_width = 1 + _boldLine = 5 if style: p_style = self.parse_style(style) stroke_color = p_style['stroke'] + if p_style['stroke-width']: + line_width = _boldLine is_dashed = p_style.has_key('stroke-dasharray') else: stroke_color = attrs.get('stroke') + if attrs.get('stroke-width'): + line_width = _boldLine if attrs.get('stroke-dasharray'): is_dashed = True else: @@ -596,13 +669,15 @@ item = goocanvas.Path(parent = self.current_parent(), data = p_data, stroke_color = stroke_color, - line_width = 1, - line_dash = goocanvas.LineDash([5.0, 5.0])) + line_width = line_width, + line_dash = goocanvas.LineDash([5.0, 5.0]), + ) else: item = goocanvas.Path(parent = self.current_parent(), data = p_data, stroke_color = stroke_color, - line_width = 1) + line_width = line_width, + ) self.item_hier.append(item) @@ -747,7 +822,7 @@ #------------------------------------------------------------------------ class DotGenerator(object): - def __init__(self, dbstate): + def __init__(self, dbstate, active_person): """ Creates graphing instructions in dot format which is fed to Graphviz so that it can layout the data in a graph and produce an SVG form @@ -757,6 +832,8 @@ self.dbstate = dbstate self.database = dbstate.db self.dot = StringIO() + + self.active_person = active_person self.colors = { 'male_fill' : '#b9cfe7', @@ -788,7 +865,7 @@ self.write( 'digraph GRAMPS_graph\n' ) self.write( '{\n' ) - self.write( ' bgcolor=white;\n' ) + self.write( ' bgcolor="#efefef";\n' ) self.write( ' center="false"; \n' ) self.write( ' charset="utf8";\n' ) self.write( ' concentrate="false";\n' ) @@ -1002,7 +1079,7 @@ "return person label string" # see if we have an image to use for this person image_path = None - if self.is_html_output: + if self.is_html_output and cm.get("interface.show-images"): media_list = person.get_media_list() if len(media_list) > 0: media_handle = media_list[0].get_reference_handle() @@ -1033,9 +1110,10 @@ # if self.is_html_output and image_path: line_delimiter = '<BR/>' - label += '<TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0" CELLBORDER="0"><TR><TD></TD><TD><IMG SRC="%s"/></TD><TD></TD>' % image_path - #trick it into not stretching the image - label += '</TR><TR><TD COLSPAN="3">' + label += '<TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"' + label += ' CELLBORDER="0"><TR>' + label += '<TD><IMG SRC="%s"/></TD>' % image_path + label += '</TR><TR><TD>' else : #no need for html label with this person self.is_html_output = False @@ -1043,16 +1121,30 @@ # at the very least, the label must have the person's name name = displayer.display_name(person.get_primary_name()) - # Need to pad the label because of a bug in the SVG output of Graphviz - # which causes the width of the text to exceed the bounding box. if self.is_html_output : # avoid < and > in the name, as this is html text label += name.replace('<', '<').replace('>', '>') + # Need to pad the label because of a bug in the SVG output of Graphviz + # which causes the width of the text to exceed the bounding box. + label += ' '; else : name = name.center(len(name) + 10) label += name + + + label += line_delimiter + birth, death = self.get_date_strings(person) - label = label + '%s(%s - %s)' % (line_delimiter, birth, death) + if cm.get("interface.full-date"): + label += '° %s' % (birth) + else: + label += '%s' % (birth) + + if death: + if cm.get("interface.full-date"): + label += '%s+ %s' % (line_delimiter, death) + else: + label += ' - %s' % (death) # see if we have a table that needs to be terminated if self.is_html_output: @@ -1090,7 +1182,13 @@ empty string """ if event: - if event.get_date_object().get_year_valid(): + if cm.get("interface.full-date") and event.get_date_object().get_valid(): + from libtranslate import Translator + translator = Translator() + self.__get_date = translator.get_date + date = self.__get_date(event.get_date_object()) + return '%s' % date + elif event.get_date_object().get_year_valid(): return '%i' % event.get_date_object().get_year() else: place_handle = event.get_place_handle() @@ -1106,10 +1204,13 @@ that begin with a number. """ self.write(' _%s -> _%s' % (id1, id2)) - + + self.write(' [') + +# if self.is_in_path_to_home(id1, id2): +# self.write(' penwidth=%s' % 5) + if style or head or tail: - self.write(' [') - if style: self.write(' style=%s' % style) if head: @@ -1117,7 +1218,7 @@ if tail: self.write(' arrowtail=%s' % tail) - self.write(' ]') + self.write(' ]') self.write(';') |
From: Rob H. <rob...@gm...> - 2012-04-16 22:54:27
|
Greetings: I tried to patch the file from what you gave in the email, and this is what I got... Frog@DancingSquirrels trunk]$ patch -p0 < graphview.patch patching file contrib/GraphView/graphview.py patch: **** malformed patch at line 82: gtk.ICON_SIZE_MENU) The best way to handle this would be to create an account here [1] and then create a feature requests by clicking in the drop down menu at the top right! Attach the patch to that bug tracker and then let the list know what the link to the feature request! Thank you for being willing to help fill a need in the GraphView plugin! Sincerely yours, Rob G. Healey On Mon, Apr 16, 2012 at 3:28 PM, Mathieu MD <mat...@gm...> wrote: > Hello, > > I work little by little on the Graphview addon, with the objective to > get the bold line from the current person down/up to the home person. > However its still too far from my skills, so I gave a smaller try by > adding a configuration menu (for date and images). > > Could you give it a quick look for any suggestion? > > Bests, > Mathieu > > > Index: contrib/GraphView/graphview.py > =================================================================== > --- contrib/GraphView/graphview.py (revision 1232) > +++ contrib/GraphView/graphview.py (working copy) > @@ -1,3 +1,4 @@ > +# -*- coding: utf-8 -*- > # > # Gramps - a GTK+/GNOME based genealogy program > # > @@ -6,6 +7,9 @@ > # DotGenerator is based on the relationship graph > # report. > # Mouse panning is derived from the pedigree view > +# Copyright (C) 2012 Mathieu MD > +# - Configuration menu (custom date format, etc.) > +# - Bold lines from current to home person > # > # This program is free software; you can redistribute it and/or modify > # it under the terms of the GNU General Public License as published by > @@ -54,6 +58,9 @@ > from gui.editors import EditPerson, EditFamily > import Errors > > +import logging > +_LOG = logging.getLogger('.addon-graphview') > + > try: > import cairo > except ImportError: > @@ -74,6 +81,17 @@ > raise Exception("GraphViz (http://www.graphviz.org) is " > "required for this view to work") > > +from config import config > + > +#--------------------------------------------------------------- > +# > +# Local config and functions > +# > +#--------------------------------------------------------------- > +cm = config.register_manager("graphview") > +cm.register("interface.full-date", False) > +cm.register("interface.show-images", True) > +cm.init() > > #------------------------------------------------------------------------- > # > @@ -169,6 +187,7 @@ > else: > self.dirty = True > > + > #------------------------------------------------------------------------- > # > # GraphWidget > @@ -205,17 +224,58 @@ > zoom_label = gtk.Label("Zoom:") > hbox.pack_start (zoom_label, False, False, 0) > > - adj = gtk.Adjustment (1.00, 0.05, 10.00, 0.05, 0.50, 0.50) > + adj = gtk.Adjustment (1.00, 0.1, 2.5, 0.05, 0.50, 0.50) > scale = gtk.HScale(adj) > adj.connect("value_changed", self.zoom_changed) > hbox.pack_start(scale, True, True, 0) > self.vbox.pack_start(scrolled_win, True, True, 0) > > + def build_menu(self, event): > + menu = gtk.Menu() > + menu.set_title(_('Settings Menu')) > + menu.append(self.create_menu_item(_("Full date"), > + cm.get("interface.full-date"), > + self.change_full_date_cb) ) > + menu.append(self.create_menu_item(_("Show images"), > + cm.get("interface.show-images"), > + self.change_show_images_cb) ) > + menu.popup(None, None, None, 0, event.time) > + return 1 > + def create_menu_item(self, text, currValue, callback): > + entry = gtk.ImageMenuItem(text) > + if currValue: > + current_image = gtk.image_new_from_stock(gtk.STOCK_APPLY, > gtk.ICON_SIZE_MENU) > + current_image.show() > + entry.set_image(current_image) > + entry.connect("activate", callback) > + entry.show() > + return entry > + def change_full_date_cb(self, event): > + cm.set("interface.full-date", not cm.get("interface.full-date")) > + self.save_config() > + def change_show_images_cb(self, event): > + cm.set("interface.show-images", not > cm.get("interface.show-images")) > + self.save_config() > + def save_config(self): > + cm.save() > + # Must find a nicer way to redraw the layout!! > + # Now, it just sets temporarily the active person to a parent, and > + # sets it back to the current person... > + handle_0 = self.active_person_handle > + parent_handle = self.find_a_parent(handle_0) > + if parent_handle: > + handle_1 = parent_handle > + else: > + # However, I don't know how to "redraw" when there is no > parent... > + return 0 > + self.view.change_active(handle_1) > + self.view.change_active(handle_0) > + > def populate(self, active_person): > """ > Populate the graph with widgets derived from Graphviz > """ > - dot = DotGenerator(self.dbstate) > + dot = DotGenerator(self.dbstate, active_person) > self.active_person_handle = active_person > dot.build_graph(active_person) > > @@ -264,6 +324,9 @@ > self._last_y = event.y_root > self._in_move = True > return False > + elif event.button == 3 and event.type == gtk.gdk.BUTTON_PRESS \ > + and item == self.canvas.get_root_item(): > + self.build_menu(event) > return False > > def button_release(self, item, target, event): > @@ -577,16 +640,26 @@ > Parse <path> tags. These define the links between nodes. > Solid lines represent birth relationships and dashed lines are > used > when a child has a non-birth relationship to a parent. > + > + A bold line link the "active" person down/up to the "home" person > """ > p_data = attrs.get('d') > style = attrs.get('style') > + _LOG.debug('attrs: '+str(attrs)) > + > + line_width = 1 > + _boldLine = 5 > > if style: > p_style = self.parse_style(style) > stroke_color = p_style['stroke'] > + if p_style['stroke-width']: > + line_width = _boldLine > is_dashed = p_style.has_key('stroke-dasharray') > else: > stroke_color = attrs.get('stroke') > + if attrs.get('stroke-width'): > + line_width = _boldLine > if attrs.get('stroke-dasharray'): > is_dashed = True > else: > @@ -596,13 +669,15 @@ > item = goocanvas.Path(parent = self.current_parent(), > data = p_data, > stroke_color = stroke_color, > - line_width = 1, > - line_dash = goocanvas.LineDash([5.0, > 5.0])) > + line_width = line_width, > + line_dash = goocanvas.LineDash([5.0, > 5.0]), > + ) > else: > item = goocanvas.Path(parent = self.current_parent(), > data = p_data, > stroke_color = stroke_color, > - line_width = 1) > + line_width = line_width, > + ) > > self.item_hier.append(item) > > @@ -747,7 +822,7 @@ > #------------------------------------------------------------------------ > class DotGenerator(object): > > - def __init__(self, dbstate): > + def __init__(self, dbstate, active_person): > """ > Creates graphing instructions in dot format which is fed to > Graphviz > so that it can layout the data in a graph and produce an SVG form > @@ -757,6 +832,8 @@ > self.dbstate = dbstate > self.database = dbstate.db > self.dot = StringIO() > + > + self.active_person = active_person > > self.colors = { > 'male_fill' : '#b9cfe7', > @@ -788,7 +865,7 @@ > > self.write( 'digraph GRAMPS_graph\n' ) > self.write( '{\n' ) > - self.write( ' bgcolor=white;\n' ) > + self.write( ' bgcolor="#efefef";\n' ) > self.write( ' center="false"; \n' ) > self.write( ' charset="utf8";\n' ) > self.write( ' concentrate="false";\n' ) > @@ -1002,7 +1079,7 @@ > "return person label string" > # see if we have an image to use for this person > image_path = None > - if self.is_html_output: > + if self.is_html_output and cm.get("interface.show-images"): > media_list = person.get_media_list() > if len(media_list) > 0: > media_handle = media_list[0].get_reference_handle() > @@ -1033,9 +1110,10 @@ > # > if self.is_html_output and image_path: > line_delimiter = '<BR/>' > - label += '<TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0" > CELLBORDER="0"><TR><TD></TD><TD><IMG SRC="%s"/></TD><TD></TD>' % image_path > - #trick it into not stretching the image > - label += '</TR><TR><TD COLSPAN="3">' > + label += '<TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"' > + label += ' CELLBORDER="0"><TR>' > + label += '<TD><IMG SRC="%s"/></TD>' % image_path > + label += '</TR><TR><TD>' > else : > #no need for html label with this person > self.is_html_output = False > @@ -1043,16 +1121,30 @@ > # at the very least, the label must have the person's name > name = displayer.display_name(person.get_primary_name()) > > - # Need to pad the label because of a bug in the SVG output of > Graphviz > - # which causes the width of the text to exceed the bounding box. > if self.is_html_output : > # avoid < and > in the name, as this is html text > label += name.replace('<', '<').replace('>', '>') > + # Need to pad the label because of a bug in the SVG output > of Graphviz > + # which causes the width of the text to exceed the bounding > box. > + label += ' '; > else : > name = name.center(len(name) + 10) > label += name > + > + > + label += line_delimiter > + > birth, death = self.get_date_strings(person) > - label = label + '%s(%s - %s)' % (line_delimiter, birth, death) > + if cm.get("interface.full-date"): > + label += '° %s' % (birth) > + else: > + label += '%s' % (birth) > + > + if death: > + if cm.get("interface.full-date"): > + label += '%s+ %s' % (line_delimiter, death) > + else: > + label += ' - %s' % (death) > > # see if we have a table that needs to be terminated > if self.is_html_output: > @@ -1090,7 +1182,13 @@ > empty string > """ > if event: > - if event.get_date_object().get_year_valid(): > + if cm.get("interface.full-date") and > event.get_date_object().get_valid(): > + from libtranslate import Translator > + translator = Translator() > + self.__get_date = translator.get_date > + date = self.__get_date(event.get_date_object()) > + return '%s' % date > + elif event.get_date_object().get_year_valid(): > return '%i' % event.get_date_object().get_year() > else: > place_handle = event.get_place_handle() > @@ -1106,10 +1204,13 @@ > that begin with a number. > """ > self.write(' _%s -> _%s' % (id1, id2)) > - > + > + self.write(' [') > + > +# if self.is_in_path_to_home(id1, id2): > +# self.write(' penwidth=%s' % 5) > + > if style or head or tail: > - self.write(' [') > - > if style: > self.write(' style=%s' % style) > if head: > @@ -1117,7 +1218,7 @@ > if tail: > self.write(' arrowtail=%s' % tail) > > - self.write(' ]') > + self.write(' ]') > > self.write(';') > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel -- Sincerely yours, Rob G. Healey |
From: Josip <jo...@pi...> - 2012-04-17 00:09:55
|
On 17.04.2012 00:28, Mathieu MD wrote: > Could you give it a quick look for any suggestion? Your patch is reformatted (long line broken) so is not working! -- Josip |
From: Mathieu MD <mat...@gm...> - 2012-04-17 06:04:45
Attachments:
graphview.py.patch
|
On 17/04/2012 02:07, Josip wrote: > Your patch is reformatted (long line broken) so is not working! Sorry for this beginners mistake! Here is the patch file. Have a nice day, -- Mathieu |
From: Gary B. <bur...@ya...> - 2012-04-17 07:17:38
|
----- Forwarded Message ----- > From: Gary Burton <bur...@ya...> > To: Mathieu MD <mat...@gm...> > Cc: > Sent: Tuesday, 17 April 2012, 8:15 > Subject: Re: [Gramps-devel] [GraphView] Please provide feedback > > Hello Matthieu > > Nice to see someone else taking an interest in improving this plugin. > > I looked at your patch. It seems to contain changes for a number of different > things. I see some changes for adding a menu, some changes affecting the way the > graphs as drawn. I suggest breaking the patch up so that you have a separate > patch file for each new feature/change that you wish to add. This will make it > easier to review the changes and will be needed when committing changes to the > SVN repository. > > Thanks > > Gary > > ----- Original Message ----- >> From: Mathieu MD <mat...@gm...> >> To: Gramps Devel List <gra...@li...> >> Cc: >> Sent: Monday, 16 April 2012, 23:28 >> Subject: [Gramps-devel] [GraphView] Please provide feedback >> >> Hello, >> >> I work little by little on the Graphview addon, with the objective to >> get the bold line from the current person down/up to the home person. >> However its still too far from my skills, so I gave a smaller try by >> adding a configuration menu (for date and images). >> >> Could you give it a quick look for any suggestion? >> >> Bests, >> Mathieu >> > |
From: Mathieu MD <mat...@gm...> - 2012-04-17 15:48:24
Attachments:
graphview.py.patch
|
Hello Gary, Thanks for your email. I attached a new patch, focused on: - the settings menu And also including these minors changes: - background color - the gtk.Adjustment zooms, which I think were too much zoomable before. I gave up the whole "bold path" thing; after hours and days on it, I'm only going crazy with it... I left a few changes in the code, but I can only let its programming for one of you Programmers... Bests, Mathieu On 17/04/2012 09:17, Gary Burton wrote: > > > ----- Forwarded Message ----- >> From: Gary Burton<bur...@ya...> >> To: Mathieu MD<mat...@gm...> >> Cc: >> Sent: Tuesday, 17 April 2012, 8:15 >> Subject: Re: [Gramps-devel] [GraphView] Please provide feedback >> >> Hello Matthieu >> >> Nice to see someone else taking an interest in improving this plugin. >> >> I looked at your patch. It seems to contain changes for a number of different >> things. I see some changes for adding a menu, some changes affecting the way the >> graphs as drawn. I suggest breaking the patch up so that you have a separate >> patch file for each new feature/change that you wish to add. This will make it >> easier to review the changes and will be needed when committing changes to the >> SVN repository. >> >> Thanks >> >> Gary >> >> ----- Original Message ----- >>> From: Mathieu MD<mat...@gm...> >>> To: Gramps Devel List<gra...@li...> >>> Cc: >>> Sent: Monday, 16 April 2012, 23:28 >>> Subject: [Gramps-devel] [GraphView] Please provide feedback >>> >>> Hello, >>> >>> I work little by little on the Graphview addon, with the objective to >>> get the bold line from the current person down/up to the home person. >>> However its still too far from my skills, so I gave a smaller try by >>> adding a configuration menu (for date and images). >>> >>> Could you give it a quick look for any suggestion? >>> >>> Bests, >>> Mathieu >>> >> > > ------------------------------------------------------------------------------ > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel -- Mathieu |
From: Serge N. <Ser...@fr...> - 2012-04-17 17:03:50
|
Le 17/04/2012 17:48, Mathieu MD a écrit : > Hello Gary, > > Thanks for your email. > > I attached a new patch, focused on: > - the settings menu > > And also including these minors changes: > - background color > - the gtk.Adjustment zooms, which I think were too much zoomable before. I disagree with that. I have a tree with more than 2000 persons. There is more than 5000 persons in my database. To see correctly some parts of my tree I need to go to the maximum zoom which is 9.5. it is not sufficient in some case. If you have some small trees, I understand you think it's too big. Perhaps it should be better to have a configurable value for this. > > I gave up the whole "bold path" thing; after hours and days on it, I'm only going crazy with it... I left a few changes in the code, but I can only let its programming for one of you Programmers... > > Bests, > Mathieu > > On 17/04/2012 09:17, Gary Burton wrote: >> >> >> ----- Forwarded Message ----- >>> From: Gary Burton<bur...@ya...> >>> To: Mathieu MD<mat...@gm...> >>> Cc: >>> Sent: Tuesday, 17 April 2012, 8:15 >>> Subject: Re: [Gramps-devel] [GraphView] Please provide feedback >>> >>> Hello Matthieu >>> >>> Nice to see someone else taking an interest in improving this plugin. >>> >>> I looked at your patch. It seems to contain changes for a number of different >>> things. I see some changes for adding a menu, some changes affecting the way the >>> graphs as drawn. I suggest breaking the patch up so that you have a separate >>> patch file for each new feature/change that you wish to add. This will make it >>> easier to review the changes and will be needed when committing changes to the >>> SVN repository. >>> >>> Thanks >>> >>> Gary >>> >>> ----- Original Message ----- >>>> From: Mathieu MD<mat...@gm...> >>>> To: Gramps Devel List<gra...@li...> >>>> Cc: >>>> Sent: Monday, 16 April 2012, 23:28 >>>> Subject: [Gramps-devel] [GraphView] Please provide feedback >>>> >>>> Hello, >>>> >>>> I work little by little on the Graphview addon, with the objective to >>>> get the bold line from the current person down/up to the home person. >>>> However its still too far from my skills, so I gave a smaller try by >>>> adding a configuration menu (for date and images). >>>> >>>> Could you give it a quick look for any suggestion? >>>> >>>> Bests, >>>> Mathieu >>>> |
From: Serge N. <Ser...@fr...> - 2012-04-17 18:56:55
|
Le 17/04/2012 17:48, Mathieu MD a écrit : > Hello Gary, > > Thanks for your email. > > I attached a new patch, focused on: > - the settings menu > > And also including these minors changes: > - background color Now , when zooming we have two colors : white and grey. > - the gtk.Adjustment zooms, which I think were too much zoomable before. With more test, the 2.0 zoom is ridiculous for my tree. I added an image to this mail to show that. I resend this without the image because it needs moderator approuval. I think you received it Mathieu. Serge > > I gave up the whole "bold path" thing; after hours and days on it, I'm only going crazy with it... I left a few changes in the code, but I can only let its programming for one of you Programmers... > > Bests, > Mathieu > > On 17/04/2012 09:17, Gary Burton wrote: >> >> >> ----- Forwarded Message ----- >>> From: Gary Burton<bur...@ya...> >>> To: Mathieu MD<mat...@gm...> >>> Cc: >>> Sent: Tuesday, 17 April 2012, 8:15 >>> Subject: Re: [Gramps-devel] [GraphView] Please provide feedback >>> >>> Hello Matthieu >>> >>> Nice to see someone else taking an interest in improving this plugin. >>> >>> I looked at your patch. It seems to contain changes for a number of different >>> things. I see some changes for adding a menu, some changes affecting the way the >>> graphs as drawn. I suggest breaking the patch up so that you have a separate >>> patch file for each new feature/change that you wish to add. This will make it >>> easier to review the changes and will be needed when committing changes to the >>> SVN repository. >>> >>> Thanks >>> >>> Gary >>> >>> ----- Original Message ----- >>>> From: Mathieu MD<mat...@gm...> >>>> To: Gramps Devel List<gra...@li...> >>>> Cc: >>>> Sent: Monday, 16 April 2012, 23:28 >>>> Subject: [Gramps-devel] [GraphView] Please provide feedback >>>> >>>> Hello, >>>> >>>> I work little by little on the Graphview addon, with the objective to >>>> get the bold line from the current person down/up to the home person. >>>> However its still too far from my skills, so I gave a smaller try by >>>> adding a configuration menu (for date and images). >>>> >>>> Could you give it a quick look for any suggestion? >>>> >>>> Bests, >>>> Mathieu >>>> >>> Serge |
From: Mathieu MD <mat...@gm...> - 2012-04-18 09:07:09
Attachments:
graphview.py.patch
|
Hi Serge, Thanks for your feedback. On 17/04/2012 20:56, Serge Noiraud wrote: >> - background color > Now , when zooming we have two colors : white and grey. I find it easier to understand: the gray zone do contains the tree items (the working zone), while the white zone is only the background filling the window. >> - the gtk.Adjustment zooms, which I think were too much zoomable >> before. > I disagree with that. I have a tree with more than 2000 persons. > There is more than 5000 persons in my database. > To see correctly some parts of my tree I need to go to the maximum > zoom which is 9.5. > it is not sufficient in some case. I saw your screenshot; indeed it's not usable at all. I reverted the previous line, except I grown the max value from 10.00 to 20.00, so it should be enough to zoom in really big trees. Just replace the line 220 with: adj = gtk.Adjustment (1.00, 0.05, 20.00, 0.05, 0.50, 0.50) #adj = gtk.Adjustment (1.00, 0.1, 2.5, 0.05, 0.50, 0.50) (new patch attached) > If you have some small trees, I understand you think it's too big. I didn't thought the zoom was depending on the number of items: when I tried loading trees, with 5 persons or with hundreds, the zoom seems to be a fixed value; so I though it was only required to zoom out, and almost never zoom in except for users with viewing disability. > Perhaps it should be better to have a configurable value for this. I don't think its really worth the pain... ;-) Thanks. -- Mathieu |
From: Mathieu MD <mat...@gm...> - 2012-04-20 21:25:56
Attachments:
graphview.py.patch
|
Hello, I added the possibility to highlight the home person. And fixed the status bar (see my previous email). Bests, -- Mathieu On 18/04/2012 11:06, Mathieu MD wrote: > Hi Serge, > > Thanks for your feedback. > > On 17/04/2012 20:56, Serge Noiraud wrote: >>> - background color >> Now , when zooming we have two colors : white and grey. > > I find it easier to understand: the gray zone do contains the tree items > (the working zone), while the white zone is only the background filling > the window. > > >> - the gtk.Adjustment zooms, which I think were too much zoomable > >> before. > > I disagree with that. I have a tree with more than 2000 persons. > > There is more than 5000 persons in my database. > > To see correctly some parts of my tree I need to go to the maximum > > zoom which is 9.5. > > it is not sufficient in some case. > > I saw your screenshot; indeed it's not usable at all. > > I reverted the previous line, except I grown the max value from 10.00 to > 20.00, so it should be enough to zoom in really big trees. > > Just replace the line 220 with: > adj = gtk.Adjustment (1.00, 0.05, 20.00, 0.05, 0.50, 0.50) > #adj = gtk.Adjustment (1.00, 0.1, 2.5, 0.05, 0.50, 0.50) > > (new patch attached) > > > If you have some small trees, I understand you think it's too big. > > I didn't thought the zoom was depending on the number of items: when I > tried loading trees, with 5 persons or with hundreds, the zoom seems to > be a fixed value; so I though it was only required to zoom out, and > almost never zoom in except for users with viewing disability. > > > Perhaps it should be better to have a configurable value for this. > > I don't think its really worth the pain... ;-) > > Thanks. |
From: Gary B. <bur...@ya...> - 2012-04-21 09:05:47
|
Hello Mathieu I will look at your patch tonight. Been a busy week so far. Bye Gary ----- Original Message ----- > From: Mathieu MD <mat...@gm...> > To: gra...@li... > Cc: > Sent: Friday, 20 April 2012, 22:25 > Subject: Re: [Gramps-devel] [GraphView] Please provide feedback > > Hello, > > I added the possibility to highlight the home person. > > And fixed the status bar (see my previous email). > > Bests, > -- > Mathieu > > On 18/04/2012 11:06, Mathieu MD wrote: >> Hi Serge, >> >> Thanks for your feedback. >> >> On 17/04/2012 20:56, Serge Noiraud wrote: >>>> - background color >>> Now , when zooming we have two colors : white and grey. >> >> I find it easier to understand: the gray zone do contains the tree items >> (the working zone), while the white zone is only the background filling >> the window. >> >> >> - the gtk.Adjustment zooms, which I think were too much zoomable >> >> before. >> > I disagree with that. I have a tree with more than 2000 persons. >> > There is more than 5000 persons in my database. >> > To see correctly some parts of my tree I need to go to the maximum >> > zoom which is 9.5. >> > it is not sufficient in some case. >> >> I saw your screenshot; indeed it's not usable at all. >> >> I reverted the previous line, except I grown the max value from 10.00 to >> 20.00, so it should be enough to zoom in really big trees. >> >> Just replace the line 220 with: >> adj = gtk.Adjustment (1.00, 0.05, 20.00, 0.05, 0.50, 0.50) >> #adj = gtk.Adjustment (1.00, 0.1, 2.5, 0.05, 0.50, 0.50) >> >> (new patch attached) >> >> > If you have some small trees, I understand you think it's too > big. >> >> I didn't thought the zoom was depending on the number of items: when I >> tried loading trees, with 5 persons or with hundreds, the zoom seems to >> be a fixed value; so I though it was only required to zoom out, and >> almost never zoom in except for users with viewing disability. >> >> > Perhaps it should be better to have a configurable value for this. >> >> I don't think its really worth the pain... ;-) >> >> Thanks. > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > |
From: Gary B. <bur...@ya...> - 2012-04-22 21:36:19
|
Hello Mathieu I have looked at your patch. As I mentioned before, it contains lots of different changes and it is better to break the patch up into separate patches so that each change can be added to the repostory separately. The first thing I think needs to be added is configuration. Your patch implements configuration with a right mouse button context menu and you have called register_manager to set/get the values. Views in Gramps which derive from gui.views.pageview.PageView (which GraphView ultimately does) provide a dialog window for displaying/saving/getting configuration settings and it just needs to be set up in Graphview. The dialog is called from the View menu and is called "Configure View". Look at any of the other views to see how it works. Look at init_config ingui.views.pageview.PageViewfor an explanation of how configuration should be done and look at pedigreeview.py for an example of how the configuration dialog has been implemented. As a first step I suggest you provide a new patch containing just one of your changes - I suggest the option to show/hide images - and make it use the Configure View dialog. Once this is working and I have committed it to the repository then new patches can be made to add each of the other changes. Bye Gary ----- Original Message ----- > From: Gary Burton <bur...@ya...> > To: "gra...@li..." <gra...@li...> > Cc: > Sent: Saturday, 21 April 2012, 10:05 > Subject: Re: [Gramps-devel] [GraphView] Please provide feedback > > Hello Mathieu > > I will look at your patch tonight. Been a busy week so far. > > Bye > > Gary > > > > ----- Original Message ----- >> From: Mathieu MD <mat...@gm...> >> To: gra...@li... >> Cc: >> Sent: Friday, 20 April 2012, 22:25 >> Subject: Re: [Gramps-devel] [GraphView] Please provide feedback >> >> Hello, >> >> I added the possibility to highlight the home person. >> >> And fixed the status bar (see my previous email). >> >> Bests, >> -- >> Mathieu >> >> On 18/04/2012 11:06, Mathieu MD wrote: >>> Hi Serge, >>> >>> Thanks for your feedback. >>> >>> On 17/04/2012 20:56, Serge Noiraud wrote: >>>>> - background color >>>> Now , when zooming we have two colors : white and grey. >>> >>> I find it easier to understand: the gray zone do contains the tree > items >>> (the working zone), while the white zone is only the background > filling >>> the window. >>> >>> >> - the gtk.Adjustment zooms, which I think were too much > zoomable >>> >> before. >>> > I disagree with that. I have a tree with more than 2000 persons. >>> > There is more than 5000 persons in my database. >>> > To see correctly some parts of my tree I need to go to the > maximum >>> > zoom which is 9.5. >>> > it is not sufficient in some case. >>> >>> I saw your screenshot; indeed it's not usable at all. >>> >>> I reverted the previous line, except I grown the max value from 10.00 > to >>> 20.00, so it should be enough to zoom in really big trees. >>> >>> Just replace the line 220 with: >>> adj = gtk.Adjustment (1.00, 0.05, 20.00, 0.05, 0.50, 0.50) >>> #adj = gtk.Adjustment (1.00, 0.1, 2.5, 0.05, 0.50, 0.50) >>> >>> (new patch attached) >>> >>> > If you have some small trees, I understand you think it's > too >> big. >>> >>> I didn't thought the zoom was depending on the number of items: > when I >>> tried loading trees, with 5 persons or with hundreds, the zoom seems > to >>> be a fixed value; so I though it was only required to zoom out, and >>> almost never zoom in except for users with viewing disability. >>> >>> > Perhaps it should be better to have a configurable value for > this. >>> >>> I don't think its really worth the pain... ;-) >>> >>> Thanks. >> >> > ------------------------------------------------------------------------------ >> For Developers, A Lot Can Happen In A Second. >> Boundary is the first to Know...and Tell You. >> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >> http://p.sf.net/sfu/Boundary-d2dvs2 >> _______________________________________________ >> Gramps-devel mailing list >> Gra...@li... >> https://lists.sourceforge.net/lists/listinfo/gramps-devel >> > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > |
From: Mathieu MD <mat...@gm...> - 2012-05-05 20:22:06
|
Gary, OK, it wasn't easy to split the several changes I made to graphview.py, but its done. Your first patch, "show image" configuration, is in Mantis: http://www.gramps-project.org/bugs/view.php?id=5725 Please give it a look. Regards, -- Mathieu On 22/04/2012 23:36, Gary Burton wrote: > Hello Mathieu > > I have looked at your patch. As I mentioned before, it contains lots of different changes and it is better to break the patch up into separate patches so that each change can be added to the repostory separately. > > > The first thing I think needs to be added is configuration. Your patch implements configuration with a right mouse button context menu and you have called register_manager to set/get the values. Views in Gramps which derive from gui.views.pageview.PageView (which GraphView ultimately does) provide a dialog window for displaying/saving/getting configuration settings and it just needs to be set up in Graphview. The dialog is called from the View menu and is called "Configure View". Look at any of the other views to see how it works. Look at init_config ingui.views.pageview.PageViewfor an explanation of how configuration should be done and look at pedigreeview.py for an example of how the configuration dialog has been implemented. > > As a first step I suggest you provide a new patch containing just one of your changes - I suggest the option to show/hide images - and make it use the Configure View dialog. Once this is working and I have committed it to the repository then new patches can be made to add each of the other changes. > > Bye > > Gary > > > > > > ----- Original Message ----- >> From: Gary Burton<bur...@ya...> >> To: "gra...@li..."<gra...@li...> >> Cc: >> Sent: Saturday, 21 April 2012, 10:05 >> Subject: Re: [Gramps-devel] [GraphView] Please provide feedback >> >> Hello Mathieu >> >> I will look at your patch tonight. Been a busy week so far. >> >> Bye >> >> Gary >> >> >> >> ----- Original Message ----- >>> From: Mathieu MD<mat...@gm...> >>> To: gra...@li... >>> Cc: >>> Sent: Friday, 20 April 2012, 22:25 >>> Subject: Re: [Gramps-devel] [GraphView] Please provide feedback >>> >>> Hello, >>> >>> I added the possibility to highlight the home person. >>> >>> And fixed the status bar (see my previous email). >>> >>> Bests, >>> -- >>> Mathieu >>> >>> On 18/04/2012 11:06, Mathieu MD wrote: >>>> Hi Serge, >>>> >>>> Thanks for your feedback. >>>> >>>> On 17/04/2012 20:56, Serge Noiraud wrote: >>>>>> - background color >>>>> Now , when zooming we have two colors : white and grey. >>>> >>>> I find it easier to understand: the gray zone do contains the tree >> items >>>> (the working zone), while the white zone is only the background >> filling >>>> the window. >>>> >>>> >> - the gtk.Adjustment zooms, which I think were too much >> zoomable >>>> >> before. >>>> > I disagree with that. I have a tree with more than 2000 persons. >>>> > There is more than 5000 persons in my database. >>>> > To see correctly some parts of my tree I need to go to the >> maximum >>>> > zoom which is 9.5. >>>> > it is not sufficient in some case. >>>> >>>> I saw your screenshot; indeed it's not usable at all. >>>> >>>> I reverted the previous line, except I grown the max value from 10.00 >> to >>>> 20.00, so it should be enough to zoom in really big trees. >>>> >>>> Just replace the line 220 with: >>>> adj = gtk.Adjustment (1.00, 0.05, 20.00, 0.05, 0.50, 0.50) >>>> #adj = gtk.Adjustment (1.00, 0.1, 2.5, 0.05, 0.50, 0.50) >>>> >>>> (new patch attached) >>>> >>>> > If you have some small trees, I understand you think it's >> too >>> big. >>>> >>>> I didn't thought the zoom was depending on the number of items: >> when I >>>> tried loading trees, with 5 persons or with hundreds, the zoom seems >> to >>>> be a fixed value; so I though it was only required to zoom out, and >>>> almost never zoom in except for users with viewing disability. >>>> >>>> > Perhaps it should be better to have a configurable value for >> this. >>>> >>>> I don't think its really worth the pain... ;-) >>>> >>>> Thanks. >>> >>> >> ------------------------------------------------------------------------------ >>> For Developers, A Lot Can Happen In A Second. >>> Boundary is the first to Know...and Tell You. >>> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >>> http://p.sf.net/sfu/Boundary-d2dvs2 >>> _______________________________________________ >>> Gramps-devel mailing list >>> Gra...@li... >>> https://lists.sourceforge.net/lists/listinfo/gramps-devel >>> >> >> ------------------------------------------------------------------------------ >> For Developers, A Lot Can Happen In A Second. >> Boundary is the first to Know...and Tell You. >> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >> http://p.sf.net/sfu/Boundary-d2dvs2 >> _______________________________________________ >> Gramps-devel mailing list >> Gra...@li... >> https://lists.sourceforge.net/lists/listinfo/gramps-devel >> > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel |
From: Mathieu MD <mat...@gm...> - 2012-05-23 10:10:43
|
Hello Gary, I uploaded a new patch here: http://www.gramps-project.org/bugs/view.php?id=5763 ================================= - Show full localized dates "1933-11-22" insdead of "1933". Or "22 nov 1933" if French locale - Show places "1933 - San Francisco,CA,US" Or "1933-11-22 - San Francisco,CA,US" - Highlight the home person Women are displayed in Pink and men in Blue. Now the home person can be highlighted in Green. ================================= All three are small features, so now that the configuration is commited, it's not really necessary to split this patch. Thanks! Kind regards, -- Mathieu On 22/05/2012 23:20, Gary Burton wrote: > Hello Mathieu > > Finally found time to apply your patches. > > Thanks > > Gary > > > > ----- Original Message ----- >> From: Mathieu MD<mat...@gm...> >> To: Gary Burton<bur...@ya...> >> Cc: "gra...@li..."<gra...@li...> >> Sent: Saturday, 5 May 2012, 21:21 >> Subject: Re: [Gramps-devel] [GraphView] Please provide feedback >> >> G ary, >> >> OK, it wasn't easy to split the several changes I made to graphview.py, >> but its done. Your first patch, "show image" configuration, is in >> Mantis: >> http://www.gramps-project.org/bugs/view.php?id=5725 |
From: Serge N. <Ser...@fr...> - 2013-06-19 18:35:36
Attachments:
GraphView.zoom.patch
|
Hi, I know this thread is very old, but I found a solution for the zoom. I have a patch for trunk. At each time we have a database change, we change the scale with a max value depending on the numbers of persons in the database. Le 18/04/2012 11:06, Mathieu MD a écrit : > Hi Serge, > > Thanks for your feedback. > > On 17/04/2012 20:56, Serge Noiraud wrote: >>> - background color >> Now , when zooming we have two colors : white and grey. > > I find it easier to understand: the gray zone do contains the tree items (the working zone), while the white zone is only the background filling the window. > > >> - the gtk.Adjustment zooms, which I think were too much zoomable > >> before. > > I disagree with that. I have a tree with more than 2000 persons. > > There is more than 5000 persons in my database. > > To see correctly some parts of my tree I need to go to the maximum > > zoom which is 9.5. > > it is not sufficient in some case. > > I saw your screenshot; indeed it's not usable at all. > > I reverted the previous line, except I grown the max value from 10.00 to 20.00, so it should be enough to zoom in really big trees. > > Just replace the line 220 with: > adj = gtk.Adjustment (1.00, 0.05, 20.00, 0.05, 0.50, 0.50) > #adj = gtk.Adjustment (1.00, 0.1, 2.5, 0.05, 0.50, 0.50) > > (new patch attached) > > > If you have some small trees, I understand you think it's too big. > > I didn't thought the zoom was depending on the number of items: when I tried loading trees, with 5 persons or with hundreds, the zoom seems to be a fixed value; so I though it was only required to zoom out, and almost never zoom in except for users with viewing disability. > > > Perhaps it should be better to have a configurable value for this. > > I don't think its really worth the pain... ;-) > > Thanks. |
From: doug <do...@o2...> - 2013-06-25 12:28:41
|
Can I test this on gramps 4.0.2 svn 22605? I don't find a file named graphview.py. Doug On 19/06/13 19:35, Serge Noiraud wrote: > > --- graphview.py.orig 2013-06-19 18:37:49.764301922 +0200 > +++ graphview.py 2013-06-19 19:02:06.489090356 +0200 > @@ -8,6 +8,7 @@ > # report. > # Mouse panning is derived from the pedigree view > # Copyright (C) 2012 Mathieu MD > +# Copyright (C) 2013 Serge Noiraud > # > # This program is free software; you can redistribute it and/or modify > # it under the terms of the GNU General Public License as published by > @@ -35,6 +36,7 @@ > #------------------------------------------------------------------------- > import os > import sys > +from math import log > from xml.parsers.expat import ExpatError, ParserCreate > from gramps.gen.const import GRAMPS_LOCALE as glocale > try: > @@ -131,6 +133,10 @@ > Set up callback for changes to the database > """ > self._change_db(db) > + nb_persons = int(db.get_number_of_people()+5) > + zoom = log(nb_persons,10)*log(nb_persons,5) > + max_zoom = 5.0 if zoom < 5.0 else zoom > + self.graph_widget.change_max_zoom(max_zoom) > if self.active: > self.graph_widget.clear() > if self.get_active() != "": > @@ -330,12 +336,10 @@ > self.vbox.pack_start(hbox, False, False, 0) > zoom_label = Gtk.Label(label="Zoom:") > hbox.pack_start (zoom_label, False, False, 0) > - > - adj = Gtk.Adjustment (1.00, 0.05, 10.00, 0.05, 0.50, 0.50) > - scale = Gtk.HScale(adjustment=adj) > - adj.connect("value_changed", self.zoom_changed) > - hbox.pack_start(scale, True, True, 0) > + self.scale = Gtk.HBox(False,4) > + hbox.pack_start(self.scale, True, True, 0) > self.vbox.pack_start(scrolled_win, True, True, 0) > + self.change_max_zoom(10.0) > > def populate(self, active_person): > """ > @@ -369,6 +373,20 @@ > # Update the status bar > self.view.change_page() > > + def change_max_zoom(self, max_zoom): > + """ > + Change the maximum value of the zoom. > + """ > + try: > + self.scale1.destroy() # destroy the Scale if it exists. > + except: # we can't change the max value > + pass # then recreate a new scale > + adj = Gtk.Adjustment (1.00, 0.05, float(max_zoom), 0.05, 0.50, 0.50) > + self.scale1 = Gtk.HScale(adjustment=adj) > + self.scale1.show() > + adj.connect("value_changed", self.zoom_changed) > + self.scale.pack_start(self.scale1, True, True, 0) > + > def clear(self): > """ > Clear the graph by creating a new root item |
From: Serge N. <Ser...@fr...> - 2013-06-25 16:40:02
|
Le 25/06/2013 14:28, doug a écrit : > Can I test this on gramps 4.0.2 svn 22605? > I don't find a file named graphview.py. Yes, the GraphView plugin under linux is under : $HOME/.gramps/gramps40/plugins/GraphView and the patch apply to the file graphview.py in this directory. You need to have the plugin installed from preferences. > > Doug > > > > On 19/06/13 19:35, Serge Noiraud wrote: >> --- graphview.py.orig 2013-06-19 18:37:49.764301922 +0200 >> +++ graphview.py 2013-06-19 19:02:06.489090356 +0200 >> @@ -8,6 +8,7 @@ >> # report. >> # Mouse panning is derived from the pedigree view >> # Copyright (C) 2012 Mathieu MD >> +# Copyright (C) 2013 Serge Noiraud >> # >> # This program is free software; you can redistribute it and/or modify >> # it under the terms of the GNU General Public License as published by >> @@ -35,6 +36,7 @@ >> #------------------------------------------------------------------------- >> import os >> import sys >> +from math import log >> from xml.parsers.expat import ExpatError, ParserCreate >> from gramps.gen.const import GRAMPS_LOCALE as glocale >> try: >> @@ -131,6 +133,10 @@ >> Set up callback for changes to the database >> """ >> self._change_db(db) >> + nb_persons = int(db.get_number_of_people()+5) >> + zoom = log(nb_persons,10)*log(nb_persons,5) >> + max_zoom = 5.0 if zoom < 5.0 else zoom >> + self.graph_widget.change_max_zoom(max_zoom) >> if self.active: >> self.graph_widget.clear() >> if self.get_active() != "": >> @@ -330,12 +336,10 @@ >> self.vbox.pack_start(hbox, False, False, 0) >> zoom_label = Gtk.Label(label="Zoom:") >> hbox.pack_start (zoom_label, False, False, 0) >> - >> - adj = Gtk.Adjustment (1.00, 0.05, 10.00, 0.05, 0.50, 0.50) >> - scale = Gtk.HScale(adjustment=adj) >> - adj.connect("value_changed", self.zoom_changed) >> - hbox.pack_start(scale, True, True, 0) >> + self.scale = Gtk.HBox(False,4) >> + hbox.pack_start(self.scale, True, True, 0) >> self.vbox.pack_start(scrolled_win, True, True, 0) >> + self.change_max_zoom(10.0) >> >> def populate(self, active_person): >> """ >> @@ -369,6 +373,20 @@ >> # Update the status bar >> self.view.change_page() >> >> + def change_max_zoom(self, max_zoom): >> + """ >> + Change the maximum value of the zoom. >> + """ >> + try: >> + self.scale1.destroy() # destroy the Scale if it exists. >> + except: # we can't change the max value >> + pass # then recreate a new scale >> + adj = Gtk.Adjustment (1.00, 0.05, float(max_zoom), 0.05, 0.50, 0.50) >> + self.scale1 = Gtk.HScale(adjustment=adj) >> + self.scale1.show() >> + adj.connect("value_changed", self.zoom_changed) >> + self.scale.pack_start(self.scale1, True, True, 0) >> + >> def clear(self): >> """ >> Clear the graph by creating a new root item > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > > |
From: doug <do...@o2...> - 2013-06-25 18:47:46
|
On 25/06/13 17:40, Serge Noiraud wrote: > Le 25/06/2013 14:28, doug a écrit : >> Can I test this on gramps 4.0.2 svn 22605? >> I don't find a file named graphview.py. > Yes, the GraphView plugin under linux is under : > $HOME/.gramps/gramps40/plugins/GraphView > and the patch apply to the file graphview.py in this directory. > > You need to have the plugin installed from preferences. > >> <snip> Sorry, I keep forgetting to look in .gramps. The patch crashes Graphview when there are more than a couple of dozen people in the tree. Shall I report a bug on the tracker or would you like details here? Doug |
From: Serge N. <Ser...@fr...> - 2013-06-25 19:30:56
|
Le 25/06/2013 20:47, doug a écrit : > On 25/06/13 17:40, Serge Noiraud wrote: >> Le 25/06/2013 14:28, doug a écrit : >>> Can I test this on gramps 4.0.2 svn 22605? >>> I don't find a file named graphview.py. >> Yes, the GraphView plugin under linux is under : >> $HOME/.gramps/gramps40/plugins/GraphView >> and the patch apply to the file graphview.py in this directory. >> >> You need to have the plugin installed from preferences. >> > <snip> > > Sorry, I keep forgetting to look in .gramps. > > The patch crashes Graphview when there are more than a > couple of dozen people in the tree. > Shall I report a bug on the tracker or would you like > details here? You can send it here. It didn't crash for me with more than 6000 people. > > Doug > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > > |
From: doug <do...@o2...> - 2013-06-26 12:14:15
|
On 25/06/13 20:30, Serge Noiraud wrote: > Le 25/06/2013 20:47, doug a écrit : >> On 25/06/13 17:40, Serge Noiraud wrote: >>> Le 25/06/2013 14:28, doug a écrit : >>>> Can I test this on gramps 4.0.2 svn 22605? >>>> I don't find a file named graphview.py. >>> Yes, the GraphView plugin under linux is under : >>> $HOME/.gramps/gramps40/plugins/GraphView >>> and the patch apply to the file graphview.py in this >>> directory. >>> >>> You need to have the plugin installed from preferences. >>> >> <snip> >> >> Sorry, I keep forgetting to look in .gramps. >> >> The patch crashes Graphview when there are more than a >> couple of dozen people in the tree. >> Shall I report a bug on the tracker or would you like >> details here? > You can send it here. > It didn't crash for me with more than 6000 people. > > User Information: =================== GraphView for person with 18 descendants (Zoom slider is sitting on 1.0) Error Details: =================== 4178: WARNING: spell.py: line 74: GtkSpell not loaded. Spell checking will not be available. To build it for Gramps see http://www.gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion#Spell_Check_Install166743: ERROR: grampsapp.py: line 114: Unhandled exception Traceback (most recent call last): File "/usr/local/lib/python3.2/dist-packages/gramps/gui/viewmanager.py", line 1284, in view_changed self.__change_page(page_num) File "/usr/local/lib/python3.2/dist-packages/gramps/gui/viewmanager.py", line 1297, in __change_page self.active_page.set_active() File "/usr/local/lib/python3.2/dist-packages/gramps/gui/views/navigationview.py", line 163, in set_active self.goto_active(None) File "/usr/local/lib/python3.2/dist-packages/gramps/gui/views/navigationview.py", line 198, in goto_active self.goto_handle(active_handle) File "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", line 207, in goto_handle self.graph_widget.populate(self.get_active()) File "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", line 357, in populate parser.parse(svg_data) File "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", line 576, in parse parser.Parse(ifile) File "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", line 852, in start_element start_function(attrs) File "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", line 765, in start_path line_dash = GooCanvas.CanvasLineDash([5.0, 5.0])) TypeError: function takes at most 0 arguments (1 given) System Information: =================== Python version: 3.2.3 (default, Jun 25 2012, 23:10:56) [GCC 4.7.1] BSDDB version: 5.3.0 (5, 3, 21) Gramps version: 4.0.2 LANG: en_GB.UTF-8 OS: Linux Distribution: 3.2.0-4-amd64 GTK version : 3.4.2 gobject version: 3.4.2 cairo version : (1, 10, 0) |
From: Serge N. <Ser...@fr...> - 2013-06-26 19:15:51
|
Hi doug Le 26/06/2013 14:14, doug a écrit : > On 25/06/13 20:30, Serge Noiraud wrote: >> Le 25/06/2013 20:47, doug a écrit : >>> On 25/06/13 17:40, Serge Noiraud wrote: >>>> Le 25/06/2013 14:28, doug a écrit : >>>>> Can I test this on gramps 4.0.2 svn 22605? >>>>> I don't find a file named graphview.py. >>>> Yes, the GraphView plugin under linux is under : >>>> $HOME/.gramps/gramps40/plugins/GraphView >>>> and the patch apply to the file graphview.py in this >>>> directory. >>>> >>>> You need to have the plugin installed from preferences. >>>> >>> <snip> >>> >>> Sorry, I keep forgetting to look in .gramps. >>> >>> The patch crashes Graphview when there are more than a >>> couple of dozen people in the tree. >>> Shall I report a bug on the tracker or would you like >>> details here? >> You can send it here. >> It didn't crash for me with more than 6000 people. >> >> > User Information: > =================== > > GraphView for person with 18 descendants > (Zoom slider is sitting on 1.0) > > > Error Details: > =================== > > 4178: WARNING: spell.py: line 74: GtkSpell not loaded. Spell > checking will not be available. > To build it for Gramps see > http://www.gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion#Spell_Check_Install166743: > ERROR: grampsapp.py: line 114: Unhandled exception > Traceback (most recent call last): > File > "/usr/local/lib/python3.2/dist-packages/gramps/gui/viewmanager.py", > line 1284, in view_changed > self.__change_page(page_num) > File > "/usr/local/lib/python3.2/dist-packages/gramps/gui/viewmanager.py", > line 1297, in __change_page > self.active_page.set_active() > File > "/usr/local/lib/python3.2/dist-packages/gramps/gui/views/navigationview.py", > line 163, in set_active > self.goto_active(None) > File > "/usr/local/lib/python3.2/dist-packages/gramps/gui/views/navigationview.py", > line 198, in goto_active > self.goto_handle(active_handle) > File > "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", > line 207, in goto_handle > self.graph_widget.populate(self.get_active()) > File > "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", > line 357, in populate > parser.parse(svg_data) > File > "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", > line 576, in parse > parser.Parse(ifile) > File > "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", > line 852, in start_element > start_function(attrs) > File > "/home/dougb/.gramps/gramps40/plugins/GraphView/graphview.py", > line 765, in start_path > line_dash = GooCanvas.CanvasLineDash([5.0, 5.0])) > TypeError: function takes at most 0 arguments (1 given) This is related to BUG #0006816 <http://www.gramps-project.org/bugs/view.php?id=6816>. I have a work around for this : stroke_color = attrs.get('stroke') if attrs.get('stroke-dasharray'): is_dashed = True <==== line 757 else: is_dashed = False at this line, replace True by False and the problem will disapear > > > System Information: > =================== > > Python version: 3.2.3 (default, Jun 25 2012, 23:10:56) [GCC > 4.7.1] > BSDDB version: 5.3.0 (5, 3, 21) > Gramps version: 4.0.2 > LANG: en_GB.UTF-8 > OS: Linux > Distribution: 3.2.0-4-amd64 > > GTK version : 3.4.2 > gobject version: 3.4.2 > cairo version : (1, 10, 0) > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > > |
From: doug <do...@o2...> - 2013-06-26 21:42:55
|
Hi Serge, On 26/06/13 20:15, Serge Noiraud wrote: > Hi doug > > Le 26/06/2013 14:14, doug a écrit : >> On 25/06/13 20:30, Serge Noiraud wrote: >>> Le 25/06/2013 20:47, doug a écrit : >>>> On 25/06/13 17:40, Serge Noiraud wrote: >>>>> Le 25/06/2013 14:28, doug a écrit : >>>>>> Can I test this on gramps 4.0.2 svn 22605? >>>>>> I don't find a file named graphview.py. >>>>> Yes, the GraphView plugin under linux is under : >>>>> $HOME/.gramps/gramps40/plugins/GraphView >>>>> and the patch apply to the file graphview.py in this >>>>> directory. >>>>> >>>>> You need to have the plugin installed from preferences. >>>>> >>>> <snip> >>>> >>>> Sorry, I keep forgetting to look in .gramps. >>>> >>>> The patch crashes Graphview when there are more than a >>>> couple of dozen people in the tree. >>>> Shall I report a bug on the tracker or would you like >>>> details here? >>> You can send it here. >>> It didn't crash for me with more than 6000 people. >>> >>> >> User Information: >> =================== >> >> GraphView for person with 18 descendants >> (Zoom slider is sitting on 1.0) >> >> <snip> > This is related to BUG #0006816 > <http://www.gramps-project.org/bugs/view.php?id=6816>. > > I have a work around for this : > >            stroke_color = attrs.get('stroke') >            if attrs.get('stroke-dasharray'): >                is_dashed = > True                              > <==== line 757 >            else: >                is_dashed = False >        >  at this line, replace True by False and the problem will > disapear >> It was exactly bug #0006816 and your workround fixes it perfectly. Thanks, Doug |
From: doug <do...@o2...> - 2013-06-27 09:51:45
|
On 26/06/13 22:42, doug wrote: > Hi Serge, > > On 26/06/13 20:15, Serge Noiraud wrote: >> Hi doug >> >> Le 26/06/2013 14:14, doug a écrit : >>> On 25/06/13 20:30, Serge Noiraud wrote: >>>> Le 25/06/2013 20:47, doug a écrit : >>>>> On 25/06/13 17:40, Serge Noiraud wrote: >>>>>> Le 25/06/2013 14:28, doug a écrit : >>>>>>> Can I test this on gramps 4.0.2 svn 22605? >>>>>>> I don't find a file named graphview.py. >>>>>> Yes, the GraphView plugin under linux is under : >>>>>> $HOME/.gramps/gramps40/plugins/GraphView >>>>>> and the patch apply to the file graphview.py in this >>>>>> directory. >>>>>> >>>>>> You need to have the plugin installed from preferences. >>>>>> >>>>> <snip> >>>>> >>>>> Sorry, I keep forgetting to look in .gramps. >>>>> >>>>> The patch crashes Graphview when there are more than a >>>>> couple of dozen people in the tree. >>>>> Shall I report a bug on the tracker or would you like >>>>> details here? >>>> You can send it here. >>>> It didn't crash for me with more than 6000 people. >>>> >>>> >>> User Information: >>> =================== >>> >>> GraphView for person with 18 descendants >>> (Zoom slider is sitting on 1.0) >>> >>> > <snip> > >> This is related to BUG #0006816 >> <http://www.gramps-project.org/bugs/view.php?id=6816>. >> >> I have a work around for this : >> >>            stroke_color = attrs.get('stroke') >>            if attrs.get('stroke-dasharray'): >>                is_dashed = >> True                              >> <==== line 757 >>            else: >>                is_dashed = False >>        >>  at this line, replace True by False and the problem will >> disapear >>> > > It was exactly bug #0006816 and your workround fixes it > perfectly. > > Thanks, > > Doug > I've also tried the patch on 3.4.5-1. Patching rejected 1 hunk out of 5, but the patched GraphView then still works fine without the need for this workround. Doug |
From: Serge N. <Ser...@fr...> - 2013-06-27 11:20:35
|
Le 27/06/2013 11:51, doug a écrit : > On 26/06/13 22:42, doug wrote: >> Hi Serge, >> >> On 26/06/13 20:15, Serge Noiraud wrote: >>> Hi doug >>> >>> Le 26/06/2013 14:14, doug a écrit : >>>> On 25/06/13 20:30, Serge Noiraud wrote: >>>>> Le 25/06/2013 20:47, doug a écrit : >>>>>> On 25/06/13 17:40, Serge Noiraud wrote: >>>>>>> Le 25/06/2013 14:28, doug a écrit : >>>>>>>> Can I test this on gramps 4.0.2 svn 22605? >>>>>>>> I don't find a file named graphview.py. >>>>>>> Yes, the GraphView plugin under linux is under : >>>>>>> $HOME/.gramps/gramps40/plugins/GraphView >>>>>>> and the patch apply to the file graphview.py in this >>>>>>> directory. >>>>>>> >>>>>>> You need to have the plugin installed from preferences. >>>>>>> >>>>>> <snip> >>>>>> >>>>>> Sorry, I keep forgetting to look in .gramps. >>>>>> >>>>>> The patch crashes Graphview when there are more than a >>>>>> couple of dozen people in the tree. >>>>>> Shall I report a bug on the tracker or would you like >>>>>> details here? >>>>> You can send it here. >>>>> It didn't crash for me with more than 6000 people. >>>>> >>>>> >>>> User Information: >>>> =================== >>>> >>>> GraphView for person with 18 descendants >>>> (Zoom slider is sitting on 1.0) >>>> >>>> >> <snip> >> >>> This is related to BUG #0006816 >>> <http://www.gramps-project.org/bugs/view.php?id=6816>. >>> >>> I have a work around for this : >>> >>>            stroke_color = attrs.get('stroke') >>>            if attrs.get('stroke-dasharray'): >>>                is_dashed = >>> True                              >>> <==== line 757 >>>            else: >>>                is_dashed = False >>>        >>>  at this line, replace True by False and the problem will >>> disapear >> It was exactly bug #0006816 and your workround fixes it >> perfectly. >> >> Thanks, >> >> Doug >> > I've also tried the patch on 3.4.5-1. > Patching rejected 1 hunk out of 5, but the patched GraphView > then still works fine without the need for this workround. Do you mean you want this patch too for 3.4.x ? > > Doug > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > > |
From: doug <do...@o2...> - 2013-06-28 14:09:27
|
On 27/06/13 12:20, Serge Noiraud wrote: > Le 27/06/2013 11:51, doug a écrit : >> On 26/06/13 22:42, doug wrote: >>> Hi Serge, >>> >>> On 26/06/13 20:15, Serge Noiraud wrote: >>>> Hi doug >>>> >>>> Le 26/06/2013 14:14, doug a écrit : >>>>> On 25/06/13 20:30, Serge Noiraud wrote: >>>>>> Le 25/06/2013 20:47, doug a écrit : >>>>>>> On 25/06/13 17:40, Serge Noiraud wrote: >>>>>>>> Le 25/06/2013 14:28, doug a écrit : >>>>>>>>> Can I test this on gramps 4.0.2 svn 22605? >>>>>>>>> I don't find a file named graphview.py. >>>>>>>> Yes, the GraphView plugin under linux is under : >>>>>>>> $HOME/.gramps/gramps40/plugins/GraphView >>>>>>>> and the patch apply to the file graphview.py in this >>>>>>>> directory. >>>>>>>> >>>>>>>> You need to have the plugin installed from preferences. >>>>>>>> >>>>>>> <snip> >>>>>>> >>>>>>> Sorry, I keep forgetting to look in .gramps. >>>>>>> >>>>>>> The patch crashes Graphview when there are more than a >>>>>>> couple of dozen people in the tree. >>>>>>> Shall I report a bug on the tracker or would you like >>>>>>> details here? >>>>>> You can send it here. >>>>>> It didn't crash for me with more than 6000 people. >>>>>> >>>>>> >>>>> User Information: >>>>> =================== >>>>> >>>>> GraphView for person with 18 descendants >>>>> (Zoom slider is sitting on 1.0) >>>>> >>>>> >>> <snip> >>> >>>> This is related to BUG #0006816 >>>> <http://www.gramps-project.org/bugs/view.php?id=6816>. >>>> >>>> I have a work around for this : >>>> >>>>            stroke_color = attrs.get('stroke') >>>>            if attrs.get('stroke-dasharray'): >>>>                is_dashed = >>>> True                              >>>> <==== line 757 >>>>            else: >>>>                is_dashed = False >>>>        >>>>  at this line, replace True by False and the problem will >>>> disapear >>> It was exactly bug #0006816 and your workround fixes it >>> perfectly. >>> >>> Thanks, >>> >>> Doug >>> >> I've also tried the patch on 3.4.5-1. >> Patching rejected 1 hunk out of 5, but the patched GraphView >> then still works fine without the need for this workround. > Do you mean you want this patch too for 3.4.x ? It was a confusion on my part - I was thinking of bug #0006802 which applies to both 4.0.2 and 3.4.5. However, the patched 3.4.5-1 graphview.py seems fine, so I'll leave it as it is. Doug |