A node scaling method, device, equipment and storage medium
By automatically determining the node scaling ratio with node information and canvas information, the problems of poor node scaling flexibility and easy overflow of canvas in the prior art are solved, and the coordinated and beautiful appearance of the shape proportion of the node after scaling is achieved.
Patent Information
- Application Number
- CN202410681831.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-05-29
AI Technical Summary
The prior art is poor in the scaling of nodes in the graphical user interface, fixed-scale scaling has poor flexibility, and free scaling can easily lead to misoperation or difficulty in precise control, resulting in the canvas overflowing after the node is scaled, destroying the rationality and logic of the overall layout.
By combining node information and canvas information, the width scaling ratio and height scaling ratio are determined, and the target scaling ratio is determined in comprehensive consideration of these two proportions, and the target node is automatically scaled.
Ensure that the nodes still maintain their original shape ratio after scaling, without distortion, making the entire picture or layout more harmonious and beautiful, avoiding the canvas overflowing after the nodes are scaled, and maintaining the rationality and logic of the overall layout.
Smart Images

Figure CN118642634B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a node scaling method, device, equipment and storage medium. Background Art
[0002] In today's digital age, graphical user interfaces play a vital role in various software applications. In many graphical user interface applications, canvas is a common element, which is used to display and edit various graphic objects, such as text, images, shapes, etc. However, when there are a large number of graphic objects on the canvas or the size is large, the display may be incomplete or difficult to operate.
[0003] In the prior art, scaling nodes in the canvas usually adopts a fixed-ratio scaling or a free-ratio scaling input by the user. However, in the fixed-ratio scaling method, users can only choose preset scaling ratios, such as 1:1, 2:1, etc., which has poor flexibility and cannot meet the user's needs for different scaling ratios. Free scaling means that users can freely adjust the scaling ratio through mouse wheel or gesture operation, but this method may cause users to misoperate or it is difficult to accurately control the scaling ratio. After the nodes are scaled, they are easy to overflow the canvas, and the user's visual coordination cannot be guaranteed. Summary of the invention
[0004] The present invention provides a node scaling method, device, equipment and storage medium to determine the scaling ratio of a target node and automatically implement node scaling.
[0005] According to one aspect of the present invention, a node scaling method is provided, the method comprising:
[0006] Determine the target node in the canvas, obtain node information based on the target node, and obtain canvas information;
[0007] Determine the width scaling ratio and the height scaling ratio according to the node information and the canvas information;
[0008] The target scaling ratio is determined according to the width scaling ratio and the height scaling ratio, and the target node is scaled according to the target scaling ratio.
[0009] Optionally, determining the target node in the canvas includes: determining each node in the canvas, and numbering each node in turn to generate numbered nodes; determining whether a target number input by the user is received, and if so, taking the node corresponding to the target number as the target node; otherwise, taking each numbered node in turn in the order of numbering as the target node.
[0010] Optionally, node information is obtained based on the target node, and canvas information is obtained, including: obtaining node width and node height based on the target node, and obtaining canvas width, canvas height and each canvas edge position; determining the spacing value from the target node to each canvas edge position, and taking the minimum spacing value among the spacing values as the target spacing value; taking the node width, node height and target spacing value as node information, and taking the canvas width and canvas height as canvas information.
[0011] Optionally, determining the width scaling ratio and the height scaling ratio based on the node information and the canvas information includes: determining a first difference between the canvas width and the target spacing value, and determining a second difference between the canvas height and the target spacing; determining the width scaling ratio based on the node width and the first difference; determining the height scaling ratio based on the node height and the second difference.
[0012] Optionally, determining the width scaling ratio based on the node width and the first difference includes: judging whether the node width is greater than the first difference, and if so, determining a first ratio of the first difference and the node width, and using the first ratio as the width scaling ratio; otherwise, determining the width scaling ratio to be 1.
[0013] Optionally, the height scaling ratio is determined based on the node height and the second difference, including: determining whether the node height is greater than the second difference, if so, determining a second ratio of the second difference and the node height, and using the second ratio as the width scaling ratio; otherwise, determining the height scaling ratio to be 1.
[0014] Optionally, determining the target scaling ratio according to the width scaling ratio and the height scaling ratio includes: judging whether the width scaling ratio is greater than the height scaling ratio, and if so, taking the height scaling ratio as the target scaling ratio; otherwise, taking the width scaling ratio as the target scaling ratio.
[0015] According to another aspect of the present invention, a node scaling device is provided, the device comprising:
[0016] A node and canvas information acquisition module is used to determine a target node in the canvas, acquire node information based on the target node, and acquire canvas information;
[0017] A width and height scaling ratio determination module, used to determine the width scaling ratio and the height scaling ratio according to the node information and the canvas information;
[0018] The target node scaling module is used to determine the target scaling ratio according to the width scaling ratio and the height scaling ratio, and scale the target node according to the target scaling ratio.
[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0020] at least one processor; and
[0021] a memory communicatively connected to the at least one processor; wherein,
[0022] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform a node scaling method described in any embodiment of the present invention.
[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a node scaling method described in any embodiment of the present invention when executed.
[0024] The technical solution of the embodiment of the present invention determines the width scaling ratio and the height scaling ratio by combining the node information and the canvas information, and determines the target scaling ratio by comprehensively considering the width scaling ratio and the height scaling ratio, and automatically performs a scaling operation on the target node, which can ensure that the node still maintains the original shape ratio after scaling and will not be distorted, making the entire picture or layout more coordinated and beautiful, better meeting the needs of users, avoiding the overflow of the canvas after the node is scaled, and also avoiding the destruction of the rationality and logic of the overall layout due to improper scaling in a single direction.
[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 is a flowchart of a node scaling method provided according to Embodiment 1 of the present invention;
[0028] Figure 2 is a flowchart of another node scaling method provided according to Embodiment 2 of the present invention;
[0029] Figure 3 is a structural schematic diagram of a node scaling device provided according to Embodiment 3 of the present invention;
[0030] Figure 4 It is a structural schematic diagram of an electronic device for implementing a node scaling method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] Embodiment 1
[0034] Figure 1 A flowchart of a node scaling method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of using antv / G6 to draw pictures. The method can be executed by a node scaling device. The node scaling device can be implemented in the form of hardware and / or software. The node scaling device can be configured in a computer controller. Figure 1 As shown, the method includes:
[0035] S110: Determine a target node in the canvas, obtain node information based on the target node, and obtain canvas information.
[0036] The canvas refers to a virtual plane or area used to carry various graphics, elements, etc. The target node refers to a specific element in the canvas that is specially selected and needs to be operated or analyzed. The node information refers to the size and position information related to the target node. The canvas information refers to the information related to the canvas size.
[0037] Specifically, the controller determines the target node in the current canvas, which is the core object for subsequent zoom operations. Then, the controller obtains node information and canvas information based on the target node, including node width, node height, and target spacing value. Canvas information includes canvas width and canvas height.
[0038] Optionally, node information is obtained based on the target node, and canvas information is obtained, including: obtaining node width and node height based on the target node, and obtaining canvas width, canvas height and each canvas edge position; determining the spacing value from the target node to each canvas edge position, and taking the minimum spacing value among the spacing values as the target spacing value; taking the node width, node height and target spacing value as node information, and taking the canvas width and canvas height as canvas information.
[0039] Specifically, the controller will obtain the width of the target node, that is, the size of the node in the horizontal direction, and the height of the target node, that is, its size in the vertical direction. At the same time, the controller will also obtain canvas information, including canvas width, that is, the size range of the entire canvas in the horizontal direction, canvas height, that is, the range in the vertical direction; and the specific positions of each edge of the canvas, such as the coordinates or limits of the top edge, bottom edge, left edge, and right edge. The controller will then determine the spacing value from the target node to each edge of the canvas, and find the smallest value from these spacing values as the target spacing value. The target spacing value represents the minimum distance between the target node and the edge of the canvas.
[0040] S120 . Determine a width scaling ratio and a height scaling ratio according to the node information and the canvas information.
[0041] The width scaling ratio refers to the scaling factor of the target node in the horizontal direction, which is used to determine the scaling degree of the target node in width. The height scaling ratio refers to the scaling factor of the target node in the vertical direction, which determines the scaling extent of the target node in height.
[0042] Specifically, the controller will calculate the width scaling ratio and the height scaling ratio according to the acquired node information and canvas information using corresponding algorithms or rules. These two ratios will reflect the degree of scaling required in the width and height directions.
[0043] Optionally, determining the width scaling ratio and the height scaling ratio based on the node information and the canvas information includes: determining a first difference between the canvas width and the target spacing value, and determining a second difference between the canvas height and the target spacing; determining the width scaling ratio based on the node width and the first difference; determining the height scaling ratio based on the node height and the second difference.
[0044] Specifically, the controller determines a first difference between the width of the canvas and the target spacing value, and a second difference between the height of the canvas and the target spacing value, that is, the first difference is obtained by subtracting the target spacing value from the width of the canvas, and the second difference is obtained by subtracting the target spacing value from the height of the canvas. Then, the width scaling ratio is further determined according to the node width and the first difference, and the height scaling ratio is determined according to the node height and the second difference.
[0045] Optionally, determining the width scaling ratio based on the node width and the first difference includes: judging whether the node width is greater than the first difference, and if so, determining a first ratio of the first difference and the node width, and using the first ratio as the width scaling ratio; otherwise, determining the width scaling ratio to be 1.
[0046] Specifically, the controller compares the node width with the first difference. If it is determined that the node width is greater than the first difference, then a first ratio of the first difference to the node width needs to be further determined, and the first ratio is used as the width scaling ratio. However, if the node width is not greater than the first difference, then the width scaling ratio is directly determined to be 1. 1 means that the width of the target node in the current canvas does not need to be scaled, and only needs to maintain the original width state.
[0047] Optionally, the height scaling ratio is determined based on the node height and the second difference, including: determining whether the node height is greater than the second difference, if so, determining a second ratio of the second difference and the node height, and using the second ratio as the width scaling ratio; otherwise, determining the height scaling ratio to be 1.
[0048] Specifically, the controller compares the node height with the second difference. If it is determined that the node height is greater than the second difference, then it is necessary to further determine the second ratio of the second difference to the node height, and use the second ratio as the height scaling ratio. However, if the node height is not greater than the second difference, then the height scaling ratio is directly determined to be 1. 1 means that the height of the target node in the current canvas does not need to be scaled, and only needs to maintain the original height state.
[0049] S130 , determining a target scaling ratio according to the width scaling ratio and the height scaling ratio, and scaling the target node according to the target scaling ratio.
[0050] Specifically, the controller will comprehensively consider the width scaling ratio and the height scaling ratio, and then determine a final target scaling ratio. The target scaling ratio is a unified ratio obtained by combining the scaling requirements in two directions. Finally, the controller will perform a scaling operation on the previously determined target node according to the determined target scaling ratio. By comprehensively considering the width scaling ratio and the height scaling ratio to scale the nodes in the canvas, it can be ensured that the nodes still maintain their original shape ratio after scaling, and will not be distorted, making the entire picture or layout more coordinated and beautiful, and avoiding overflow of the canvas after node scaling, and avoiding the rationality and logic of the overall layout being destroyed due to improper scaling in a single direction.
[0051] Optionally, determining the target scaling ratio according to the width scaling ratio and the height scaling ratio includes: judging whether the width scaling ratio is greater than the height scaling ratio, and if so, taking the height scaling ratio as the target scaling ratio; otherwise, taking the width scaling ratio as the target scaling ratio.
[0052] Specifically, the controller compares the two ratios, that is, determines whether the width scaling ratio is greater than the height scaling ratio. If the width scaling ratio is greater than the height scaling ratio, then the height scaling ratio is selected and determined as the target scaling ratio. However, if it is determined that the width scaling ratio is not greater than the height scaling ratio, then the width scaling ratio is determined as the target scaling ratio. That is, the smaller value of the width scaling ratio and the height scaling ratio is used as the target scaling ratio. By comprehensively considering the width scaling ratio and the height scaling ratio, the nodes can be scaled more comprehensively to adapt to different canvas sizes and layout requirements. This ensures that the nodes can maintain the appropriate ratio and size after scaling, thereby presenting a better effect in the canvas.
[0053] The technical solution of the embodiment of the present invention determines the width scaling ratio and the height scaling ratio by combining the node information and the canvas information, and determines the target scaling ratio by comprehensively considering the width scaling ratio and the height scaling ratio, and automatically performs a scaling operation on the target node, which can ensure that the node still maintains the original shape ratio after scaling and will not be distorted, making the entire picture or layout more coordinated and beautiful, better meeting the needs of users, avoiding the overflow of the canvas after the node is scaled, and also avoiding the destruction of the rationality and logic of the overall layout due to improper scaling in a single direction.
[0054] Embodiment 2
[0055] Figure 2 This is a flowchart of a node scaling method provided in the second embodiment of the present invention. This embodiment adds a specific process of determining the target node in the canvas based on the above-mentioned first embodiment. Among them, the specific content of steps S260-S270 is roughly the same as steps S120-S130 in the first embodiment, so they will not be repeated in this embodiment. Figure 2 As shown, the method includes:
[0056] S210: Determine each node in the canvas, and number each node in sequence to generate numbered nodes.
[0057] S220, determine whether the target number input by the user is received, if so, execute S230, otherwise, execute S240.
[0058] S230. Set the node corresponding to the target number as the target node.
[0059] S240: taking the numbered nodes as target nodes in sequence according to the numbering order.
[0060] Specifically, the controller will identify the entire canvas to obtain all the nodes therein. Then, in order to facilitate subsequent operations and management, the controller will number each of these identified nodes in turn. The controller determines the target node in two ways, one is to use the user-specified node as the target node, and the other is to use each node as the target node in sequence according to the numbering order. The controller will determine whether the target number entered by the user has been received. If the target number entered by the user is received, then the node corresponding to the target number is found from the numbered nodes as the target node. However, if the target number entered by the user is not received, then each numbered node will be processed as a target node in sequence according to the previously generated numbering order.
[0061] S250: Obtain node information based on the target node, and obtain canvas information.
[0062] Optionally, node information is obtained based on the target node, and canvas information is obtained, including: obtaining node width and node height based on the target node, and obtaining canvas width, canvas height and each canvas edge position; determining the spacing value from the target node to each canvas edge position, and taking the minimum spacing value among the spacing values as the target spacing value; taking the node width, node height and target spacing value as node information, and taking the canvas width and canvas height as canvas information.
[0063] S260: Determine a width scaling ratio and a height scaling ratio according to the node information and the canvas information.
[0064] Optionally, determining the width scaling ratio and the height scaling ratio based on the node information and the canvas information includes: determining a first difference between the canvas width and the target spacing value, and determining a second difference between the canvas height and the target spacing; determining the width scaling ratio based on the node width and the first difference; determining the height scaling ratio based on the node height and the second difference.
[0065] Optionally, determining the width scaling ratio based on the node width and the first difference includes: judging whether the node width is greater than the first difference, and if so, determining a first ratio of the first difference and the node width, and using the first ratio as the width scaling ratio; otherwise, determining the width scaling ratio to be 1.
[0066] Optionally, the height scaling ratio is determined based on the node height and the second difference, including: determining whether the node height is greater than the second difference, if so, determining a second ratio of the second difference and the node height, and using the second ratio as the width scaling ratio; otherwise, determining the height scaling ratio to be 1.
[0067] S270: Determine a target scaling ratio according to the width scaling ratio and the height scaling ratio, and scale the target node according to the target scaling ratio.
[0068] Optionally, determining the target scaling ratio according to the width scaling ratio and the height scaling ratio includes: judging whether the width scaling ratio is greater than the height scaling ratio, and if so, taking the height scaling ratio as the target scaling ratio; otherwise, taking the width scaling ratio as the target scaling ratio.
[0069] The technical solution of the embodiment of the present invention determines the width scaling ratio and the height scaling ratio by combining the node information and the canvas information, and determines the target scaling ratio by comprehensively considering the width scaling ratio and the height scaling ratio, and automatically performs a scaling operation on the target node, which can ensure that the node still maintains the original shape ratio after scaling and will not be distorted, making the entire picture or layout more coordinated and beautiful, better meeting the needs of users, avoiding the overflow of the canvas after the node is scaled, and also avoiding the destruction of the rationality and logic of the overall layout due to improper scaling in a single direction.
[0070] Embodiment 3
[0071] Figure 3 This is a schematic diagram of the structure of a node scaling device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a node and canvas information acquisition module 310, which is used to determine a target node in the canvas, acquire node information based on the target node, and acquire canvas information;
[0072] A width and height scaling ratio determination module 320, configured to determine a width scaling ratio and a height scaling ratio according to the node information and the canvas information;
[0073] The target node scaling module 330 is used to determine a target scaling ratio according to the width scaling ratio and the height scaling ratio, and scale the target node according to the target scaling ratio.
[0074] Optionally, the node and canvas information acquisition module 310 specifically includes: a target node determination unit, used to: determine each node in the canvas, and number each node in turn to generate numbered nodes; determine whether a target number input by the user is received, and if so, use the node corresponding to the target number as the target node; otherwise, use each numbered node as the target node in order of numbering.
[0075] Optionally, the node and canvas information acquisition module 310 specifically includes: an information acquisition unit, used to: acquire the node width and node height based on the target node, and acquire the canvas width, canvas height and each canvas edge position; determine the spacing value from the target node to each canvas edge position, and use the minimum spacing value among the spacing values as the target spacing value; use the node width, node height and target spacing value as node information, and use the canvas width and canvas height as canvas information.
[0076] Optionally, the width and height scaling ratio determination module 320 specifically includes: a difference determination unit, used to determine a first difference between the canvas width and the target spacing value, and to determine a second difference between the canvas height and the target spacing; a width scaling ratio determination unit, used to determine a width scaling ratio based on the node width and the first difference; and a height scaling ratio determination unit, used to determine a height scaling ratio based on the node height and the second difference.
[0077] Optionally, the width scaling ratio determination unit is specifically used to: determine whether the node width is greater than the first difference, if so, determine a first ratio of the first difference and the node width, and use the first ratio as the width scaling ratio; otherwise, determine the width scaling ratio to be 1.
[0078] Optionally, the height scaling ratio determination unit is specifically used to: determine whether the node height is greater than the second difference, if so, determine a second ratio of the second difference and the node height, and use the second ratio as the width scaling ratio; otherwise, determine the height scaling ratio to be 1.
[0079] Optionally, the target node scaling module 330 is specifically used to: determine whether the width scaling ratio is greater than the height scaling ratio, and if so, use the height scaling ratio as the target scaling ratio; otherwise, use the width scaling ratio as the target scaling ratio.
[0080] The technical solution of the embodiment of the present invention determines the width scaling ratio and the height scaling ratio by combining the node information and the canvas information, and determines the target scaling ratio by comprehensively considering the width scaling ratio and the height scaling ratio, and automatically performs a scaling operation on the target node, which can ensure that the node still maintains the original shape ratio after scaling and will not be distorted, making the entire picture or layout more coordinated and beautiful, better meeting the needs of users, avoiding the overflow of the canvas after the node is scaled, and also avoiding the destruction of the rationality and logic of the overall layout due to improper scaling in a single direction.
[0081] A node scaling device provided in an embodiment of the present invention can execute a node scaling method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0082] Embodiment 4
[0083] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0084] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0085] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0086] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a node scaling method.
[0087] In some embodiments, a node scaling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of a node scaling method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a node scaling method in any other appropriate manner (e.g., by means of firmware).
[0088] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0089] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0090] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0091] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0092] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0093] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0094] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0095] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A node scaling method, characterized in that: include: Determine a target node in a canvas; wherein the canvas refers to a virtual plane or area used to carry various graphics and elements; the target node refers to an element in the canvas that is specially selected and needs to be specifically operated or analyzed; Acquire a node width and a node height based on the target node, and acquire a canvas width, a canvas height, and a position of each canvas edge; Determine the distance value from the target node to each edge position of the canvas, and use the minimum distance value among the distance values as the target distance value; Using the node width, node height and target spacing value as the node information, and using the canvas width and canvas height as the canvas information; Determining a first difference between the canvas width and the target spacing value, and determining a second difference between the canvas height and the target spacing; Determining a width scaling ratio according to the node width and the first difference; Determining a height scaling ratio according to the node height and the second difference; A target scaling ratio is determined according to the width scaling ratio and the height scaling ratio, and the target node is scaled according to the target scaling ratio.
2. The method according to claim 1, characterized in that: The step of determining a target node in the canvas includes: Determine each node in the canvas, and number each of the nodes in turn to generate numbered nodes; Determine whether a target number input by the user is received, and if so, use a node corresponding to the target number as the target node; Otherwise, the numbered nodes are taken as the target nodes in sequence according to the numbering order.
3. The method according to claim 1, characterized in that The determining the width scaling ratio according to the node width and the first difference value comprises: Determine whether the node width is greater than the first difference, and if so, determine a first ratio of the first difference to the node width, and use the first ratio as the width scaling ratio; Otherwise, the width scaling ratio is determined to be 1.
4. The method according to claim 1, characterized in that: The determining the height scaling ratio according to the node height and the second difference includes: Determine whether the node height is greater than the second difference, and if so, determine a second ratio of the second difference to the node height, and use the second ratio as the width scaling ratio; Otherwise, the height scaling ratio is determined to be 1.
5. The method according to claim 1, characterized in that The determining the target scaling ratio according to the width scaling ratio and the height scaling ratio comprises: Determine whether the width scaling ratio is greater than the height scaling ratio, and if so, use the height scaling ratio as the target scaling ratio; Otherwise, the width scaling ratio is used as the target scaling ratio.
6. A node scaling device, characterized in that: include: A node and canvas information acquisition module, used to determine a target node in the canvas; wherein the canvas refers to a virtual plane or area used to carry various graphics and elements; the target node refers to an element in the canvas that is specially selected and needs to be specifically operated or analyzed; A node and canvas information acquisition module, including an information acquisition unit; The information acquisition unit is used to acquire the node width and node height based on the target node, and acquire the canvas width, canvas height and the position of each canvas edge; Determine the spacing value from the target node to each canvas edge position, and use the minimum spacing value among the spacing values as the target spacing value; The node width, node height and target spacing value are used as node information, and the canvas width and canvas height are used as canvas information; A width and height scaling ratio determination module, used to determine a width scaling ratio and a height scaling ratio according to the node information and the canvas information; The width and height scaling ratio determination module comprises a difference determination unit, a width scaling ratio determination unit and a height scaling ratio determination unit; The difference determination unit is used to determine a first difference between the canvas width and the target spacing value, and to determine a second difference between the canvas height and the target spacing; The width scaling ratio determining unit is used to determine the width scaling ratio according to the node width and the first difference value; The height scaling ratio determining unit is used to determine the height scaling ratio according to the node height and the second difference; The target node scaling module is used to determine a target scaling ratio according to the width scaling ratio and the height scaling ratio, and scale the target node according to the target scaling ratio.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 5.
8. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 5 when executed.
Citation Information
Patent Citations
Method and device for exporting PDF from web report and storage medium
CN111309671A