Lateral flattening adaptive conversion and layout method for sidebar tree structure

By setting a minimum recalculation threshold and density range determination in the sidebar tree structure, gradually adjusting the folding state and performing linear interpolation updates, the rendering delay and visual jump issues when the container width changes are resolved, achieving smooth layout transitions and visual continuity.

CN123114332APending Publication Date: 2026-11-17HUANENG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611300289.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies cannot adaptively adjust the expansion and collapse states of nodes when the container width of the sidebar tree structure changes, resulting in uncontrolled horizontal layout density and a lack of smooth transition when switching nodes, causing rendering delays and disrupting visual continuity.

Method used

By monitoring changes in container width, setting a minimum recalculation threshold to filter invalid events, determining the folding level direction based on density intervals, gradually adjusting the folding state, and updating the horizontal coordinates via linear interpolation within the transition time window, gradual unfolding and folding are achieved, ensuring visual continuity.

Benefits of technology

The frequency of layout recalculation was reduced, meaningless folding state switching between adjacent frames was eliminated, and the visual tracking continuity and smooth transition effect of the user in the sidebar were ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114332A_ABST
    Figure CN123114332A_ABST
Patent Text Reader

Abstract

This invention relates to the field of user interface layout technology and discloses a method for adaptive transformation and layout of a sidebar tree structure with horizontal flattening, including: filtering width change events through thresholds to reduce invalid recalculation; determining the direction of folding level change based on node density range; progressively releasing or merging nodes according to representative scores; and performing linear interpolation to smoothly update the horizontal coordinates within the transition time window.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of user interface layout technology, specifically to a method for the horizontal flattening adaptive transformation and layout of a sidebar tree structure. Background Technology

[0002] Sidebar tree structures are widely used to display hierarchical navigation content. Users can change the width of the sidebar container by dragging the sidebar borders or adjusting the browser window size.

[0003] Existing technologies perform a full lateral layout recalculation for all nodes at all levels of the entire tree when responding to changes in container width. The recalculation includes re-evaluating the expanded and collapsed states of each sibling node group, reallocating horizontal coordinates, and regenerating a flattened layout sequence.

[0004] The above full recalculation method has the following shortcomings: when continuously dragging or adjusting the window size, every frame width change triggers a full layout recalculation, which causes significant rendering delay when there are many nodes; the collapsing state changes drastically between adjacent frames, and the horizontal layout of the sidebar changes frequently, which interrupts the visual continuity of the user's tracking of the target node. Summary of the Invention

[0005] This invention provides a method for the horizontal flattening adaptive transformation and layout of a sidebar tree structure, which solves the technical problems in related technologies where the sidebar tree structure cannot adaptively adjust the expansion and collapse states of nodes when the container width changes dynamically, resulting in uncontrolled horizontal layout density and a lack of smooth transition when switching nodes.

[0006] This invention discloses a method for adaptive transformation and layout of a sidebar tree structure with horizontal flattening, comprising the following steps: Listen for sidebar container width change events and obtain the current frame container width value. ,calculate With reference width absolute value of the difference ,when Exceeding the preset minimum recalculation threshold At that time, Update to the new baseline width and trigger subsequent steps; Calculate the target node density value based on the new reference width. ,Will With the current folding level parameter Corresponding density range When a comparison is performed, When the coordinates fall within the interval, only horizontal coordinate reallocation is performed; when When crossing interval boundaries, determine the new folding level parameters. and change of direction; When the change direction is towards sparseness, the aggregation nodes are traversed in descending order of representative scores, and the highest-scoring member is released as an independent rendering node one by one, up to the current horizontal layout density value. It stopped falling back to the target density range; When the direction changes to a dense direction, the independent rendering nodes are traversed in ascending order of representative scores, and each node is merged into the aggregation node of its sibling group, until... It stopped falling back to the target density range; Within the preset transition time window Within the module, a linear interpolation algorithm is used to update the horizontal coordinates of each node frame by frame. ,in For nodes The current horizontal coordinates, The target horizontal coordinate, , This represents the elapsed time of the current frame relative to the start of the transition.

[0007] Furthermore, the target node density value The calculation method is as follows: ; in This represents the number of independent rendering nodes visible in the current horizontal layout. New baseline width; various fold levels Corresponding density range Offline calibration is performed according to visual readability requirements under different width ranges, and the intervals of adjacent fold levels share boundary values.

[0008] Furthermore, the representative score is calculated based on at least one of the node's access frequency, hierarchy depth, or user tag weight.

[0009] Furthermore, when an aggregate node contains multiple members with the same representative score, the release order is determined by using the preorder traversal order of the node in the original tree structure as the secondary sorting basis.

[0010] Furthermore, when the dense direction changes, if there is no aggregation node in the target sibling group, an aggregation node is created for that sibling group and then merged.

[0011] This invention discloses a sidebar tree structure horizontal flattening adaptive conversion and layout system, comprising: The trigger determination module is used to listen for sidebar container width change events, calculate the absolute value of the difference between the current frame container width and the baseline width, compare it with the minimum recalculation threshold, and output the determination result of whether to trigger recalculation and the new baseline width value. The density interval comparison module is used to calculate the target node density value based on the new reference width, compare the target node density value with the density interval corresponding to the current folding level, trigger horizontal coordinate reassignment when the target node density value falls within the interval, and output the folding level change direction indicator and new folding level parameters when the target node density value crosses the interval boundary. The Gradual Unfolding module is used to traverse aggregate nodes in descending order of representative scores and release the highest-scoring members as independent rendering nodes when the folding level changes to a sparser direction. It stops when the horizontal layout density value falls back to the target density range and outputs the tree node list after gradual unfolding. The progressive folding module is used to traverse independent rendering nodes in ascending order of representative scores and merge them into the aggregate node one by one when the folding level changes to the dense direction. It stops when the horizontal layout density value falls back to the target density range and outputs a tree node list after progressive folding. The coordinate smoothing transition module is used to calculate the difference between the current horizontal coordinate of each node and the target horizontal coordinate. Within the preset transition time window, the horizontal coordinate of each node is updated frame by frame using a linear interpolation algorithm, and the layout coordinate sequence with a smooth transition trajectory is output.

[0012] Furthermore, the target node density value in the density interval comparison module The calculation method is as follows: ; in This represents the number of independent rendering nodes visible in the current horizontal layout. The new baseline width is used; the density intervals corresponding to each fold level are calibrated offline according to the visual readability requirements under different width ranges, and the intervals of adjacent fold levels share boundary values.

[0013] Furthermore, the representative scores in the progressive unfolding module and the progressive folding module are calculated based on at least one of the node access frequency, hierarchy depth, or user tag weight.

[0014] Furthermore, when the aggregate node contains multiple members with the same representative score, the progressive unfolding module uses the preorder traversal order of the node in the original tree structure as the secondary sorting basis to determine the release order.

[0015] Furthermore, when the progressive folding module does not yet have an aggregation node in the target sibling group, it creates an aggregation node for the sibling group and then merges it.

[0016] The beneficial effects of this invention are as follows: This invention filters invalid width change events by using a minimum recalculation threshold, determines the direction of folding level changes based on density intervals, progressively adjusts the folding state at the granularity of individual nodes, and performs linear interpolation on the horizontal coordinates within the transition time window. This solves the technical problems of rendering latency and drastic switching of folding states caused by full layout recalculation under high-frequency width changes, and achieves the technical effects of reducing the frequency of layout recalculation triggering, eliminating meaningless switching of folding states in adjacent frames, and ensuring the continuity of user visual tracking. Attached Figure Description

[0017] Figure 1 This is a flowchart of the method for adaptive conversion and layout of the horizontal flattening of the sidebar tree structure provided in the embodiments of the present invention. Detailed Implementation

[0018] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.

[0019] At least one embodiment of the present invention discloses a method for adaptive horizontal flattening and layout of a sidebar tree structure, see [link to relevant documentation]. Figure 1 This includes the following steps: Step 1: Width change filtering and recalculation trigger judgment.

[0020] Listen for sidebar container width change events and obtain the current frame container width value. .calculate The baseline width recorded during the last horizontal flat layout calculation. absolute value of the difference ,Will Compared with the preset minimum recalculation threshold Comparison. When When, skip the subsequent calculation process; when At that time, Update to the new baseline width and trigger subsequent steps, outputting the result of whether recalculation is triggered and the new baseline width value.

[0021] It should be noted that the minimum recalculation threshold This refers to the minimum number of pixels that the container width must cumulatively change between two effective layout recalculations during a continuous width change. This includes the numerous tiny frame changes that occur when dragging the sidebar boundaries. Below Therefore, it is filtered out and does not trigger subsequent calculations, only when the cumulative width change exceeds Only then does it enter the recalculation process.

[0022] Step 2: Density range comparison and folding level determination.

[0023] Based on the new reference width Calculate the target node density value corresponding to the horizontal available space of the sidebar. .Will With the currently effective horizontal flattening folding level parameters The corresponding density range A comparison was conducted, among which and Folding levels The lower and upper bounds of the corresponding density interval.

[0024] when At this time, the target density still falls within the current interval, and only the horizontal coordinates of each tree node are redistributed, skipping the folding state change process. When crossing interval boundaries, determine new folding level parameters. And change direction, output folding level change direction indicator (dense direction or sparse direction) and .

[0025] In the embodiments of this application, the density interval determination enables continuous adjustments within the same width range to perform only coordinate reassignment without changing the folding state of any node, thereby eliminating meaningless unfolding and folding switching.

[0026] Furthermore, the target node density value The calculation method is as follows: ; in This represents the number of independent rendering nodes visible in the current horizontal layout. This is the new baseline width. (Each fold level) Corresponding density range The system is pre-calibrated offline according to the visual readability requirements under different width ranges, and the intervals of adjacent fold levels share boundary values ​​to ensure the continuity of the judgment.

[0027] Step 3, the gradual unfolding of the folding level as it changes towards sparseness.

[0028] For cases where the change direction identifier output in step 2 is a sparse direction (the sidebar becomes wider and more nodes can be expanded), traverse all existing aggregation nodes in the current tree structure and sort the aggregation node sequence in descending order according to the score of the member with the highest representative score in each aggregation node.

[0029] Release the member with the highest representative score from the top-ranked aggregation nodes in sequence, and convert that member into a horizontally independent rendering node. After releasing each node, recalculate the current horizontal layout density value. ,in This is the current horizontal layout density value, when Falling back to the new target density range Stop releasing when the range is reached, and output the list of tree nodes after the gradual expansion.

[0030] It should be noted that the representativeness score refers to a quantitative indicator of the importance of each member within the aggregation node in the tree structure. It can be calculated based on attributes such as the node's access frequency, hierarchical depth, or user-marked weight. The member with the highest representativeness score is preferentially released as an independent node, ensuring that important nodes are prioritized for display within a limited horizontal space increment.

[0031] Furthermore, for aggregate nodes containing multiple members with the same representative score, the preorder traversal order of the nodes in the original tree structure is used as the secondary sorting basis to ensure the determinism of the release order.

[0032] Step 4, progressive folding when the fold level changes towards a denser direction.

[0033] For cases where the change direction identifier in step 2 is a dense direction (the sidebar becomes narrower, and more nodes need to be compressed), traverse the nodes that are currently rendered horizontally independently in each sibling group of the tree structure, and sort each node in ascending order according to the representative score.

[0034] The process involves merging the first independent node into an existing aggregate node within its sibling group; if no aggregate node exists in the sibling group, a new aggregate node is created before merging. After merging each node, the current horizontal layout density value is recalculated. ,when Falling back to the new target density range Stop merging nodes when the range is reached, and output the progressively collapsed list of tree nodes.

[0035] In this embodiment, steps 3 and 4 adjust the folding state gradually at the granularity of a single node, instead of changing the entire group of nodes all at once. This makes the folding state change process traceable and ensures the continuity of visual tracking for the user in the sidebar.

[0036] Step 5: Smooth transition by linear interpolation of the horizontal coordinate.

[0037] For the progressively adjusted tree node list, calculate the current horizontal coordinate of each node. Horizontal coordinates of the target The difference between ,in Number the nodes. Within the preset transition time window. Within this process, a linear interpolation algorithm is used to update the horizontal coordinates of each node frame by frame: ; in This represents the elapsed time of the current frame relative to the start of the transition. For nodes At any moment The horizontal coordinate, This is a preset transition time window. It outputs a horizontally flattened coordinate sequence of a sidebar tree structure with a smooth transition trajectory.

[0038] On the other hand, the present invention also proposes a horizontal flattening adaptive conversion and layout system for a sidebar tree structure, comprising: The trigger determination module is used to listen for sidebar container width change events, calculate the absolute value of the difference between the current frame container width and the baseline width, compare it with the minimum recalculation threshold, and output the determination result of whether to trigger recalculation and the new baseline width value. The density interval comparison module is used to calculate the target node density value based on the new reference width, compare the target node density value with the density interval corresponding to the current folding level, output the folding level change direction indicator and the new folding level parameters, or trigger only the horizontal coordinate reassignment when the density does not cross the interval. The Gradual Unfolding module is used to traverse aggregate nodes in descending order of representative scores and release the highest-scoring members as independent rendering nodes when the folding level changes to a sparser direction. It stops when the horizontal layout density value falls back to the target range and outputs a list of tree nodes after gradual unfolding. The progressive folding module is used to traverse independent rendering nodes in ascending order of representative scores and merge them into the aggregate node one by one when the folding level changes to the dense direction. It stops when the horizontal layout density value falls back to the target range and outputs a tree node list after progressive folding. The coordinate smoothing transition module is used to calculate the difference between the current horizontal coordinate of each node and the target horizontal coordinate. Within the preset transition time window, the horizontal coordinate of each node is updated frame by frame using a linear interpolation algorithm, and the layout coordinate sequence with a smooth transition trajectory is output.

[0039] By way of example, the system proposed in this invention may also include various features and combinations thereof in the method embodiments, which will not be elaborated here.

[0040] Step 1's minimum recalculation threshold filtering prevents numerous tiny frame changes during dragging from triggering subsequent calculations, reducing the frequency of layout recalculation to the effective width change point, thereby reducing rendering latency under high-frequency triggering. Step 2's density range determination ensures that continuous adjustments within the same width range only require coordinate reassignment without changing the folded state, fundamentally avoiding drastic switching of folded states between adjacent frames. Steps 3 and 4 adjust the folded state incrementally at the individual node level, matching the rate of folded state change with the width change amplitude, ensuring visual continuity for users tracking target nodes in the sidebar. Step 5's linear interpolation smooth transition further eliminates the abrupt change in horizontal coordinates, maintaining a visually smooth layout adjustment process.

[0041] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.

Claims

1. A method for adaptive transformation and layout of a sidebar tree structure with horizontal flattening, characterized in that, Includes the following steps: Listen for sidebar container width change events and obtain the current frame container width value. ,calculate With reference width absolute value of the difference ,when Exceeding the preset minimum recalculation threshold At that time, Update to the new baseline width and trigger subsequent steps; Calculate the target node density value based on the new reference width. ,Will With the current folding level parameter Corresponding density range When a comparison is performed, When the coordinates fall within the interval, only horizontal coordinate reallocation is performed; when When crossing interval boundaries, determine the new folding level parameters. and change of direction; When the change direction is towards sparseness, the aggregation nodes are traversed in descending order of representative scores, and the highest-scoring member is released as an independent rendering node one by one, up to the current horizontal layout density value. It stopped falling back to the target density range; When the direction changes to a dense direction, the independent rendering nodes are traversed in ascending order of representative scores, and each node is merged into the aggregation node of its sibling group, until... It stopped falling back to the target density range; Within the preset transition time window Within the module, a linear interpolation algorithm is used to update the horizontal coordinates of each node frame by frame. ,in For nodes The current horizontal coordinates, The target horizontal coordinate, , This represents the elapsed time of the current frame relative to the start of the transition.

2. The method for horizontal flattening and adaptive transformation and layout of the sidebar tree structure according to claim 1, wherein, The target node density value The calculation method is as follows: ; in This represents the number of independent rendering nodes visible in the current horizontal layout. New baseline width; various fold levels Corresponding density range Offline calibration is performed according to visual readability requirements under different width ranges, and the intervals of adjacent fold levels share boundary values.

3. The method for horizontal flattening and adaptive transformation and layout of the sidebar tree structure according to claim 1, wherein, The representative score is calculated based on at least one of the node's access frequency, hierarchy depth, or user tag weight.

4. The method for horizontal flattening and adaptive transformation and layout of the sidebar tree structure according to claim 1, wherein, When an aggregate node contains multiple members with the same representative score, the release order is determined by using the preorder traversal order of the node in the original tree structure as the secondary sorting basis.

5. The method for horizontal flattening and adaptive transformation and layout of the sidebar tree structure according to claim 1, wherein, When the direction of the dense cluster changes, if there is no aggregation node in the target sibling group, an aggregation node will be created for that sibling group and then merged.

6. A sidebar tree structure horizontal flattening adaptive conversion and layout system, characterized in that, include: The trigger determination module is used to listen for sidebar container width change events, calculate the absolute value of the difference between the current frame container width and the baseline width, compare it with the minimum recalculation threshold, and output the determination result of whether to trigger recalculation and the new baseline width value. The density interval comparison module is used to calculate the target node density value based on the new reference width, compare the target node density value with the density interval corresponding to the current folding level, trigger horizontal coordinate reassignment when the target node density value falls within the interval, and output the folding level change direction indicator and new folding level parameters when the target node density value crosses the interval boundary. The Gradual Unfolding module is used to traverse aggregate nodes in descending order of representative scores and release the highest-scoring members as independent rendering nodes when the folding level changes to a sparser direction. It stops when the horizontal layout density value falls back to the target density range and outputs the tree node list after gradual unfolding. The progressive folding module is used to traverse independent rendering nodes in ascending order of representative scores and merge them into the aggregate node one by one when the folding level changes to the dense direction. It stops when the horizontal layout density value falls back to the target density range and outputs a tree node list after progressive folding. The coordinate smoothing transition module is used to calculate the difference between the current horizontal coordinate of each node and the target horizontal coordinate. Within the preset transition time window, the horizontal coordinate of each node is updated frame by frame using a linear interpolation algorithm, and the layout coordinate sequence with a smooth transition trajectory is output.

7. The sidebar tree structure horizontal flattening adaptive conversion and layout system according to claim 6, wherein, The density value of the target node in the density interval comparison module The calculation method is as follows: ; in This represents the number of independent rendering nodes visible in the current horizontal layout. New baseline width; The density intervals corresponding to each fold level are calibrated offline according to the visual readability requirements under different width ranges, and the intervals of adjacent fold levels share boundary values.

8. The sidebar tree structure horizontal flattening adaptive conversion and layout system according to claim 6, wherein, The representative scores in the progressive unfolding module and the progressive folding module are calculated based on at least one of the node access frequency, hierarchy depth, or user tag weight.

9. The sidebar tree structure horizontal flattening adaptive conversion and layout system according to claim 6, wherein, When an aggregate node contains multiple members with the same representative score, the progressive unfolding module uses the preorder traversal order of the node in the original tree structure as the secondary sorting basis to determine the release order.

10. The sidebar tree structure horizontal flattening adaptive conversion and layout system according to claim 6, wherein, When the progressive folding module does not yet have an aggregation node in the target sibling group, it creates an aggregation node for the sibling group and then merges it.