gramps/gramps/plugins/view/view.gpr.py
Bastien Jacquet fec5d532d1 Feature: Gep-030 FanChart2Way
...New FanChart consisting of both ascendants and descendants.

It can be checked-out there :
https://sourceforge.net/u/bubblegum00/gramps/ci/geps/gep-030-FanChart2Way/~/tree/

<snip>

I find it quite handy, so please let me know if you have any comments or suggestions.

NB: I heavily cleaned up the FanChart code on my way.

Regards,

Bastien Jacquet

https://sourceforge.net/p/gramps/mailman/message/32908110/
........................................................
Refactor fanchart for further modification

Fix radial text pos_start radian alignment

Simplify father's and mother's details getter

Rename draw_gradient to draw_gradient_legend

refactor prepare_background_box

Add option not to flip names

Add a display_format(self, person, num) function as proposed by Benny Malengier on 2012-12-13
It just returns name_display.name_formats[num][_F_FN](person.get_primary_name())

Add option to show the name on two lines

Allow for variable radius depending on generation

Switch to WORD_CHAR wrapping of name (ie word, and char if 0-length word)

Move rescaling tentative inside wrap_truncate_layout

Fix person_under_cursor bugs

Refactor root angle computation

Refactor code positionning the fan

Refactor personpos_at_angle

move implementation of person_under_cursor outside of FanChartBaseWidget class

Change draw_person to take angles in radians

Use same structure for innerring as for outerring

Uses cursor_to_polar and cursor_on_tranlation_dot

Slightly change person_under_cursor logic to return an "address" in the fan

Uses radian_in_bounds to compare angles modulo 2 PI

Fixup test on cursor over inner ring

Fix Center size for FanchartDesc

Fixup fanchart check up to last generation

Give same signature to draw_person

Refactor the common code of self.draw_person in a single function in Base class

Fix center box comment

Refactoring inside celladdress

Remove manual central box drawing since done with draw_person

Fixup draw_person color for duplicates

Use draw_person for central person too

Make __compute_angle and __rec_fill_data public for use in FanChart2Way

Add 2Way View

Rewrite create_map_rect_to_sector to allow bottom-outside-oriented text-arc

Allow to automatically right upside-up bottom arc-text

Correct icons for Fanchart2Way

Small code refactoring

Refactor code of fanchartdesc to use self.rootangle_rad

Rename change_slice to toggle_cell_state

Fanchart2Way code formating and changes

Small refactoring of fanchartdesc innerring fill data

Remove the name from the local temporary data structure

Remove the name from the local temporary data structure (in Fanchart2Way)

Change background gradient to follow the user-selected gradient colors

rename parentsroot to innerring

Some renaming for clearer code

Show last generation of partners in descendant fanchart

Show last partner in Fanchart2Way

Fanchart2Way : Add option to disable gradient on the background

Fixup flipupsidedownname parameter for gramplet usage of fancharts

Fixup twolinename parameter for gramplet usage of fancharts

Add FanChart2Way in available gramplets

Tentative fix for last view on Fanchart2Way

Show step-sibling in Fancharts context-menu

Fix overestimation of descendant halfdist

(SM) Trailing White spaces removed

(SM) Fix config box Table Grid

(SM) Move Icons gramps-fanchart2way to new location

(SM) Add Copyright for Bastien Jacquet

(SM) Fix BSDDB AttributeError NoneType object has no attr

(SM) Update patch to account for bug 9771; fix missing right-click menu items

(Nick Hall/eno93) Fix set_text method takes the length of the utf-8, not the length of the unicode as the second parameter ((Gramps.py:3697): Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text())
2016-11-26 18:00:08 +00:00

308 lines
8.4 KiB
Python

# encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2009 Douglas S. Blank
# Copyright (C) 2009 Nick Hall
# Copyright (C) 2011 Tim G L Lyons
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
MODULE_VERSION="5.0"
#------------------------------------------------------------------------
#
# default views of Gramps
#
#------------------------------------------------------------------------
register(VIEW,
id = 'eventview',
name = _("Events"),
description = _("The view showing all the events"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'eventview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Events", _("Events")),
viewclass = 'EventView',
order = START,
)
register(VIEW,
id = 'familyview',
name = _("Families"),
description = _("The view showing all families"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'familyview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Families", _("Families")),
viewclass = 'FamilyView',
order = START,
)
register(VIEW,
id = 'dashboardview',
name = _("Dashboard"),
description = _("The view showing Gramplets"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'dashboardview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Dashboard", _("Dashboard")),
viewclass = 'DashboardView',
order = START,
)
register(VIEW,
id = 'mediaview',
name = _("Media"),
description = _("The view showing all the media objects"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'mediaview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Media", _("Media")),
viewclass = 'MediaView',
order = START,
)
register(VIEW,
id = 'noteview',
name = _("Notes"),
description = _("The view showing all the notes"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'noteview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Notes", _("Notes")),
viewclass = 'NoteView',
order = START,
)
register(VIEW,
id = 'relview',
name = _("Relationships"),
description = _("The view showing all relationships of the selected person"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'relview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Relationships", _("Relationships")),
viewclass = 'RelationshipView',
order = START,
)
register(VIEW,
id = 'pedigreeview',
name = _("Pedigree"),
description = _("The view showing an ancestor pedigree of the selected person"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'pedigreeview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Ancestry", _("Charts")),
viewclass = 'PedigreeView',
order = START,
stock_icon = 'gramps-pedigree',
)
register(VIEW,
id = 'fanchartview',
name = _("Fan Chart"),
category = ("Ancestry", _("Charts")),
description = _("A view showing parents through a fanchart"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'fanchartview.py',
authors = ["Douglas S. Blank", "B. Malengier"],
authors_email = ["doug.blank@gmail.com", "benny.malengier@gmail.com"],
viewclass = 'FanChartView',
stock_icon = 'gramps-fanchart',
)
register(VIEW,
id = 'fanchartdescview',
name = _("Descendant Fan"),
category = ("Ancestry", _("Charts")),
description = _("Showing descendants through a fanchart"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'fanchartdescview.py',
authors = ["B. Malengier"],
authors_email = ["benny.malengier@gmail.com"],
viewclass = 'FanChartDescView',
stock_icon = 'gramps-fanchartdesc',
)
register(VIEW,
id = 'fanchart2wayview',
name = _("2-Way Fan"),
category = ("Ancestry", _("Charts")),
description = _("Showing ascendants and descendants through a fanchart"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'fanchart2wayview.py',
authors = ["B. Jacquet"],
authors_email = ["bastien.jacquet_dev@m4x.org"],
viewclass = 'FanChart2WayView',
stock_icon = 'gramps-fanchart2way',
)
register(VIEW,
id = 'personview',
name = _("Grouped People"),
description = _("The view showing all people in the Family Tree grouped per"
" family name"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'persontreeview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("People", _("People")),
viewclass = 'PersonTreeView',
order = START,
stock_icon = 'gramps-tree-group',
)
register(VIEW,
id = 'personlistview',
name = _("People"),
description = _("The view showing all people in the Family Tree"
" in a flat list"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'personlistview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("People", _("People")),
viewclass = 'PersonListView',
stock_icon = 'gramps-tree-list',
)
register(VIEW,
id = 'placelistview',
name = _("Places"),
description = _("The view showing all the places of the Family Tree"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'placelistview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Places", _("Places")),
viewclass = 'PlaceListView',
stock_icon = 'gramps-tree-list',
)
register(VIEW,
id = 'placetreeview',
name = _("Place Tree"),
description = _("A view displaying places in a tree format."),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'placetreeview.py',
authors = ["Donald N. Allingham", "Gary Burton", "Nick Hall"],
authors_email = [""],
category = ("Places", _("Places")),
viewclass = 'PlaceTreeView',
stock_icon = 'gramps-tree-group',
order = START,
)
register(VIEW,
id = 'repoview',
name = _("Repositories"),
description = _("The view showing all the repositories"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'repoview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Repositories", _("Repositories")),
viewclass = 'RepositoryView',
order = START,
)
register(VIEW,
id = 'sourceview',
name = _("Sources"),
description = _("The view showing all the sources"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'sourceview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Sources", _("Sources")),
viewclass = 'SourceView',
order = START,
stock_icon = 'gramps-tree-list',
)
register(VIEW,
id = 'citationlistview',
name = _("Citations"),
description = _("The view showing all the citations"),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'citationlistview.py',
authors = ["The Gramps project"],
authors_email = ["http://gramps-project.org"],
category = ("Citations", _("Citations")),
viewclass = 'CitationListView',
order = START,
)
register(VIEW,
id = 'citationtreeview',
name = _("Citation Tree"),
description = _("A view displaying citations and sources in a tree format."),
version = '1.0',
gramps_target_version = MODULE_VERSION,
status = STABLE,
fname = 'citationtreeview.py',
authors = ["Tim G L Lyons", "Nick Hall"],
authors_email = [""],
category = ("Sources", _("Sources")),
viewclass = 'CitationTreeView',
stock_icon = 'gramps-tree-select',
)