BALKANGraph / FamilyTreeJS

Build family tree app with BALKAN FamilyTreeJS library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
50 stars 16 forks source link

What should I do if I want to place the male on the right? #81

Closed wanyouyu closed 8 months ago

wanyouyu commented 8 months ago

Now it's on the left. I want to place the male on the right

ZornitsaPesheva commented 8 months ago

You need to change the field definition in the template: Example: FamilyTree.templates.tommy_male.field_0 = '<text ' + FamilyTree.attr.width + ' ="230" style="font-size: 18px;font-weight:bold;" fill="#ffffff" x="210" y="90" text-anchor="end">{val}'; Here I have changed X and "text-anchor" to move the manes on the right

wanyouyu commented 8 months ago

I want to place men on the right and women on the left, because in China, people who place them on the right are more prestigious. I originally intended to rely on_ SetPositions to modify their positioning, but its positioning data seems to come from OrgChartJS. I think it won't work if just modifying ? right? Perhaps my understanding of the entire source code is insufficient.

ZornitsaPesheva commented 8 months ago

You can use "left-partner" Simple example here: https://code.balkan.app/org-chart-js/left-partner#JS It is the same for Family Tree JS. It is used in this demo: https://code.balkan.app/family-tree-js/multiple-templates-family-tree#JS

wanyouyu commented 8 months ago

Thank you very much. It worked and solved a big problem for me.