Layout processing method and device for tree-shaped Canvas
A canvas and layout technology, applied in the computer field, can solve the problems of low rendering efficiency of canvas and unstable vertical coordinates.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0064] Embodiments of the present invention provide a layout processing method of a tree-like Canvas canvas, which can be applied to canvas components, such as figure 1 As shown, the method may include the steps of:
[0065] Step S11, acquiring the layout parameters of the Canvas and the tree structure data of the Canvas.
[0066] Among them, the layout parameter is used to indicate the layout direction of the Canvas canvas, and the layout parameter can be preset by the user before calling the canvas component, for example, setting the layout parameter to perform left and right layout on the DOM (Document Object Model, Document Object Model) object in the Canvas canvas Or layout up and down.
[0067] Wherein, the tree structure data can be data in JSON format or data in other formats, and the tree structure data includes node data with a parent-child relationship.
[0068] Specifically, the implementation process of step S11 may include:
[0069] Obtain the canvas configura...
Embodiment 2
[0102] Embodiments of the present invention provide a layout processing method of a tree-like Canvas canvas, which can be applied to canvas components, such as Figure 4 As shown, the method may include the steps of:
[0103] Step S41, acquiring the layout parameters of the Canvas and the tree structure data of the Canvas.
[0104] Specifically, for this process, reference may be made to step S11 in the first embodiment above, which will not be repeated here.
[0105] Step S42, creating virtual DOM objects for nodes at all levels in the tree structure data, and calculating the width and height of each virtual DOM object, and recording them as the virtual width and virtual height of nodes at all levels.
[0106] Specifically, for this process, reference may be made to step S12 in the first embodiment above, which will not be repeated here.
[0107] Step S43, if the layout parameter indicates the upper and lower layout of the Canvas, then traverse the nodes at all levels from ...
Embodiment 3
[0119] An embodiment of the present invention provides a layout processing device for a tree-like Canvas, such as Figure 5 As shown, the device may include:
[0120] Data acquisition module 51, for obtaining the layout parameter of Canvas canvas and the tree structure data of Canvas canvas;
[0121] Object creation module 52, is used for creating virtual DOM object respectively to all levels of nodes in the tree structure data, and calculates the width and the height of each virtual DOM object, is recorded as the virtual width and the virtual height of all levels of nodes;
[0122] The recursive calculation module 53 is used to traverse the nodes at all levels from the root node if the layout parameter indicates that the Canvas canvas is arranged left and right, and when adding a level of child nodes, reverse recursive calculation is performed according to the virtual height of the child nodes of the level The new virtual height of the previous parent node until the new virt...
PUM

Abstract
Description
Claims
Application Information

- R&D
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com