[go: up one dir, main page]

CN110609927B - Visual family tree layout method, terminal device and storage medium - Google Patents

Visual family tree layout method, terminal device and storage medium Download PDF

Info

Publication number
CN110609927B
CN110609927B CN201910904081.0A CN201910904081A CN110609927B CN 110609927 B CN110609927 B CN 110609927B CN 201910904081 A CN201910904081 A CN 201910904081A CN 110609927 B CN110609927 B CN 110609927B
Authority
CN
China
Prior art keywords
node
nodes
entering
judging whether
layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910904081.0A
Other languages
Chinese (zh)
Other versions
CN110609927A (en
Inventor
李密
王丰年
许恒
张磊
赵建强
畅斌
黄振中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN201910904081.0A priority Critical patent/CN110609927B/en
Publication of CN110609927A publication Critical patent/CN110609927A/en
Application granted granted Critical
Publication of CN110609927B publication Critical patent/CN110609927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/904Browsing; Visualisation therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention relates to a visualized family tree layout method, terminal equipment and a storage medium, wherein the method comprises the following steps: s1: constructing a configuration file according to the relationship between the figure nodes, carrying out hierarchical processing on the nodes, and setting the nodes belonging to the spouse relationship and the brother relationship as the same layer; s2: arranging the sequence of the figure nodes according to the relation of the figure nodes of each layer, preferably enabling brother nodes to be adjacent and then enabling spouse nodes to be adjacent; s3: setting the position of each node according to the arrangement sequence of the nodes, wherein the position of a child node of the next layer is arranged in the middle of the position of a parent node corresponding to the child node of the previous layer, and calculating the coordinate of each node; s4: and drawing the link lines between the nodes according to the coordinates of each node, and marking the relationship between the nodes on the corresponding link lines. The layout of family members is automatically completed by the system, and the family tree structures of a plurality of families can be completely displayed by only loading the configuration file once.

Description

Visual family tree layout method, terminal device and storage medium
Technical Field
The invention relates to the field of computer data visualization, in particular to a visualized family tree layout method, terminal equipment and a storage medium.
Background
With the explosive growth of data, the data needs to be analyzed, and the original table display mode is obscure and unattractive, so that the mainstream data result display task cannot be taken. For the reasons, the visualized display and analysis of the data become necessary for products with analysis functions. Therefore, a comprehensive data visualization special system platform is developed, the system provides data visualization interfaces such as a relational graph and a map by using a data visualization technology, so that the result data is mapped into a graph, and a plurality of graph theory algorithms are provided on the basis of the graph theory algorithms for analyzing the relationship among the data.
Based on the application of a data visualization special system in electronic data forensics and network information security industries, family membership around a person plays a crucial role in analyzing the personality and psychology of the person, so that the family tree analysis and research are imperative, and the family tree data needs to be efficiently and clearly visualized to really and intuitively know the family membership.
In the current data visualization display system, most of the expression forms are common graphs such as pie charts, bar charts, line charts and the like, and cool and dazzling graphs such as bubble charts, area charts, province maps, word clouds, waterfall charts, funnel charts and the like, even GIS maps, but the analysis and the display of the family tree are not added into the data visualization system, so that a professional analysis display system of the family tree is formed.
In the prior art, the family tree is firstly drawn from the person with the highest generation, children of the family tree are arranged, then a family tree branch is created for each generation, and after the creation is completed, the family tree branch is manually processed and sorted, so that the family tree information can be completely and accurately displayed. The prior method mainly has the following defects:
1. the information of family members and the family member relationship are required to be designated one by one on the interface, and only one character node can be created each time, so that the workload of a producer is greatly increased, and the family tree production time is prolonged;
2. a server needs to be arranged to create and maintain a family tree database, and the problem of low data access efficiency along with the increase of the number of character nodes exists in practical application;
3. the family tree needs to be compiled by taking a person node in a family member as a starting point, and the person node which is not related to the family can not be added into the system.
Disclosure of Invention
In order to solve the above problems, the present invention provides a visualized family tree layout method, a terminal device, and a storage medium.
The specific scheme is as follows:
a visualized family tree layout method comprises the following steps:
s1: constructing a configuration file according to the relationship between the figure nodes, carrying out hierarchical processing on the nodes, and setting the nodes belonging to the spouse relationship and the brother relationship as the same layer;
s2: arranging the sequence of the figure nodes according to the relation of the figure nodes of each layer, preferably enabling brother nodes to be adjacent and then enabling spouse nodes to be adjacent;
s3: setting the position of each node according to the arrangement sequence of the nodes, wherein the position of a child node of the next layer is arranged in the middle of the position of a parent node corresponding to the child node of the previous layer, and calculating the coordinate of each node;
s4: and drawing the link lines between the nodes according to the coordinates of each node, and marking the relationship between the nodes on the corresponding link lines.
Further, the configuration file comprises a node unit and a relation unit, the node unit comprises node information of all nodes, and the node information comprises gender, name and unique identification code; the relationship unit comprises relationships among all nodes, and relationship information corresponding to each relationship comprises unique identification codes and relationship types of two nodes with the relationship.
Further, step S2 specifically includes the following steps:
s201: setting variables i to 1, JiThe node number of the ith layer is represented, I represents the total layer number, k stores the unique identification code of the node, and a linked list L stores the sequence of each layer of the node;
s202: judging whether the jth node of the ith layer is stored in a linked list L or not, and if so, entering S203; otherwise, inserting the jth node of the ith layer into the tail of the linked list L, and entering S203;
s203: setting k as the unique identification code of the jth node of the ith layer, setting the node with the unique identification code of k as a k node, judging whether the k node has a brother node or not, and if so, entering S204; otherwise, go to S206;
s204: judging whether brother nodes of the k node are all stored in the linked list L or not, and if so, entering S206; otherwise, go to S205;
s205: searching a unique identification code of a brother node which is not stored in the linked list L, setting the unique identification code as a, enabling k to be a, inserting the k node into the tail of the linked list L, judging whether the k node has the brother node or not, and if so, returning to S204; otherwise, go to S206;
s206: judging whether the k node has a spouse node, if so, entering S207; otherwise, go to S209;
s207: judging whether the spouse node of the k node is stored in the linked list L or not, if so, entering S208; otherwise, inserting the spouse node behind the k node, and entering S209;
s208: judging whether the k node and the spouse node thereof are adjacent in the linked list L, if so, entering S209; otherwise, after deleting the k node from the linked list L, inserting the k node behind the spouted node thereof, and entering S209;
s209: judging J to JiIf yes, entering S210; otherwise, let j equal to j +1, return to S202;
s210: judging whether I is true, if so, ending; otherwise, let j equal to 1 and i equal to i +1, return to S202.
Further, the step S3 of setting the node position specifically includes the following steps:
s301: setting the total layer number as I, variable F as 1 and FnTo representThe number of nodes contained in the nth layer, subscript N represents the number of layers, the layer with the largest number of nodes contained in the I layer is searched, and the number of layers is set to be N;
s302: making N equal to N-1, judging whether an nth layer exists, and if so, entering S303; otherwise, go to S307;
s303: judging whether the f-th node has child information, if so, entering S304; otherwise, go to S305;
s304: judging whether the f-th node has spouse information or not, if so, searching child nodes and spouse nodes of the f-th node, and setting the child nodes to be positioned between the f-th node and the spouse nodes; entering S306; otherwise, the f-th node is arranged at the position of the layer corresponding to the child node, and S306 is entered;
s305: setting the f-th node to be arranged at the last allocated position of the layer;
s306: judging F is FnIf yes, making f equal to 1 and n equal to n-1, and returning to S302; otherwise, making f equal to f +1, and returning to S303;
s307: making N equal to N +1, judging whether an nth layer exists, and if so, entering S308; otherwise, ending;
s308: judging whether the f-th node has parent information, if so, entering S309; otherwise, go to S310;
s309: setting the f-th node in the center of the parent position corresponding to the layer, and entering S311;
s310: setting the f-th node to be arranged at the last allocated position of the layer;
s311: judging F is FnIf yes, making f equal to 1 and n equal to n +1, and returning to S307; otherwise, let f be f +1, return to S308.
Further, the step S4 of drawing the link line includes the following steps:
s401: judging whether the incidence relation between the two nodes is a former relation or not, if so, setting a deflection point on the link line, wherein the abscissa of the deflection point is the abscissa of the first node, and the ordinate is the ordinate of the second node, and finishing; otherwise, go to S402;
s402: judging whether the two nodes are in child relationship, if so, entering S403; otherwise, ending;
s403: judging whether a child node of the two nodes has at least 2 father nodes or mother nodes, if so, entering S405; otherwise, go to S404;
s404: judging whether the abscissa x of the child node is the same as the abscissa x of the parent node or the parent node, if so, setting no deflection point on the link line, and ending; otherwise, setting two deflection points on the link line, wherein the abscissa of the two deflection points is respectively the abscissa of the child node and the abscissa of the father node or the mother node thereof, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node thereof, and ending;
s405: judging whether the couple relation exists between more than 2 father nodes or mother nodes of the child nodes, if so, entering S406; otherwise, more than 2 deflection points are set on the link line, the abscissa of the first deflection point is the abscissa of the father node or the mother node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node; the abscissa of the second deflection point is the abscissa of the child node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the parent node or the parent node thereof, and the process is finished;
s406: judging whether the abscissa of the child node is the same as the abscissas of the central points of the parent node and the parent node, if so, setting a deflection point on the link line, namely the central points of the parent node and the parent node, and ending; otherwise, setting three deflection points on the link line, wherein the first deflection point is the central point of the father node and the mother node, the abscissa of the second deflection point is the abscissa of the central point of the father node and the mother node, the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node, the abscissa of the third deflection point is the abscissa of the child node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node, and ending.
A visual family tree layout terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method of the embodiment of the present invention when executing the computer program.
A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to an embodiment of the invention as described above.
The invention adopts the technical scheme, overcomes the problem that the existing electronic family tree products need manual input to create relationships and arrange the relationships, users only need to set the relationships between family members and members in the configuration file, set the relationships on the basis of any one person, and support various appellation relationships, the layout of the family members is automatically completed by the system, and the family tree structures of a plurality of families can be completely displayed only by loading the configuration file once. Therefore, in actual use, the family tree structure can be visually displayed through visualization of the family tree, user operation can be simplified, and manufacturing efficiency is improved.
Drawings
Fig. 1 is a flowchart illustrating a first embodiment of the present invention.
Fig. 2 is a schematic diagram showing a configuration file in this embodiment.
Fig. 3 is a diagram showing the final effect of the family tree in this embodiment.
Detailed Description
To further illustrate the various embodiments, the invention provides the accompanying drawings. The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the embodiments. Those skilled in the art will appreciate still other possible embodiments and advantages of the present invention with reference to these figures.
The invention will now be further described with reference to the accompanying drawings and detailed description.
The first embodiment is as follows:
an embodiment of the present invention provides a visualized family tree layout method, as shown in fig. 1, which is a flowchart of the visualized family tree layout method according to the embodiment of the present invention, and the method includes the following steps:
step S1: and constructing a configuration file according to the relationship between the character nodes, carrying out hierarchical processing on the nodes, and setting the nodes belonging to the spouse relationship and the brother relationship as the same layer.
The configuration file at least comprises a node unit and a relation unit, wherein the node unit comprises node information of all nodes, and the node information at least comprises gender, name and unique identification code (UID); the relationship unit comprises relationships among all nodes, and the relationship information corresponding to each relationship at least comprises unique identification codes and relationship types of two nodes with the relationship.
The configuration file format adopted in this embodiment is json, and as shown in fig. 2, person in the configuration file of the json format is used to represent a node unit, relationship is used to represent a relationship unit, idA and idB represent two nodes having a relationship, and rel represents a relationship category between two nodes.
When a relationship is empty, the relationship is not embodied in the configuration file.
When the relationship is a non-ancestral relationship, idA represents the parent.
In this embodiment, the relationship categories include parent-child and parent-child relationships, incumbent spouses, former spouses, and siblings, and specifically include the following keywords: a present spouse, wife, couple, spouse, husband, wife, husband, wife, husband, wife, father, mother, foster, father, son, father, son, brother, girl.
It should be noted that, those skilled in the art may set the relationship type and the format of the configuration file according to actual requirements, and may adaptively increase or decrease the content of the configuration file, which is not limited herein.
Step S2: and arranging the sequence of the character nodes according to the relation of the character nodes of each layer, wherein the sequence of the character nodes is adjacent to the sequence of the spouse nodes, and the sequence of the sibling nodes is adjacent to the sequence of the sibling nodes.
That is, when a node has both sibling and spouse nodes, it is preferably made adjacent to its spouse node.
In this embodiment, the step of storing the arrangement order of the nodes by a linked list specifically includes the following steps:
s201: setting variables i to 1, JiThe node number of the ith layer is represented, I represents the total layer number, k stores a unique identification code (UID) of the node, and a linked list L stores the sequence of each layer of the node;
s202: judging whether the jth node of the ith layer is stored in a linked list L or not, and if so, entering S203; otherwise, inserting the jth node of the ith layer into the tail of the linked list L, and entering S203;
s203: let k be the unique identification code of the jth node of the ith layer, judge whether the node (for short, k node) with the unique identification code k has a brother node, if yes, enter S204; otherwise, go to S206;
s204: judging whether brother nodes of the k node are all stored in the linked list L or not, and if so, entering S206; otherwise, go to S205;
s205: searching a unique identification code of a brother node which is not stored in the linked list L, assuming that the identification code is a, making k be a, inserting the k node into the tail of the linked list L, judging whether the k node has the brother node or not, and if so, returning to S204; otherwise, go to S206;
s206: judging whether the k node has a spouse node, if so, entering S207; otherwise, go to S209;
s207: judging whether the spouse node of the k node is stored in the linked list L or not, if so, entering S208; otherwise, inserting the spouse node behind the k node, and entering S209;
s208: judging whether the k node and the spouse node thereof are adjacent in the linked list L, if so, entering S209; otherwise, after deleting the k node from the linked list L, inserting the k node behind the spouted node thereof, and entering S209;
s209: judging whether J is true, if so, entering S210; otherwise, let j equal to j +1, return to S202;
s210: judging whether I is true, if so, ending; otherwise, let j equal to 1 and i equal to i +1, return to S202.
Step S3: and setting the position of each node according to the arrangement sequence of the nodes, wherein the position of the child node of the next layer is set in the middle of the position of the parent node corresponding to the child node of the previous layer, and calculating the coordinate of each node.
The setting of the node position in step S3 specifically includes the following steps:
s301: setting the total layer number as I, variable F as 1 and FnThe number of nodes contained in the nth layer is represented, the subscript N represents the number of layers, the layer with the largest number of nodes contained in the I layer is searched, and the number of layers is set to be N;
s302: making N equal to N-1, judging whether an nth layer exists, and if so, entering S303; otherwise, go to S307;
s303: judging whether the f-th node has child information, if so, entering S304; otherwise, go to S305;
s304: judging whether the f-th node has spouse information or not, if so, searching child nodes and spouse nodes of the f-th node, and setting the child nodes to be positioned between the f-th node and the spouse nodes; entering S306; otherwise, the f-th node is arranged at the position of the layer corresponding to the child node, and S306 is entered;
s305: setting the f-th node to be arranged at the last allocated position of the layer;
s306: judging F is FnIf yes, making f equal to 1 and n equal to n-1, and returning to S302; otherwise, making f equal to f +1, and returning to S303;
s307: making N equal to N +1, judging whether an nth layer exists, and if so, entering S308; otherwise, ending;
s308: judging whether the f-th node has parent information, if so, entering S309; otherwise, go to S310;
s309: setting the f-th node in the center of the parent position corresponding to the layer, and entering S311;
s310: setting the f-th node to be arranged at the last allocated position of the layer;
s311: judging F is FnIf yes, making f equal to 1 and n equal to n +1, and returning to S307; otherwise, let f be f +1, return to S308.
After the relative position of each node is set, the corresponding specific coordinate can be obtained through the preset distance interval between two adjacent layers and the position interval between two adjacent nodes.
Step S4: and drawing the link lines between the nodes according to the coordinates of each node, and marking the relationship between the nodes on the corresponding link lines, thereby finishing the visual display of the spectrogram.
The drawing of the link line in this embodiment includes the steps of:
s401: judging whether the incidence relation between the two nodes is a former relation or not, if so, setting a deflection point on the link line, wherein the abscissa of the deflection point is the abscissa of the first node, and the ordinate is the ordinate of the second node, and finishing; otherwise, go to S402;
s402: judging whether the two nodes are in child relationship, if so, entering S403; otherwise, ending;
s403: judging whether a child node of the two nodes has at least 2 father nodes or mother nodes, if so, entering S405; otherwise, go to S404;
s404: judging whether the abscissa x of the child node is the same as the abscissa x of the parent node or the parent node, if so, setting no deflection point on the link line, and ending; otherwise, setting two deflection points on the link line, wherein the abscissa of the two deflection points is respectively the abscissa of the child node and the abscissa of the father node or the mother node thereof, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node thereof, and ending;
s405: judging whether the couple relation exists between more than 2 father nodes or mother nodes of the child nodes, if so, entering S406; otherwise, more than 2 deflection points are set on the link line, the abscissa of the first deflection point is the abscissa of the father node or the mother node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node; the abscissa of the second deflection point is the abscissa of the child node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the parent node or the parent node thereof, and the process is finished;
s406: judging whether the abscissa of the child node is the same as the abscissas of the central points of the parent node and the parent node, if so, setting a deflection point on the link line, namely the central points of the parent node and the parent node, and ending; otherwise, setting three deflection points on the link line, wherein the first deflection point is the central point of the father node and the mother node, the abscissa of the second deflection point is the abscissa of the central point of the father node and the mother node, the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node, the abscissa of the third deflection point is the abscissa of the child node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node, and ending.
It should be noted that, some customized designs may be performed in the spectrogram according to the requirements of the user, such as designing a display symbol of each node, displaying a name corresponding to the node at a corresponding position of the node, and the like, which is not limited herein.
Fig. 3 shows a family tree diagram finally displayed in this embodiment. The displayed effect accords with the branch structure of the number of families, thereby meeting the requirement.
The embodiment of the invention solves the problem that the existing electronic family tree product needs manual input to create the relationship and arrange, the user only needs to set the relationship between family members and members in the configuration file, set by taking any one person as a reference and support various appellation relationships, the layout of the family members is automatically completed by the system, and the family tree structures of a plurality of families can be completely displayed by only loading the configuration file once. Therefore, in actual use, the family tree structure can be visually displayed through visualization of the family tree, user operation can be simplified, and manufacturing efficiency is improved.
Example two:
the invention further provides a visual family tree layout terminal device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of the method embodiments of the first embodiment of the invention.
Further, as an executable scheme, the visual family tree layout terminal device may be a desktop computer, a notebook, a palm computer, a cloud server, and other computing devices. The visual pedigree layout terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the above-mentioned composition structure of the visual pedigree layout terminal device is only an example of the visual pedigree layout terminal device, and does not constitute a limitation on the visual pedigree layout terminal device, and may include more or less components than the above, or combine some components, or different components, for example, the visual pedigree layout terminal device may further include an input-output device, a network access device, a bus, and the like, which is not limited in this embodiment of the present invention.
Further, as an executable solution, the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and the like. The general processor may be a microprocessor or the processor may be any conventional processor, and the processor is a control center of the visual family tree layout terminal device, and various interfaces and lines are used to connect various parts of the entire visual family tree layout terminal device.
The memory can be used for storing the computer program and/or the module, and the processor can realize various functions of the visual pedigree layout terminal device by running or executing the computer program and/or the module stored in the memory and calling the data stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the mobile phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The invention also provides a computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned method of an embodiment of the invention.
The module/unit integrated with the visual pedigree layout terminal device can be stored in a computer readable storage medium if the module/unit is implemented in the form of a software functional unit and sold or used as an independent product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM ), Random Access Memory (RAM), software distribution medium, and the like.
While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (6)

1. A visualized family tree layout method is characterized by comprising the following steps:
s1: constructing a configuration file according to the relationship between the figure nodes, carrying out hierarchical processing on the nodes, and setting the nodes belonging to the spouse relationship and the brother relationship as the same layer;
s2: arranging the sequence of the figure nodes according to the relation of the figure nodes of each layer, preferably enabling brother nodes to be adjacent and then enabling spouse nodes to be adjacent; step S2 specifically includes the following steps:
s201: setting variables i to 1, JiThe node number of the ith layer is represented, I represents the total layer number, k stores the unique identification code of the node, and a linked list L stores the sequence of each layer of the node;
s202: judging whether the jth node of the ith layer is stored in a linked list L or not, and if so, entering S203; otherwise, inserting the jth node of the ith layer into the tail of the linked list L, and entering S203;
s203: setting k as the unique identification code of the jth node of the ith layer, setting the node with the unique identification code of k as a k node, judging whether the k node has a brother node or not, and if so, entering S204; otherwise, go to S206;
s204: judging whether brother nodes of the k node are all stored in the linked list L or not, and if so, entering S206; otherwise, go to S205;
s205: searching a unique identification code of a brother node which is not stored in the linked list L, setting the unique identification code as a, enabling k to be a, inserting the k node into the tail of the linked list L, judging whether the k node has the brother node or not, and if so, returning to S204; otherwise, go to S206;
s206: judging whether the k node has a spouse node, if so, entering S207; otherwise, go to S209;
s207: judging whether the spouse node of the k node is stored in the linked list L or not, if so, entering S208; otherwise, inserting the spouse node behind the k node, and entering S209;
s208: judging whether the k node and the spouse node thereof are adjacent in the linked list L, if so, entering S209; otherwise, after deleting the k node from the linked list L, inserting the k node behind the spouted node thereof, and entering S209;
s209: judging J to JiIf yes, entering S210; otherwise, let j equal to j +1, return to S202;
s210: judging whether I is true, if so, ending; otherwise, let j equal to 1, i equal to i +1, return to S202;
s3: setting the position of each node according to the arrangement sequence of the nodes, wherein the position of a child node of the next layer is arranged in the middle of the position of a parent node corresponding to the child node of the previous layer, and calculating the coordinate of each node;
s4: and drawing the link lines between the nodes according to the coordinates of each node, and marking the relationship between the nodes on the corresponding link lines.
2. The visualized pedigree layout method according to claim 1, wherein: the configuration file comprises node units and a relation unit, wherein the node units comprise node information of all nodes, and the node information comprises gender, name and unique identification code; the relationship unit comprises relationships among all nodes, and relationship information corresponding to each relationship comprises unique identification codes and relationship types of two nodes with the relationship.
3. The visualized pedigree layout method according to claim 1, wherein: the step S3 of setting the node position specifically includes the following steps:
s301: setting the total layer number as I, variable F as 1 and FnThe number of nodes contained in the nth layer is represented, the subscript N represents the number of layers, the layer with the largest number of nodes contained in the I layer is searched, and the number of layers is set to be N;
s302: making N equal to N-1, judging whether an nth layer exists, and if so, entering S303; otherwise, go to S307;
s303: judging whether the f-th node has child information, if so, entering S304; otherwise, go to S305;
s304: judging whether the f-th node has spouse information or not, if so, searching child nodes and spouse nodes of the f-th node, and setting the child nodes to be positioned between the f-th node and the spouse nodes; entering S306; otherwise, the f-th node is arranged at the position of the layer corresponding to the child node, and S306 is entered;
s305: setting the f-th node to be arranged at the last allocated position of the layer;
s306: judging F is FnIf yes, making f equal to 1 and n equal to n-1, and returning to S302; otherwise, making f equal to f +1, and returning to S303;
s307: making N equal to N +1, judging whether an nth layer exists, and if so, entering S308; otherwise, ending;
s308: judging whether the f-th node has parent information, if so, entering S309; otherwise, go to S310;
s309: setting the f-th node in the center of the parent position corresponding to the layer, and entering S311;
s310: setting the f-th node to be arranged at the last allocated position of the layer;
s311: judging F is FnIf yes, making f equal to 1 and n equal to n +1, and returning to S307; otherwise, let f be f +1, return to S308.
4. The visualized pedigree layout method according to claim 1, wherein: the step S4 of drawing the link line includes the steps of:
s401: judging whether the incidence relation between the two nodes is a former relation or not, if so, setting a deflection point on the link line, wherein the abscissa of the deflection point is the abscissa of the first node, and the ordinate is the ordinate of the second node, and finishing; otherwise, go to S402;
s402: judging whether the two nodes are in child relationship, if so, entering S403; otherwise, ending;
s403: judging whether a child node of the two nodes has at least 2 father nodes or mother nodes, if so, entering S405; otherwise, go to S404;
s404: judging whether the abscissa x of the child node is the same as the abscissa x of the parent node or the parent node, if so, setting no deflection point on the link line, and ending; otherwise, setting two deflection points on the link line, wherein the abscissa of the two deflection points is respectively the abscissa of the child node and the abscissa of the father node or the mother node thereof, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node thereof, and ending;
s405: judging whether the couple relation exists between more than 2 father nodes or mother nodes of the child nodes, if so, entering S406; otherwise, more than 2 deflection points are set on the link line, the abscissa of the first deflection point is the abscissa of the father node or the mother node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node; the abscissa of the second deflection point is the abscissa of the child node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the parent node or the parent node thereof, and the process is finished;
s406: judging whether the abscissa of the child node is the same as the abscissas of the central points of the parent node and the parent node, if so, setting a deflection point on the link line, namely the central points of the parent node and the parent node, and ending; otherwise, setting three deflection points on the link line, wherein the first deflection point is the central point of the father node and the mother node, the abscissa of the second deflection point is the abscissa of the central point of the father node and the mother node, the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node, the abscissa of the third deflection point is the abscissa of the child node, and the ordinate is positioned between the ordinate of the child node and the ordinate of the father node or the mother node, and ending.
5. A visual family tree layout terminal equipment is characterized in that: comprising a processor, a memory and a computer program stored in the memory and running on the processor, the processor implementing the steps of the method according to any of claims 1 to 4 when executing the computer program.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201910904081.0A 2019-09-24 2019-09-24 Visual family tree layout method, terminal device and storage medium Active CN110609927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910904081.0A CN110609927B (en) 2019-09-24 2019-09-24 Visual family tree layout method, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910904081.0A CN110609927B (en) 2019-09-24 2019-09-24 Visual family tree layout method, terminal device and storage medium

Publications (2)

Publication Number Publication Date
CN110609927A CN110609927A (en) 2019-12-24
CN110609927B true CN110609927B (en) 2022-02-15

Family

ID=68892008

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910904081.0A Active CN110609927B (en) 2019-09-24 2019-09-24 Visual family tree layout method, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN110609927B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905846A (en) * 2020-05-20 2021-06-04 招小亮 Making, revising and using personal genealogy
CN113536048A (en) * 2021-06-29 2021-10-22 北京明略软件系统有限公司 Graph display method, system, storage medium and electronic device
CN114218353A (en) * 2021-12-10 2022-03-22 武汉众智数字技术有限公司 A family layout method based on knowledge graph

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025760A (en) * 2007-01-31 2007-08-29 王宏源 Method for digitalizing family tree
CN101963990A (en) * 2010-10-09 2011-02-02 吴刚 Digital modeling and searching method for personal relationships and events
CN102142015A (en) * 2011-01-30 2011-08-03 唐凌遥 Processing system and processing method for nodes in family tree
CN102682114A (en) * 2012-05-11 2012-09-19 广州家族网信息科技有限公司 Method and system for generating family tree
CN103729401A (en) * 2013-11-18 2014-04-16 广州多益网络科技有限公司 Method for generating family tree
CN108153840A (en) * 2017-12-15 2018-06-12 杭州数梦工场科技有限公司 A kind of generation method, device and the electronic equipment of kinship collection of illustrative plates
CN108921914A (en) * 2018-05-25 2018-11-30 北京石油化工学院 A kind of pedigree drawing drawing method, device and electronic equipment
CN109933633A (en) * 2019-04-02 2019-06-25 北京睿至大数据有限公司 A kind of O&M knowledge mapping construction method based on time and scene dimension

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8886592B2 (en) * 2011-01-20 2014-11-11 Kent W. Huff Efficient genealogy registry system
US9330418B2 (en) * 2012-09-14 2016-05-03 Ancestry.Com Operations Inc. System and method for creating a family tree data structure

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025760A (en) * 2007-01-31 2007-08-29 王宏源 Method for digitalizing family tree
CN101963990A (en) * 2010-10-09 2011-02-02 吴刚 Digital modeling and searching method for personal relationships and events
CN102142015A (en) * 2011-01-30 2011-08-03 唐凌遥 Processing system and processing method for nodes in family tree
CN102682114A (en) * 2012-05-11 2012-09-19 广州家族网信息科技有限公司 Method and system for generating family tree
CN103729401A (en) * 2013-11-18 2014-04-16 广州多益网络科技有限公司 Method for generating family tree
CN108153840A (en) * 2017-12-15 2018-06-12 杭州数梦工场科技有限公司 A kind of generation method, device and the electronic equipment of kinship collection of illustrative plates
CN108921914A (en) * 2018-05-25 2018-11-30 北京石油化工学院 A kind of pedigree drawing drawing method, device and electronic equipment
CN109933633A (en) * 2019-04-02 2019-06-25 北京睿至大数据有限公司 A kind of O&M knowledge mapping construction method based on time and scene dimension

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Evaluating the VIPER pedigree visualisation: Detecting inheritance inconsistencies in genotyped pedigrees;Trevor Paterson 等;《2011 IEEE Symposium on Biological Data Visualization (BioVis).》;20111205;119-126 *
基于二叉树的电子家谱设计方法;陈国军 等;《软件》;20150315;第36卷(第3期);95-97 *
家庭谱系关系的搜索算法及其元图表示;刘军丹;《中国优秀硕士学位论文全文数据库 基础科学辑》;20131215;A002-122 *

Also Published As

Publication number Publication date
CN110609927A (en) 2019-12-24

Similar Documents

Publication Publication Date Title
KR101794373B1 (en) Temporary formatting and charting of selected data
CN112035667A (en) Knowledge graph display method and device and terminal equipment
CN108196920B (en) Display processing method and device of UI (user interface)
CN109299169B (en) Data visualization method, system, terminal and computer readable storage medium
CN110609927B (en) Visual family tree layout method, terminal device and storage medium
US8570326B2 (en) Rule based visualization mechanism
CA2751295C (en) Analysis of object structures such as benefits and provider contracts
CN113010612A (en) Visual construction method, query method and device for graph data
US20200098161A1 (en) System and method for executing non-graphical algorithms on a gpu (graphics processing unit)
CN113326314A (en) Data visualization method and device, electronic equipment and readable storage medium
CN111309215A (en) Processing method, device, equipment and storage medium of sliding list in Unity
CN112632929B (en) Method and device for intelligently recommending chart based on table data and electronic equipment
CN111444368B (en) Method and device for constructing user portrait, computer equipment and storage medium
CN113361240B (en) Method, apparatus, device and readable storage medium for generating target article
CN114816578A (en) Method, device and equipment for generating program configuration file based on configuration table
CN114519153A (en) Webpage history record display method, device, equipment and storage medium
CN114329189A (en) Content information recommendation method and device, electronic equipment and readable medium
CN118378097A (en) Document generation method, device, equipment and storage medium
CN111143568A (en) Buffering method, device, equipment and storage medium for paper classification
CN115329150A (en) Method and device for generating search condition tree, electronic equipment and storage medium
US20230316604A1 (en) Reuse of infographics
CN115658988A (en) Chart configuration method and device, electronic equipment and storage medium
CN113723062A (en) Report label editing method and device, storage medium and terminal equipment
CN115687704A (en) Information display method and device, electronic equipment and computer readable storage medium
CN104243201A (en) Method and system for storing topological graph corresponding to network equipment test case

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant