CN115082593A - Two-dimensional relation graph visualization method and device - Google Patents

Two-dimensional relation graph visualization method and device Download PDF

Info

Publication number
CN115082593A
CN115082593A CN202210980588.6A CN202210980588A CN115082593A CN 115082593 A CN115082593 A CN 115082593A CN 202210980588 A CN202210980588 A CN 202210980588A CN 115082593 A CN115082593 A CN 115082593A
Authority
CN
China
Prior art keywords
track
node
nodes
canvas
positions
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.)
Granted
Application number
CN202210980588.6A
Other languages
Chinese (zh)
Other versions
CN115082593B (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.)
Zhejiang Lab
Original Assignee
Zhejiang Lab
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 Zhejiang Lab filed Critical Zhejiang Lab
Priority to CN202210980588.6A priority Critical patent/CN115082593B/en
Publication of CN115082593A publication Critical patent/CN115082593A/en
Application granted granted Critical
Publication of CN115082593B publication Critical patent/CN115082593B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Numerical Control (AREA)
  • Replacement Of Web Rolls (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a two-dimensional relationship graph visualization method and a two-dimensional relationship graph visualization device, wherein firstly, a track is determined according to the required inter-track distance; traversing the node array, setting a position for each node, firstly judging a track to which the node belongs, and then forming a position group by eight points of each edge and a vertex on the corresponding track for placing the node; sequentially judging whether the positions in the position group are occupied by other nodes or not; if the unoccupied position can not be found in the current position group, generating a new 8 positions to form a position group, and searching the placeable position from the position group again; this step is repeated until an available location is found. Setting the available positions in the position group to the current node, rendering the nodes to the canvas according to the determined positions of the nodes, and rendering the edges with the association relationship to the canvas to obtain the visual two-dimensional relationship diagram.

Description

Two-dimensional relationship graph visualization method and device
Technical Field
The invention relates to the field of data visualization, in particular to a two-dimensional relationship graph visualization method and device.
Background
The advent of HTML5 revolutionized the visualization of data by Web front-ends. With the Canvas of HTML5, the Web front end can draw a wide variety of charts, including relational graphs. The canvas element of HTML5 can implement canvas function, which draws graphics and processing on a web page through its own API in combination with using JavaScript scripting language, has a method of implementing drawing lines, arcs and rectangles, filling areas with styles and colors, writing styled text, and adding images, and can control each pixel thereof using JavaScript. The canvas element of HTML5 allows the browser to display graphics or animated images directly without requiring a plug-in such as Flash or Silverlight.
The layout schemes of the existing two-dimensional relationship diagram mainly include the following: 1) random layout, as the name implies, the positions of the nodes are randomly distributed; 2) the high-dimensional data dimension reduction algorithm is distributed; 3) force directing layout; 4) the circular ring layout is that all nodes are laid on a circular ring; 5) the radiation layout takes one node as a center, the other nodes are arranged on rings with different distances according to the degree relation with the center point, the node with the first degree distance from the center point is arranged on the first ring closest to the node with the first degree distance from the center point, the node with the second degree distance from the center point is arranged on the second ring, and the like; 6) hierarchical layout; 7) the concentric circle layout is based on a certain attribute (default is degree) of a node, and the higher the attribute value is, the closer the node is to the center position on the layout; 8) grid layout, namely, after all nodes are sequenced through a certain specified attribute, the nodes are placed on a grid in order;
it can be seen that the relationship graph comprises two elements, namely a node and an edge, the node is required to be drawn on a canvas, then an edge is drawn between the two nodes which are connected with each other, and if the edge is directional, an arrow is required to be drawn. Therefore, drawing a relationship diagram on the canvas can be disassembled into 3 steps: 1) drawing nodes onto the canvas, 2) drawing edges onto the canvas, and 3) drawing arrows on the edges. Then the layout is clearly unsuitable for a graph that is intended to be evenly distributed and where nodes do not collide with each other.
The general practice is to implement the random layout and perform collision detection on the nodes. The specific method comprises the following steps: traversing the node array to set the current nodeA random position; comparing whether the node collides with the node drawn on the canvas; if collision occurs, generating a new random position, and comparing the new random position with the nodes drawn on the canvas again until the nodes do not collide with all the nodes drawn on the canvas; the node is drawn onto the canvas. Assuming there are n nodes in the graph, the time complexity is that for a random layout plus a scheme for collision detection of nodes
Figure 246208DEST_PATH_IMAGE001
The spatial complexity is
Figure 599829DEST_PATH_IMAGE002
. The scheme of the two-dimensional relationship graph which is uniformly distributed and has no mutual collision among nodes is realized through random layout and collision detection, and the time complexity is higher; because only the positions of the nodes are considered, and the distribution of the edges is not considered, the lines of the visual image finally presented by the visual image can be cluttered.
Disclosure of Invention
The invention aims to provide a two-dimensional relational graph visualization method and a two-dimensional relational graph visualization device aiming at the defects of the prior art, and provides a method and a device with lower time complexity; and lines are drawn nearby, the displayed visual image is more attractive and organized, and a two-dimensional relational graph which is uniformly distributed and does not collide with each other among nodes is obtained.
The purpose of the invention is realized by the following technical scheme: in a first aspect, the present invention provides a two-dimensional relationship diagram visualization method, including the following steps:
(1) constructing a node array according to the node attributes and the relationship among the node attributes;
(2) determining the tracks according to the required inter-track distance; the track is the side of a square on the canvas, the center of the square is the center of the canvas, and all nodes need to be placed on the track and cannot be separated from the track;
(3) traversing the node array, setting a position for each node, firstly judging a track to which the node belongs, and then forming a position group by eight points of each edge and a vertex on the corresponding track for placing the node;
(4) sequentially judging whether the positions in the position group are occupied by other nodes or not; if no unoccupied position can be found in the current position group, finding 2 adjacent nodes with the largest distance difference on the track of the first quadrant parallel to the x axis in the canvas, and taking the midpoint position between the 2 adjacent nodes as a new position (x ', y'), further generating a new eight position group of positions [ [ x ', y' ], [ -x ', -y' ], [ x ', -y' ], [ y ', x' ], [ -y ', -x' ], [ y ', -x' ], [ -y ', x' ] ], again finding placeable positions from the position group; repeating this step until an available location is found;
(5) setting the available positions in the position group to the current node, rendering the nodes to the canvas according to the determined positions of the nodes, and rendering the edges with the association relationship to the canvas to obtain the visual two-dimensional relationship diagram.
Further, a track is the side of a square enclosed by the following function;
Figure 398020DEST_PATH_IMAGE003
wherein f is a function representing the track, x and y are the horizontal and vertical coordinates of the track on the canvas,arepresenting the track length of each quadrant on the canvas according toaDetermining the track.
Further, the first track isa=0, the track is a point, i.e. the origin, and the second track isa=dThe third track isa=2dThird trackIs a=3dD represents the distance between the tracks, and the like, and the value of d is determined according to the requirement and the size of the canvas.
Further, when the track to which the node belongs is determined, the nodes are uniformly distributed to each track.
Further, the track to which the node belongs is determined according to the classification to which the node belongs for the relation graph data with the classification information.
Further, the 8-point composition rule of the position group is:
1) first position group: [ [ x, y ], [ -x, -y ], [ x, -y ], [ -x, y ], [0, y ], [0, -y ], [ x, 0], [ -x, 0] ], wherein x = y = a,
2) second and subsequent position groups: [ [ x ', y' ], [ -x ', -y' ], [ x ', -y' ], [ -x ', y' ], [ y ', x' ], [ -y ', -x' ], [ y ', -x' ], [ -y ', x' ].
Further, when looking for a new location group, it is assumed that
Figure 128079DEST_PATH_IMAGE004
The distance between 2 adjacent nodes with the maximum distance difference is z, the radius of the node is r, and r is more than 0 when
Figure 328116DEST_PATH_IMAGE005
When the node is placed on the target track, the node is placed on the target track by reducing r, and the target does not collide with other nodes; the reset r is:
Figure 855568DEST_PATH_IMAGE006
in a second aspect, the present invention provides a two-dimensional relationship graph visualization apparatus, including a memory and one or more processors, where the memory stores executable code, and the processors execute the executable code to implement the two-dimensional relationship graph visualization method.
In a third aspect, the present invention provides a computer-readable storage medium, on which a program is stored, which, when executed by a processor, implements the two-dimensional relationship graph visualization method.
The invention has the beneficial effects that: the algorithm provided by the invention has the advantages that the time complexity is obviously improved, a brand-new layout algorithm is provided for the two-dimensional relational graph, the nodes can be uniformly distributed and do not collide with each other, the canvas space can be fully utilized, the nodes are uniformly distributed, and a better visualization effect is presented.
Drawings
FIG. 1 is a flow chart of a two-dimensional relationship graph visualization method of the present invention;
FIG. 2 is an exemplary schematic of a track of the present invention;
FIG. 3 is a schematic diagram of node placement locations of a two-dimensional relationship graph according to the present invention;
FIG. 4 is a diagram illustrating an example of the effect presented by the two-dimensional relationship graph visualization method according to the present invention;
FIG. 5 is a two-dimensional graph of patient symptoms versus disease visualization;
FIG. 6 is a schematic view of a two-dimensional relationship graph visualization apparatus according to the present invention.
Detailed Description
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
The invention proposes a concept of "rail". The track is a line or a point with a certain rule on the canvas, and all nodes must be placed on the track according to a certain rule but cannot be separated from the track. And a plurality of tracks are marked on the canvas, and all nodes can be placed on the tracks only. As shown in fig. 1, the two-dimensional relationship diagram visualization method provided by the present invention specifically includes the following processes:
(1) determining the distance between the tracks, thereby determining the tracks:
the track is the side of a square enclosed by the following function; when the temperature is higher than the set temperatureaWhere =0, the orbit is 1 point, i.e., the origin.
Figure 875477DEST_PATH_IMAGE007
Wherein f is a function representing the track, x and y are the horizontal and vertical coordinates of the track on the canvas,arepresenting the track length of each quadrant on the canvas according toaDetermining the track.
(1.1) a value of the inter-track distance is given on demand, which can be any positive number. For example, the width and height of the whole canvas are 500px, and 4 tracks are to be opened, then the distance is 500px/2/4 =62.5 px, which is a relatively suitable track distance;
and (1.2) after the distance is determined, determining the track of each track. As shown in fig. 2, for example, the track pitch is 62.5px, then:
when in useaWhen =0, the first track is (0, 0), i.e. the origin of the center;
when in useaWhere =62.5, the second track is the side of a square surrounded by the following function;
Figure 143647DEST_PATH_IMAGE008
when in useaIf =125, the third track is the side of the square enclosed by the function;
Figure 198191DEST_PATH_IMAGE009
when in useaIf =187.5, the fourth track is the side of a square surrounded by the following function.
Figure 159193DEST_PATH_IMAGE010
(2) Traversing a node array, setting a position for each node, wherein the node array is obtained from a server or a database or is customized by a user:
and (2.1) traversing the node array, and judging the track to which the current node belongs.
There are various ways to determine the track to which the current node belongs. For the relational graph data with classification information, the track to which the node belongs can be determined according to the classification to which the node belongs; for the relational graph data without extra information, the nodes can be uniformly distributed to each track, for example, 4 tracks, 31 nodes, then the 1 st to 10 th nodes can be placed on the second track, the 11 th to 20 th nodes can be placed on the third track, the 21 st to 30 th nodes can be placed on the fourth track, and the 31 st node can be placed on the first track.
(2.2) finding placeable positions in the position group with 8 points as a group.
And finding 8 points on the track to which the current node belongs, wherein the 8 points form a position group, and sequentially judging whether the 8 positions are occupied by other nodes.
If no unoccupied location can be found in the current location group, find the unoccupied location in the canvas
Figure 931977DEST_PATH_IMAGE011
The middle point position between the 2 adjacent nodes with the largest distance difference on the track of (1) is taken as a new position (x ', y'), and then a new eight-position composition position group [ [ x ', y'], [-x’, -y’], [x’, -y’], [-x’, y’], [y’, x’], [-y’, -x’], [y’, -x’], [-y’, x’]]Searching the placeable position from the position group again; this step is repeated until an available location is found.
If an unoccupied location is found in the current location group, the available location is returned.
And (2.3) setting the returned available position to the current node.
In step (2.2), the 8-point composition rule of a position group is as follows:
1) first position group: [ [ x, y ], [ -x, -y ], [ x, -y ], [ -x, y ], [0, y ], [0, -y ], [ x, 0], [ -x, 0] ], where x = y = a, so the set of positions can also be described as: [ [ a, a ], [ -a, -a ], [ a, -a ], [ -a, a ], [0, a ], [0, -a ], [ a, 0], [ -a, 0] ];
2) second and subsequent position groups: [ [ x ', y' ], [ -x ', -y' ], [ x ', -y' ], [ -x ', y' ], [ y ', x' ], [ -y ', -x' ], [ y ', -x' ], [ -y ', x' ].
When looking for a new set of locations, assume that
Figure 738259DEST_PATH_IMAGE012
The distance between the 2 most different adjacent nodes found above is z, the node radius is r (r can be set to any positive number), when
Figure 912889DEST_PATH_IMAGE013
When it is, the current track is no longer leftOne node is done, then the goal of putting the node to the target track without colliding with other nodes is achieved by scaling down r. The reset r is:
Figure 575951DEST_PATH_IMAGE014
fig. 3 is a schematic diagram of node placement positions of a two-dimensional relationship diagram with 17 nodes and two tracks.
The core logic of the invention is as follows:
the first step is as follows: after the track spacing a and the node rendering radius r are determined, the node array is stored in a variable nodes, the length of the node array is obtained through calculation, and the value is assigned to a variable len.
The second step is that: and opening a two-dimensional array buffers to store the node positions, wherein the first dimension represents a track, and the second dimension represents the positions of nodes which are already placed on the track.
The third step: the positions are set for the nodes in each node array by means of len-loop traversal through the node arrays nodes. Wherein the loop traverses the internal logic as follows:
firstly, determining the current node to be the kth track according to the classification attribute of the node or by adopting a uniform distribution mode. Wherein, the user is required to give the value of k (k is more than or equal to 0) by the node self classification attribute mode; the uniform distribution mode is to generate a random number and assign the random number to k, specifically, after the track pitch a is known, the size of the canvas is obtained through document.
Secondly, determining the position group of the currently traversed node according to the number of nodes in the buffers [ k ]:
if the length of buffers [ k ] is less than or equal to 8, the position group variable group is the first position group: [ [ ka, ka ], [ -ka, -ka ], [ ka, -ka ], [ -ka, ka ], [0, ka ], [0, -ka ], [ ka, 0], [ -ka, 0] ];
if the length of the buffers [ k ] is greater than 8, the position group variable group is [ [ x ', y' ], [ -x ', -y' ], [ x ', -y' ], [ -x ', y' ], [ y ', x' ], [ -y ', -x' ], [ y ', -x' ], [ -y ', x' ].
Then, finding out a subscript t of the last node position in the group in the buffers [ k ], setting the position of the current node as group [ t +1], and putting the group [ t +1] into the buffers [ k ] in a push mode;
finally, if t +1>7, then find y = ka, x ≧ 0 on the track the most spaced 2 nodes, if their spacing z < 4r, modify r = z/4.
The fourth step: the outputs a nodes variable that sets the position for each node.
Assuming that there are m tracks with n nodes per track, the time complexity of the present invention is
Figure 836031DEST_PATH_IMAGE015
The spatial complexity is O (n × m + 8) = n
Figure 446004DEST_PATH_IMAGE016
. An example of the effect of the final presentation is shown in fig. 4. The confirmation procedure of the node location of this example is:
(1) first, the distance between tracks is determined according to the width of the canvas, for example, the width and height of the current canvas are both 600px, and if an effect that a two-dimensional relationship visualization satisfying at least 6 tracks is to be presented, the width between tracks can be set to be 600px/6/2 = 50 px.
Then 6 tracks are determined from the track function:
the first track is point (0, 0);
the second track is the side of a square enclosed by the following function;
Figure 475140DEST_PATH_IMAGE017
the third track is the side of a square enclosed by the following function;
Figure 777945DEST_PATH_IMAGE018
the fourth track is the side of a square enclosed by the following function;
Figure 259742DEST_PATH_IMAGE019
the fifth track is the side of a square enclosed by the following function;
Figure 407827DEST_PATH_IMAGE020
the sixth track is the side of a square enclosed by the following function;
Figure 282680DEST_PATH_IMAGE021
(2) and traversing the node array, and selecting a track and setting a position for each node. While setting the radius of each node to 5 px.
A first node (named "1" in fig. 4) placed on the first track, i.e., at the position of (0, 0);
the second to ninth nodes (the nodes named "2-1", "2-2", "2-3", "2-4", "2-5", "2-6", "2-7" and "2-8" in fig. 4) are placed on the second track at positions (50, 50), (-50 ), (-50, 50), (0, -50), (50, 0) and (-50, 0) in this order;
the tenth to seventeenth nodes (nodes named "3-1", "3-2", "3-3", "3-4", "3-5", "3-6", "3-7" and "3-8" in fig. 4) are placed on the third track at positions (100 ), (-100, -100), (-100, 100), (0, -100), (100, 0) and (-100, 0) in this order;
eighteenth to twenty-fifth nodes (nodes named "4-1", "4-2", "4-3", "4-4", "4-5", "4-6", "4-7", and "4-8" in fig. 4) are placed on the fourth trajectory at positions (150 ), (-150, -150), (-150, 150), (0, -150), (150, 0), and (-150, 0), in that order;
the twenty-sixth to forty-first nodes (nodes named "5-1", "5-2", "5-3", "5-4", "5-5", "5-6", "5-7", "5-8", "5-9", "5-10", "5-11", "5-12", "5-13", "5-14", "5-15" and "5-16" in fig. 4) are placed on a fifth track, wherein the positions of the nodes "5-1", "5-2", "5-3", "5-4", "5-5", "5-6", "5-7" and "5-8" are selected from a first group of positions, in order (200 ), and, (-200 ), (-200, 200), (0, -200), (200, 0), and (-200, 0); at this point, the positions in the first position group are all used and found
Figure 756387DEST_PATH_IMAGE022
The distance between 2 neighboring points having the largest upper difference, i.e., the node "5-1" at the position of (200 ) and the node "5-5" at the position of (0, 200), is 200px because the node radius is 5px, 200px>4 × 5px, so the current track can also continue to place nodes with their middle position being (100, 200), thereby generating a new position group: [[100, 200], [-100, -200], [100, -200], [-100, 200], [200, 100], [-200, -100], [200, -100], [-200, 100]]. Then the positions of nodes "5-9", "5-10", "5-11", "5-12", "5-13", "5-14", "5-15" and "5-16" are selected from a second group of positions, in the order (100, 200), (-100, -200), (-100, 200), (200, 100), (-200, -100), (200, -100) and (-200, 100).
The forty-second to fifty-second nodes (nodes named "6-1", "6-2", "6-3", "6-4", "6-5", "6-6", "6-7", "6-8", "6-9", "6-10" and "6-11" in FIG. 4) are placed on a sixth track, where the nodes "6-1", "6-2", "6-3", "6-4", "6-5" and,The "6-6", "6-7" and "6-8" positions are selected from the first group of positions, in order (250 ), (-250, -250), (-250, 250), (0, -250), (250, 0) and (-250, 0); at this point, the positions in the first position group are all used and found
Figure 991059DEST_PATH_IMAGE023
The distance between 2 neighboring points having the largest upper difference, i.e., the node "6-1" at the position (250 ) and the node "6-5" at the position (0, 250), is 250px because the node radius is 5px, 250px>4 × 5px, so the current track can also continue to place nodes with their middle positions (125, 250), thereby generating a new position group: [[125, 250], [-125, -250], [125, -250], [-125, 250], [250, 125], [-250, -125], [250, -125], [-250, 125]]. Then the positions of nodes "6-9", "6-10" and "6-11" are selected from a second group of positions, which are (125, 250), (-125, -250) and (125, -250) in that order.
And determining the positions of all the nodes, rendering the nodes on the canvas according to the determined positions, rendering the edges with the association relation on the canvas, and finally obtaining the two-dimensional relation graph shown in the figure 4.
As shown in fig. 5, an example of the present invention applied to the relationship between patient symptoms and diseases is that the node positions of the example are confirmed by:
1) firstly, there are 6 types of nodes in the two-dimensional relationship graph of patient symptoms and diseases: patient nodes, patient self symptom nodes, constant nodes named "symptom", diagnosis-assisted symptom nodes, and doctor-added symptom nodes. We determine the orbit to which the current node belongs by the classification attribute of the node itself: the method comprises the steps of allocating patient nodes to a first track, allocating symptom nodes of a patient to 2 nd and 3 rd tracks, allocating constant nodes named as 'symptoms' to a 4 th track, allocating auxiliary diagnosis symptom nodes to a 5 th track, allocating auxiliary diagnosis symptom nodes to 4 th, 5 th, 6 th and 7 th tracks, and allocating symptom nodes added by a doctor to a 3 rd track.
2) Determining the distance between tracks according to the width of the canvas, for example, the width and height of the current canvas are both 700px, and in order to present an effect that can satisfy the two-dimensional relationship visualization of at least 7 tracks, the width between tracks can be set to 700px/7/2 = 50 px.
Then, according to the track function, 7 tracks are determined:
the first track is point (0, 0);
the second track is the side of a square enclosed by the following functions;
Figure 677255DEST_PATH_IMAGE024
the third track is the side of a square enclosed by the following function;
Figure 680983DEST_PATH_IMAGE025
the fourth track is the side of a square enclosed by the following function;
Figure 325591DEST_PATH_IMAGE019
the fifth track is the side of a square enclosed by the following function;
Figure 781981DEST_PATH_IMAGE020
the sixth track is the side of a square enclosed by the following functions;
Figure 334185DEST_PATH_IMAGE021
the seventh track is the side of a square enclosed by the following function;
Figure 926840DEST_PATH_IMAGE026
3) and traversing the node array, and selecting a track and setting a position for each node. While setting the radius of each node to 5 px.
A first node (patient node named "patient 01276" in fig. 5) placed on the first trajectory, i.e., at the (0, 0) position;
a second node (patient self-symptom node named "rheumatism" in fig. 5) placed on a second trajectory at a position of (50, 50);
a third node (physician-added disease node named "helicobacter pylori infection" in fig. 5) placed on a third trajectory at a position of (100 );
the fourth to ninth nodes (constant node named "symptom", auxiliary diagnostic symptom node named "depression", "early satiety", constant node named "symptom", auxiliary diagnostic symptom node named "morning stiffness", and constant node named "symptom" in fig. 5) are placed on the fourth track at positions (150 ), (-150, -150), (-150, 150), (0, 150), and (0, -150) in this order;
the tenth node to the twenty-first node (in fig. 5, the node of the auxiliary diagnosis condition named "chronic gastritis", the node of the auxiliary diagnosis condition symptom named "anxiety", "belching", the node of the auxiliary diagnosis condition named "rheumatoid arthritis", the node of the auxiliary diagnosis condition symptom named "joint pain", "local pain in shoulder joint", "lower lumbar pain", "temporomandibular joint pain", "vomiting", "loss of appetite", "belching", and "early satiety"), are placed on the fifth trajectory, wherein the positions of the nodes "chronic gastritis", "anxiety", "belching", "rheumatoid arthritis", "joint pain", "local pain in shoulder joint", "lower lumbar pain", and "temporomandibular joint pain" are selected from the group of first positions, which are (200 ), (-200, -200) in this order, (200, -200), (-200, 200), (0, -200), (200, 0), and (-200, 0); at this point, the positions in the first position group are all used and found
Figure 742349DEST_PATH_IMAGE027
The distance between the 2 most distant neighbors, node "chronic gastritis" at position (200 ) and node "arthralgia" at position (0, 200), is 200px because the node radius is 5px, 200px>4 × 5px, so the current track can also continue to place nodes with their middle position being (100, 200), thereby generating a new position group: [[100, 200], [-100, -200], [100, -200], [-100, 200], [200, 100], [-200, -100], [200, -100], [-200, 100]]. Then the "vomiting", "anorexia", "belching" and "early satiety" positions of the node are selected from the second group of positions, in order (100, 200), (-100, -200), (-100, 200);
the twenty-second to twenty-fifth nodes (auxiliary diagnostic disorder symptom nodes named "epigastric pain", "abdominal distension", "shoulder joint movement limitation", and "epigastric distension" in fig. 5) are placed on the sixth trajectory at positions (250 ), (-250, -250), (250, -250), and (-250, 250) in this order;
the twenty-sixth to thirty-second nodes (nodes of auxiliary diagnostic symptoms named "hip pain", "cutaneous rheumatoid nodules", "neck pain", "shortness of breath after activity", "restricted neck activity", "numbness of limbs" and "nausea" in fig. 5) are placed on the seventh trajectory at the positions of (300 ), (-300, -300), (-300, 300), (0, -300) and (300, 0) in this order;
and determining the positions of all the nodes, rendering the nodes on the canvas according to the determined positions of the nodes, rendering the edges with the association relation on the canvas, and finally obtaining the two-dimensional relation graph shown in the figure 5.
According to the two-dimensional relationship graph of the symptoms and the diseases of the patient, the patient suffers from rheumatism symptoms and simultaneously suffers from symptoms such as numbness of hands and feet, arthralgia, abdominal distension, belching and early satiety, the patient is inferred to suffer from chronic gastritis, rheumatoid arthritis and the like through auxiliary diagnosis, and a doctor diagnoses the possible helicobacter pylori infection according to the symptoms and the auxiliary diagnosis symptoms of the patient.
Corresponding to the embodiment of the two-dimensional relationship diagram visualization method, the invention also provides an embodiment of a two-dimensional relationship diagram visualization device.
Referring to fig. 6, a two-dimensional relationship graph visualization apparatus provided in an embodiment of the present invention includes a memory and one or more processors, where the memory stores executable code, and the processors execute the executable code to implement the two-dimensional relationship graph visualization method in the foregoing embodiment.
The two-dimensional relationship graph visualization apparatus of the present invention can be applied to any device with data processing capability, such as a computer or other devices. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for running through the processor of any device with data processing capability. From a hardware aspect, as shown in fig. 6, the two-dimensional relationship diagram visualization apparatus of the present invention is a hardware structure diagram of any device with data processing capability, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 6, in which any device with data processing capability in an embodiment may also include other hardware according to the actual function of the any device with data processing capability, which is not described again.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
An embodiment of the present invention further provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the two-dimensional relationship graph visualization method in the foregoing embodiment is implemented.
The computer readable storage medium may be an internal storage unit, such as a hard disk or a memory, of any data processing capability device described in any of the foregoing embodiments. The computer readable storage medium may also be any external storage device of a device with data processing capabilities, such as a plug-in hard disk, a Smart Media Card (SMC), an SD Card, a Flash memory Card (Flash Card), etc. provided on the device. Further, the computer readable storage medium may include both an internal storage unit and an external storage device of any data processing capable device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the arbitrary data processing-capable device, and may also be used for temporarily storing data that has been output or is to be output.
The above-described embodiments are intended to illustrate rather than to limit the invention, and any modifications and variations of the present invention are within the spirit of the invention and the scope of the appended claims.

Claims (9)

1. A two-dimensional relational graph visualization method is characterized by comprising the following steps:
(1) constructing a node array according to the node attributes and the relationship between the node attributes and each other;
(2) determining the tracks according to the required inter-track distance; the track is the side of a square on the canvas, the center of the square is the center of the canvas, and all nodes need to be placed on the track and cannot be separated from the track;
(3) traversing the node array, setting a position for each node, firstly judging a track to which the node belongs, and then forming a position group by eight points of each edge and a vertex on the corresponding track for placing the node;
(4) sequentially judging whether the positions in the position group are occupied by other nodes or not; if no unoccupied position can be found in the current position group, finding 2 adjacent nodes with the largest distance difference on the track of the first quadrant parallel to the x axis in the canvas, and taking the midpoint position between the 2 adjacent nodes as a new position (x ', y'), further generating a new eight position group of positions [ [ x ', y' ], [ -x ', -y' ], [ x ', -y' ], [ y ', x' ], [ -y ', -x' ], [ y ', -x' ], [ -y ', x' ] ], again finding placeable positions from the position group; repeating this step until an available location is found;
(5) setting the available positions in the position group to the current node, rendering the nodes to the canvas according to the determined positions of the nodes, and rendering the edges with the association relationship to the canvas to obtain the visual two-dimensional relationship diagram.
2. A two-dimensional relationship graph visualization method according to claim 1, wherein the trajectory is an edge of a square enclosed by a function;
Figure 547131DEST_PATH_IMAGE001
wherein f is a function representing the track, x and y are the horizontal and vertical coordinates of the track on the canvas,arepresenting the track length of each quadrant on the canvas according toaDetermining the track.
3. The two-dimensional relationship graph visualization method according to claim 2, wherein the first track isa=0, the track is a point, i.e. the origin, and the second track isa=dThe third track isa=2dThird trackIs a=3dD represents the distance between the tracks, and the like, and the value of d is determined according to the requirement and the size of the canvas.
4. The two-dimensional relationship graph visualization method according to claim 1, wherein when determining the tracks to which the nodes belong, the nodes are uniformly distributed to the tracks.
5. The two-dimensional relationship graph visualization method according to claim 1, wherein the relationship graph data with classification information is determined according to the classification of the node.
6. The two-dimensional relationship graph visualization method according to claim 2, wherein the 8-point composition rule of the position group is:
1) first position group: [ [ x, y ], [ -x, -y ], [ x, -y ], [ -x, y ], [0, y ], [0, -y ], [ x, 0], [ -x, 0] ], wherein x = y = a,
2) second and subsequent position groups: [ [ x ', y' ], [ -x ', -y' ], [ x ', -y' ], [ -x ', y' ], [ y ', x' ], [ -y ', -x' ], [ y ', -x' ], [ -y ', x' ].
7. A two-dimensional relationship map visualization method as claimed in claim 2, wherein when finding a new location group, it is assumed that
Figure 995430DEST_PATH_IMAGE002
The distance between 2 adjacent nodes with the maximum distance difference is z, the radius of the node is r, and r is more than 0 when
Figure 306325DEST_PATH_IMAGE003
When the node is placed on the target track, the node is placed on the target track by reducing r, and the target does not collide with other nodes; the reset r is:
Figure 32360DEST_PATH_IMAGE004
8. a two-dimensional relationship graph visualization apparatus comprising a memory and one or more processors, the memory having stored therein executable code, wherein the processors, when executing the executable code, implement the two-dimensional relationship graph visualization method according to any one of claims 1 to 7.
9. A computer-readable storage medium on which a program is stored, the program, when executed by a processor, implementing the two-dimensional relationship graph visualization method according to any one of claims 1 to 7.
CN202210980588.6A 2022-08-16 2022-08-16 Two-dimensional relationship graph visualization method and device Active CN115082593B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210980588.6A CN115082593B (en) 2022-08-16 2022-08-16 Two-dimensional relationship graph visualization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210980588.6A CN115082593B (en) 2022-08-16 2022-08-16 Two-dimensional relationship graph visualization method and device

Publications (2)

Publication Number Publication Date
CN115082593A true CN115082593A (en) 2022-09-20
CN115082593B CN115082593B (en) 2022-11-11

Family

ID=83244789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210980588.6A Active CN115082593B (en) 2022-08-16 2022-08-16 Two-dimensional relationship graph visualization method and device

Country Status (1)

Country Link
CN (1) CN115082593B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3947684A (en) * 1973-09-28 1976-03-30 Hitachi Medical Corporation Scintigram display apparatus with multilevel analysis and two-dimensional interpolation
GB2042784A (en) * 1979-01-08 1980-09-24 Karras E Three-dimensional data displays
CN107358527A (en) * 2017-06-19 2017-11-17 重庆誉存大数据科技有限公司 A kind of investment relation network visualization analysis method and system
CN110516004A (en) * 2019-08-28 2019-11-29 中国人民解放军国防科技大学 Visualization method and system giving consideration to information global characteristics and local hierarchical structure
CN112308968A (en) * 2020-11-27 2021-02-02 国家海洋环境预报中心 Three-dimensional visual expression method for sea wave numerical prediction information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3947684A (en) * 1973-09-28 1976-03-30 Hitachi Medical Corporation Scintigram display apparatus with multilevel analysis and two-dimensional interpolation
GB2042784A (en) * 1979-01-08 1980-09-24 Karras E Three-dimensional data displays
CN107358527A (en) * 2017-06-19 2017-11-17 重庆誉存大数据科技有限公司 A kind of investment relation network visualization analysis method and system
CN110516004A (en) * 2019-08-28 2019-11-29 中国人民解放军国防科技大学 Visualization method and system giving consideration to information global characteristics and local hierarchical structure
CN112308968A (en) * 2020-11-27 2021-02-02 国家海洋环境预报中心 Three-dimensional visual expression method for sea wave numerical prediction information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李绪等: "《社交网络数据个性化推荐的可视化方法》", 《计算机工程》 *

Also Published As

Publication number Publication date
CN115082593B (en) 2022-11-11

Similar Documents

Publication Publication Date Title
Liu et al. Neural subdivision
CN103606192B (en) A kind of wind field visual presentation method based on the three-dimensional earth
JP2022524891A (en) Image processing methods and equipment, electronic devices and computer programs
CN102117497B (en) Method and system for three-dimensional terrain modeling
CN101976468B (en) Method and system for visualizing multiresolution dynamic landform
CN110081891A (en) The method and apparatus for rendering map image using the modification of non-grating map datum
CN104732565B (en) A kind of security protection layout drawing practice based on monitoring range the visual design
CN107220372B (en) A kind of automatic laying method of three-dimensional map line feature annotation
Tasse et al. Enhanced texture‐based terrain synthesis on graphics hardware
CN113066183A (en) Virtual scene generation method and device, computer equipment and storage medium
Tucci et al. Using spatial analysis and geovisualization to reveal urban changes: Milan, Italy, 1737–2005
Shen et al. A new approach to simplifying polygonal and linear features using superpixel segmentation
JP2020057381A (en) Information processor, information processing method and program
CN102779165A (en) Building method of grid map picture base
CN112489213A (en) Three-dimensional terrain model generation method and device, electronic equipment and storage medium
CN115082593B (en) Two-dimensional relationship graph visualization method and device
CN116109803B (en) Information construction method, device, equipment and storage medium
Batch et al. Evaluating View Management for Situated Visualization in Web‐based Handheld AR
Wibowo et al. Mapping and grouping of farm land with Graham scan algorithm on convex hull method
CN107688431A (en) Man-machine interaction method based on radar fix
Zhang et al. A georeferenced graph model for geospatial data matching by optimising measures of similarity across multiple scales
CN102708169B (en) Geographical space data storage method based on SWF (Small Web Format) file extension
CN104919454A (en) Managing interactions with data having membership in multiple groupings
She et al. A building label placement method for 3D visualizations based on candidate label evaluation and selection
CN111833395A (en) Direction-finding system single target positioning method and device based on neural network model

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