CN107391465A - A kind of method and device that dendrogram bottom element is positioned in the form of element group - Google Patents

A kind of method and device that dendrogram bottom element is positioned in the form of element group Download PDF

Info

Publication number
CN107391465A
CN107391465A CN201710617625.6A CN201710617625A CN107391465A CN 107391465 A CN107391465 A CN 107391465A CN 201710617625 A CN201710617625 A CN 201710617625A CN 107391465 A CN107391465 A CN 107391465A
Authority
CN
China
Prior art keywords
element group
elements
group
dendrogram
trip
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
CN201710617625.6A
Other languages
Chinese (zh)
Other versions
CN107391465B (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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710617625.6A priority Critical patent/CN107391465B/en
Publication of CN107391465A publication Critical patent/CN107391465A/en
Application granted granted Critical
Publication of CN107391465B publication Critical patent/CN107391465B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents

Abstract

The invention discloses a kind of method and device that dendrogram bottom element is positioned in the form of element group, this method includes:Bottom element is obtained in the element included from dendrogram, father's element identical bottom element is divided into an element group;For either element group, if element group interior element total quantity is less than or equal to default often row greatest member quantity, first trip number of elements in element group is set to be equal to element group interior element total quantity;Otherwise, first trip number of elements in element group is set to be equal to default often row greatest member quantity;Bottom element in each element group is carried out by branch according to first trip number of elements in each element group and default principle;Wherein, the default principle is equal to or less than the principle of first trip number of elements for other row element quantity in each element group.Above-mentioned technical proposal disclosed by the invention, bottom element is put on display in the form of element group so that dendrogram is integrally compact, coordinates and attractive in appearance.

Description

A kind of method and device that dendrogram bottom element is positioned in the form of element group
Technical field
The present invention relates to Website development technical field, and dendrogram is positioned in the form of element group more specifically to one kind The method and device of bottom element.
Background technology
Popularization and people couple with HTML5 (Hyper Text Markup Language, HTML) The continuous improvement of website experience requirement, figure ratio more and more higher shared in Website development work.Wherein, dendrogram is exactly One kind in common figure.
Dendrogram is the figure being made up of the line of relation between element and expression element.Wherein, element is tree-shaped Represented in figure be entity figure and word, such as network in interchanger, main frame etc., department, member in organization chart Work etc., what the line drawing between element in dendrogram was stated is the line of inter-entity relation.Whether the element positioning of dendrogram is reasonable Largely determine dendrogram integral layout it is whether compact and coordinate it is attractive in appearance.But the difficult point of element positioning exists It is unpredictable in the element number of each level in dendrogram, and the bottom element of dendrogram is i.e. in whole tree The quantity of the element of last layer of shape structure is often larger so that the width of the painting canvas where dendrogram becomes big so that overall cloth Office is not to coordinate very much.
In the prior art, the method for realizing dendrogram is:Carried out between the element of dendrogram also real while line The element positioning of simple logic is showed.But when the quantity of bottom element is more, they can be in one line, and then interface is drawn It is very long so that integral layout is not particularly compact, influences overall harmony and aesthetic property.
In summary, a kind of technical scheme for positioning bottom element position in dendrogram how is provided so that overall Layout comparison is compact, coordinates, be attractive in appearance, is current those skilled in the art's urgent problem to be solved.
The content of the invention
In view of this, it is an object of the invention to provide it is a kind of by element group in the form of position dendrogram bottom element method and Device so that dendrogram integral layout is compact, coordinates, be attractive in appearance.
To achieve these goals, the present invention provides following technical scheme:
A kind of method that dendrogram bottom element is positioned in the form of element group, including:
Bottom element is obtained in the element included from dendrogram, father's element identical bottom element is divided into a member Element group;
For either element group, if element group interior element total quantity is less than or equal to default often row greatest member quantity, First trip number of elements in element group is then set to be equal to element group interior element total quantity;Otherwise, first trip member in element group is set Prime number amount is equal to default often row greatest member quantity;
According to first trip number of elements in each element group and default principle by the bottom in each element group Element carries out branch;Wherein, the default principle is equal to or less than first trip for other row element quantity in each element group The principle of number of elements.
Preferably, each first trip number of elements and default principle will each elements in the element group for the basis Bottom element in group carries out branch, including:
According to element group putting in order from left to right, first bottom element in each element group is calculated successively and is existed Specify the coordinate value on painting canvas;
According in each element group in addition to first bottom element row of other bottom elements in the element is rolled into a ball First trip number of elements in row order, the default principle and element group, it is determined that the line number residing for other described bottom elements And columns, and according to residing for the coordinate value of first bottom element in each element group, other described bottom elements Spacing in line number and columns, the element set in advance group between bottom element, calculate in each element group except the The coordinate value of other bottom elements on the specified painting canvas outside one bottom element;
Each bottom element in each element group is placed into the position of respective coordinates value on the specified painting canvas, it is real Now to the branch of each element group.
Preferably, will be each in the element group according to first trip number of elements in each element group and default principle Bottom element carry out branch, including:
According to first trip number of elements in each element group and default principle by the bottom in each element group Element is carried out in lines, is somebody's turn to do wherein the default principle is less than or equal to for the number of elements of last column in each element group First trip number of elements in element group, the number of elements of other rows are equal to the principle of first trip number of elements in element group.
Preferably, after the realization is to the branch of each element group, in addition to:
Calculate from bottom to top in the dendrogram except element roll into a ball in addition to coordinate value of the other elements on the specified painting canvas, And the other elements in addition to element is rolled into a ball are put on the specified painting canvas in the dendrogram according to the coordinate value.
Preferably, it is described that it is put on the specified painting canvas in the dendrogram in addition to element is rolled into a ball according to the coordinate value After his element, in addition to:
According in the putting position of first trip element in each element group and the dendrogram in addition to element is rolled into a ball its The putting position of his element, in each element group in first trip element and the dendrogram in addition to element is rolled into a ball other elements Between carry out line.
A kind of device that dendrogram bottom element is positioned in the form of element group, including:
Acquisition module, it is used for:Bottom element is obtained in the element included from dendrogram, by father's element identical bottom member Element is divided into an element group;
Setup module, it is used for:For either element group, often gone if element group interior element total quantity is less than or equal to preset Greatest member quantity, then first trip number of elements in element group is set to be equal to element group interior element total quantity;Otherwise, this yuan is set First trip number of elements is equal to default often row greatest member quantity in element group;
Branch's module, is used for:According to first trip number of elements and default principle in each element group will be each Bottom element in element group carries out branch;Wherein, the default principle is other row element quantity in each element group Equal to or less than the principle of first trip number of elements.
Preferably, branch's module includes:
First branch's unit, is used for:According to element group putting in order from left to right, each element group is calculated successively Coordinate value of the interior first bottom element on painting canvas is specified;According in each element group in addition to first bottom element Other bottom elements first trip number of elements in the ordering during the element is rolled into a ball, the default principle and element group, really Line number and columns residing for other fixed described bottom elements, and according to the seat of first bottom element in each element group Line number and columns residing for scale value, other described bottom elements, in the element set in advance group between bottom element between Away from other bottom elements described in addition to first bottom element are on the specified painting canvas in each element group of calculating Coordinate value;Each bottom element in each element group is placed into the position of respective coordinates value on the specified painting canvas, it is real Now to the branch of each element group.
Preferably, branch's module includes:
Second branch's unit, is used for:Will be each according to first trip number of elements in each element group and default principle Bottom element in the element group carries out branch, wherein member of the default principle for last column in each element group Prime number amount is less than or equal to first trip number of elements in element group, and the number of elements of other rows is equal to first trip element in element group The principle of quantity.
Preferably, in addition to:
Computing module, it is used for:After realizing the branch to each element group, calculate from bottom to top in the dendrogram Coordinate value of the other elements on the specified painting canvas in addition to element is rolled into a ball, and put according to the coordinate value on the specified painting canvas Put in the dendrogram except element roll into a ball in addition to other elements.
Preferably, in addition to:
Link module, it is used for:According in the dendrogram except element roll into a ball in addition to other elements on the specified painting canvas Coordinate value is put in the dendrogram on the specified painting canvas in addition to element is rolled into a ball after other bottom elements, according to each institute State element group in first trip element putting position and the dendrogram in except element roll into a ball in addition to other elements putting position, In each element group line is carried out in first trip element and the dendrogram between other elements in addition to element is rolled into a ball.
The invention provides a kind of method and device that dendrogram bottom element is positioned in the form of element group, wherein this method Including:Bottom element is obtained in the element included from dendrogram, father's element identical bottom element is divided into an element Group;For either element group, if element group interior element total quantity is less than or equal to default often row greatest member quantity, set First trip number of elements is equal to element group interior element total quantity in element group;Otherwise, first trip number of elements in element group is set Equal to default often row greatest member quantity;According to first trip number of elements in each element group and default principle by each institute The bottom element stated in element group carries out branch;Wherein, the default principle is other row element numbers in each element group Principle of the amount equal to or less than first trip number of elements.Above-mentioned technical proposal disclosed in the present application, by father's element identical bottom member Element is divided into an element group, and according to the pass between default often row greatest member quantity and each element group interior element total quantity System, it is determined that first trip number of elements in each element group, then according to first trip number of elements and default principle in each element group It is by the bottom element progress branch in each element group, rather than as prior art that bottom element is in one line, so Can shortens the width occupied by dendrogram bottom element, and then shortens the width at interface so that dendrogram integral layout ratio It is compacter, coordinate and it is attractive in appearance.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of flow of method that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention Figure;
Fig. 2 is a kind of structure of device that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention Schematic diagram;
Fig. 3 is to utilize the dendrogram schematic diagram obtained by technical scheme provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made Embodiment, belong to the scope of protection of the invention.
Fig. 1 is refer to, Fig. 1 shows a kind of positioning dendrogram bottom in the form of element group that the embodiment of the present invention is provided The flow chart of the method for element, it can include:
S11:Bottom element is obtained in the element included from dendrogram, father's element identical bottom element is divided into one Individual element group.
It should be noted that the embodiment of the present invention can use primary JavaScript or jQuery to carry out counterlogic Processing, to realize technical scheme provided by the invention.And in embodiments of the present invention, the executive agent of above-mentioned technical proposal can By a kind of device that dendrogram bottom element is positioned in the form of element group provided by the corresponding embodiment of the present invention, the device First have to obtain all elements that dendrogram includes, and bottom element is obtained in these elements included from dendrogram, simultaneously Bottom element is grouped according to father's element, father's element identical bottom element is divided into one group, forms an element group.
S12:For either element group, if element group interior element total quantity is less than or equal to default often row greastest element prime number Amount, then first trip number of elements in element group is set to be equal to element group interior element total quantity;Otherwise, first trip in element group is set Number of elements is equal to default often row greatest member quantity.
Each element is rolled into a ball into interior element total quantity and previously according to the default often row greatest member quantity for being actually needed determination It is compared to determine first trip number of elements in each element group, wherein, if element group interior element total quantity is less than or equal in advance If often row greatest member quantity, just set first trip number of elements in element group to be equal to element group interior element total quantity, then should The interior just only a line bottom element, and the number of elements of the row is equal to element group interior element total quantity of element group;If element group Interior element total quantity is more than default often row greatest member quantity, then sets first trip number of elements in element group often to be gone equal to default Greatest member quantity, and take the bottom element for being wherein equal to first trip number of elements in element group to be placed on the first row, it is remaining Bottom element carries out branch again, can thus reach the purpose for shortening each element group width.
S13:According to first trip number of elements and default principle in each element group by each element roll into a ball in bottom element Carry out branch;Wherein, it is the original that other row element quantity are equal to or less than first trip number of elements in each element group to preset principle Then.
First trip number of elements and previously according to being actually needed the pre- of setting in each element group determined according to above-mentioned If principle can by each element roll into a ball in bottom element carry out branch, wherein, default principle can be each element group in its His row element quantity is equal to or less than the principle of first trip number of elements in each element group, and the bottom in each element group is first After element carries out branch, the width of each element group can be shortened, so that the narrowed width of whole dendrogram.
In technical scheme disclosed in the present application, father's element identical bottom element in dendrogram is divided into an element Group, and the magnitude relationship between interior element total quantity and default often row greatest member quantity is rolled into a ball according to each element, it is determined that each First trip number of elements in element group, and divided bottom element in each element group according to first trip number of elements and default principle OK, it is rather than the progress of bottom element is in one line, can be significantly after bottom element in each element group is carried out into branch Reduce the width occupied by dendrogram bottom element, be unlikely to make the very long of interface drawing, so that dendrogram integral layout ratio It is compacter, coordinate and it is attractive in appearance.
A kind of method that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention, according to each member The bottom element in each element group is carried out branch by first trip number of elements and default principle in element group, can be included:
According to element group putting in order from left to right, first bottom element in each element group is calculated successively and is being specified Coordinate value on painting canvas;
According to arrangement time of other bottom elements in element group in addition to first bottom element in each element group First trip number of elements in sequence, default principle and element group, determines the line number and columns residing for other bottom elements, and according to According to the line number residing for the coordinate value of first bottom element in each element group, other bottom elements and columns, preset Element group in spacing between bottom element, calculate in each element group other bottoms member in addition to first bottom element Coordinate value of the element on painting canvas is specified;
Each bottom element in each element group is placed into the position of respective coordinates value on specified painting canvas, realized to each The branch of element group.
The element exhibition method of dendrogram is upper lower leaf in embodiments of the present invention, i.e., dendrogram be along genesis analysis, Top-level elements are upper, and bottom element is under.Certainly, point that the distribution of dendrogram can also be according to actual conditions for other directions Cloth, and the coordinate value of described element is defined as:Abscissa is the distance between element left side and specified painting canvas left side, indulges and sits It is designated as the distance between element top and specified painting canvas top.In embodiments of the present invention, with top-level elements in upper, bottom element Illustrated lower for situation.Therefore, the element group in the embodiment of the present invention is distributed according to horizontal.Can be according to member Element group putting in order from left to right, coordinate of first bottom element on painting canvas is specified in each element group is calculated successively Value, circular can be:Abscissa=specifying the spacing of painting canvas with Far Left element group in the horizontal+is located at and calculated The element group left side element group width sum+positioned at the calculated element group left side element group number × two it is adjacent Spacing between element group in the horizontal, ordinate=specify the spacing+(tree of painting canvas with top-level elements in dendrogram in the vertical The total number of plies -1 of element in shape figure) × (interlamellar spacing between element height+adjacent element in the vertical), wherein, the width of element group It is adjacent in first trip number of elements × element width+(first trip number of elements -1 in element group) × element group in=element group Horizontal spacing between element, the number of plies that the element that the total number of plies of element is included by dendrogram in dendrogram is separated.Calculate In each element group after the coordinate value of first bottom element, can be rolled into a ball according to each element in remove first bottom element it Other row element quantity are equal to or small in ordering of other the outer bottom elements in element group, default each element group In first trip number of elements in the principle of first trip number of elements and element group determine line number residing for other bottom elements and Columns, for example, first trip number of elements is 3 in element group, the element rolls into a ball the 2nd row and the 3rd row maximum places two elements, then The bottom element that ordering is 7 is in the 3rd row, the 2nd row.Then can be according in the above-mentioned each element group calculated first Line number and columns residing for the coordinate value of individual bottom element, other bottom elements determined, the element group set in advance Spacing between interior bottom element, calculate interior other bottom elements in addition to first bottom element of each element group and specifying Coordinate value on painting canvas, calculating process can be:First bottom element in the abscissa of a certain bottom element=element group Abscissa+(columns -1 residing for the bottom element) × (adjacent bottom in left and right in the element width+element set in advance group Horizontal spacing between layer element), the ordinate of first bottom element in the ordinate of the bottom element=element group+ (line number -1 residing for the bottom element) × (in the element height+element set in advance group neighbouring bottom element it Between longitudinal pitch), can be according to each bottom member after the coordinate value of each bottom element in each element group is calculated The coordinate value of element is put position on specified painting canvas corresponding to coordinate value, after putting completion, it is possible to realize to every The branch of individual element group.The branch to each element group is realized by means of which, can be greatly shortened occupied by bottom element Width, reduce specify painting canvas width.
A kind of method that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention, according to each member The bottom element in each element group is carried out branch by first trip number of elements and default principle in element group, can be included:
The bottom element in each element group is carried out according to first trip number of elements in each element group and default principle In lines, wherein the number of elements that default principle is last column in each element group is less than or equal to first trip element in element group Quantity, the number of elements of other rows are equal to the principle of first trip number of elements in element group.
It is above-mentioned to each element group in bottom element carry out branch be according to each element group in first trip number of elements and Default principle is realized.Wherein, default principle can be that the number of elements of last column in each element group is less than or equal to First trip number of elements in element group, the number of elements of other rows are equal to the principle of first trip number of elements in element group, namely Often the quantity of row bottom element is equal in each element group, and equal to the quantity of first trip element in element group, if gone out The now situation of inadequate a line, then last several bottom elements of inadequate a line are placed on last column, principle are preset according to this, Calculating the detailed process of the line number residing for other bottom elements and columns can be:Line number residing for a certain bottom element= Math.floor (bottom element first trip number of elements in ordering/element group in element group)+1, the bottom Columns=bottom element residing for element first trip number of elements in ordering % elements group in element group, its In, what Math.floor was represented is to return to the maximum integer less than parameter, and what % was represented is to take the remainder, and is calculated except in element group Outside first bottom element after the line number of other bottom elements and columns, the calculating side of corresponding bottom element coordinate value Formula is identical with the mode of above-mentioned calculating bottom element coordinate value, and the row of each element group can be determined according to this principle Number is:(element rolls into a ball first trip element in interior element total quantity/element group to a certain element group interior element line number=Math.ceil Quantity), what wherein Math.ceil was represented is to return to the smallest positive integral more than or equal to parameter, and can in each element group So that the bottom element after branch carries out proper alignment, namely, same row bottom member identical with the ordinate of a line bottom element The abscissa of element is identical.Certainly, bottom element can also have the arrangement mode of other forms, these rows in residing element group Row mode is within protection scope of the present invention.Branch is carried out to bottom element in each element group by means of which, can To cause element group is overall to look that comparison is neat, attractive in appearance.
A kind of method that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention, is realized to each After the branch of element group, it can also include:
Coordinate value of the other elements on painting canvas is specified in addition to element is rolled into a ball is calculated in dendrogram from bottom to top, and according to this Coordinate value puts in the dendrogram other elements in addition to element is rolled into a ball on painting canvas is specified.
After branch is carried out to each element group belonging to dendrogram bottom element, it is tree-shaped that this can be calculated from bottom to top The coordinate value of the corresponding father's element of each element group in figure, the coordinate value of the surplus element above father's element is then calculated, its The abscissa of middle father's element and surplus element is equal to the daughter element abscissa minimum value and daughter element abscissa maximum calculated Average value so that father's element and surplus element are in the horizontal positioned at the centre of corresponding daughter element, corresponding father's element and surplus The computational methods of the coordinate value of remaining element can be:For father's element, abscissa=father's element institute of a certain father's element Width/2 of width/2- elements of the abscissa of first bottom element+element group in corresponding element group, father's element The height of ordinate-father's element of first bottom element-father member in element group corresponding to ordinate=father's element The spacing of plain and corresponding element group in the vertical, for bottom element in being rolled into a ball except element and father's element in addition in dendrogram For surplus element, the abscissa of a certain surplus element=(daughter element abscissa minimum value corresponding to the surplus element+this is surplus Daughter element abscissa maximum corresponding to remaining element)/2, ordinate=daughter element corresponding to the surplus element of the surplus element The height of the ordinate-surplus element-surplus element and corresponding daughter element are in longitudinal interlamellar spacing.Certainly, father's member is calculated Element and surplus element coordinate value method can also be in advance using other algorithms calculate in the dendrogram remove bottom element it The coordinate value of outer other elements, these calculate the method for the other elements coordinate value in addition to element is rolled into a ball in the dendrogram in this hair It is bright protect within the scope of, when know except element roll into a ball in addition to other elements coordinate value after, it is possible to specify painting canvas on put Put these other elements.The mode of the other elements in addition to element is rolled into a ball is put by means of which, is advantageous to what is rolled into a ball according to element These elements are put in position, and dendrogram can be made integrally to see away and compare coordination and compact.
A kind of method that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention, according to dendrogram In in addition to element is rolled into a ball coordinate value of the other elements on painting canvas is specified put on painting canvas is specified in dendrogram except element rolls into a ball it After outer other elements, it can also include:
According in the putting position and dendrogram of first trip element in each element group in addition to element is rolled into a ball other elements Putting position, line is carried out between other elements in addition to element is rolled into a ball in first trip element and dendrogram in each element group.
When calculating in dendrogram coordinate value of the other elements on painting canvas is specified in addition to element is rolled into a ball, and according to coordinate value After this is specified and has put other elements on painting canvas, first trip element is rolled into a ball according to each element and specifies at this and puts position on painting canvas Put and the putting position of other elements and element roll into a ball the relation between element in addition to element is rolled into a ball, carry out each element group First trip element and line in addition to element is rolled into a ball between other elements are, it is necessary to which explanation, the embodiment of the present invention can use JsPlumb or other line instruments carry out the line between dendrogram element.When the element included to dendrogram is carried out After line is completed, dendrogram area occupied on painting canvas is specified can be calculated according to the data of dendrogram, so as to reasonable Arrange dendrogram region occupied on painting canvas is specified, make to specify arranged between painting canvas and dendrogram it is harmonious and attractive in appearance, it is tree-shaped Figure calculating process of occupied area on painting canvas is specified can be:Area=dendrogram that dendrogram occupies on painting canvas is specified The width of residing specified painting canvas × this specifies the height of painting canvas, wherein, the width of the specified painting canvas residing for dendrogram=this refers to Determine width sum+(element of each element groups of horizontal spacing × 2+ between painting canvas and Far Left or the element group of rightmost Group number -1) × left and right it is adjacent two elements group between horizontal spacing, specify painting canvas height=this specify painting canvas and Longitudinal pitch × 2+ (the total number of plies -1 of element in dendrogram) × (element height+adjacent element between the top or bottom element Between interlamellar spacing in the vertical)+all elements group height maximum, height=element group interior element line number of element group × Longitudinal direction in element height+(element group interior element line number -1) × element group set in advance between neighbouring bottom element Spacing, element group interior element line number is to roll into a ball the line number for carrying out being determined after branch to each element.So allow for dendrogram Become more complete, and the area of specified painting canvas that can be according to occupied by dendrogram come reasonable arrangement dendrogram in specified picture Location on cloth and rationally design the size for specifying painting canvas so that dendrogram it is overall closely with it is attractive in appearance.
The embodiment of the present invention additionally provides a kind of device that dendrogram bottom element is positioned in the form of element group, such as Fig. 2 institutes Show, can include:
Acquisition module 11, is used for:Bottom element is obtained in the element included from dendrogram, by father's element identical bottom Element is divided into an element group;
Setup module 12, is used for:For either element group, preset often if element group interior element total quantity is less than or equal to Row greatest member quantity, then first trip number of elements in element group is set to be equal to element group interior element total quantity;Otherwise, setting should First trip number of elements is equal to default often row greatest member quantity in element group;
Branch's module 13, is used for:According to first trip number of elements and default principle in each element group by each element group Interior bottom element carries out branch;Wherein, it is that other row element quantity are equal to or less than first trip in each element group to preset principle The principle of number of elements.
A kind of device that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention, branch's module can With including:
First branch's unit, is used for:According to element group putting in order from left to right, the is calculated in each element group successively Coordinate value of one bottom element on painting canvas is specified;According to each element group in addition to first bottom element other bottoms Element first trip number of elements in the ordering during the element is rolled into a ball, default principle and element group, determines other bottoms member Line number and columns residing for element, and according to the coordinate value of first bottom element, other bottom element institutes in each element group Spacing in the line number and columns at place, the element set in advance group between bottom element, calculate in each element group except the Coordinate value of other bottom elements on painting canvas is specified outside one bottom element;Each bottom element in each element group is put The position of respective coordinates value on specified painting canvas is put, realizes the branch to each element group.
A kind of device that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention, branch's module can With including:
Second branch's unit, is used for:According to first trip number of elements and default principle in each element group by each element Bottom element in group carries out branch, wherein the number of elements that default principle is last column in each element group is less than or equal to First trip number of elements in element group, the number of elements of other rows are equal to the principle of first trip number of elements in element group.
A kind of device that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention, can also be wrapped Include:
Computing module, it is used for:After realizing the branch to each element group, calculate in dendrogram remove element group from bottom to top Outside coordinate value of the other elements on painting canvas is specified, and put according to the coordinate value on painting canvas is specified and remove element in dendrogram Other elements outside group.
A kind of device that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention, can also be wrapped Include:
Link module, it is used for:According to coordinate value of the other elements on painting canvas is specified exists in addition to element is rolled into a ball in dendrogram Specify and put on painting canvas in dendrogram in addition to element is rolled into a ball after other bottom elements, according to first trip element in each element group In putting position and dendrogram except element roll into a ball in addition to other elements putting position, each element group in first trip element and tree In shape figure line is carried out in addition to element is rolled into a ball between other elements.
The technical scheme provided according to the embodiment of the present invention, the bottom element of dendrogram can be positioned and will be set The element that shape figure is included carries out reasonable placement.As a specific embodiment, technical solution of the present invention can be illustrated, Fig. 3 is a kind of dendrogram signal positioned in the form of element group obtained by dendrogram bottom element provided in an embodiment of the present invention Figure, wherein painting canvas are the specified painting canvas in the application, and the element included in element group is bottom element.If it can be seen that will Dendrogram bottom element is in one line, can greatly increase the width of dendrogram, the width of painting canvas is become big, interface is drawn very It is long.But according to technical scheme, dendrogram bottom element is put on display in the form of element group and to the bottom in element group Layer element carries out branch, can greatly shorten the width of dendrogram and painting canvas, and dendrogram integrally looks compact, association Reconcile attractive in appearance.
Relevant portion in a kind of device that dendrogram bottom element is positioned in the form of element group provided in an embodiment of the present invention Explanation refer to it is right in a kind of method that dendrogram bottom element is positioned in the form of element group that the embodiment of the present invention provided The detailed description of part is answered, will not be repeated here.In other above-mentioned technical proposal provided in an embodiment of the present invention with prior art The part of middle corresponding technical scheme realization principle is simultaneously unspecified, in order to avoid excessively repeat.
The foregoing description of the disclosed embodiments, those skilled in the art are enable to realize or using the present invention.To this A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and generic principles defined herein can Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited The embodiments shown herein is formed on, and is to fit to consistent with principles disclosed herein and features of novelty most wide Scope.

Claims (10)

  1. A kind of 1. method that dendrogram bottom element is positioned in the form of element group, it is characterised in that including:
    Bottom element is obtained in the element included from dendrogram, father's element identical bottom element is divided into an element Group;
    For either element group, if element group interior element total quantity is less than or equal to default often row greatest member quantity, set Put first trip number of elements in element group and be equal to element group interior element total quantity;Otherwise, first trip member prime number in element group is set Amount is equal to default often row greatest member quantity;
    According to first trip number of elements in each element group and default principle by the bottom element in each element group Carry out branch;Wherein, the default principle is equal to or less than first trip element for other row element quantity in each element group The principle of quantity.
  2. 2. according to the method for claim 1, it is characterised in that each first trip number of elements in element group of the basis And the bottom element in each element group is carried out branch by default principle, including:
    According to element group putting in order from left to right, first bottom element in each element group is calculated successively and is being specified Coordinate value on painting canvas;
    According to arrangement time of other bottom elements in element group in addition to first bottom element in each element group First trip number of elements in sequence, the default principle and element group, it is determined that line number residing for other described bottom elements and Columns, and the line number residing for according to the coordinate value of first bottom element in each element group, other described bottom elements And the spacing in columns, the element set in advance group between bottom element, calculate in each element group and remove first The coordinate value of other bottom elements on the specified painting canvas outside bottom element;
    Each bottom element in each element group is placed into the position of respective coordinates value on the specified painting canvas, realization pair The branch of each element group.
  3. 3. according to the method for claim 2, it is characterised in that according to first trip number of elements in each element group and Bottom element in each element group is carried out branch by default principle, including:
    According to first trip number of elements in each element group and default principle by the bottom element in each element group Branch is carried out, wherein the default principle is less than or equal to the element for the number of elements of last column in each element group First trip number of elements in group, the number of elements of other rows are equal to the principle of first trip number of elements in element group.
  4. 4. according to the method for claim 2, it is characterised in that after the realization is to the branch of each element group, Also include:
    Coordinate value of the other elements on the specified painting canvas, and root in addition to element is rolled into a ball are calculated in the dendrogram from bottom to top The other elements in addition to element is rolled into a ball are put on the specified painting canvas in the dendrogram according to the coordinate value.
  5. 5. according to the method for claim 4, it is characterised in that described to be put according to the coordinate value on the specified painting canvas In the dendrogram in addition to element is rolled into a ball after other elements, in addition to:
    According in the putting position of first trip element in each element group and the dendrogram in addition to element is rolled into a ball other yuan The putting position of element, in each element group in first trip element and the dendrogram in addition to element is rolled into a ball between other elements Carry out line.
  6. A kind of 6. device that dendrogram bottom element is positioned in the form of element group, it is characterised in that including:
    Acquisition module, it is used for:Bottom element is obtained in the element included from dendrogram, father's element identical bottom element is drawn It is divided into an element group;
    Setup module, it is used for:For either element group, if element group interior element total quantity is less than or equal to default often row maximum Number of elements, then first trip number of elements in element group is set to be equal to element group interior element total quantity;Otherwise, the element group is set Interior first trip number of elements is equal to default often row greatest member quantity;
    Branch's module, is used for:Will each element according to first trip number of elements in each element group and default principle Bottom element in group carries out branch;Wherein, the default principle is equal to for other row element quantity in each element group Or the principle less than first trip number of elements.
  7. 7. device according to claim 6, it is characterised in that branch's module includes:
    First branch's unit, is used for:According to element group putting in order from left to right, the is calculated in each element group successively Coordinate value of one bottom element on painting canvas is specified;According in each element group in addition to first bottom element other Bottom element first trip number of elements in the ordering during the element is rolled into a ball, the default principle and element group, determines institute The line number and columns residing for other bottom elements are stated, and according to the coordinate of first bottom element in each element group Spacing in line number and columns, the element set in advance group residing for value, other described bottom elements between bottom element, Calculate seat of other bottom elements on the specified painting canvas described in addition to first bottom element in each element group Scale value;Each bottom element in each element group is placed into the position of respective coordinates value on the specified painting canvas, realized To the branch of each element group.
  8. 8. device according to claim 7, it is characterised in that branch's module includes:
    Second branch's unit, is used for:According to first trip number of elements and default principle in each element group will be each Bottom element in element group carries out branch, wherein first prime number of the default principle for last column in each element group Amount is less than or equal to first trip number of elements in element group, and the number of elements of other rows is equal to first trip number of elements in element group Principle.
  9. 9. device according to claim 7, it is characterised in that also include:
    Computing module, it is used for:After realizing the branch to each element group, calculate from bottom to top in the dendrogram except member Coordinate value of the other elements on the specified painting canvas outside element group, and institute is put on the specified painting canvas according to the coordinate value State in dendrogram except element roll into a ball in addition to other elements.
  10. 10. device according to claim 9, it is characterised in that also include:
    Link module, it is used for:According in the dendrogram except element roll into a ball in addition to coordinate of the other elements on the specified painting canvas Value is put in the dendrogram on the specified painting canvas in addition to element is rolled into a ball after other bottom elements, according to each member Element group in first trip element putting position and the dendrogram in except element roll into a ball in addition to other elements putting position, each In the element group line is carried out in first trip element and the dendrogram between other elements in addition to element is rolled into a ball.
CN201710617625.6A 2017-07-26 2017-07-26 Method and device for positioning bottom layer elements of dendrogram in element group form Active CN107391465B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710617625.6A CN107391465B (en) 2017-07-26 2017-07-26 Method and device for positioning bottom layer elements of dendrogram in element group form

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710617625.6A CN107391465B (en) 2017-07-26 2017-07-26 Method and device for positioning bottom layer elements of dendrogram in element group form

Publications (2)

Publication Number Publication Date
CN107391465A true CN107391465A (en) 2017-11-24
CN107391465B CN107391465B (en) 2021-07-16

Family

ID=60341582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710617625.6A Active CN107391465B (en) 2017-07-26 2017-07-26 Method and device for positioning bottom layer elements of dendrogram in element group form

Country Status (1)

Country Link
CN (1) CN107391465B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109375971A (en) * 2018-09-14 2019-02-22 浙江口碑网络技术有限公司 Layout method and device, storage medium, the electronic device of the page
CN110096277A (en) * 2019-03-19 2019-08-06 北京三快在线科技有限公司 A kind of dynamic page methods of exhibiting, device, electronic equipment and storage medium
CN110636105A (en) * 2019-08-14 2019-12-31 北京金堤科技有限公司 Tree graph obtaining method and device, storage medium and electronic equipment
CN114721620A (en) * 2022-05-12 2022-07-08 北京搜狐新动力信息技术有限公司 Data processing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651634A (en) * 2008-08-13 2010-02-17 阿里巴巴集团控股有限公司 Method and system for providing regional information
CN101894168A (en) * 2010-06-30 2010-11-24 优视科技有限公司 Method and system for layout display of web page of mobile terminal
CN102143209A (en) * 2010-12-30 2011-08-03 用友软件股份有限公司 Graph showing method, graph showing device and server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651634A (en) * 2008-08-13 2010-02-17 阿里巴巴集团控股有限公司 Method and system for providing regional information
CN101894168A (en) * 2010-06-30 2010-11-24 优视科技有限公司 Method and system for layout display of web page of mobile terminal
CN102143209A (en) * 2010-12-30 2011-08-03 用友软件股份有限公司 Graph showing method, graph showing device and server

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
博智书苑: "组织结构图幻灯片图形化", 《POWERPOINT完美演示高手秘笈108招 2010版》 *
山田雅夫: "企业费用构成", 《一图胜千言 学会用图表快速表达》 *
方法林 等: "时间维度树状图描述", 《高职院校顶岗实习质量管理探索与实践》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109375971A (en) * 2018-09-14 2019-02-22 浙江口碑网络技术有限公司 Layout method and device, storage medium, the electronic device of the page
CN110096277A (en) * 2019-03-19 2019-08-06 北京三快在线科技有限公司 A kind of dynamic page methods of exhibiting, device, electronic equipment and storage medium
CN110096277B (en) * 2019-03-19 2020-06-12 北京三快在线科技有限公司 Dynamic page display method and device, electronic equipment and storage medium
CN110636105A (en) * 2019-08-14 2019-12-31 北京金堤科技有限公司 Tree graph obtaining method and device, storage medium and electronic equipment
CN114721620A (en) * 2022-05-12 2022-07-08 北京搜狐新动力信息技术有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN107391465B (en) 2021-07-16

Similar Documents

Publication Publication Date Title
CN107391465A (en) A kind of method and device that dendrogram bottom element is positioned in the form of element group
CN104217073B (en) A kind of visual layout's method of network community gravitation guiding
CN103914334B (en) The mask method and system of map
CN105595490B (en) Method for measuring human body dimension for garment customization through pictures
DE102012106124A1 (en) PV system design (process for the construction and design of a solar system)
CN108255489A (en) Front-end interface code generating method, device, electronic equipment and storage medium
CN103870558B (en) Page rendering method and mask layer creating method
CN107240384A (en) display brightness compensation method and device
CN104346172B (en) A kind of irregular DIV Dynamic Distributions method
CN105894234A (en) Data processing method and data processing system for calculating throwing position of self-service parcel cabinet
CN109410344A (en) A kind of dress designing method based on three-dimensional structure
CN107742318A (en) Commodity real time three-dimensional imaging method and the transaction system based on real-time three-dimensional displaying
CN106886917A (en) A kind of method and device for generating advertisement
Recchia et al. Permeable boundaries in the late 3rd millennium BC Central Mediterranean. Contacts and mobility between the Balkans, Greece, Southern Italy and Malta
CN107491657A (en) Evolutionary Game method and device method and device for intelligent medical treatment service and decision-making
CN105630380B (en) Element combinations and the method and system of fractionation
CN106933794A (en) Picture layout method and device, electronic equipment, computer-readable storage medium
CN107145654A (en) One kind is based on internet warp-knitted fabric design method
CN106251200A (en) The virtual fit method of Case-based Reasoning
CN116341257A (en) Automatic fiber layout method based on fiber braiding
KR101137025B1 (en) Method for managing subscribers based on multi-step feedback system
CN107609015A (en) A kind of methods of exhibiting of hot list, device, live Platform Server and medium
KR102263987B1 (en) Apparatus and methods for providing shape of user-customized bedding
CN113485704A (en) Information processing method and system for commodity activity page of E-commerce platform
CN109741448A (en) Method, apparatus and equipment based on dem data drawing three-dimensional relief model

Legal Events

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