CN115238133A - Map layout method and device, storage medium and electronic equipment - Google Patents

Map layout method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN115238133A
CN115238133A CN202210775139.8A CN202210775139A CN115238133A CN 115238133 A CN115238133 A CN 115238133A CN 202210775139 A CN202210775139 A CN 202210775139A CN 115238133 A CN115238133 A CN 115238133A
Authority
CN
China
Prior art keywords
level
width
map
classification
hierarchy
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.)
Pending
Application number
CN202210775139.8A
Other languages
Chinese (zh)
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.)
Yancheng Tianyanchawei Technology Co ltd
Original Assignee
Yancheng Jindi 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 Yancheng Jindi Technology Co Ltd filed Critical Yancheng Jindi Technology Co Ltd
Priority to CN202210775139.8A priority Critical patent/CN115238133A/en
Publication of CN115238133A publication Critical patent/CN115238133A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

The invention provides a map layout method, a map layout device, a storage medium and electronic equipment, wherein the method comprises the following steps: generating a data structure map by a preset processing method according to the map data; obtaining classification nodes on different levels according to different levels of the nodes in the data structure map; acquiring an initial coordinate of a classification node on a first level in the data structure map in the abscissa axis direction and the maximum width of the classification node on different levels in the abscissa axis direction, and respectively calculating the level width of each level in the data structure map according to the initial coordinate and preset intervals on different levels; and sequentially arranging the classification nodes on different levels according to the initial coordinates and the level width of each level to generate a target map. The map layout method, the map layout device, the storage medium and the electronic equipment can flexibly set the hierarchy widths of different hierarchies, so that the map layout is more reasonable, the display effect is enhanced, and the user experience is improved.

Description

Map layout method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of page processing technologies, and in particular, to a method and an apparatus for map layout, a storage medium, and an electronic device.
Background
With the development of big data technology, more and more information with relevance can be mined. The relevant information needs to be displayed, for example, the information with certain corresponding relation is displayed on the page in a map manner, namely, an information panorama formed by the information is displayed through a hierarchical map.
Taking an enterprise relationship graph as an example, a conventional display method is that a certain target company is taken as a central point, and related enterprises or persons related to the target company are excavated outwards layer by layer through duties, equities, cooperation, competition, pledges, suspected relations and the like, so that an enterprise relationship panoramic graph of the target company is formed.
However, the conventional information display method cannot meet the requirement of displaying large data. Taking the example of displaying information by using a tree graph structure, each node has a plurality of branches, each branch corresponds to a lower node, and the size occupied by each node in a page is the width of the node. The effect of the conventional information display method is generally as shown in fig. 1, that is, in the graph structure, although the size of the node can be set by setting the attribute of the node, the size of the set node is uniform or the same, that is, the size of the node is uniform or the same regardless of the node in the same hierarchy or the node in different hierarchies. That is, although the widths of the nodes can be set, the setting method in the prior art is not flexible enough, and is limited to synchronously setting the widths of all the nodes in the whole graph to be the same value, and a flexible display method in which the nodes in different levels occupy different widths cannot be realized.
Disclosure of Invention
In view of this, the present invention provides a map layout method, an apparatus, a storage medium, and an electronic device, which can solve the technical problem that the occupation widths of nodes at different levels in a map layout cannot be dynamically adjusted.
Based on an aspect of the embodiments of the present invention, there is provided a map layout method, including:
acquiring map data, and generating a data structure map by a preset processing method according to the map data;
traversing nodes in the data structure graph, and classifying the nodes according to different levels of the nodes in the data structure graph to obtain classified nodes on different levels;
acquiring the initial coordinate of a classification node on the first level in the data structure map in the abscissa axis direction and the maximum width of the classification node on different levels in the abscissa axis direction;
calculating the level width of each level in the data structure graph respectively based on the initial coordinate, the maximum width of the classification nodes on the different levels in the abscissa axis direction and preset intervals on the different levels;
and sequentially arranging the classification nodes on different levels according to the initial coordinate and the level width of each level to generate a target map.
Optionally, before the classifying nodes on different levels are sequentially arranged according to the starting coordinate and the level width of each level, and a target graph is generated, the method further includes:
the hierarchy interval width in the abscissa axis direction between different hierarchies is set to zero.
Optionally, after obtaining the start coordinate of the classification node on the first level in the abscissa axis direction and the maximum width of the classification node on the different levels in the abscissa axis direction in the data structure graph, the method further includes:
the maximum width of the classification node located on the middle hierarchy in the abscissa axis direction is set to zero.
Optionally, if the data structure graph includes three levels, the calculating the level width of each level in the data structure graph based on the start coordinate, the maximum width of the classification node on the different levels in the abscissa axis direction, and the preset interval on the different levels respectively includes:
calculating the level width of the first level according to the initial coordinate and the maximum width of the classification node on the first level in the abscissa axis direction;
calculating the hierarchy width of the middle hierarchy according to the hierarchy width of the first hierarchy, preset intervals on the middle hierarchy and the maximum width of the classification nodes on the middle hierarchy in the abscissa axis direction;
and calculating the level width of the tail level according to the level width of the middle level, a preset interval on the tail level and the maximum width of the classification node on the tail level in the abscissa axis direction.
Optionally, the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the direction of the abscissa axis;
and/or the level width of the middle level is equal to the sum of the level width of the first level, a preset interval on the middle level and the maximum width of the classification node on the middle level in the abscissa axis direction;
and/or the level width of the last level is equal to the sum of the level width of the middle level, a preset interval on the last level and the maximum width of the classification node on the last level in the direction of the abscissa axis.
Optionally, the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the direction of the abscissa axis;
and/or the level width of the middle level is equal to the sum of the level width of the first level, a preset interval on the middle level and the maximum width of the classification node on the middle level in the abscissa axis direction, wherein the maximum width of the classification node on the middle level in the abscissa axis direction is zero;
and/or the level width of the last level is equal to the sum of the level width of the middle level, a preset interval on the last level and the maximum width of the classification node on the last level in the direction of the abscissa axis.
Optionally, the target atlas further comprises a plurality of target sub-atlases; wherein the arrangement layout of the target sub-map and the target map is the same;
and the classification nodes on the tail level in the target map and the classification nodes on the first level in any target sub-map have an incidence relation and are connected at intervals according to a preset map.
On the other hand, according to the embodiment of the present invention, there is provided a map layout apparatus, which is characterized in that the apparatus includes:
the data structure map generation module is used for acquiring map data and generating a data structure map by a preset processing method according to the map data;
the classification module is used for traversing nodes in the data structure graph, classifying the nodes according to different levels of the nodes in the data structure graph to obtain classification nodes on different levels;
the acquisition module is used for acquiring the initial coordinate of the classification node on the first level in the data structure map in the abscissa axis direction and the maximum width of the classification node on different levels in the abscissa axis direction;
a calculation module, configured to calculate, based on the start coordinate, a maximum width of the classification nodes on the different levels in the abscissa axis direction, and preset intervals on the different levels, a level width of each level in the data structure graph;
and the generation module is used for sequentially arranging and laying the classification nodes on different levels according to the initial coordinate and the level width of each level to generate a target map.
Optionally, the apparatus further comprises: and the setting module is used for setting the interval width of the levels between different levels in the direction of the abscissa axis to be zero.
Optionally, the setting module is further configured to set a maximum width of the classification node located on the middle hierarchy level in the abscissa axis direction to zero.
Optionally, wherein the data structure graph comprises three levels, the calculation module comprises:
the first calculation submodule is used for calculating the level width of a first level according to the maximum width of the classification nodes on the initial coordinate and the first level in the direction of the abscissa axis;
the second calculation submodule is used for calculating the hierarchy width of the middle hierarchy according to the hierarchy width of the first hierarchy, the preset interval on the middle hierarchy and the maximum width of the classification nodes on the middle hierarchy in the abscissa axis direction;
and the third calculation submodule is used for calculating the hierarchy width of the tail hierarchy according to the hierarchy width of the middle hierarchy, the preset interval on the tail hierarchy and the maximum width of the classification node on the tail hierarchy in the abscissa axis direction.
Optionally, the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the direction of the abscissa axis; and/or the level width of the middle level is equal to the sum of the level width of the first level, a preset interval on the middle level and the maximum width of the classification node on the middle level in the direction of the abscissa axis; and/or the level width of the last level is equal to the sum of the level width of the middle level, a preset interval on the last level and the maximum width of the classification node on the last level in the direction of the abscissa axis.
Optionally, the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the direction of the abscissa axis; and/or the level width of the middle level is equal to the sum of the level width of the first level, a preset interval on the middle level and the maximum width of the classification node on the middle level in the abscissa axis direction, wherein the maximum width of the classification node on the middle level in the abscissa axis direction is zero; and/or the level width of the last level is equal to the sum of the level width of the middle level, a preset interval on the last level and the maximum width of the classification node on the last level in the direction of the abscissa axis.
Optionally, the target atlas further comprises a plurality of target sub-atlases; wherein the arrangement layout of the target sub-map is the same as that of the target map.
Optionally, the classification node at the last level in the target graph and the classification node at the first level in any one of the target sub-graphs have an association relationship and are connected at a preset graph interval.
According to a further aspect of the embodiments of the present invention, there is provided a computer-readable storage medium storing a computer program for executing the method of any one of the above embodiments.
Based on still another aspect of the embodiments of the present invention, there is provided an electronic device, including: a processor and a memory; wherein the content of the first and second substances,
the memory to store the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any of the above embodiments.
According to a further aspect of the embodiments of the present invention, there is provided a computer program product including computer readable code, which when run on a device, a processor in the device executes a method for implementing any of the embodiments described above.
The map layout method, the map layout device, the storage medium and the electronic equipment provided by the invention are used for obtaining the layout of the whole map through calculation and obtaining the positions of each node and connecting line in the map. The method comprises the steps of drawing nodes and connecting lines of the graph in a browser or a webpage, and customizing the width of each level node in the graph, so that the dynamic adjustment or setting of the node width of different levels can be realized. Therefore, according to the technical scheme, the width of the node can be determined according to the content in the node, so that a more reasonable map of the node width of each level is obtained, the display effect is enhanced, and the user experience is improved.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in more detail embodiments of the present invention with reference to the attached drawings. The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings, like reference numbers generally represent like parts or steps.
FIG. 1 is a schematic illustration of a prior art map display;
FIG. 2 is a flow chart of a graph layout method provided by an exemplary embodiment of the present invention;
FIG. 3 is a diagram of an example atlas layout provided by an example embodiment of the invention;
FIG. 4 is a schematic diagram of an example of a map layout provided by another exemplary embodiment of the present invention;
FIG. 5 is a schematic diagram of a map layout apparatus provided in an exemplary embodiment of the present invention;
fig. 6 is a structure of an electronic device according to an exemplary embodiment of the present invention.
Detailed Description
Hereinafter, example embodiments according to the present invention will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of embodiments of the invention and not all embodiments of the invention, with the understanding that the invention is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present invention are used merely to distinguish one element, step, device, module, or the like from another element, and do not denote any particular technical or logical order therebetween.
It should also be understood that in embodiments of the present invention, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the invention may be generally understood as one or more, unless explicitly defined otherwise or stated to the contrary hereinafter.
In addition, the term "and/or" in the present invention is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In the present invention, the character "/" generally indicates that the preceding and following related objects are in an "or" relationship.
It should also be understood that the description of the embodiments of the present invention emphasizes the differences between the embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations, and with numerous other electronic devices such as terminal devices, computer systems, servers, and the like. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Exemplary method
The embodiment of the invention provides a map layout method, a map layout device, a computer-readable storage medium, electronic equipment and a computer program product. Then, a level width of each level in the data structure graph is calculated based on the position information of the classification nodes on the different levels in the data structure graph, the maximum width of the classification nodes on the different levels, and the preset intervals on the different levels. And finally, sequentially arranging the classification nodes on different levels according to the initial coordinates and the level width of each level, and generating a target map.
Fig. 2 is a flowchart of a map layout method according to an exemplary embodiment of the present invention. The embodiment can be applied to an electronic device, as shown in fig. 2, the method includes the following steps:
step 201, acquiring map data, and generating a data structure map by a preset processing method according to the map data;
when a user wants to acquire or browse the multi-level associated data associated with the target object, the multi-level associated data provided for the user in a map mode can better present the association between the data and provide a more intuitive presentation effect for the user, so that the user experience is improved. To do so, a user may request generation of a target graph of multi-level association data associated with a target object. For example, when a user requests or wishes to generate a target profile, a request for generation of the target profile may be sent. In response to receiving a request for generating a target map, the server or the server searches the database based on the target object, thereby obtaining map data. And then, generating a data structure map by a preset processing method according to the map data. For example, the map data includes relationship information, object information, and the like. Wherein the relationship information includes: the relationship of job, stock right, cooperation, competition, pledge and pledge, etc. The object information includes information of an associated business or person, for example. And processing the map data by a preset processing method, for example, gradually establishing an association structure relationship according to the object information associated with the target object, so as to generate the data structure map.
The preset processing method can be to process the map data by using a d3Js d3.Hierarchy method and a d3.Tree method in sequence to obtain a data structure map. The skilled person can flexibly select the preset treatment method according to actual needs, and the method is not limited herein.
Step 202, traversing nodes in the data structure graph, and classifying the nodes according to different levels of the nodes in the data structure graph to obtain classified nodes on different levels;
a plurality of nodes are included in the data structure graph and may be at different levels. The data structure graph comprises a cyclic presentation tree structure of target objects- > dimension set- > specific dimension- > target objects (such cyclic presentation tree structure can be an infinite loop or a predetermined number of cycles).
In one embodiment, the initial layout of the atlas (i.e., the data structure atlas) may be obtained by initializing the atlas data. For example, the d3.Hierarchy method and the d3.Tree method of d3Js are sequentially used to process the map data, and the initial layout of the map, namely the tree structure, is obtained. The initial layout has one or more levels therein, each level having one or more nodes, and each node for providing or displaying a base unit of the graph data. And classifying the nodes according to different levels of the nodes in the data structure map to obtain classified nodes on different levels.
Step 203, acquiring the initial coordinates of the classification nodes on the first level in the data structure graph in the abscissa axis direction and the maximum widths of the classification nodes on different levels in the abscissa axis direction;
for the classification node on the first level, the start position of the classification node on the first level may be set by presetting the position of the classification node or other initialization manners, where the start position may include an abscissa and an ordinate, so as to obtain the start coordinate of the classification node on the first level. In the embodiment of the present application, the abscissa is taken as an example for explanation, but it should be understood by those skilled in the art that the start coordinate of the classification node on the first hierarchy is not limited to the abscissa.
In one embodiment, after step 203, the method of the present embodiment further comprises: the maximum width of the classification node located on the middle hierarchy in the abscissa axis direction is set to zero. This arrangement enables the classification nodes on the intermediate level to be located on the connection between the first level and the intermediate level without increasing the level width of the intermediate level, for example, the cooperation relationship, the competition relationship, and the pledge relationship shown in fig. 3 are located on the connection between the first level and the intermediate level. Of course, those skilled in the art may set the maximum width of the classification base point on other levels in the direction of the abscissa axis to be zero according to actual needs, which is not limited in the present invention.
Step 204, respectively calculating the hierarchy width of each hierarchy in the data structure map based on the initial coordinate, the maximum width of the classification nodes on different hierarchies in the abscissa axis direction and preset intervals on different hierarchies;
in one embodiment, the hierarchy width of each level in the data structure map is calculated separately in the case where the data structure map includes three levels. Three of the levels include: first, middle and last levels. Specifically, the step of respectively calculating the level width of each level in the data structure graph based on the starting coordinate, the maximum width of the classification nodes on different levels in the abscissa axis direction and the preset intervals on different levels comprises the following steps: and calculating the hierarchy width of the first hierarchy according to the maximum width of the classification nodes on the initial coordinate and the first hierarchy in the direction of the abscissa axis. The start coordinate is, for example, the start coordinate of the target object or company, and the classification node on the first level is, for example, the target object or company. That is, the level width of the first level is calculated from the start coordinate of the target object or company and the maximum width of all classification nodes in the target object or company in the abscissa axis direction. And calculating the hierarchy width of the middle hierarchy according to the hierarchy width of the first hierarchy, a preset interval on the middle hierarchy and the maximum width of the classification nodes on the middle hierarchy in the abscissa axis direction. The preset interval on the middle level may be a preset reasonable value, and the classification node on the middle level is, for example, a dimension set. That is, the hierarchy width of the intermediate hierarchy is calculated from the hierarchy width of the first hierarchy, a preset interval on the intermediate hierarchy, and the maximum width of the classification node on the dimension set in the abscissa axis direction. And calculating the level width of the tail level according to the level width of the middle level, a preset interval on the tail level and the maximum width of the classification node on the tail level in the abscissa axis direction. The classification nodes at the last level are, for example, specific dimensions. That is, the level width of the last level is calculated from the level width of the middle level, the preset interval on the last level, and the maximum width of the specific dimension in the abscissa axis direction.
Preferably, the width of the classification node in the current hierarchy is determined based on the content of each classification node. The more contents of the classification nodes, the more characters need to be occupied, and thus, the larger the numerical value of the node width of the classification node. And taking the maximum value of the width of the classification node in the same hierarchy as the maximum width of the hierarchy in the direction of the abscissa axis.
Specifically, the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the abscissa axis direction; and/or the hierarchy width of the middle hierarchy is equal to the sum of the hierarchy width of the first hierarchy, the preset interval on the middle hierarchy and the maximum width of the classification node on the middle hierarchy in the direction of the abscissa axis; and/or the level width of the tail level is equal to the sum of the level width of the middle level, the preset interval on the tail level and the maximum width of the classification node on the tail level in the abscissa axis direction.
Alternatively, the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the abscissa axis direction; and/or the hierarchy width of the middle hierarchy is equal to the sum of the hierarchy width of the first hierarchy, the preset interval on the middle hierarchy and the maximum width of the classification node on the middle hierarchy in the direction of the abscissa axis, wherein the maximum width of the classification node on the middle hierarchy in the direction of the abscissa axis is zero; and/or the hierarchy width of the last hierarchy is equal to the sum of the hierarchy width of the middle hierarchy, the preset interval on the last hierarchy and the maximum width of the classification node on the last hierarchy in the direction of the abscissa axis.
In a specific example, for example, the width of the classification node in the dimension set hierarchy is 0, the maximum width of the classification node in the dimension hierarchy is the maximum value of the content width of each classification node in the dimension hierarchy, and the maximum width of the classification node in the target object or company hierarchy is the maximum value of the content width of each classification node in the target object or company hierarchy. Defining a total width of L' =0; and circularly traversing the initial layout data of the map, and modifying the x-axis data of each classification node, namely the data in the abscissa axis direction. The starting point of the classification node at the first level is L, and the total width W1= L + the maximum width of the company node level at this level. The classification node starts at the second level with M and the total width W2= M + L1+0 (the width of the dimension set node level is 0). The starting point of the classification node at the third level is N, and the total width W3= N + L2+ the maximum width of the level of the node at the current level. The starting point of the classification node at the fourth level is O, and the total width W4= O + L3+ the maximum width of the company node level at this level. The classification node starts at the fifth level with P and the total width W5= P + L1+0 (the width of the dimension set node level is 0). The starting point of the classification node at the sixth level is Q, and the total width W6= Q + L2+ the maximum width of the level of the dimension node at this level. The classification node starts at the seventh level with R, and the total width W7= R + L3+ the maximum width of the level of the company node of this level. The classification nodes in the subsequent loop level are analogized, and are not described in detail herein.
And step 205, sequentially arranging the classification nodes on different levels according to the initial coordinates and the level width of each level, and generating a target map.
In order to accurately control the width of the generated target map according to the needs of the user, so that the target map is more reasonably arranged, laid out and displayed on the page to be displayed, before step 205, the method of the embodiment of the present invention further includes: the hierarchy interval width in the abscissa axis direction between different hierarchies is set to zero. By the arrangement mode, not only can the calculation process of the hierarchy width of each hierarchy be simplified, but also the influence of the hierarchy interval width of different hierarchies in the direction of the abscissa axis on the width of the generated target map can be avoided, so that the aim of accurately controlling the width of the generated target map is fulfilled.
In one embodiment, the target atlas further comprises a plurality of target sub-atlases; wherein, the arrangement layout of the target sub-map is the same as that of the target map. As above, the data structure graph includes a cyclic representation tree structure of target object- > dimension set- > concrete dimension- > target object. Therefore, after the atlas relationship of the specific dimension- > target object is generated, a circular display tree structure of the dimension set- > specific dimension- > target object for the next circular turn of the target object selected or specified by the user can be provided or presented according to the target object selected or specified by the user. Therefore, the arrangement layout of the target sub-map is the same as that of the target map. In addition, the classification node on the last level in the target map has an association relation with the classification node on the first level in any target sub-map and is connected according to a preset map interval.
The display effect of the invention is shown in fig. 4, and the occupation of each classification node in each hierarchy is realized based on d3Js, and the technical effects that the widths of the classification nodes on different hierarchies are different are realized. By calculation, the x-axis position at which the respective classification node at each level should actually be located can be obtained. Further, the initial layout data of the map is updated, and the map data, such as an enterprise relationship graph, is displayed by drawing connecting lines between the classification nodes based on the updated layout data.
In one embodiment, the vertical coordinate of each classification node in the hierarchy is determined based on the presentation area of the hierarchy and the number of classification nodes of the hierarchy. The presentation area of the hierarchy is determined based on the abscissa of the start position of the hierarchy, the classification node width of the hierarchy, and the length that a line of the presentation page can be presented. Wherein the presentation page is a page for presenting the map. And if the current level is the line feed level, the initial position of the classification node of the current level is obtained in an initialization mode. The abscissa of the ending position of the classification node of the current level is the sum of the abscissa of the starting position of the classification node of the current level and the maximum width of the classification node of the current level.
According to the map layout method provided by the invention, the layout of the whole map is obtained through calculation, and the positions of each node and connecting line in the map are obtained. The method comprises the steps of drawing nodes and connecting lines of the graph in a browser or a webpage, and customizing the width of each level node in the graph, so that the dynamic adjustment or setting of the node width of different levels can be realized. Therefore, according to the technical scheme, the width of the node can be determined according to the content in the node, so that a more reasonable map of the width of the node of each level is obtained, the display effect is enhanced, and the user experience is improved.
Exemplary devices
Fig. 5 is a schematic structural diagram of a map layout apparatus according to an exemplary embodiment of the present invention. As shown in fig. 5, the map layout apparatus includes: a data structure map generation module 501, a classification module 502, an acquisition module 503, a calculation module 504, a generation module 505, and a setting module 506:
the data structure map generating module 501 is configured to obtain map data, and generate a data structure map according to the map data by using a preset processing method.
The classification module 502 is configured to traverse nodes in the data structure graph, and classify the nodes according to different levels of the nodes in the data structure graph to obtain classification nodes on different levels.
The obtaining module 503 is configured to obtain a start coordinate of a classification node on a first level in the data structure graph in the abscissa axis direction and a maximum width of a classification node on a different level in the abscissa axis direction.
A calculating module 504, configured to calculate, based on the start coordinate, the maximum width of the classification nodes on different levels in the abscissa axis direction, and preset intervals on different levels, a level width of each level in the data structure graph, respectively. Wherein the data structure map comprises three levels.
The calculation module 504 further includes:
the first calculation submodule is used for calculating the level width of the first level according to the maximum width of the classification nodes on the initial coordinate and the first level in the direction of the abscissa axis;
the second calculation submodule is used for calculating the hierarchy width of the middle hierarchy according to the hierarchy width of the first hierarchy, the preset interval on the middle hierarchy and the maximum width of the classification node on the middle hierarchy in the abscissa axis direction;
and the third calculation submodule is used for calculating the hierarchy width of the tail hierarchy according to the hierarchy width of the middle hierarchy, the preset interval on the tail hierarchy and the maximum width of the classification nodes on the tail hierarchy in the abscissa axis direction.
Optionally, the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the direction of the abscissa axis; and/or the hierarchy width of the middle hierarchy is equal to the sum of the hierarchy width of the first hierarchy, the preset interval on the middle hierarchy and the maximum width of the classification node on the middle hierarchy in the direction of the abscissa axis; and/or the hierarchy width of the last hierarchy is equal to the sum of the hierarchy width of the middle hierarchy, the preset interval on the last hierarchy and the maximum width of the classification node on the last hierarchy in the direction of the abscissa axis.
Optionally, the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the direction of the abscissa axis; and/or the hierarchy width of the middle hierarchy is equal to the sum of the hierarchy width of the first hierarchy, the preset interval on the middle hierarchy and the maximum width of the classification node on the middle hierarchy in the direction of the abscissa axis, wherein the maximum width of the classification node on the middle hierarchy in the direction of the abscissa axis is zero; and/or the hierarchy width of the last hierarchy is equal to the sum of the hierarchy width of the middle hierarchy, the preset interval on the last hierarchy and the maximum width of the classification node on the last hierarchy in the direction of the abscissa axis.
And a generating module 505, configured to sequentially arrange the classification nodes on different levels according to the initial coordinate and the level width of each level, so as to generate a target graph.
A setting module 506 for setting a width of a level interval between different levels in the abscissa axis direction to zero. The setting module 506 is further configured to set a maximum width of the classification node located on the middle hierarchy level in the abscissa axis direction to zero.
In one embodiment, the target atlas further comprises a plurality of target sub-atlases; wherein, the arrangement layout of the target sub-map is the same as that of the target map.
In one embodiment, the classification nodes on the last level in the target graph have an association relationship with the classification nodes on the first level in any target sub-graph and are connected according to a preset graph interval.
The map layout device obtains the layout of the whole map through calculation, and obtains the position of each node and connecting line in the map. The method comprises the steps of drawing nodes and connecting lines of the graph in a browser or a webpage, and customizing the width of each level node in the graph, so that the dynamic adjustment or setting of the node width of different levels can be realized. Therefore, according to the technical scheme, the width of the node can be determined according to the content in the node, so that a more reasonable map of the node width of each level is obtained, the display effect is enhanced, and the user experience is improved.
The map layout method provided by the embodiment of the present invention corresponds to the map layout device provided by the embodiment of the present invention, and other descriptions can refer to the description of the map layout method provided by the embodiment of the present invention, and are not described herein again.
Exemplary electronic device
Fig. 6 is a structure of an electronic device according to an exemplary embodiment of the present invention. The electronic device may be either or both of the first device and the second device, or a stand-alone device separate from them, which stand-alone device may communicate with the first device and the second device to receive the acquired input signals therefrom. As shown in fig. 6, the electronic device 60 includes one or more processors 61 and a memory 62.
The processor 61 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
Memory 62 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by processor 61 to implement the graph layout methods of the various embodiments of the invention described above and/or other desired functions. In one example, the electronic device may further include: an input device 63 and an output device 64, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device 63 may also include, for example, a keyboard, a mouse, and the like.
The output device 64 can output various information to the outside. The output devices 64 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device that are relevant to the present invention are shown in fig. 6, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device may include any other suitable components, depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present invention may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the atlas layout method according to various embodiments of the invention described in the "exemplary methods" section above of this specification.
The computer program product may write program code for carrying out operations for embodiments of the present invention in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present invention may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the atlas layout method according to various embodiments of the present invention described in the "exemplary methods" section above of this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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.
The basic principles of the present invention have been described above with reference to specific embodiments, but it should be noted that the advantages, effects, etc. mentioned in the present invention are only examples and are not limiting, and the advantages, effects, etc. must not be considered to be possessed by various embodiments of the present invention. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the invention is not limited to the specific details described above.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The block diagrams of devices, apparatuses, systems involved in the present invention are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The method and apparatus of the present invention may be implemented in a number of ways. For example, the methods and apparatus of the present invention may be implemented in software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustrative purposes only, and the steps of the method of the present invention are not limited to the order specifically described above unless specifically indicated otherwise. Furthermore, in some embodiments, the present invention may also be embodied as a program recorded in a recording medium, the program including machine-readable instructions for implementing a method according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
It should also be noted that in the apparatus, devices and methods of the present invention, the components or steps may be broken down and/or re-combined. These decompositions and/or recombinations are to be regarded as equivalents of the present invention. The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the invention. Thus, the present invention is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, the description is not intended to limit embodiments of the invention to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A method of atlas layout, the method comprising:
acquiring map data, and generating a data structure map by a preset processing method according to the map data;
traversing nodes in the data structure graph, and classifying the nodes according to different levels of the nodes in the data structure graph to obtain classified nodes on different levels;
acquiring the initial coordinate of a classification node on the first level in the data structure map in the abscissa axis direction and the maximum width of the classification node on different levels in the abscissa axis direction;
respectively calculating the level width of each level in the data structure map based on the initial coordinate, the maximum width of the classification nodes on different levels in the abscissa axis direction and preset intervals on different levels;
and sequentially arranging the classification nodes on different levels according to the initial coordinate and the level width of each level to generate a target map.
2. The method according to claim 1, wherein before the classification nodes on different levels are arranged in sequence according to the starting coordinate and the level width of each level, and a target graph is generated, the method further comprises:
the hierarchy interval width in the abscissa axis direction between different hierarchies is set to zero.
3. The method of claim 1, wherein after obtaining a starting coordinate of a classification node at a first level in the data structure graph in an abscissa axis direction and a maximum width of a classification node at a different level in the abscissa axis direction, the method further comprises:
the maximum width of the classification node located on the middle hierarchy in the abscissa axis direction is set to zero.
4. The method according to claim 1, wherein if the data structure graph includes three levels, the calculating the level width of each level in the data structure graph based on the starting coordinate, the maximum width of the classification nodes on the different levels in the abscissa axis direction, and the preset interval on the different levels respectively comprises:
calculating the level width of the first level according to the initial coordinate and the maximum width of the classification node on the first level in the abscissa axis direction;
calculating the hierarchy width of the middle hierarchy according to the hierarchy width of the first hierarchy, preset intervals on the middle hierarchy and the maximum width of the classification nodes on the middle hierarchy in the abscissa axis direction;
and calculating the hierarchy width of the tail hierarchy according to the hierarchy width of the middle hierarchy, a preset interval on the tail hierarchy and the maximum width of the classification nodes on the tail hierarchy in the direction of the abscissa axis.
5. The method according to claim 4, wherein the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the direction of the abscissa axis;
and/or the level width of the middle level is equal to the sum of the level width of the first level, a preset interval on the middle level and the maximum width of the classification node on the middle level in the abscissa axis direction;
and/or the level width of the last level is equal to the sum of the level width of the middle level, a preset interval on the last level and the maximum width of the classification node on the last level in the direction of the abscissa axis.
6. The method according to claim 4, wherein the level width of the first level is equal to the sum of the start coordinate and the maximum width of the classification node on the first level in the abscissa axis direction;
and/or the level width of the middle level is equal to the sum of the level width of the first level, a preset interval on the middle level and the maximum width of the classification node on the middle level in the abscissa axis direction, wherein the maximum width of the classification node on the middle level in the abscissa axis direction is zero;
and/or the level width of the last level is equal to the sum of the level width of the middle level, a preset interval on the last level and the maximum width of the classification node on the last level in the direction of the abscissa axis.
7. The method of claim 1, wherein the target atlas further comprises a plurality of target sub-atlases; wherein the arrangement layout of the target sub-map and the target map is the same;
and the classification nodes on the tail level in the target map and the classification nodes on the first level in any target sub-map have an incidence relation and are connected at intervals according to a preset map.
8. An atlas layout apparatus, the apparatus comprising:
the data structure map generation module is used for acquiring map data and generating a data structure map by a preset processing method according to the map data;
the classification module is used for traversing nodes in the data structure graph, classifying the nodes according to different levels of the nodes in the data structure graph to obtain classification nodes on different levels;
the acquisition module is used for acquiring the initial coordinate of the classification node on the first level in the data structure map in the abscissa axis direction and the maximum width of the classification node on different levels in the abscissa axis direction;
a calculation module, configured to calculate, based on the start coordinate, a maximum width of the classification nodes on the different levels in the abscissa axis direction, and preset intervals on the different levels, a level width of each level in the data structure graph;
and the generation module is used for sequentially arranging and laying the classification nodes on different levels according to the initial coordinate and the level width of each level to generate a target map.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for performing the method of any of claims 1-7.
10. An electronic device, characterized in that the electronic device comprises: a processor and a memory; wherein, the first and the second end of the pipe are connected with each other,
the memory to store the processor-executable instructions;
the processor to read the executable instructions from the memory and execute the instructions to implement the method of any of claims 1-7.
CN202210775139.8A 2022-07-01 2022-07-01 Map layout method and device, storage medium and electronic equipment Pending CN115238133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210775139.8A CN115238133A (en) 2022-07-01 2022-07-01 Map layout method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210775139.8A CN115238133A (en) 2022-07-01 2022-07-01 Map layout method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115238133A true CN115238133A (en) 2022-10-25

Family

ID=83670596

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210775139.8A Pending CN115238133A (en) 2022-07-01 2022-07-01 Map layout method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115238133A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106557323A (en) * 2016-11-09 2017-04-05 北京锐安科技有限公司 A kind of network visual layout method and device
CN107357846A (en) * 2017-06-26 2017-11-17 北京金堤科技有限公司 The methods of exhibiting and device of relation map
US20170371925A1 (en) * 2016-06-23 2017-12-28 Linkedin Corporation Query data structure representation
CN113822963A (en) * 2021-09-22 2021-12-21 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for drawing and displaying topological graph
CN113850884A (en) * 2021-08-18 2021-12-28 北京达佳互联信息技术有限公司 Method and device for generating mulberry basic diagram, electronic equipment and storage medium
CN114265941A (en) * 2021-12-20 2022-04-01 百融至信(北京)征信有限公司 Method and system for converting relationship graph into tree-like form blood relationship graph

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170371925A1 (en) * 2016-06-23 2017-12-28 Linkedin Corporation Query data structure representation
CN106557323A (en) * 2016-11-09 2017-04-05 北京锐安科技有限公司 A kind of network visual layout method and device
CN107357846A (en) * 2017-06-26 2017-11-17 北京金堤科技有限公司 The methods of exhibiting and device of relation map
CN113850884A (en) * 2021-08-18 2021-12-28 北京达佳互联信息技术有限公司 Method and device for generating mulberry basic diagram, electronic equipment and storage medium
CN113822963A (en) * 2021-09-22 2021-12-21 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for drawing and displaying topological graph
CN114265941A (en) * 2021-12-20 2022-04-01 百融至信(北京)征信有限公司 Method and system for converting relationship graph into tree-like form blood relationship graph

Similar Documents

Publication Publication Date Title
CN109634598B (en) Page display method, device, equipment and storage medium
Buels et al. JBrowse: a dynamic web platform for genome visualization and analysis
US10990644B2 (en) Systems and methods for contextual vocabularies and customer segmentation
US10318595B2 (en) Analytics based on pipes programming model
KR101311055B1 (en) Named object view of electronic data report
JP2006048647A (en) Method, system and device of providing access to workbook model by remote function call
WO2014179819A2 (en) Software design pattern for adapting a graph database visualization software
JP2003517685A (en) System and method for efficiently laying out a display table
US20150007084A1 (en) Chaining applications
CN110689600A (en) Rendering method and device of tree component, readable storage medium and electronic equipment
US9076180B2 (en) Customized product display
US11868682B1 (en) Smart takeoff estimation systems and methods
CN110837366A (en) Form generation method, electronic device and computer readable storage medium
US10157172B2 (en) Property dependency visualization
US8234586B2 (en) User interface framework and techniques
US11120171B2 (en) System and method for construction cost estimation for non-computer aided design (CAD) files
JP2022551249A (en) IMAGE PROCESSING METHOD, IMAGE PROCESSING COMMAND GENERATION METHOD AND APPARATUS
CN112395257A (en) Lightweight CAD (computer-aided design) model service method and system
CN115238133A (en) Map layout method and device, storage medium and electronic equipment
US9690753B1 (en) Caching of a site model in a hierarchical modeling system for network sites
CN116594683A (en) Code annotation information generation method, device, equipment and storage medium
JP2020129359A (en) Method, apparatus, facility, and medium for managing knowledge base
CN110895590A (en) Candidate object acquisition method and device, electronic equipment and storage medium
US10769054B1 (en) Integrated program code marketplace and service provider network
CN111475156B (en) Page code generation method and device, electronic equipment and storage medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230801

Address after: Room 404-405, 504, Building B-17-1, Big data Industrial Park, Kecheng Street, Yannan High tech Zone, Yancheng, Jiangsu Province, 224000

Applicant after: Yancheng Tianyanchawei Technology Co.,Ltd.

Address before: 224000 room 501-503, building b-17-1, Xuehai road big data Industrial Park, Kecheng street, Yannan high tech Zone, Yancheng City, Jiangsu Province

Applicant before: Yancheng Jindi Technology Co.,Ltd.