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

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

Info

Publication number
CN113435172B
CN113435172B CN202110792147.9A CN202110792147A CN113435172B CN 113435172 B CN113435172 B CN 113435172B CN 202110792147 A CN202110792147 A CN 202110792147A CN 113435172 B CN113435172 B CN 113435172B
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.)
Active
Application number
CN202110792147.9A
Other languages
Chinese (zh)
Other versions
CN113435172A (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

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 positioning parameters of the chart to be positioned by responding to chart insertion operation of a user; determining whether other content has been typeset in the first target area; if 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 to-be-positioned chart is inserted into the first target area, so that the problem that the chart cannot be correctly inserted into the proper position in the page is solved, and the accuracy of inserting the chart is improved.

Description

Processing method, device, equipment and storage medium for chart positioning
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 of contents such as texts, charts and the like is carried out, charts are required to be typeset near the texts related to the charts in a mixed mode, and the charts are generally processed according to the principle that the texts are seen first and then the charts are seen. In order to keep the layout of typeset contents beautiful and consistent, some books and periodicals have finer requirements on the position of charts, for example, in column typesetting, charts in columns may need to be uniformly arranged at the bottom of pages; the character profile section may need to uniformly rank the portraits in the header of the profile, etc. As books and periodicals have more demands for typeset contents, typesetting systems face the problem that contents exist in predetermined insertion areas of charts.
In the prior art, in order to avoid the problem that the predetermined insertion area of the chart has content, for example, the insertion point of the chart is at the right column of the column, and the placement 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 placement area is required at the head of the bar, etc., and the insertion point of the chart is often manually moved to a proper position by the user, however, this method easily breaks the connection between the chart and the text, and thus the chart cannot be properly inserted into a proper position in the page.
In summary, the processing scheme of chart positioning in the prior art has low accuracy of chart placement.
Disclosure of Invention
The embodiment of the invention provides a processing method, a device, equipment and a storage medium for chart positioning, which are used for solving the problem of lower accuracy of chart placement in a chart positioning processing scheme in the prior art.
In a first aspect, an embodiment of the present invention provides a method for processing chart positioning, including:
responding to the chart insertion operation of a user, and determining a first target area for inserting the chart to be positioned in the current page according to the positioning parameters of the chart to be positioned;
determining whether other content has been typeset in the first target area;
if 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 the other content can be moved to other areas, the to-be-positioned bitmap is inserted into the first target area.
In one embodiment, the method further comprises:
and if other contents are not typeset in the first target area, inserting the to-be-positioned bitmap into the first target area.
In one embodiment, the method further comprises:
if other contents can not move 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 to-be-positioned bitmap into the second target area.
In one embodiment, the method further comprises:
updating the placement state of the chart to be positioned according to the positioning condition of the chart to be positioned, wherein the placement state comprises an undeposited state, a direct placement state, a successful test placement state or a failed test placement state.
In one embodiment, determining whether other content can be moved to other areas of the current page than the first target area includes:
creating a chart test positioning task of a chart to be positioned, and storing the chart test positioning task into a chart test 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;
if the chart trial positioning task is not successfully executed, determining that other contents can not be moved to other areas.
In one embodiment, performing a diagramming localization task based on a diagramming localization task stack includes:
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 to-be-positioned bitmap into a first target area;
typesetting the retrospective content in other areas except the first target area in the current page;
if other areas can typeset all the backtracking contents, 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 chart insertion operation of the user, and determining a first target area for inserting the chart to be positioned in the current page according to the positioning parameters of the chart to be positioned;
the first determining module is used for determining whether other contents are 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 to-be-positioned bitmap 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:
the processor, the memory, the interactive interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the method of chart positioning 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 having stored thereon a computer program, which when executed by a processor, implements the method for processing chart positioning according to the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, where the computer program is executed by a processor to implement the method for positioning a chart according to the first aspect.
According to the method, the device, the equipment and the storage medium for processing chart positioning, provided by the embodiment of the invention, a first target area for inserting the chart to be positioned in a current page is determined according to positioning parameters of the chart to be positioned by responding to the chart insertion operation of a user; determining whether other content has been typeset in the first target area; if 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 to-be-positioned chart is inserted into the first target area, so that the problem that the chart cannot be correctly inserted into the 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 of the prior art, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it will be obvious that the drawings in the following description are some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flowchart of a chart positioning processing method provided in an embodiment of the present invention;
fig. 2 is a schematic diagram of 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 of the effect of performing trial positioning on a chart to be positioned according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the effect of canceling trial positioning of a chart to be positioned according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a chart positioning processing device 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
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which are made by a person skilled in the art based on the embodiments of the invention in light of the present disclosure, are intended to be within the scope of the invention.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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 a scheme that a user manually moves an insertion point of a chart to a proper position, at least there is a technical problem that a connection between the chart and a text is easily broken, so that the chart cannot be correctly inserted to the proper position in a page.
In view of the above problems, the present invention provides a method for processing chart positioning, which determines a target area for inserting a chart to be positioned through determining whether the chart to be positioned can be directly inserted into the target area, if so, inserts the chart to be positioned into the target area after moving the other contents to other areas except the target area on the current page 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 involved in the present invention will be explained first.
Stacking: in the invention, a chart test positioning task stack refers to a data structure with data items arranged in sequence, wherein a plurality of chart test positioning tasks are arranged in sequence, and the chart test positioning tasks can only be inserted and deleted at the top of the stack.
Backtracking: a process of searching for preference, searching forward according to preference conditions to achieve the aim. But when a certain step is explored, the original selection is found to be not optimal or the target is not reached, and the process returns to one step for reselection.
The method for processing chart positioning provided by the invention has the core ideas that a target area which can be used for inserting the chart to be positioned is determined in the current page according to the positioning parameters of the chart to be positioned, if other contents are not 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, whether the other contents can be moved is required to be judged, if the other contents can be moved, the other contents are moved to other areas except the target area in the current page, then the chart to be positioned is inserted into the target area, if the other contents cannot be moved, another target area needs to be determined in the next page of the current page, and then the chart to be positioned is inserted 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 method for processing chart positioning provided by the embodiment can be applied to an application scene, in the scene, by taking a computer device as an example, the scheme can be implemented in text editing software in the computer device, so that the chart to be positioned does not need to be manually adjusted, the purpose of automatically completing positioning 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 is described in detail below through several embodiments.
Fig. 1 is a flowchart of a chart positioning processing method provided in an embodiment of the present invention, where, as shown in fig. 1, the chart positioning processing method includes the following steps:
s101: and responding to the chart insertion operation of the user, and determining a first target area for inserting the chart to be positioned in the current page according to the positioning parameters of the chart to be positioned.
In this step, the positioning parameters of the chart to be positioned may include the specification of the chart, and the determined first target area at least needs to enable the chart to be positioned to be completely inserted, so that the mutual exclusion placement area on the current page, that is, the first target area, may be calculated according to the positioning parameters of the chart to be positioned. When the user sends a request for performing the chart insertion operation through a mouse, a keyboard or a touch screen, the computer can determine a page into which the chart to be positioned is to be inserted according to the association between the chart to be positioned and text content after responding to the request, and determine a first target area in the page.
S102: it is determined whether other content has been typeset in the first target area.
In this step, after the first target area is determined, since the to-be-positioned bitmap is required to be completely inserted into the first target area, it is required to determine whether other text contents or other contents such as other chart contents have been typeset in the first target area.
In a specific implementation, if other contents are not typeset in the first target area, direct positioning processing can be performed on the chart to be positioned, the chart to be positioned is directly inserted into the first target area, if the chart to be positioned is successfully inserted into the first target area, positioning of the chart to be positioned is successful, at this time, the placement state of the chart to be positioned can be updated from the undeplacement state to the direct placement state, and a success mark is returned to the computer, so that the chart to be positioned is successfully positioned.
S103: if 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.
In this step, if other contents are typeset in the first target area, after a failure flag is returned to the computer, in order to insert the to-be-positioned table into the first target area, it is required to determine whether the placement position of the other contents typeset in the first target area can be adjusted, specifically, whether the other contents can be moved to other areas except the first target area in the current page.
In a specific implementation, if other contents cannot be moved to other areas except the first target area in the current page, that is, the to-be-positioned chart cannot be inserted into the first target area, after a failure flag is returned to the computer, a suitable second target area can be selected in the next page of the current page according to the test positioning parameters of the to-be-positioned chart, then the to-be-positioned chart is inserted into the second target area, at this time, the success of positioning the to-be-positioned chart is indicated, the placement state of the to-be-positioned chart can be updated from the non-placement state to the direct placement state, and a success flag is returned to the computer.
As an alternative implementation manner, after other contents have been typeset in the first target area, if the to-be-positioned bitmap can still be completely inserted into the first target area, and after the to-be-positioned chart is inserted, the relevance between the text content and the chart content on the current page is not destroyed, then the to-be-positioned bitmap can also be inserted into the first target area.
S104: if the other content can be moved to other areas, the to-be-positioned bitmap is inserted into the first target area.
In this step, other contents are typeset in the first target area, and the other contents can be moved to other areas except the first target area in the current page, then after the other typeset contents in the first target area are moved, the to-be-positioned bitmap can be inserted into the first target area, at this time, the successful positioning of the to-be-positioned chart is illustrated, the placement state of the to-be-positioned chart can be updated from the undeposited 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 the first target area in the current page, a chart test positioning task of a chart to be positioned can be created first, the chart test positioning task is stored in a chart test positioning task stack, then the chart test positioning task is executed based on the chart test positioning task stack, if the chart test positioning task is executed successfully, it is determined that other content can be moved to other areas, and if the chart test positioning task is executed unsuccessfully, it is determined that other content cannot be moved to other areas.
In the scheme, if other contents are typeset in the first target area, direct positioning processing cannot be performed on the chart to be positioned, trial positioning processing is 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:
a chart account (Identity document, abbreviated as ID) represents an account of a chart to be positioned, which is currently subjected to trial positioning processing.
The test positioning processing parameters represent the processing parameters of the chart to be positioned, which are to be subjected to test positioning processing at present, and can be obtained by calculating the positioning parameters of the chart to be positioned, wherein 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 calculated by 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 section of a word) to be backtracked in a content stream of the current page; and a backtracking start point positioning position indicating a positioning position (which page is the same as the page and which column is the same as the column typesetting region) to backtrack to the current page. The backtracking ending point represents the typesetting ending position to be backtracked when the current page performs trial positioning processing, and comprises an ending point stream position, wherein the position of the typesetting ending point in the content stream of the current page in the trial positioning processing of the current page is generally the position (the number of the page content stream to be crossed) in the content stream of the current page, and can be obtained by calculating the position of the chart to be positioned in the content stream of the current page; and the positioning position of the ending point represents the positioning position of the typesetting ending point on the typesetting page in the trial positioning processing of the current page, and the positioning position is generally a column position to be crossed and can be obtained through calculation of positioning parameters of the chart to be positioned.
The running state represents the running state of the chart test positioning task, comprises an initial state and represents the running of the chart test positioning task in the initial state; the test positioning state indicates that the operation of the chart test positioning task is in test positioning processing; canceling the trial positioning state, which means that the running of the chart trial positioning task is in the process of canceling the trial positioning; and the termination state is used for indicating that the running of the chart trial positioning task is in the termination state.
In one implementation, when the chart test positioning task is stored in the chart test positioning task stack, the top task of the chart test positioning task stack can be checked first, if the backtracking starting point of the top task is after the backtracking starting point of the new task, the put-in state of the chart to be positioned recorded in the top task is updated to be the un-put-in state, the running state of the top task is updated to be the termination state, and then the top task is popped out from the chart test positioning task stack.
In a specific implementation, when a chart trial positioning task is executed based on a chart trial positioning task stack, the running state of the current chart trial positioning task can be updated to a trial positioning state firstly, then layout backtracking processing is executed on inserted contents of a current page according to a backtracking starting point in trial positioning processing parameters to obtain backtracking contents, the inserted contents of the current page are removed, then a bitmap to be positioned is inserted into a first target area, under the condition that the bitmap to be positioned is successfully inserted into the first target area, the placed state of the chart to be positioned is updated from the undeposited state to be a trial positioning successful state, and the backtracking contents are subjected to typesetting in other areas except the first target area in the current page until the position of the typesetting contents is located behind the position of the backtracking ending point, then whether the inserted position of the chart to be positioned meets positioning conditions is judged, the positioning conditions are used for indicating that the inserted positions of the backtracking contents which can be typeset in other areas except the first target area in the current page, under the condition that the inserted positions of the chart to be positioned meet positioning conditions, a position of the chart to be positioned is successfully inserted into the target area, and the position of the chart to be positioned is not successfully positioned is calculated, at the time, the condition that the position of the graph to be successfully positioned is not placed is required to be successfully inserted into the target area, and the graph to be successfully positioned is not positioned, and the position is not successfully positioned, and the position is calculated, and the position is failed to be successfully positioned.
In this scheme, when the content of the current page is cleared, text content of the typesetting position on the current page after the backtracking start point may be selectively cleared from the current page, and/or chart content of the typesetting position on the current page after the backtracking start point and in which the put state is not the trial put-successful state may be cleared from the current page, and then the current typesetting position is set as the backtracking start point.
In a specific implementation, when canceling test positioning processing is performed on a chart to be positioned, firstly updating the running state of a current chart test positioning task into a canceling test positioning state, then re-executing layout backtracking processing on typeset contents of a current page according to a backtracking starting point in test positioning processing parameters to obtain backtracking contents, clearing the typeset contents and a first target area of the current page, then typesetting the backtracking contents in the current page again until the typeset contents cross a backtracking ending point, finally updating the running state of the current chart test positioning task from the canceling test positioning state into a termination state, and popping the chart test positioning task from a chart test positioning task stack.
In the scheme, after canceling trial positioning processing is performed on the chart to be positioned, since the chart to be positioned cannot be inserted into the first target area, in order to ensure the relevance between text content and chart content, a second target area can be determined in the next page of the current page according to the positioning parameters of the chart to be positioned, then the chart to be positioned is inserted into the second target area, and after the current page is subjected to typesetting again, other contents needing typesetting can be typeset again at the position of the backtracking ending point.
According to the chart positioning processing method provided by the embodiment, a first target area for inserting the chart to be positioned in the current page is determined according to positioning parameters of the chart to be positioned by responding to the chart inserting operation of a user; determining whether other content has been typeset in the first target area; if 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 to-be-positioned chart is inserted into the first target area, so that the problem that the chart cannot be correctly inserted into the proper position in the page is solved, and the accuracy of inserting the chart is improved.
Fig. 2 is a schematic diagram of an effect of performing direct positioning processing on a chart to be positioned according to an embodiment of the present invention, where, as shown in fig. 2, a typesetting mode is a column typesetting, the chart to be positioned is a column picture, and a first target area is a mutually exclusive placement area at the bottom of a text content block, where (1) in fig. 2 represents a column picture. The specific implementation process of the direct positioning treatment of the chart to be positioned is as follows:
(1) The insertion point of the through-fence picture is positioned at the tail part of the third section, and the system performs direct positioning processing on the through-fence picture when completing typesetting of the text content where the insertion point of the through-fence picture is positioned: firstly, calculating a mutual exclusion placement area, then judging that other contents which are typeset in the mutual exclusion placement area are not available, as shown in a division diagram A in FIG. 2, and finally inserting a passrail picture into the mutual exclusion placement area, as shown in a division diagram B in FIG. 2, wherein at the moment, the direct positioning processing of the passrail picture is successful;
(2) The system can continue typesetting the following contents, as shown in the diagram C in fig. 2, that is, the layout effect diagram of the direct positioning process successfully performed on the diagram to be positioned.
Fig. 3 is a schematic diagram of an effect of performing trial positioning processing on a chart to be positioned according to an embodiment of the present invention, where, as shown in fig. 3, the chart to be positioned is still typeset in a column manner, and the chart to be positioned is a column picture, and the first target area is a mutually exclusive placement area at the bottom of a text content block, where (1) in fig. 3 represents a column picture. The specific implementation process of the trial positioning processing of the chart to be positioned is as follows:
(1) The insertion point of the through-fence picture is positioned at the tail part of the seventh section, and when the system finishes typesetting the text content where the insertion point of the through-fence picture is positioned, the system firstly performs direct positioning processing on the through-fence picture: calculating a mutual exclusion imbedding area, and judging that other contents are typeset in the mutual exclusion imbedding area, wherein the direct positioning processing of the through-column picture fails at the moment as shown in a division A in FIG. 3;
(2) The system performs trial positioning processing: firstly, backtracking the layout content of a current page to obtain backtracking content, then clearing the layout content on the current page, as shown in a partition diagram B in FIG. 3, inserting a full-column picture into a mutual exclusion placement area, as shown in a partition diagram C in FIG. 3, typesetting the backtracking content in an area except the mutual exclusion placement area in the current page until the backtracking content passes through the stream position of the insertion point of the full-column picture, and judging that the layout effect of the current page meets the positioning condition at the moment, namely, typesetting all the backtracking content in the area except the mutual exclusion placement area in the current page, as shown in a partition diagram D in FIG. 3, and performing trial positioning processing on the full-column picture at the moment to be successful;
(3) The system can continue typesetting the following contents, as shown in a diagram E in fig. 3, that is, a layout effect diagram in which the diagram to be positioned is successfully subjected to trial positioning processing.
Fig. 4 is a schematic diagram of an effect of canceling trial positioning processing on a chart to be positioned according to an embodiment of the present invention, as shown in fig. 4, the chart to be positioned is still typeset in columns in a typesetting manner, the chart to be positioned is a through-column picture, and the first target area is a mutually exclusive placement area at the bottom of a text content block, where (1) in fig. 4 represents a through-column picture. The specific implementation process of canceling trial positioning processing on the chart to be positioned is as follows:
(1) The insertion point of the through-fence picture is positioned at the tail part of the eighth section, and when the system finishes typesetting the text content where the insertion point of the through-fence picture is positioned, the system firstly performs direct positioning processing on the through-fence picture: calculating a mutual exclusion imbedding area, and judging that other contents are typeset in the mutual exclusion imbedding area, wherein the direct positioning processing of the through-column picture fails at the moment as shown in a division A in FIG. 4;
(2) The system performs trial positioning processing: firstly, backtracking the layout content of a current page to obtain backtracking content, then clearing the layout content on the current page, as shown in a partition diagram B in FIG. 4, inserting a full-column picture into a mutual exclusion placement area, as shown in a partition diagram C in FIG. 4, typesetting the backtracking content in an area except the mutual exclusion placement area in the current page until the backtracking content passes through the last column of a text content block, and judging that the layout effect of the current page does not meet a positioning condition at the moment because the backtracking content is not completely typeset in the area except the mutual exclusion placement area in the current page, as shown in a partition diagram D in FIG. 4, and indicating that trial positioning processing of the full-column picture fails;
(3) The system carries out cancel test positioning processing on the passrail picture: firstly, carrying out backtracking processing on the layout content of the page in the picture division D again to obtain backtracking content, then clearing the layout content and the through-column picture on the current page again, as shown in a picture division E in fig. 4, and typesetting the backtracking content on the current page again until the backtracking content passes over the stream position of the insertion point of the through-column picture, as shown in a picture division F in fig. 4, wherein the system finishes the cancel trial positioning processing of the through-column picture;
(4) Because the current page cannot insert the through-column picture, the system can put the through-column picture into the next page of the current page for typesetting, and the rest area in the current page can continue typesetting new other contents, as shown in a diagram G in FIG. 4, namely, a layout effect diagram for canceling trial positioning processing of the diagram to be positioned.
According to the chart positioning processing method, when the chart to be positioned is subjected to positioning processing, the chart to be positioned is subjected to direct positioning processing, trial positioning processing and trial positioning canceling processing in sequence, the chart to be positioned under certain specific conditions can be positioned quickly, conveniently and correctly, namely, the relative positions of text content and chart cosmetology are kept reasonable, the relevance between the text content and the chart content is ensured, the problem that the chart cannot be inserted into the proper position in the page correctly due to the fact that a user manually adjusts the position of the chart to be positioned is avoided, and the accuracy of inserting the chart is greatly improved while the workload of manual adjustment is reduced.
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 chart insertion operation by a user, a first target area for inserting the chart to be positioned in the current page according to a positioning parameter of the chart to be positioned;
a first determining module 52, configured to determine whether other content is typeset in the first target area;
a second determining module 53, configured to determine whether other content can be moved to other areas except the first target area in the current page if other content is typeset in the first target area;
the inserting module 54 is configured to insert the to-be-located bitmap 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 bitmap 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 cannot be moved to other areas; and the second processing module is used for inserting the to-be-positioned table into the second target area.
Optionally, the processing device 50 for chart positioning further includes: and the updating module is used for updating the placement 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 creating unit is used for 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; the execution unit is used for executing 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 can not be moved to other areas if the test positioning task is not successfully executed.
Optionally, the execution unit is further configured to change an operation state of the current chart trial positioning task to a trial positioning state, where the operation 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 to-be-positioned bitmap into a first target area; typesetting the retrospective content in other areas except the first target area in the current page; if other areas can typeset all the backtracking contents, the chart trial positioning task is successfully executed.
The processing device for chart positioning provided in this embodiment is configured to execute the technical solution in the foregoing method embodiment, and its implementation principle and technical effects are similar and 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;
wherein the processor 611 is configured to execute the technical solution of the processing method of chart positioning described above via execution of the executable instructions.
Alternatively, the memory 612 may be separate or integrated with the processor 611.
Optionally, when the memory 612 is a device separate from the processor 611, the electronic device 600 may further include:
and a bus for connecting the devices.
The implementation principle and technical effects of the technical solution provided by the foregoing method embodiment are similar to those of the foregoing method embodiment, and are not repeated herein.
The embodiment of the invention also provides a readable storage medium, on which a computer program is stored, which when executed by a processor, implements the chart positioning processing method provided by the foregoing method embodiment.
The embodiment of the invention also provides a computer program product, which comprises a computer program, and the computer program is used for realizing the processing method of chart positioning provided by the embodiment of the method when being executed by a processor.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features can be replaced equivalently; such modifications and substitutions do not depart from the spirit of the invention.

Claims (8)

1. A method for processing chart positioning, comprising:
responding to the chart insertion operation of a user, and determining a first target area for inserting the chart to be positioned in the current page according to the positioning parameters of the chart to be positioned;
determining whether other content is typeset in the first target area;
if 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 the other content can be moved to the other area, inserting the to-be-positioned bitmap into the first target area;
the determining whether the other content can be moved to the other area except the first target area in the current page includes:
creating a chart test positioning task of the bitmap to be positioned, and storing the chart test positioning task into a chart test 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;
if the chart trial positioning task is not successfully executed, determining that the other content can not be moved to the other area;
executing the diagramming localization task based on the diagramming localization task stack, comprising:
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;
performing backtracking processing on the inserted content of the current page to obtain backtracking content, and clearing the inserted content;
inserting the to-be-positioned bitmap into the first target area;
typesetting the backtracking content in other areas except the first target area in the current page;
and if the other areas can typeset all the backtracking contents, the chart trial positioning task is successfully executed.
2. The method according to claim 1, wherein the method further comprises:
and if other contents are not typeset in the first target area, inserting the to-be-positioned bitmap into the first target area.
3. The method according to claim 1, wherein the method further comprises:
if the other content can not move to the other area, 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 to-be-positioned bitmap into the second target area.
4. A method according to any one of claims 1 to 3, further comprising:
updating the placement state of the chart to be positioned according to the positioning condition of the chart to be positioned, wherein the placement state comprises an undeposited state, a direct placement state, a trial placement success state or a trial placement failure state.
5. A chart positioning processing apparatus, comprising:
the response module is used for responding to the chart insertion operation of a user, and determining a first target area for inserting the chart to be positioned in the current page according to the positioning parameters of the chart to be positioned;
the first determining module is used for determining whether other contents are 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;
the inserting module is used for inserting the to-be-positioned bitmap into the first target area if the other content can be moved to the other area;
the second determining module includes:
the creating unit is used for creating a chart test positioning task of the to-be-positioned bitmap and storing the chart test positioning task into a chart test positioning task stack;
the execution unit is used for executing the chart trial positioning task based on the chart trial positioning task stack;
the first determining unit is used for determining that the other content can be moved to the other area if the chart trial positioning task is successfully executed;
the second determining unit is used for determining that the other content can not be moved to the other area if the chart trial positioning task is not successfully executed;
the execution unit is further used for 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; performing backtracking processing on the inserted content of the current page to obtain backtracking content, and clearing the inserted content; inserting the to-be-positioned bitmap into the first target area; typesetting the backtracking content in other areas except the first target area in the current page; and if the other areas can typeset all the backtracking contents, the chart trial positioning task is successfully executed.
6. An electronic device, comprising:
the processor, the memory, the interactive interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the method of chart positioning of any one of claims 1 to 4 via execution of the executable instructions.
7. A readable storage medium having stored thereon a computer program, which when executed by a processor, implements the method of processing chart localization of any one of claims 1 to 4.
8. A computer program product comprising a computer program for implementing the method of processing chart localization of any one of claims 1 to 4 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 CN113435172A (en) 2021-09-24
CN113435172B true 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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10636180B2 (en) * 2017-05-22 2020-04-28 SharesPost, Inc. Dynamic waterfall charts

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113435172A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
JP6725714B2 (en) System and method for automatic conversion of interactive sites and applications that support mobile and other viewing environments
US7487442B2 (en) Method, system, and computer-readable medium for the layout of automatically-placed elements and user-placed elements in a chart
EP0225191B1 (en) Document processing system
US8930809B2 (en) Editing apparatus and layout method, and storage medium
JPS60134357A (en) Picture file registering and retrieving system
CN117668402A (en) System and method for applying layout to document
US20130007601A1 (en) Positioning graphical objects within previously formatted text
CN108875853A (en) The processing method and processing device of data label printing
US20060156225A1 (en) Method and computer readable medium for laying out footnotes
CN113435172B (en) Processing method, device, equipment and storage medium for chart positioning
JP7000536B1 (en) Layout method, program, or information processing system
JPS61863A (en) Block processing system for document processor
CN114115864A (en) Interface generation method and device and electronic equipment
CN112906347B (en) Character typesetting method, electronic equipment and storage medium
JP2008026995A (en) Document file processing program, method, and device
JP4521218B2 (en) Image forming system, information processing apparatus, image forming apparatus, image forming method, and image forming program
JPH11250037A (en) Content editing device and recording medium
JP5303967B2 (en) Typesetting device, typesetting method, and typesetting processing program
JP4183774B2 (en) Layout processing method and apparatus using inter-element reference
US20050010858A1 (en) Method and apparatus for creating document
KR102053069B1 (en) Presentation document editing apparatus capable of efficiently updating thumbnail images and operating method thereof
CN112528599B (en) XML-based multi-page document processing method, device, computer equipment and medium
WO2023119611A1 (en) Information processing device, layout assistance method, and layout assistance program
JP2003196265A (en) Line leading from arbitrary point
JPH10105548A (en) Page control method

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