CN113704943A - Node topological graph layout method and device, computer storage medium and electronic equipment - Google Patents

Node topological graph layout method and device, computer storage medium and electronic equipment Download PDF

Info

Publication number
CN113704943A
CN113704943A CN202111062911.3A CN202111062911A CN113704943A CN 113704943 A CN113704943 A CN 113704943A CN 202111062911 A CN202111062911 A CN 202111062911A CN 113704943 A CN113704943 A CN 113704943A
Authority
CN
China
Prior art keywords
node
nodes
laid out
column
nth row
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
CN202111062911.3A
Other languages
Chinese (zh)
Other versions
CN113704943B (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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202111062911.3A priority Critical patent/CN113704943B/en
Publication of CN113704943A publication Critical patent/CN113704943A/en
Application granted granted Critical
Publication of CN113704943B publication Critical patent/CN113704943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/18Network design, e.g. design based on topological or interconnect aspects of utility systems, piping, heating ventilation air conditioning [HVAC] or cabling

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The disclosure relates to the field of topology layout, and provides a node topology layout method, a node topology layout device, a computer storage medium, and an electronic device, wherein the node topology layout method includes: determining the position relation between the nodes to be laid out and the reference nodes according to the trigger positions of the node creation operation acting on the reference nodes; the position relation comprises a serial relation or a parallel relation; a preset association relation exists between the trigger position and the position relation; responding to the fact that the nodes to be laid out and the reference nodes meet the serial relation, the display width of the nodes is larger than the remaining display width of the current line in the visual interface, and the nodes to be laid out or the reference nodes are laid out at the relevant positions of the reference nodes; wherein, the associated positions are in the same column and the next row of the reference node. The method in the disclosure can meet the requirement of a user for quickly checking the general view of each node under the global view angle.

Description

Node topological graph layout method and device, computer storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of topology layout, and in particular, to a node topology layout method, a node topology layout apparatus, a computer storage medium, and an electronic device.
Background
With the rapid popularization of the concept of CI/CD (CI/CD represents Continuous Integration) and Continuous Delivery), pipelines in various systems can be visualized to be the indispensable requirements in Web (World Wide Web) pages, and how to reasonably arrange and draw nodes becomes a key problem which developers have to consider.
At present, nodes are generally laid out in a fixed expansion mode, the fixed expansion is to fix the size and position of each node and the arrangement direction of the nodes, and a user can only expand the nodes in a specified direction. Therefore, under the condition of a large number of nodes, the graph cannot be completely displayed in the visualization window, and the requirement of a user for visually and quickly viewing the general view of a single node under the global view angle cannot be met.
In view of the above, there is a need in the art to develop a new node topology layout method and apparatus.
It is to be noted that the information disclosed in the background section above is only used to enhance understanding of the background of the present disclosure.
Disclosure of Invention
The present disclosure aims to provide a node topology layout method, a node topology layout device, a computer storage medium, and an electronic device, so as to overcome, at least to some extent, the problem in the related art that a complete node cannot be displayed in a visual interface window.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, a node topology layout method is provided, including: determining the position relation between the nodes to be laid out and the reference nodes according to the trigger positions of the node creation operation acting on the reference nodes; the position relation comprises a serial relation or a parallel relation; a preset incidence relation exists between the trigger position and the position relation; responding to the situation that the node to be laid out and the reference node meet the serial relation, and the node display width is larger than the residual display width of the current line in a visual interface, and laying out the node to be laid out or the reference node at the relevant position of the reference node; wherein the associated positions are in the same column and next row of the reference node.
In an exemplary embodiment of the present disclosure, the node to be laid out and the reference node satisfying the serial relationship include that the node to be laid out is a node subsequent to the reference node; the step of laying out the nodes to be laid out or the reference nodes at the associated positions of the reference nodes in response to the fact that the nodes to be laid out and the reference nodes meet the serial relation and the node display width is larger than the remaining display width of the current line in the visual interface comprises the following steps: and in response to that the node to be laid out is a node behind the reference node and the node display width is larger than the remaining display width of the current line in the visual interface, laying out the node to be laid out at the associated position of the reference node.
In an exemplary embodiment of the present disclosure, the node to be laid out and the reference node satisfying the serial relationship include that the node to be laid out is a previous node of the reference node; the step of laying out the nodes to be laid out or the reference nodes at the associated positions of the reference nodes in response to the fact that the nodes to be laid out and the reference nodes meet the serial relation and the node display width is larger than the remaining display width of the current line in the visual interface comprises the following steps: responding to the situation that the node to be laid out is the previous node of the reference node and the display width of the node is larger than the residual display width of the current line in the visual interface, and moving the reference node to the relevant position of the reference node; and laying out the nodes to be laid out at the positions of the reference nodes.
In an exemplary embodiment of the present disclosure, the coordinates of the nodes to be laid out are calculated by the following formula, and the nodes are laid out according to the coordinates, where the coordinates of the nodes to be laid out refer to the coordinates of the corner points of the nodes to be laid out:
Figure BDA0003257311650000021
wherein n is the row number of the node to be laid out, m is the column number of the node to be laid out, i is the node serial number of the node to be laid out in the mth row and the noden,mPosXiThe horizontal coordinate of the node to be laid out is taken as the horizontal coordinate; the nodeWidth is the node display width of the node to be laid out;
noden,mPoxYithe vertical coordinate of the node to be laid out is taken as the vertical coordinate; node(s)n,mCenterPosYiThe vertical coordinate of the horizontal center line of the node to be laid out is taken as the vertical coordinate; nodehight is the node display height of the node to be laid out; the initial value of i is 0.
In an exemplary embodiment of the present disclosure, the ordinate of the horizontal center line of the node to be laid out is determined by the following formula:
Figure BDA0003257311650000031
wherein rowPosYnrowHeight, which is the ordinate of the start node of the nth rownIs the height of said n-th row, parallelCountn,mIs the number of nodes included in the nth row and mth column.
In an exemplary embodiment of the present disclosure, the ordinate of the start node of the nth row is determined by the following formula:
Figure BDA0003257311650000032
among them, rowHeightjRepresenting the height of the jth row, j being 1 to n-1.
In an exemplary embodiment of the present disclosure, the height of the nth row is determined by: acquiring the number of nodes in each column in the nth row; determining a maximum value of the number of nodes; and determining the height of the nth row according to the product of the maximum value and the node display height.
In an exemplary embodiment of the present disclosure, the number of nodes respectively included in the m-1 th column of the nth row and the m-th column of the nth row is obtained; and in response to the numbers of the nodes contained in the m-1 th column of the nth row and the m-1 th column of the nth row being one, connecting the middle point of the right boundary of the node in the m-1 th column of the nth row and the middle point of the left boundary of the node in the m-1 th column of the nth row in a straight line manner, wherein the straight line is used for indicating the data transmission direction between the nodes.
In an exemplary embodiment of the present disclosure, in response to the number of nodes included in the m-1 th column of the nth row being greater than one and/or the number of nodes included in the m-th column of the nth row being greater than one, acquiring a horizontal center line of the m-th column of the nth row; acquiring a vertical dividing line between the m-1 th column in the nth row and the m-th column in the nth row; determining a characteristic point according to the intersection point of the horizontal central line and the vertical dividing line; drawing a Bezier curve by taking the midpoint of the right boundary line of each node in the (n) th row and the (m-1) th column as a starting point and the characteristic point as an end point; and drawing a Bezier curve by taking the characteristic point as a starting point and taking the middle point of the left boundary line of each node in the nth row and the mth column as an end point; the Bezier curve is used for connecting nodes of two adjacent columns to obtain the node topological graph.
In an exemplary embodiment of the present disclosure, the coordinates of the feature points are determined by the following formula:
Figure BDA0003257311650000041
wherein inputPosPosxn,mAs the abscissa, node, of the feature pointn,mPosX0The abscissa of the starting node of the nth row and the mth column is shown; inputPosyn,mAs ordinate, node, of said characteristic pointn,mPosY0Is the ordinate of the starting node of the nth row and the mth column.
According to a second aspect of the present disclosure, there is provided a node topology layout apparatus, including: the triggering module is used for determining the position relation between the nodes to be laid out and the reference nodes according to the triggering positions of the node creation operation acting on the reference nodes; the position relation comprises a serial relation or a parallel relation; a preset incidence relation exists between the trigger position and the position relation; the node topological graph module is used for responding to the fact that the nodes to be laid out and the reference nodes meet the serial relation, the node display width is larger than the residual display width of the current line in a visual interface, and the nodes to be laid out or the reference nodes are laid out at the relevant positions of the reference nodes; wherein the associated positions are in the same column and next row of the reference node.
According to a third aspect of the present disclosure, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the node topology layout method of the first aspect described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the node topology layout method of the first aspect described above via execution of the executable instructions.
As can be seen from the foregoing technical solutions, the node topology layout method, the node topology layout apparatus, the computer storage medium, and the electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
in the technical solutions provided in some embodiments of the present disclosure, on one hand, in view of the fact that the node size and the node distance are preset fixed values, and different trigger positions correspond to different positions of nodes to be laid out, therefore, the present disclosure can solve the technical problems of disordered graphic layout and poor regularity caused by randomly placing nodes in the related art, and ensure the neatness and beauty of the graphic. On the other hand, in response to that the serial relationship between the nodes to be laid out and the reference nodes is satisfied, and the node display width is greater than the remaining display width of the current row in the visual interface, the nodes to be laid out or the reference nodes are laid out at the associated positions (the same column and the next row of the reference nodes) of the reference nodes, so that a complete graph can be displayed in a visual interface window, the technical problem that the nodes are added along the fixed direction in the related art and exceed the visual interface under the condition that the number of the nodes is large is solved, and the requirement of a user for quickly viewing the general profile of each node under the global view angle is satisfied.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 is a flow chart diagram illustrating a node topology layout method according to an embodiment of the present disclosure;
FIG. 2 shows a schematic diagram of a node in an embodiment of the disclosure;
FIG. 3A illustrates a schematic diagram of nodes satisfying a serial relationship in an embodiment of the disclosure;
FIG. 3B illustrates a schematic diagram of nodes satisfying a parallel relationship in an embodiment of the disclosure;
FIG. 4 is a schematic diagram illustrating a node creation icon in an embodiment of the present disclosure;
FIG. 5 illustrates a schematic diagram of node coordinates in an embodiment of the present disclosure;
FIG. 6 shows a schematic flow chart for plotting Bezier curves in an embodiment of the present disclosure;
FIG. 7 shows a schematic diagram of a node topology diagram in an embodiment of the disclosure;
FIG. 8 is a flowchart illustrating an overall process of a node topology layout method according to an embodiment of the disclosure;
fig. 9 is a schematic structural diagram of a node topology layout apparatus in an exemplary embodiment of the present disclosure;
fig. 10 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/parts/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. other than the listed elements/components/etc.; the terms "first" and "second", etc. are used merely as labels, and are not limiting on the number of their objects.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
The current node drawing method generally comprises the following two methods:
and (7) fixedly expanding. The fixed expansion is to fix the size and position of each node and the drawing direction of the node, and a user can expand the node only in a specified direction.
And secondly, freely expanding, namely dragging the drawing area by the user according to requirements to generate different types of nodes, and associating the nodes with the dependency relationship through a one-way connection line.
However, the above method has the following drawbacks:
for the fixed expansion mode, because the size, the position and the expansion direction of the node are specified, the user only needs to pay attention to the type and the front-back dependency relationship of the node. However, because the expansion can be performed only along a fixed direction, once the number of nodes increases, the graph easily exceeds the view window;
for the free expansion mode, the free expansion enables a user to draw nodes according to personal preferences at will, and under the condition of a large number of nodes, in order to show the front-back dependency relationships of all nodes in a view window, the problem of disordered display of a node topological graph is likely to occur.
In the embodiment of the disclosure, a node topological graph layout method is provided first, which overcomes, at least to some extent, the defect that a complete node cannot be displayed in a visual interface window in the related art.
Fig. 1 is a flowchart illustrating a node topology layout method according to an embodiment of the present disclosure, where an execution subject of the node topology layout method may be a visualization device for laying out nodes.
Referring to fig. 1, a node topology layout method according to one embodiment of the present disclosure includes the steps of:
step S110, determining the position relation between the nodes to be laid out and the reference nodes according to the trigger positions of the node creation operation acting on the reference nodes;
and step S120, in response to the fact that the serial relation between the nodes to be distributed and the reference nodes is met, and the display width of the nodes is larger than the residual display width of the current line in the visual interface, distributing the nodes to be distributed or the reference nodes at the associated positions of the reference nodes.
In the technical solution provided in the embodiment shown in fig. 1, on one hand, in view of the fact that the node size and the node distance are preset fixed values, and different trigger positions correspond to different positions of nodes to be laid out, the present disclosure can solve the technical problems of disordered graphic layout and poor regularity caused by randomly placing nodes in the related art, and ensure the neatness and beauty of the graphic. On the other hand, in response to that the serial relation between the nodes to be laid out and the reference nodes is satisfied, and the display width of the nodes is larger than the remaining display width of the current line in the visual interface, the nodes to be laid out or the reference nodes are laid out at the associated positions (the same column and the next line of the reference nodes) of the reference nodes, so that a complete graph can be displayed in a visual interface window, the technical problem that the nodes are added along the fixed direction in the related art and exceed the visual interface under the condition that the number of the nodes is large is solved, and the requirement that a user can quickly check the general view of each node under the global view angle is satisfied.
The following describes the specific implementation of each step in fig. 1 in detail:
the node topology, commonly called PipeLine (pipe), is simply understood to be the data path for the client to transmit data (Packet) and receive the DataNode reply (ACK). The whole assembly line is formed by connecting a plurality of DataNodes (namely nodes), the assembly line is like a water pipe, and data (Packets) flow in from one end and sequentially pass through the DataNodes on the assembly line. After the pipeline is visualized, a user can know the source, the processing process and the processing result of data more intuitively, for example, a set of codes can be obtained from a code warehouse, and the codes are published into an application after the processing processes of compiling, testing, deploying and the like.
Referring to fig. 2, fig. 2 shows a schematic diagram of a node in the embodiment of the present disclosure, in the diagram, a rectangle shown by a solid line is the node, a rectangle shown by a dotted line is a peripheral virtual frame of the node, nodeWidth is a width of the peripheral virtual frame of the node, nodehight is a height of the peripheral virtual frame of the node, a node distance reserved in a horizontal direction is paddinghorizon, a node distance reserved in a vertical direction is paddingVertical, both an upper side reserved distance and a lower side reserved distance of the node are paddingVertical/2, and both a left side reserved distance and a right side reserved distance of the node are paddinghorizon/2.
Therefore, when a user creates a first node (hereinafter referred to as a source node) in a visual interface, the user may click the create button, further input a node name, click the add node button, and input node information (step type, circulation mode, timeout time, warehouse address, branch, etc.), so as to create the source node at a default initial position in the visual interface, specifically, taking the default initial position in the visual interface as (0, 0) as an example, the default initial position may be determined as a coordinate of a corner point (e.g., an upper left corner vertex) of the source node, and further, the coordinate of each feature point on the source node may be determined according to the node display width (sum of the width of the node itself and the left and right reserved distances of the node), the node display height (sum of the height of the node itself and the upper and lower reserved distances of the node), to create the source node.
In step S110, determining a position relationship between the node to be laid out and the reference node according to the trigger position of the node creation operation acting on the reference node; the position relation comprises a serial relation or a parallel relation; a preset association relationship exists between the trigger position and the position relationship.
In this step, the reference node may be any node already created in the visualization page, and exemplarily, the reference node may be the source node, or may be any node in the process of creating the node by the user, and may be set by the user according to the actual situation, which is not particularly limited by the present disclosure.
For example, reference may be made to fig. 3A, where fig. 3A shows a schematic diagram of nodes satisfying a serial relationship in the embodiment of the present disclosure, and specifically shows a schematic diagram of creating only one node at each rank position to form a serially arranged node chain. FIG. 3B is a schematic diagram of nodes satisfying the parallel relationship in the embodiment of the present disclosure, and specifically shows a schematic diagram of creating a plurality of nodes at a certain row-column position (two parallel nodes, node2-1 and node2-2, are created at the position of node 2) to form a node chain arranged in parallel.
On the premise that the reference node is created, if a user wants to create a new node, a trigger operation (for example, a single-click operation or a double-click operation) can be performed at different positions on the reference node, illustratively, a preset association relationship exists between a trigger position and a position relationship, specifically, when the trigger position is located on an upper boundary line of the reference node, it can be determined that a node to be laid out and the reference node are in a parallel relationship, and the node to be laid out is located above the reference node; when the trigger position is located on the lower boundary line of the reference node, it can be determined that the nodes to be laid out and the reference node are in a parallel relationship, and the nodes to be laid out are located below the reference node; when the trigger position is located on the left boundary line of the reference node, it can be determined that the nodes to be laid out and the reference node are in a serial relationship, and the nodes to be laid out are located on the left side of the reference node; when the trigger position is located on the right boundary line of the reference node, it can be determined that the nodes to be laid out and the reference node are in serial relation, and the nodes to be laid out are located on the right side of the reference node.
For example, referring to fig. 4, fig. 4 shows a schematic diagram of a node creation icon in the embodiment of the present disclosure, specifically, the node creation icon may be set on a boundary line of a reference node or a peripheral virtual border of the node, for example: the method comprises the steps that four node creating icons can be respectively arranged on an upper boundary line and a lower boundary line of a reference node, a left boundary line of a peripheral virtual frame of the reference node and a right boundary line of the peripheral virtual frame, and further, when a node creating icon Ta with a triggering position located on the upper boundary line, a node to be laid out and the reference node can be determined to be in a parallel relation, and the node to be laid out is located above the reference node; when the triggering position is located on the node creation icon Tc on the lower boundary line, it can be determined that the node to be laid out and the reference node are in a parallel relationship, and the node to be laid out is located below the reference node; when the triggering position is located on the node creation icon Td on the left boundary line of the peripheral virtual frame, it can be determined that the node to be laid out and the reference node are in a serial relationship, and the node to be laid out is located on the left side of the reference node; when the node creation icon Tb with the trigger position located on the right boundary line of the peripheral virtual frame, it may be determined that the node to be laid out and the reference node are in a serial relationship, and the node to be laid out is located on the right side of the reference node.
With continued reference to fig. 1, in step S120, in response to that the serial relationship between the to-be-laid out node and the reference node is satisfied, and the node display width is greater than the remaining display width of the current line in the visual interface, the to-be-laid out node or the reference node is laid out at the associated position of the reference node.
In this step, in an optional implementation manner, the remaining display width of the current line in the visual interface may be obtained first, and then, a size relationship between the node display width and the remaining display width of the current line is determined. Specifically, the remaining display width of the current line may be determined by: acquiring the number of nodes which are laid out on a current line in a visual interface; determining the display width of the laid nodes according to the preset node width and the number of the laid nodes; and determining the remaining display width of the current line in the visual interface according to the width of the visual interface and the display width of the laid nodes.
For example, assuming that the number of laid out nodes in the current row is 4, the display width nodeWidth of each node is 10, the width of the laid out node in the current row is 40, and if the width of the visual interface is 45, the remaining display width of the current row in the visual interface may be determined to be 5. Further, it may be determined that the node display width is greater than the remaining display width of the current row.
In another optional implementation, the maximum number of nodes that can be accommodated by each row may be calculated first, and then, the number of nodes that have been laid out in the current row is obtained, if the difference between the maximum number of nodes that can be accommodated by each row and the number of nodes that have been laid out in the current row is less than 1 (that is, the row cannot accommodate the next complete node any more), it may be determined that the display width of a node is greater than the remaining display width of the current row, and if the difference between the maximum number of nodes that can be accommodated by each row and the number of nodes that have been laid out in the current row is greater than or equal to 1, it may be determined that the display width of a node is not greater than the remaining display width of the current row.
The maximum number of nodes that can be accommodated by the current row can be calculated by the following formula 1:
Figure BDA0003257311650000101
maxNodePerRow is the maximum number of nodes that can be accommodated by each row, math.floor means rounding down (for example, 6 if 6.6), conteninerwidth is the width of the visual interface, and nodeWidth is the node display width.
For example, when visualizing a worldA face width of 45 and a node display width of 10, it can be determined
Figure BDA0003257311650000102
The value of (2) is 4.5, rounding down can obtain that the maximum number of nodes that can be accommodated by the current row is 4, and if the number of nodes that have been laid out by the current row is 4, the difference between the two can be determined to be 0, that is, the difference is less than 1, so that it can be determined that the display width of the node is greater than the remaining display width of the current row.
As can be seen from the above explanation of step S110, the serial relationship between the node to be laid out and the reference node includes two cases, that is, the node to be laid out is a node subsequent to the reference node, and the node to be laid out is a node previous to the reference node.
Thus, in an optional implementation manner, when the node to be laid out is a node subsequent to the reference node, and the display width of the node is greater than the remaining display width of the current row in the visual interface, the node to be laid out may be laid out at the associated position of the reference node, for example, when the reference node is located in the nth row and the mth column, the node to be laid out may be laid out in the nth +1 row and the mth column.
And when the node to be laid out is a node behind the reference node and the display width of the node is not more than the remaining display width of the current line in the visual interface, directly laying out the node to be laid out at the next position of the reference node.
Specifically, if the nodes are arranged in sequence from left to right and the reference node is located in the mth row and the mth column, the nodes to be arranged may be arranged in the mth +1 th column of the nth row. If the nodes are arranged in the order from right to left and the reference node is located in the nth row and the mth column, the node to be arranged may be arranged at the position where the reference node is located, and the reference node is moved to the next position.
In another optional implementation manner, when the node to be laid out is a previous node of the reference node, and the display width of the node is greater than the remaining display width of the current line in the visual interface, the node to be laid out may be laid out at the position where the reference node is located, and the reference node is moved to the associated position of the reference node. For example, when the reference node is located in the nth row and the mth column, the reference node may be moved to its associated position, i.e., the nth row and the mth column of the n +1 th row, and the nodes to be laid out may be laid out in the mth column of the nth row.
When the node to be laid out is a previous node of the reference node and the display bandwidth of the node is not greater than the remaining display width of the current row in the visual interface, if the nodes are arranged in a left-to-right sequential manner, the node to be laid out may be laid out at a position where the reference node is located, and the reference node is moved backward to a next position in the row, for example, when the reference node is located in the mth row, the node to be laid out may be laid out in the mth row, and the reference node is moved to the mth +1 th row. If the nodes are arranged from right to left, the nodes to be laid out may be laid out at a position before the nodes to be laid out, for example, when the reference node is located at the mth row of the nth row, the nodes to be laid out may be laid out at the mth-1 row of the nth row.
Therefore, the technical problem that nodes exceed the width of a visual interface due to the fact that the nodes are only distributed in the fixed direction in the related technology can be solved, and all the nodes can be visually displayed without zooming the interface by a user.
Illustratively, when the nodes to be laid out are laid out, the coordinates of the nodes need to be calculated. Referring to fig. 5, fig. 5 shows a schematic diagram of node coordinates in the embodiment of the present disclosure, where the node coordinates refer to coordinates of corner points of a peripheral virtual frame of a node (for example, coordinates of a vertex at the top left corner), and as shown in fig. 5, when there are 3 nodes satisfying a parallel relationship at a certain position, the coordinates of node2-1 are coordinates of point a, the coordinates of node2-2 are coordinates of point B, and the coordinates of node2-3 are coordinates of point C.
When calculating the node coordinates, assuming that the node to be laid out is located in the mth column of the nth row, the height of the nth row may be determined according to the number of nodes included in each position of the laid out node in the nth row. In the following formulas, horizontal rightward is taken as the positive direction of the X axis, and vertical downward is taken as the positive direction of the Y axis.
Specifically, the height of the nth row is determined by the following formula:
rowHeightn=nodeHeight*maxParallelCountnequation 2
Wherein, maxParallelcountnAnd in all the columns of which the nodes are drawn for the nth row, the number of the nodes corresponding to the column with the most nodes is included. For example, assume that the node to be placed is located in row 2, column 3, and that both column 1 and column 2 of row 2 have placed nodes, such as: line 2, column 1, contains 1 node, line 2, column 2 contains 2 nodes, the maximum value of the number of nodes is 2, namely, maxParallelCount is determinednIs 2, and thus, the height of the nth row can be determined to be 2 × nodehight.
Thus, the ordinate of the start node of the nth row (i.e., the 1 st node of the 1 st column of the nth row) can be determined by the following formula 3:
Figure BDA0003257311650000121
wherein rowPosYnIs the ordinate of the start node of the nth row, when the value of n is 1, the ordinate of the start node of the nth row is 0, when the value of n is greater than 1, the ordinate of the start node of the nth row is the sum of the heights of the previous n-1 rows (rowHeight)jRepresenting the height of the jth row, j taking on a value from 1 to n-1).
After the ordinate of the start node of the nth row is calculated, the ordinate of the horizontal center line of the node to be laid out may be calculated based on the following formula 4:
Figure BDA0003257311650000122
wherein rowPosYnIs the ordinate of the start node of the nth row,rowHeightnparallel count is the height of the nth rown,mThe node number in the mth column of the nth row is shown, the nodehight is the node display height, i is the node serial number of the node to be laid out in the mth column of the nth row, and the initial value of i is 0.
For example, the number of nodes parallelCount contained in the nth row and the mth column at this timen,mIs 1, i is 0 (i.e. the node to be laid out is the 1 st node in the n-th row and m-th column), the ordinate of the horizontal center line of the node to be laid out is
Figure BDA0003257311650000131
The number of nodes parallelCount contained in the nth row and mth column at this timen,mIs 2, i is 0 (i.e. the node to be laid out is the 1 st node in the n-th row and m-th column), the ordinate of the horizontal center line of the node to be laid out is
Figure BDA0003257311650000132
Figure BDA0003257311650000133
When i is 1 (i.e. the node to be laid out is the 2 nd node in the n-th row and m-th column), the ordinate of the horizontal center line of the node to be laid out is
Figure BDA0003257311650000134
Figure BDA0003257311650000135
The number of nodes parallelCount contained in the nth row and mth column at this timen,mIs 3, i is 0 (i.e. the node to be laid out is the 1 st node in the n-th row and m-th column), the ordinate of the horizontal center line of the node to be laid out is
Figure BDA0003257311650000136
When i is 1 (i.e. the node to be laid out is the 2 nd node in the n-th row and m-th column), the ordinate of the horizontal center line of the node to be laid out is
Figure BDA0003257311650000137
When i is 2 (i.e. the node to be laid out is the 3 rd node in the n-th row and m-th column), the ordinate of the horizontal center line of the node to be laid out is
Figure BDA0003257311650000138
After the ordinate of the horizontal center line of the node to be laid out is calculated, the coordinate of the node to be laid out may be calculated based on the following formula 5 and laid out according to the coordinate:
Figure BDA0003257311650000141
wherein, node width is the node display width of the node to be laid outn,mPosXiThe abscissa of the node to be laid out is such that, for example, when the node to be laid out is located in row 2, column 3, then m is 3, and the abscissa of the node to be laid out is 2 × nodeWidth.
noden,mPoxYiThe vertical coordinate of the node to be laid out is shown; node(s)n,mCenterPosYiIs the ordinate of the horizontal center line of the node to be laid out, so that, for example, when there are 3 nodes satisfying the parallel relationship in the 2 nd row and 3 rd column, if the node to be laid out is the 1 st node in the 2 nd row and 3 rd column, the ordinate of the node to be laid out is
Figure BDA0003257311650000142
If the node to be laid out is the 2 nd node in the 2 nd row and the 3 rd column, the ordinate of the node to be laid out is
Figure BDA0003257311650000143
If the node to be laid out is the 3 rd node in the 2 nd row and the 3 rd column, the ordinate of the node to be laid out is
Figure BDA0003257311650000144
It should be noted that, when the nodes to be laid out and the reference nodes are in a parallel relationship, if the height of the row is affected after the nodes to be laid out are added, the horizontal center line of the row needs to be recalculated, and the coordinates of each node in the row are adjusted, so as to avoid the problem of unattractive pipeline graph caused by uneven positions between the nodes, and ensure the ordered and beautiful appearance of the whole graph.
Since the coordinates of each node are stored when the nodes are laid out, when it is necessary to delete a node, for example: when a user clicks a certain node and deletes the node, the coordinate of the node can be quickly positioned and deleted.
After the nodes in the nth row and the mth column are laid out, the number of nodes included in the nth row and the mth column and the number of nodes included in the nth row and the mth column may be respectively obtained, and when the number of nodes included in the nth row and the mth column is 1, a straight line with an arrow may be used to connect a midpoint of a right boundary line of the nodes in the nth row and the mth column to a midpoint of a left boundary line of the nodes in the nth row and the mth column, so as to indicate a data transmission direction between the nodes.
When the number of nodes included in the m-1 th column in the nth row is not 1 and/or the number of nodes included in the m-1 th column in the nth row is not 1, referring to fig. 6, fig. 6 shows a schematic flow chart of plotting a bezier curve in the embodiment of the present disclosure, including steps S601-S605:
in step S601, in response to the number of nodes included in the m-1 th column of the nth row being greater than one and/or the number of nodes included in the m-th column of the nth row being greater than one, a horizontal center line of the nth row is obtained.
In this step, as can be seen by referring to the above explanation, the ordinate of the horizontal center line of the nth row and the mth column is the sum of the ordinate of the start node of the nth row and the mth column and the half height of the nth row, that is, the vertical coordinate is
Figure BDA0003257311650000151
As shown by line 1 in fig. 5.
In step S602, a vertical dividing line between the m-1 th column of the nth row and the m-th column of the nth row is obtained.
In this step, next, referring to FIG. 5, it is assumed that nodes 2-1, 2-2, and 2-3 are on the nth rowm-1 column, node3 is in the nth row and mth column, then the vertical dividing line of the nth row and mth column, i.e. the right boundary of the peripheral virtual frame of node2-2 and the left boundary of the peripheral virtual frame of node3 (both are coincident) are in the nth row and mth column, so that the abscissa of the numerical dividing line is the abscissa of the starting node of the nth row and mth column, i.e. the abscissa of the noden,mPosX0
In step S603, a feature point is determined based on the intersection of the horizontal centerline and the vertical dividing line.
In this step, a feature point, such as point O in fig. 5, may be determined according to the intersection point of the horizontal center line and the vertical dividing line, and thus, the abscissa of the feature point may be represented as a noden,mPosX0The ordinate can be expressed as
Figure BDA0003257311650000152
In step S604, a Bezier curve is drawn with the midpoint of the right boundary of each node in the m-1 th column of the nth row as a starting point and the above-mentioned feature point as an end point.
In this step, the midpoint of the right boundary line of each node in the m-1 th row and the n-1 th column may be used as a starting point, the feature point may be used as an end point, and then, two control points of the third order bezier curve may be calculated, where the abscissa of the control point 1 is located on the vertical central line of the starting point and the end point, the ordinate thereof is the same as the ordinate of the starting point, the abscissa of the control point 2 is located on the vertical central line of the starting point and the end point, the ordinate thereof is the same as the ordinate of the end point, and further, the third order bezier curve may be generated using a path element of SVG (Scalable Vector Graphics) according to the starting point, the end point, and the two control points. For example, the path parameter between two points can be represented as $ { s.x } $ { s.y } C $ { C0.x } $ { C0.y } $ { C1.x } $ { C1.y } $ { e.x } $ { e.y }, where M represents Move, the coordinates of the start point are (s.x, s.y), C represents Curve, a three-order bezier Curve, which includes two control points and an end point, the coordinates of the two control points are (C0.x, C0.y) and (C1.x, C1.y), respectively, and the coordinates of the end point are (e.x, e.y).
In step S605, a bezier curve is drawn with the above feature points as starting points and the midpoint of the left boundary line of each node in the nth row and mth column as an end point.
In this step, referring to the explanation of step S604, a bezier curve may be drawn using the path element of SVG, with the feature point as a starting point and the left boundary line of each node in the nth row and the mth column as an end point.
After the bezier curve is drawn, nodes in two adjacent columns can be connected to form a node topological graph, referring to fig. 7, fig. 7 shows a schematic diagram of the node topological graph in the embodiment of the present disclosure, and as can be seen from the diagram, the node topological graph in the present disclosure can present the execution sequence of each step more clearly, so that relevant developers can know the position of each node, the dependency relationship and the input-output relationship of adjacent nodes in the node topological graph intuitively, and can quickly locate a specific node when a problem occurs.
It should be noted that, when it is detected that the visualization window is scaled, the present disclosure may scale the size of each node displayed in the visualization window and each connecting line (length, arrow size) in equal proportion, so that the size of the display graph is adapted to the size of the visualization window.
Fig. 8 is a schematic overall flowchart illustrating a node topology layout method in the embodiment of the present disclosure, including steps S801 to S810:
in step S801, start;
in step S802, a trigger node is clicked to draw an event;
in step S803, whether or not there is a serial relationship;
if not (no serial relation), the process goes to step S809, where node information is input, node coordinates are calculated, all nodes in the row and connection lines between the nodes are reset, and the process goes to step S807;
if yes (serial node is drawn), step S804 is performed to determine whether the node exceeds the visual interface;
if the current line does not exceed the visual interface, the method enters step S810, node information is input, a node is drawn at the next position of the current line, and the method enters step S806;
if the node exceeds the visual interface, in step S805, inputting node information, changing lines, and drawing a node below the last line of last nodes;
in step S806, a one-way connection is drawn;
in step S807, whether or not to end;
if yes, the process goes to step S808 and ends;
otherwise, the procedure returns to step S802.
Based on the technical scheme, the method and the device can solve the technical problems of disordered graph layout and poor orderliness caused by randomly placing nodes in the related technology, and ensure the neatness and attractiveness of the graph. On the other hand, a complete graph can be displayed in the visual interface window, the technical problem that the visual interface is exceeded under the condition that the number of nodes is large due to the fact that the nodes are added along the fixed direction in the related technology is solved, and the requirement that a user quickly checks the general view of each node under the global view angle is met.
The present disclosure also provides a node topology layout apparatus, and fig. 9 shows a schematic structural diagram of the node topology layout apparatus in an exemplary embodiment of the present disclosure; as shown in fig. 9, the node topology layout apparatus 900 may include a triggering module 910 and a node layout module 920. Wherein:
a triggering module 910, configured to determine a position relationship between a node to be laid out and a reference node according to a triggering position of a node creation operation acting on the reference node; the position relation comprises a serial relation or a parallel relation; a preset association relation exists between the trigger position and the position relation;
the node layout module 920 is configured to, in response to that the serial relationship between the nodes to be laid out and the reference nodes is satisfied, and the node display width is greater than the remaining display width of the current line in the visual interface, lay out the nodes to be laid out or the reference nodes at the associated positions of the reference nodes; wherein, the associated positions are in the same column and the next row of the reference node.
In an exemplary embodiment of the present disclosure, the serial relationship includes a node to be laid out as a subsequent node of the reference node; a node placement module 920 configured to:
and responding to the situation that the node to be laid out is the next node of the reference node, and the display width of the node is larger than the residual display width of the current line in the visual interface, and laying out the node to be laid out at the relevant position of the reference node.
In an exemplary embodiment of the present disclosure, the serial relationship includes a previous node in which a node to be laid out is a reference node; a node placement module 920 configured to:
responding to the situation that the node to be laid out is the previous node of the reference node, and the display width of the node is larger than the residual display width of the current line in the visual interface, and moving the reference node to the relevant position of the reference node; and laying out the nodes to be laid out at the positions of the reference nodes.
In an exemplary embodiment of the present disclosure, the node placement module 920 is configured to:
calculating the coordinates of the nodes to be laid out by the following formula, and laying out the nodes according to the coordinates, wherein the coordinates of the nodes to be laid out refer to the coordinates of the corner points of the nodes to be laid out:
Figure BDA0003257311650000181
wherein n is the row number of the node to be laid out, m is the column number of the node to be laid out, i is the node serial number of the node to be laid out in the mth row of the nth row, and noden,mPosXiThe horizontal coordinate of the node to be laid out is shown; node width is the node display width of the node to be laid out;
noden,mPoxYithe vertical coordinate of the node to be laid out is shown; node(s)n,mCenterPosYiIs the ordinate of the horizontal center line of the node to be laid out; nodehight is the node display height of the node to be laid out; the initial value of i is 0.
In an exemplary embodiment of the present disclosure, the node placement module 920 is configured to:
determining the ordinate of the horizontal center line of the node to be laid out by the following formula:
Figure BDA0003257311650000182
wherein rowPosYnRowHeight, the ordinate of the start node of the nth rownParallel count is the height of the nth rown,mThe number of nodes included in the nth row and the mth column.
In an exemplary embodiment of the present disclosure, the node placement module 920 is configured to:
the ordinate of the start node of the nth row is determined by the following formula:
Figure BDA0003257311650000183
among them, rowHeightjRepresenting the height of the jth row, j being 1 to n-1.
In an exemplary embodiment of the present disclosure, the node placement module 920 is configured to:
acquiring the number of nodes in each column in the nth row; determining the maximum value of the number of nodes; the height of the nth row is determined based on the product of the maximum value and the node display height.
In an exemplary embodiment of the present disclosure, the node placement module 920 is configured to:
acquiring the number of nodes respectively contained in the m-1 th column of the nth row and the m-th column of the nth row; and in response to the m-1 th column in the nth row and the m-1 th column in the nth row, connecting the middle point of the right boundary of the node in the m-1 th column in the nth row and the middle point of the left boundary of the node in the m-1 th column in the nth row in a straight line manner, wherein the straight line is used for indicating the data transmission direction between the nodes.
In an exemplary embodiment of the present disclosure, the node placement module 920 is configured to:
acquiring a horizontal center line of the nth row and the mth column in response to the number of nodes contained in the (m-1) th column of the nth row being more than one and/or the number of nodes contained in the mth column of the nth row being more than one; acquiring a vertical dividing line between the m-1 th column in the nth row and the m-th column in the nth row; determining a characteristic point according to the intersection point of the horizontal central line and the vertical dividing line; drawing a Bezier curve by taking the midpoint of the right boundary line of each node in the (n) th row and the (m-1) th column as a starting point and taking the characteristic point as an end point; and drawing a Bezier curve by taking the characteristic point as a starting point and taking the middle point of the left boundary line of each node in the nth row and the mth column as an end point; the Bezier curve is used for connecting nodes of two adjacent columns to obtain a node topological graph.
In an exemplary embodiment of the present disclosure, the node placement module 920 is configured to:
the coordinates of the feature points are determined by the following formula:
Figure BDA0003257311650000191
wherein inputPosPosxn,mAs the abscissa, node, of the feature pointn,mPosX0The abscissa of the starting node of the nth row and the mth column; inputPosyn,mAs ordinate of characteristic point, noden,mPosY0Is the ordinate of the start node of the nth row and the mth column.
The specific details of each module in the node topology layout apparatus have been described in detail in the corresponding node topology layout method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
The present application also provides a computer-readable storage medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device.
A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable storage medium may transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The computer readable storage medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the above embodiments.
In addition, the embodiment of the disclosure also provides an electronic device capable of implementing the method.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1000 according to this embodiment of the disclosure is described below with reference to fig. 10. The electronic device 1000 shown in fig. 10 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the electronic device 1000 is embodied in the form of a general purpose computing device. The components of the electronic device 1000 may include, but are not limited to: the at least one processing unit 1010, the at least one memory unit 1020, a bus 1030 connecting different system components (including the memory unit 1020 and the processing unit 1010), and a display unit 1040.
Wherein the storage unit stores program code that is executable by the processing unit 1010 to cause the processing unit 1010 to perform steps according to various exemplary embodiments of the present disclosure described in the above section "exemplary methods" of the present specification. For example, the processing unit 1010 may perform the following as shown in fig. 1: step S110, determining the position relation between the nodes to be laid out and the reference nodes according to the trigger positions of the node creation operation acting on the reference nodes; the position relation comprises a serial relation or a parallel relation; a preset association relation exists between the trigger position and the position relation; step S120, responding to the fact that the serial relation between the nodes to be distributed and the reference nodes is met, the display width of the nodes is larger than the residual display width of the current line in the visual interface, and distributing the nodes to be distributed or the reference nodes at the relevant positions of the reference nodes; wherein, the associated positions are in the same column and the next row of the reference node.
The storage unit 1020 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)10201 and/or a cache memory unit 10202, and may further include a read-only memory unit (ROM) 10203.
The memory unit 1020 may also include a program/utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1030 may be any one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, and a local bus using any of a variety of bus architectures.
The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1000, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1000 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interfaces 1050. Also, the electronic device 1000 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1060. As shown, the network adapter 1060 communicates with the other modules of the electronic device 1000 over the bus 1030. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (13)

1. A node topology map layout method, the method comprising:
determining the position relation between the nodes to be laid out and the reference nodes according to the trigger positions of the node creation operation acting on the reference nodes; the position relation comprises a serial relation or a parallel relation; a preset incidence relation exists between the trigger position and the position relation;
responding to the situation that the node to be laid out and the reference node meet the serial relation, and the node display width is larger than the residual display width of the current line in a visual interface, and laying out the node to be laid out or the reference node at the relevant position of the reference node;
wherein the associated positions are in the same column and next row of the reference node.
2. The method according to claim 1, wherein the node to be laid out and the reference node satisfying a serial relationship include the node to be laid out being a node subsequent to the reference node;
the step of laying out the nodes to be laid out or the reference nodes at the associated positions of the reference nodes in response to the fact that the nodes to be laid out and the reference nodes meet the serial relation and the node display width is larger than the remaining display width of the current line in the visual interface comprises the following steps:
and in response to that the node to be laid out is a node behind the reference node and the node display width is larger than the remaining display width of the current line in the visual interface, laying out the node to be laid out at the associated position of the reference node.
3. The method according to claim 1, wherein the node to be laid out and the reference node satisfying a serial relationship include the node to be laid out being a previous node of the reference node;
the step of laying out the nodes to be laid out or the reference nodes at the associated positions of the reference nodes in response to the fact that the nodes to be laid out and the reference nodes meet the serial relation and the node display width is larger than the remaining display width of the current line in the visual interface comprises the following steps:
responding to the situation that the node to be laid out is the previous node of the reference node and the display width of the node is larger than the residual display width of the current line in the visual interface, and moving the reference node to the relevant position of the reference node;
and laying out the nodes to be laid out at the positions of the reference nodes.
4. The method according to claim 1, wherein the coordinates of the nodes to be laid out are calculated by the following formula and laid out according to the coordinates, and the coordinates of the nodes to be laid out refer to the coordinates of the corner points of the nodes to be laid out:
Figure FDA0003257311640000021
wherein n is the row number of the node to be laid out, m is the column number of the node to be laid out, i is the node serial number of the node to be laid out in the mth row and the noden,mPosXiThe horizontal coordinate of the node to be laid out is taken as the horizontal coordinate; nodeWidth isThe node display width of the node to be laid out;
noden,mPoxYithe vertical coordinate of the node to be laid out is taken as the vertical coordinate; node(s)n,mCenterPosYiThe vertical coordinate of the horizontal center line of the node to be laid out is taken as the vertical coordinate; nodehight is the node display height of the node to be laid out; the initial value of i is 0.
5. The method of claim 4, wherein the ordinate of the horizontal centerline of the node to be laid out is determined by the following formula:
Figure FDA0003257311640000022
wherein rowPosYnrowHeight, which is the ordinate of the start node of the nth rownIs the height of said n-th row, parallelCountn,mIs the number of nodes included in the nth row and mth column.
6. The method of claim 5, wherein the ordinate of the start node of the nth row is determined by the following formula:
Figure FDA0003257311640000023
among them, rowHeightjRepresenting the height of the jth row, j being 1 to n-1.
7. The method of claim 5, wherein the height of the nth row is determined by:
acquiring the number of nodes in each column in the nth row;
determining a maximum value of the number of nodes;
and determining the height of the nth row according to the product of the maximum value and the node display height.
8. The method according to any one of claims 1 to 7, further comprising:
acquiring the number of nodes respectively contained in the m-1 th column of the nth row and the m-th column of the nth row;
in response to the m-1 th column in the nth row and the m-1 th column in the nth row, the number of nodes contained in the mth column in the nth row is one, and the midpoint of the right boundary line of the node in the m-1 th column in the nth row and the midpoint of the left boundary line of the node in the mth column in the nth row are connected in a straight line manner;
wherein the straight line is used for indicating the data transmission direction between the nodes.
9. The method according to any one of claims 1 to 7, further comprising:
acquiring a horizontal center line of an m-th column in the nth row in response to the number of nodes contained in the m-1 th column in the nth row being more than one and/or the number of nodes contained in the m-th column in the nth row being more than one;
acquiring a vertical dividing line between the m-1 th column in the nth row and the m-th column in the nth row;
determining a characteristic point according to the intersection point of the horizontal central line and the vertical dividing line;
drawing a Bezier curve by taking the midpoint of the right boundary line of each node in the (n) th row and the (m-1) th column as a starting point and the characteristic point as an end point; and
drawing a Bezier curve by taking the characteristic point as a starting point and taking the middle point of the left boundary line of each node in the nth row and the mth column as an end point;
the Bezier curve is used for connecting nodes of two adjacent columns to obtain the node topological graph.
10. The method of claim 9, wherein the coordinates of the feature points are determined by the formula:
Figure FDA0003257311640000031
wherein inputPosPosxn,mAs the abscissa, node, of the feature pointn,mPosX0The abscissa of the starting node of the nth row and the mth column is shown; inputPosyn,mAs ordinate, node, of said characteristic pointn,mPosY0Is the ordinate of the starting node of the nth row and the mth column.
11. A node topology layout apparatus, comprising:
the triggering module is used for determining the position relation between the nodes to be laid out and the reference nodes according to the triggering positions of the node creation operation acting on the reference nodes; the position relation comprises a serial relation or a parallel relation; a preset incidence relation exists between the trigger position and the position relation;
the node layout module is used for responding that the serial relation is met between the nodes to be laid out and the reference nodes, the node display width is larger than the residual display width of the current line in a visual interface, and the nodes to be laid out or the reference nodes are laid out at the relevant positions of the reference nodes;
wherein the associated positions are in the target positions of the same column and the next row of the reference node.
12. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the node topology layout method of any of claims 1 to 10.
13. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the node topology layout method of any of claims 1-10 via execution of the executable instructions.
CN202111062911.3A 2021-09-10 2021-09-10 Node topological graph layout method and device, computer storage medium and electronic equipment Active CN113704943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111062911.3A CN113704943B (en) 2021-09-10 2021-09-10 Node topological graph layout method and device, computer storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111062911.3A CN113704943B (en) 2021-09-10 2021-09-10 Node topological graph layout method and device, computer storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113704943A true CN113704943A (en) 2021-11-26
CN113704943B CN113704943B (en) 2024-04-05

Family

ID=78660013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111062911.3A Active CN113704943B (en) 2021-09-10 2021-09-10 Node topological graph layout method and device, computer storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113704943B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001304888A (en) * 2000-04-21 2001-10-31 Navitime Japan Co Ltd Method and device for searching route in road network
US20060235658A1 (en) * 2003-05-28 2006-10-19 Celestar Lexico-Sciencies, Inc. Pathway information display device
US20090249213A1 (en) * 2008-03-31 2009-10-01 Atsushi Murase User interface providing information system topology presentation
CN101582793A (en) * 2009-06-05 2009-11-18 东软集团股份有限公司 Method and device for graphical display of network topology
CN108921914A (en) * 2018-05-25 2018-11-30 北京石油化工学院 A kind of pedigree drawing drawing method, device and electronic equipment
CN109324722A (en) * 2018-07-23 2019-02-12 广州视源电子科技股份有限公司 Node adding method, device, equipment and the storage medium of mind map
CN109981311A (en) * 2017-12-27 2019-07-05 阿里巴巴集团控股有限公司 Scheme the implementation method and device of layout
CN109997160A (en) * 2017-01-20 2019-07-09 西门子产品生命周期管理软件公司 The method updated for part
US20200257664A1 (en) * 2019-08-27 2020-08-13 Alibaba Group Holding Limited Node layout determining method and apparatus, computing device, and computer readable medium
CN111967113A (en) * 2020-08-13 2020-11-20 苏州浪潮智能科技有限公司 Cloud platform node topological graph layout method and device
CN112612846A (en) * 2020-12-23 2021-04-06 厦门市美亚柏科信息股份有限公司 Association relation visualization method and terminal
CN113297262A (en) * 2021-06-18 2021-08-24 中国农业银行股份有限公司 Data flow graph layout method and device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001304888A (en) * 2000-04-21 2001-10-31 Navitime Japan Co Ltd Method and device for searching route in road network
US20060235658A1 (en) * 2003-05-28 2006-10-19 Celestar Lexico-Sciencies, Inc. Pathway information display device
US20090249213A1 (en) * 2008-03-31 2009-10-01 Atsushi Murase User interface providing information system topology presentation
CN101582793A (en) * 2009-06-05 2009-11-18 东软集团股份有限公司 Method and device for graphical display of network topology
CN109997160A (en) * 2017-01-20 2019-07-09 西门子产品生命周期管理软件公司 The method updated for part
CN109981311A (en) * 2017-12-27 2019-07-05 阿里巴巴集团控股有限公司 Scheme the implementation method and device of layout
CN108921914A (en) * 2018-05-25 2018-11-30 北京石油化工学院 A kind of pedigree drawing drawing method, device and electronic equipment
CN109324722A (en) * 2018-07-23 2019-02-12 广州视源电子科技股份有限公司 Node adding method, device, equipment and the storage medium of mind map
US20200257664A1 (en) * 2019-08-27 2020-08-13 Alibaba Group Holding Limited Node layout determining method and apparatus, computing device, and computer readable medium
CN111967113A (en) * 2020-08-13 2020-11-20 苏州浪潮智能科技有限公司 Cloud platform node topological graph layout method and device
CN112612846A (en) * 2020-12-23 2021-04-06 厦门市美亚柏科信息股份有限公司 Association relation visualization method and terminal
CN113297262A (en) * 2021-06-18 2021-08-24 中国农业银行股份有限公司 Data flow graph layout method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吕亮;卢泽新;郦苏丹;李渊;: "基于扩展力学模型的网络拓扑图布局算法", 计算机应用研究, no. 07 *

Also Published As

Publication number Publication date
CN113704943B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
JP6018045B2 (en) Temporary formatting and graphing of selected data
JP4868580B2 (en) Computer-implemented method, system and program for hiding columns of electronic table
CN101965608A (en) Method of managing applications in a multi-monitor computer system and multi-monitor computer system employing the method
JP5992934B2 (en) 3D viewing method
US20060174200A1 (en) Method and system to layout topology objects
US9733785B2 (en) Facilitating touch screen users to select elements identified in a two dimensional space
CN111767100B (en) Image processing method, device, system and medium applied to browser
US11113855B2 (en) Expression interpretation engine for computer map visualizations
US10210143B2 (en) Analyzing a click path in a spherical landscape viewport
JP2022539290A (en) Visual programming for deep learning
US11010013B2 (en) Providing visual control guidance on a display
US10289388B2 (en) Process visualization toolkit
CN113656533A (en) Tree control processing method and device and electronic equipment
CN113253898A (en) Guide method and device for interface interaction, electronic equipment and readable medium
JP6781819B2 (en) Task processing method and distributed computing framework system
CN113704943A (en) Node topological graph layout method and device, computer storage medium and electronic equipment
US20210081504A1 (en) System and method for construction cost estimation for non-computer aided design (cad) files
US20210096698A1 (en) Systems and methods for indicating organizational relationships between objects
CN115794980A (en) Data display method, equipment, device and medium
CN112083845B (en) Bubble control processing method and device
CN113126863A (en) Object selection implementation method and device, storage medium and electronic equipment
CN113794604A (en) Network security situation display method, device, equipment and storage medium
CN113476848A (en) Method and device for generating tree chain map, storage medium and electronic equipment
CN110888787A (en) Data monitoring method, device and system
CN113360064A (en) Method and device for searching local area of picture, medium and electronic equipment

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