CN113435172A - Processing method, device and equipment for chart positioning and storage medium - Google Patents

Processing method, device and equipment for chart positioning and storage medium Download PDF

Info

Publication number
CN113435172A
CN113435172A CN202110792147.9A CN202110792147A CN113435172A CN 113435172 A CN113435172 A CN 113435172A CN 202110792147 A CN202110792147 A CN 202110792147A CN 113435172 A CN113435172 A CN 113435172A
Authority
CN
China
Prior art keywords
chart
positioning
target area
content
trial
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
CN202110792147.9A
Other languages
Chinese (zh)
Other versions
CN113435172B (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.)
Beijing Founder Electronics Co Ltd
Original Assignee
Beijing Founder Electronics 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 Beijing Founder Electronics Co Ltd filed Critical Beijing Founder Electronics Co Ltd
Priority to CN202110792147.9A priority Critical patent/CN113435172B/en
Publication of CN113435172A publication Critical patent/CN113435172A/en
Application granted granted Critical
Publication of CN113435172B publication Critical patent/CN113435172B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/183Tabulation, i.e. one-dimensional positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a processing method, a device, equipment and a storage medium for chart positioning, wherein in the scheme, a first target area for inserting a chart to be positioned in a current page is determined according to a positioning parameter of the chart to be positioned by responding to a chart inserting operation of a user; determining whether other contents have been typeset in the first target area; if the other contents are typeset in the first target area, determining whether the other contents can be moved to other areas except the first target area in the current page; if other contents can be moved to other areas, the chart to be positioned is inserted into the first target area, the problem that the chart cannot be correctly inserted into a proper position in the page is solved, and the accuracy of inserting the chart is improved.

Description

Processing method, device and equipment for chart positioning and storage medium
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, a device, and a storage medium for processing chart positioning.
Background
At present, when typesetting contents such as texts and diagrams, the mixed typesetting of images and texts requires that the diagrams should be typeset near the texts related to the diagrams, and the typesetting is generally processed according to the principle of firstly seeing the texts and then seeing the diagrams. In order to keep the layout of the typeset content beautiful and consistent, some books and periodicals have more detailed requirements on the position of the diagram, for example, in the column typesetting, the diagram of the whole column may need to be uniformly arranged at the bottom of the page; the person profile section may need to uniformly list the likeness at the head of the profile, etc. As the requirements of books and periodicals for typesetting contents increase, the typesetting system faces the problem that the preset insertion area of the diagram has the existing contents.
In the prior art, in order to avoid the problem that the preset insertion area of the chart has content, for example, the insertion point of the chart is in the right column of the column, and the embedding area is required to be at the bottom of the block; the insertion point of the portrait of the person is at the bottom of the bar, the posting area is required at the head of the bar, etc., often by the user manually moving the insertion point of the chart to the proper location, however, this approach easily breaks the link between the chart and the text, resulting in the chart not being properly inserted into the page in the proper position.
In summary, in the processing scheme of chart positioning in the prior art, the accuracy of chart placement is low.
Disclosure of Invention
The embodiment of the invention provides a processing method, a processing device and a storage medium for chart positioning, which are used for solving the problem that the accuracy of chart placement is low in the processing scheme of chart positioning in the prior art.
In a first aspect, an embodiment of the present invention provides a processing method for chart positioning, including:
responding to the graph inserting operation of a user, and determining a first target area for inserting a graph to be positioned in a current page according to the positioning parameters of the graph to be positioned;
determining whether other contents have been typeset in the first target area;
if the other contents are typeset in the first target area, determining whether the other contents can be moved to other areas except the first target area in the current page;
and if other contents can be moved to other areas, inserting the chart to be positioned into the first target area.
In one embodiment, the method further comprises:
and if no other contents are typeset in the first target area, inserting the chart to be positioned into the first target area.
In one embodiment, the method further comprises:
if the other contents can not be moved to other areas, determining a second target area in the next page of the current page according to the positioning parameters of the chart to be positioned;
and inserting the chart to be positioned into the second target area.
In one embodiment, the method further comprises:
and updating the embedding state of the diagram to be positioned according to the positioning condition of the diagram to be positioned, wherein the embedding state comprises an un-embedding state, a direct embedding state, a trial embedding success state or a trial embedding failure state.
In one embodiment, determining whether other content can be moved to an area other than the first target area in the current page includes:
creating a chart trial positioning task of a chart to be positioned, and storing the chart trial positioning task into a chart trial positioning task stack;
executing a chart trial positioning task based on the chart trial positioning task stack;
if the chart trial positioning task is successfully executed, determining that other contents can be moved to other areas;
and if the chart positioning task is not successfully executed, determining that other contents cannot be moved to other areas.
In one embodiment, a chart trial positioning task is performed based on a chart trial positioning task stack, comprising:
changing the running state of the current chart trial positioning task into a trial positioning state, wherein the running state of the chart trial positioning task comprises the trial positioning state;
backtracking the inserted content of the current page to obtain backtracking content, and clearing the inserted content;
inserting a chart to be positioned into a first target area;
typesetting the backtracking content in other areas except the first target area in the current page;
if all backtracking contents can be typeset in other areas, the chart trial positioning task is successfully executed.
In a second aspect, an embodiment of the present invention provides a processing apparatus for chart positioning, including:
the response module is used for responding to the graph inserting operation of a user and determining a first target area for inserting the graph to be positioned in the current page according to the positioning parameters of the graph to be positioned;
a first determining module, configured to determine whether other content has been typeset in the first target area;
the second determining module is used for determining whether other contents can be moved to other areas except the first target area in the current page if the other contents are typeset in the first target area;
and the inserting module is used for inserting the chart to be positioned into the first target area if other contents can be moved to other areas.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
a processor, a memory, an interactive interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the chart positioning processing method of the first aspect via execution of the executable instructions.
In a fourth aspect, an embodiment of the present invention provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the processing method for chart positioning according to the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program is used to implement the processing method for chart positioning according to the first aspect.
According to the processing method, the processing device, the processing equipment and the storage medium for chart positioning, provided by the embodiment of the invention, a first target area for inserting a chart to be positioned in a current page is determined according to the positioning parameters of the chart to be positioned by responding to the chart inserting operation of a user; determining whether other contents have been typeset in the first target area; if the other contents are typeset in the first target area, determining whether the other contents can be moved to other areas except the first target area in the current page; if other contents can be moved to other areas, the chart to be positioned is inserted into the first target area, the problem that the chart cannot be correctly inserted into a proper position in the page is solved, and the accuracy of inserting the chart is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of a processing method for chart positioning according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an effect of performing direct positioning processing on a chart to be positioned according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating an effect of performing trial positioning processing on a chart to be positioned according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating an effect of canceling tentative positioning processing on a to-be-positioned chart according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a chart positioning processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments based on the embodiments in the present invention, which can be made by those skilled in the art in light of the present disclosure, are within the scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the prior art provided in the background art, in the scheme that the insertion point of the chart is manually moved to a proper position by a user, at least, the technical problem that the connection between the chart and the text is easily broken, so that the chart cannot be correctly inserted into the proper position in the page exists.
In order to solve the above problems, the present invention provides a processing method for chart positioning, which determines a target area for inserting a chart to be positioned in a current page, determines whether the chart to be positioned can be directly inserted into the target area, if there are other contents already typeset in the target area, inserts the chart to be positioned into the target area after moving the other contents into other areas on the current page except the target area on the premise that the other contents can be moved, otherwise, inserts the chart to be positioned into an area in a next page of the current page, thereby achieving the purpose of correctly inserting the chart to be positioned. The terms referred to in the present invention will be explained first.
Stacking: in the invention, the stacking of chart test positioning tasks refers to the sequential arrangement of a plurality of chart test positioning tasks, and the chart test positioning tasks can be inserted and deleted only at the top end of the stack.
Backtracking: a process of preferred search, search forward according to preferred condition, in order to reach the goal. When a certain step is explored, the original selection is found to be not good or the target is not reached, and the step is returned to be reselected.
The processing method for chart positioning provided by the invention has the core idea that according to the positioning parameters of the chart to be positioned, determining a target area which can be used for inserting the chart to be positioned in the current page, if no other contents are typeset in the target area, the chart to be positioned can be directly inserted into the target area, if other contents are typeset in the target area, it is necessary to determine whether the other content can be moved, and if the other content can be moved, the other content is moved to an area other than the target area in the current page, then the chart to be positioned is inserted into the target area, if the other content can not be moved, another target area needs to be determined in the next page of the current page, and then inserting the chart to be positioned into the other target area, so that the chart to be positioned can be correctly inserted into a proper position in the page.
In a specific implementation, the processing method for chart positioning provided by the embodiment may be applied to an application scenario, in which, taking a computer device as an example, the scheme may be implemented in text editing software in the computer device, so that it is not necessary to manually adjust a chart to be positioned, the purpose of automatically completing positioning and typesetting of the chart to be positioned in the computer device is achieved, and the accuracy of positioning the chart is improved.
The processing method of the chart positioning will be described in detail below with reference to several embodiments.
Fig. 1 is a flowchart of a processing method for chart positioning according to an embodiment of the present invention, and as shown in fig. 1, the processing method for chart positioning includes the following steps:
s101: and responding to the graph inserting operation of a user, and determining a first target area for inserting the graph to be positioned in the current page according to the positioning parameters of the graph to be positioned.
In this step, the positioning parameter of the diagram to be positioned may include a specification of the diagram, and the determined first target region is at least required to enable the diagram to be positioned to be completely inserted, so that a mutually exclusive built-in region on the current page may be calculated according to the positioning parameter of the diagram to be positioned, where the mutually exclusive built-in region is also the first target region. The user can send a request for carrying out the graph inserting operation through a mouse, a keyboard, a touch screen or the like, and when the user sends the request for carrying out the graph inserting operation, the computer can determine a page into which the graph to be positioned is inserted according to the association between the graph to be positioned and the text content after responding to the request, and determine a first target area in the page.
S102: it is determined whether other contents have been laid out in the first target area.
In this step, after the first target area is determined, since the chart to be positioned needs to be completely inserted into the first target area, it is necessary to determine whether other text content or other chart content and other content have been typeset in the first target area.
In a specific implementation, if no other content is typeset in the first target region, the chart to be positioned may be directly positioned, the chart to be positioned is directly inserted into the first target region, if the chart to be positioned is successfully inserted into the first target region, the chart to be positioned is successfully positioned, at this time, the insertion state of the chart to be positioned may be updated from the non-insertion state to the direct insertion state, and a success flag is returned to the computer, indicating that the chart to be positioned has been successfully positioned.
S103: if the other contents are already typeset in the first target area, determining whether the other contents can be moved to other areas except the first target area in the current page.
In this step, if the other content has been typeset in the first target area, after a failure flag is returned to the computer, in order to insert the chart to be positioned into the first target area, it needs to be determined whether the position of the other content that has been typeset in the first target area can be adjusted, specifically, whether the other content can be moved to another area of the current page except the first target area is determined.
In a specific implementation, if other content cannot be moved to other areas except the first target area in the current page, that is, the chart to be positioned cannot be inserted into the first target area, after a failure flag is returned to the computer, a suitable second target area may be selected from the next page of the current page according to trial positioning parameters of the chart to be positioned, and then the chart to be positioned is inserted into the second target area, which indicates that the positioning of the chart to be positioned is successful, and the placement state of the chart to be positioned may be updated from the non-placement state to the direct placement state, and a success flag is returned to the computer.
As an optional implementation manner, after other contents have been typeset in the first target area, if the chart to be positioned can still be completely inserted into the first target area, and after the chart to be positioned is inserted, the association between the text content and the chart content on the current page is not destroyed, then the chart to be positioned may also be inserted into the first target area at this time.
S104: and if other contents can be moved to other areas, inserting the chart to be positioned into the first target area.
In this step, after the other content that has been typeset in the first target region is moved, the diagram to be positioned may be inserted into the first target region, which indicates that the positioning of the diagram to be positioned is successful, and the placement state of the diagram to be positioned may be updated from the un-placement state to the direct placement state, and a success flag is returned to the computer.
The above-described method of this embodiment is further described below.
In a specific implementation, when determining whether other content can be moved to other areas except for the first target area in the current page, a chart trial positioning task of a chart to be positioned may be created first, the chart trial positioning task is stored in a chart trial positioning task stack, the chart trial positioning task is executed based on the chart trial positioning task stack, if the chart trial positioning task is successfully executed, it is determined that the other content can be moved to other areas, and if the chart trial positioning task is not successfully executed, it is determined that the other content cannot be moved to other areas.
In the scheme, if other contents are already typeset in the first target area, the chart to be positioned cannot be directly positioned, trial positioning needs to be performed on the chart to be positioned, and whether other contents can be moved to other areas except the first target area in the current page is determined.
The chart trial positioning task may include the following:
the graph account (ID) represents an account of a graph to be located to be subjected to trial positioning processing.
The trial positioning processing parameters represent processing parameters of a chart to be positioned, which is to be subjected to trial positioning processing currently, and can be obtained by calculating the positioning parameters of the chart to be positioned, and the parameters comprise a backtracking starting point and a backtracking ending point. The backtracking starting point represents a typesetting starting position to be backtracked when the current page is subjected to trial positioning processing, and can be obtained by calculating positioning parameters of a chart to be positioned, wherein the backtracking starting point comprises a backtracking starting point stream position which represents a position (a few sections of words) to be backtracked in a content stream of the current page; and a backtracking start point location position indicating a location position to be backtracked on the current page (several lines in the several columns of the several page and coordinates with respect to the column layout area). The backtracking end point represents a layout ending position to be backtracked when the trial positioning processing is performed on the current page, and comprises an end point stream position, which represents the position of the layout ending point in the content stream of the current page during the trial positioning processing performed on the current page, and is generally the position (the second word) in the content stream of the page to be crossed, and can be obtained by calculating the position of the chart to be positioned in the content stream of the current page; and the end point positioning position represents the positioning position of the typesetting end point on the typesetting page in the trial positioning treatment of the current page, generally is a column position to be passed over, and can be obtained by calculating the positioning parameters of the chart to be positioned.
The operation state represents the operation state of the chart trial positioning task, comprises an initial state and represents that the operation of the chart trial positioning task is in the initial state; a trial positioning state indicating that the operation of the chart trial positioning task is in trial positioning processing; a trial positioning canceling state which indicates that the operation of the chart trial positioning task is in trial positioning canceling processing; and the termination state represents that the operation of the chart positioning task is in the termination state.
In a specific implementation, when storing the chart trial positioning task into the chart trial positioning task stack, the top task of the chart trial positioning task stack may be checked first, and if the backtracking start point of the top task is behind the backtracking start point of the newly-built task, the embedded state of the chart to be positioned recorded in the top task is updated to an un-embedded state, the running state of the top task is updated to an end state, and then the top task is popped up from the chart trial positioning task stack.
In a specific implementation, when executing a diagram trial positioning task based on a diagram trial positioning task stack, the operation state of the current diagram trial positioning task may be updated to a trial positioning state, then a layout backtracking process is performed on the inserted content of the current page according to a backtracking starting point in trial positioning processing parameters to obtain backtracking content, the inserted content of the current page is cleared, then a diagram to be positioned is inserted into a first target region, under the condition that the diagram to be positioned is successfully inserted into the first target region, the embedding state of the diagram to be positioned is updated from the un-embedding state to a trial embedding success state, and the backtracking content is typeset in other regions of the current page except the first target region to obtain typeset content, until the position of the typeset content is located behind the backtracking ending point, then whether the inserting position of the diagram to be positioned meets the positioning condition is judged, the positioning condition is used for indicating that all backtracking contents can be typeset in other areas except the first target area in the current page, a success mark is returned to the computer under the condition that the insertion position of the chart to be positioned meets the positioning condition, the chart trial positioning task is successfully executed at the moment, the embedding state of the chart to be positioned is updated from the non-embedding state to the trial embedding failure state under the condition that the chart to be positioned is unsuccessfully inserted into the first target area or the insertion position of the chart to be positioned does not meet the positioning condition, a failure state is returned to the computer, the chart trial positioning task is unsuccessfully executed at the moment, and the chart to be positioned needs to be subjected to cancel trial positioning processing at the moment.
In the scheme, when the content of the current page is cleared, the text content of which the typesetting position on the current page is behind the backtracking starting point can be selectively cleared from the current page, and/or the chart content of which the typesetting position on the current page is behind the backtracking starting point and the built-in state is not the trial built-in success state is cleared from the current page, and then the current typesetting position is set as the backtracking starting point.
In a specific implementation, when a chart to be positioned is subjected to test canceling positioning processing, firstly, the running state of a current chart test positioning task is updated to be a test canceling positioning state, then layout backtracking processing is performed on the typeset content of a current page again according to a backtracking starting point in a test positioning processing parameter to obtain backtracking content, the typeset content and a first target area of the current page are eliminated, then the backtracking content is typeset again in the current page until the typeset content exceeds a backtracking ending point, and finally, the running state of the current chart test positioning task is updated from the test canceling positioning state to an ending state, and the chart test positioning task is popped up from a chart test positioning task stack.
In the scheme, after the tentative positioning processing is cancelled on the graph to be positioned, because the graph to be positioned cannot be inserted into the first target area, in order to ensure the correlation between the text content and the graph content, a second target area can be determined in the next page of the current page according to the positioning parameters of the graph to be positioned, then the graph to be positioned is inserted into the second target area, and after the current page is typeset again, other contents to be typeset can be typeset again at the backtracking end point.
In the processing method for chart positioning provided by this embodiment, a first target area for inserting a chart to be positioned in a current page is determined according to a positioning parameter of the chart to be positioned by responding to a chart insertion operation of a user; determining whether other contents have been typeset in the first target area; if the other contents are typeset in the first target area, determining whether the other contents can be moved to other areas except the first target area in the current page; if other contents can be moved to other areas, the chart to be positioned is inserted into the first target area, the problem that the chart cannot be correctly inserted into a proper position in the page is solved, and the accuracy of inserting the chart is improved.
Fig. 2 is a schematic diagram illustrating an effect of performing direct positioning processing on a diagram to be positioned according to an embodiment of the present invention, as shown in fig. 2, a typesetting manner is used as a column-divided typesetting, a diagram to be positioned is a column image, a first target region is an exclusive embedding region at the bottom of a text content block, where (i) in fig. 2 represents a column image. The specific implementation process of directly positioning the chart to be positioned is as follows:
(1) the insertion point of the picture in the column is positioned at the tail of the third section, and when the system finishes typesetting the text content of the picture in the column where the insertion point is positioned, the system directly positions the picture in the column: firstly, calculating a mutual exclusion embedding area, then judging that no other typeset content exists in the mutual exclusion embedding area, as shown in a partial diagram A in figure 2, and finally inserting the banner picture into the mutual exclusion embedding area, as shown in a partial diagram B in figure 2, wherein at the moment, the banner picture is successfully positioned directly;
(2) the system may continue to perform the typesetting of the following content, as shown in the partial diagram C in fig. 2, which is also the layout effect diagram for successfully performing the direct positioning processing on the diagram to be positioned.
Fig. 3 is a schematic diagram illustrating an effect of performing trial positioning processing on a diagram to be positioned according to an embodiment of the present invention, as shown in fig. 3, the diagram to be positioned is still typeset in columns, the diagram to be positioned is a column image, and a first target region is an example of a mutually exclusive embedding region at the bottom of a text content block, where (i) in fig. 3 represents a column image. The specific implementation process of trial positioning processing on the chart to be positioned is as follows:
(1) the insertion point of the banner picture is positioned at the tail of the seventh section, and when the system finishes typesetting the text content of the banner picture insertion point, the system firstly carries out direct positioning processing on the banner picture: calculating a mutual exclusion embedding area, and then judging that other contents are typeset in the mutual exclusion embedding area, as shown in a partial diagram A in figure 3, at this time, the direct positioning processing on the banner picture fails;
(2) the system performs trial positioning processing: firstly, backtracking processing is carried out on the layout content of the current page to obtain backtracking content, then the layout content on the current page is cleared, as shown in a partial graph B in figure 3, then a banner picture is inserted into a mutual exclusion embedding area, as shown in a partial graph C in figure 3, the backtracking content is typeset in an area except the mutual exclusion embedding area in the current page, until the backtracking content crosses the stream position of the insertion point of the banner picture, at the moment, the layout effect of the current page is judged to meet the positioning condition, that is, all the backtracking content can be typeset in the area except the mutual exclusion embedding area in the current page, as shown in a partial graph D in figure 3, at the moment, the trial positioning processing on the banner picture is successful;
(3) the system may continue to typeset the content later, as shown in a partial graph E in fig. 3, which is the layout effect graph in which the trial positioning process is successfully performed on the to-be-positioned graph.
Fig. 4 is a schematic diagram illustrating an effect of canceling trial positioning processing on a diagram to be positioned according to an embodiment of the present invention, as shown in fig. 4, the diagram to be positioned is still typeset in columns, the diagram to be positioned is a column image, and a first target region is an example of a mutually exclusive embedding region at the bottom of a text content block, where (i) in fig. 4 represents a column image. The specific implementation process of canceling trial positioning processing on the chart to be positioned is as follows:
(1) the insertion point of the picture in the column is positioned at the tail of the eighth segment, and when the system finishes typesetting the text content where the insertion point of the picture in the column, the system firstly carries out direct positioning processing on the picture in the column: calculating a mutual exclusion embedding area, and then judging that other contents are typeset in the mutual exclusion embedding area, as shown in a partial diagram A in figure 4, at this time, the direct positioning processing on the banner picture fails;
(2) the system performs trial positioning processing: firstly, backtracking processing is carried out on the layout content of the current page, the layout content on the current page is removed after the backtracking content is obtained, as shown in a partial graph B in figure 4, then a banner picture is inserted into a mutual exclusion embedding area, as shown in a partial graph C in figure 4, the backtracking content is typeset in an area except the mutual exclusion embedding area in the current page until the backtracking content crosses the last column of a text content block, and as the backtracking content is not completely typeset in the area except the mutual exclusion embedding area in the current page, the layout effect of the current page is judged to be not satisfied with a positioning condition at the moment, as shown in a partial graph D in figure 4, the trial positioning processing on the banner picture is failed;
(3) the system carries out trial cancellation positioning processing on the picture of the column: firstly, performing backtracking processing on the layout content of the page in the partial graph D again to obtain backtracking content, then removing the layout content and the column picture on the current page again as shown in a partial graph E in FIG. 4, and then typesetting the backtracking content on the current page again until the position of an insertion point of the column picture is crossed, as shown in a partial graph F in FIG. 4, at this time, the system completes the test positioning canceling processing on the column picture;
(4) because the current page cannot be inserted with the banner picture, the system can place the banner picture into the next page of the current page for typesetting, and the remaining area in the current page can continue to typeset new other content, as shown in a partial graph G in fig. 4, the partial graph G is also a layout effect graph for canceling trial positioning processing on the chart to be positioned.
According to the processing method for chart positioning, when the chart to be positioned is positioned, the chart to be positioned is directly positioned, the trial positioning is performed and the trial positioning is cancelled in sequence, so that the chart to be positioned under certain specific conditions can be quickly, conveniently and correctly positioned, namely, the relative positions of text content and chart beautifying are kept reasonable, the relevance between the text content and the chart content is also ensured, the problem that the chart cannot be correctly inserted into the proper position in the page when a user manually adjusts the position of the chart to be positioned is avoided, the workload of manual adjustment is reduced, and the correct rate of chart insertion is greatly improved.
Fig. 5 is a schematic structural diagram of a chart positioning processing device according to an embodiment of the present invention, and as shown in fig. 5, the chart positioning processing device 50 includes:
the response module 51 is configured to determine, in response to a diagram insertion operation of a user, a first target area in which a diagram to be positioned is inserted in a current page according to a positioning parameter of the diagram to be positioned;
a first determining module 52, configured to determine whether other content has been typeset in the first target area;
a second determining module 53, configured to determine whether the other content may be moved to another area in the current page other than the first target area if the other content has been typeset in the first target area;
and an inserting module 54, configured to insert the chart to be located into the first target area if other content can be moved to other areas.
Optionally, the processing device 50 for chart positioning further includes: and the first processing module is used for inserting the chart to be positioned into the first target area if other contents are not typeset in the first target area.
Optionally, the processing device 50 for chart positioning further includes: the third determining module is used for determining a second target area in the next page of the current page according to the positioning parameters of the chart to be positioned if other contents can not be moved to other areas; and the second processing module is used for inserting the chart to be positioned into the second target area.
Optionally, the processing device 50 for chart positioning further includes: and the updating module is used for updating the embedding state of the chart to be positioned according to the positioning condition of the chart to be positioned.
Optionally, the second determining module 53 includes: the system comprises a creating unit, a chart trial positioning task processing unit and a chart trial positioning task processing unit, wherein the creating unit is used for creating a chart trial positioning task of a chart to be positioned and storing the chart trial positioning task into a chart trial positioning task stack; an execution unit configured to execute the chart trial positioning task based on the chart trial positioning task stack; the first determining unit is used for determining that other contents can be moved to other areas if the chart trial positioning task is successfully executed; and the second determining unit is used for determining that other contents cannot be moved to other areas if the chart trial positioning task is not successfully executed.
Optionally, the executing unit is further configured to change an operating state of the current chart trial positioning task to a trial positioning state, where the operating state of the chart trial positioning task includes the trial positioning state; backtracking the inserted content of the current page to obtain backtracking content, and clearing the inserted content; inserting a chart to be positioned into a first target area; typesetting the backtracking content in other areas except the first target area in the current page; if all backtracking contents can be typeset in other areas, the chart trial positioning task is successfully executed.
The processing apparatus for chart positioning provided in this embodiment is used to execute the technical solutions in the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 6, the electronic device 600 includes:
a processor 611, a memory 612, and an interaction interface 613;
the memory 612 is used for storing executable instructions of the processor 611;
the processor 611 is configured to execute the technical solution of the processing method for chart positioning through executing the executable instructions.
Optionally, the memory 612 may be separate or integrated with the processor 611.
Optionally, when the memory 612 is a separate device from the processor 611, the electronic device 600 may further include:
and the bus is used for connecting the devices.
The electronic device is configured to execute the technical solution provided by the foregoing method embodiment, and the implementation principle and technical effect of the electronic device are similar to those in the foregoing method embodiment, and are not described herein again.
The embodiment of the invention also provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the processing method for chart positioning provided by the foregoing method embodiment is implemented.
The embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program is used to implement the processing method for chart positioning provided by the foregoing method embodiment.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for processing chart positioning, comprising:
responding to a graph inserting operation of a user, and determining a first target area for inserting a graph to be positioned in a current page according to a positioning parameter of the graph to be positioned;
determining whether other contents have been typeset in the first target area;
if the other contents are typeset in the first target area, determining whether the other contents can be moved to other areas except the first target area in the current page;
and if the other content can be moved to the other area, inserting the chart to be positioned into the first target area.
2. The method of claim 1, further comprising:
and if no other contents are typeset in the first target area, inserting the chart to be positioned into the first target area.
3. The method of claim 1, further comprising:
if the other contents can not be moved to the other areas, determining a second target area in the next page of the current page according to the positioning parameters of the chart to be positioned;
inserting the chart to be positioned into the second target area.
4. The method according to any one of claims 1 to 3, further comprising:
and updating the embedding state of the chart to be positioned according to the positioning condition of the chart to be positioned, wherein the embedding state comprises an un-embedding state, a direct embedding state, a trial embedding success state or a trial embedding failure state.
5. The method of claim 3, wherein the determining whether the other content can be moved to an area other than the first target area in the current page comprises:
creating a chart trial positioning task of the chart to be positioned, and storing the chart trial positioning task into a chart trial positioning task stack;
executing the chart trial positioning task based on the chart trial positioning task stack;
if the chart trial positioning task is successfully executed, determining that the other content can be moved to the other area;
and if the chart trial positioning task is not successfully executed, determining that the other content cannot be moved to the other area.
6. The method of claim 5, wherein performing the chart tentative locating task based on the chart tentative locating task stack comprises:
changing the current running state of the chart trial positioning task into a trial positioning state, wherein the running state of the chart trial positioning task comprises the trial positioning state;
backtracking the inserted content of the current page to obtain backtracking content, and clearing the inserted content;
inserting the chart to be positioned into the first target area;
typesetting the backtracking content in other areas except the first target area in the current page;
and if all the backtracking contents can be typeset in the other areas, the chart trial positioning task is successfully executed.
7. A chart positioning processing apparatus, comprising:
the response module is used for responding to the graph inserting operation of a user and determining a first target area for inserting the graph to be positioned in the current page according to the positioning parameters of the graph to be positioned;
a first determining module, configured to determine whether other content has been typeset in the first target area;
a second determining module, configured to determine whether the other content may be moved to another area of the current page other than the first target area if the other content has been typeset in the first target area;
an inserting module, configured to insert the chart to be positioned into the first target area if the other content can be moved to the other area.
8. An electronic device, comprising:
a processor, a memory, an interactive interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the chart positioning processing method of any of claims 1 to 6 via execution of the executable instructions.
9. A readable storage medium on which a computer program is stored, which, when being executed by a processor, carries out the method of processing chart positioning according to any one of claims 1 to 6.
10. A computer program product, characterized in that it comprises a computer program for implementing the processing method of chart positioning of any of claims 1 to 6 when executed by a processor.
CN202110792147.9A 2021-07-13 2021-07-13 Processing method, device, equipment and storage medium for chart positioning Active CN113435172B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110792147.9A CN113435172B (en) 2021-07-13 2021-07-13 Processing method, device, equipment and storage medium for chart positioning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110792147.9A CN113435172B (en) 2021-07-13 2021-07-13 Processing method, device, equipment and storage medium for chart positioning

Publications (2)

Publication Number Publication Date
CN113435172A true CN113435172A (en) 2021-09-24
CN113435172B CN113435172B (en) 2024-04-02

Family

ID=77760251

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110792147.9A Active CN113435172B (en) 2021-07-13 2021-07-13 Processing method, device, equipment and storage medium for chart positioning

Country Status (1)

Country Link
CN (1) CN113435172B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180336711A1 (en) * 2017-05-22 2018-11-22 SharesPost, Inc. Dynamic waterfall charts
CN111581939A (en) * 2020-05-11 2020-08-25 广东小天才科技有限公司 Method and device for typesetting questions, electronic equipment and storage medium
CN111611037A (en) * 2020-05-09 2020-09-01 掌阅科技股份有限公司 View object processing method for electronic book, electronic device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180336711A1 (en) * 2017-05-22 2018-11-22 SharesPost, Inc. Dynamic waterfall charts
CN111611037A (en) * 2020-05-09 2020-09-01 掌阅科技股份有限公司 View object processing method for electronic book, electronic device and storage medium
CN111581939A (en) * 2020-05-11 2020-08-25 广东小天才科技有限公司 Method and device for typesetting questions, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113435172B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
US8572475B2 (en) Display control of page data by annotation selection
JP5063564B2 (en) Information processing apparatus, processing method thereof, and program
JPH11203491A (en) Image processor and its method
US8793572B2 (en) Positioning graphical objects within previously formatted text
US10762377B2 (en) Floating form processing based on topological structures of documents
US10073820B2 (en) Systems, methods, and interfaces for pagination and display on an access device
CN103176979B (en) The online duplication method of format file content, equipment and system
CN113435172A (en) Processing method, device and equipment for chart positioning and storage medium
US6819806B1 (en) Document processing apparatus and storage medium
JP4296210B2 (en) Two-dimensional code image display device and two-dimensional code image display program
CN103514148A (en) Training data editing system and program
JP4603658B2 (en) Image processing apparatus, image processing method, and storage medium
JP3711210B2 (en) Document editing system and program recording medium
US10275127B2 (en) Client apparatus, information processing system, information processing method, and non-transitory computer readable medium
JP4087270B2 (en) Data processing apparatus, data processing method, data processing program, and recording medium
JP2009181528A (en) Operation cancellation system, method, and program
JPH11250037A (en) Content editing device and recording medium
CN116385106A (en) Intelligent order ordering method after order point delay
JP2005043995A (en) Information processor, character recognizing program, and recording medium
JP4868990B2 (en) Closed loop automatic recognition device and closed loop automatic recognition method
US7949951B1 (en) Selectively limiting paragraph recomposition
JP4256842B2 (en) Document layout method, apparatus, and program
AU745125B2 (en) Flexible typesetting
CN116468515A (en) Intelligent order ordering method for order point location order
US8120788B2 (en) Image arranging device and image arranging program storage medium

Legal Events

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