An adaptive adjustment method, device, equipment, and medium for chart axes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-15
- Publication Date
- 2026-08-14
AI Technical Summary
随着数据量级和复杂度的提升,这种基于极值定理的传统方法暴露出极其显著的数学与工程缺陷:1.对局部异常值的鲁棒性极差:真实世界的采样数据常伴随脉冲噪声或系统错误
Smart Images

Figure CN122195570B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer software and massive data visualization technology, and in particular to an adaptive adjustment method, device, equipment and medium for chart coordinate axes. Background Technology
[0002] In modern industrial IoT, financial quantitative analysis, and scientific computing software development, data visualization charts (such as line charts, scatter plots, candlestick charts, and spectrum graphs) are core components for displaying high-frequency, massive amounts of data. Traditional methods for calculating coordinate axis scales typically involve directly scanning the dataset to find the "absolute maximum" and "absolute minimum" values as the upper and lower boundaries of the projected coordinate system, followed by linear division. With increasing data volume and complexity, this traditional method based on the extreme value theorem reveals significant mathematical and engineering flaws: 1. Extremely poor robustness to local outliers: Real-world sampled data often includes impulse noise or system errors. If a function is used, the range of the coordinate system is drastically amplified, causing high-value, effective data to be compressed into an indistinguishable straight line in the screen pixel space (information entropy loss), severely damaging the data's visual analytical value. 2. Lack of multi-scale dynamic adaptive mapping: When users perform continuous geometric transformations (zoom in or out) on the chart, the data subset within the viewport changes dynamically. Zooming in causes the loss of all reference scales within the viewport (blind spots), while zooming out causes severe pixel-level overlap between scale lines and text labels (aliasing), leading to a sharp decline in system usability. 3. Rendering computation bottleneck caused by high-frequency redrawing: In scenarios with tens of millions of data points, if each zoom interaction triggers global traversal, extreme value recalculation, and DOM / Canvas tree reconstruction, it will lead to catastrophic main thread blocking and a precipitous drop in frame rate. Therefore, an adaptive axis update method is urgently needed. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide an adaptive adjustment method, device, equipment and medium for chart coordinate axes, which realizes intelligent adjustment of the coordinate system at any scaling ratio through a complete process of "downsampling-probability distribution modeling-scale vector set determination-affine smoothing rendering", thereby improving the accuracy of chart coordinate system adjustment.
[0004] This application provides an adaptive adjustment method for chart coordinate axes, the adaptive adjustment method comprising: In response to the viewport matrix transformation event triggered by the graphics engine, the data logic interval corresponding to the current visible area is determined, and the original data point set within the data logic interval is subjected to viewpoint downsampling processing, and the processed data point set is output. The lower and upper visual limits are calculated for the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method. A dynamic margin mapping is then applied to the upper and lower visual limits to obtain the final lower and upper boundaries. Based on the final lower boundary, the final upper boundary, and the scale step, a set of scale vectors is generated; Construct a transformation matrix from the data logic space to the screen pixel space, and when there is a jump in the coordinate axis range or scale step, perform a smooth tweening animation transition on the old and new coordinate axes based on the cubic Bézier curve interpolation function.
[0005] In one possible implementation, the original data point set within the data logical interval is subjected to viewpoint downsampling processing, and the processed data point set is output, including: The original data point set is divided into multiple buckets related to the screen pixel width, and the data points to be retained are selected by maximizing the area of the triangle formed by the representative points in three consecutive buckets.
[0006] In one possible implementation, the step of calculating the lower and upper visual limits of the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR boxplot method includes: For the empirical cumulative distribution function quantile method, a lower quantile probability threshold and an upper quantile probability threshold are set. The minimum processed data point whose empirical cumulative distribution function value is greater than or equal to the lower quantile probability threshold is taken as the visual lower limit, and the maximum processed data point whose empirical cumulative distribution function value is greater than or equal to the upper quantile probability threshold is taken as the visual upper limit. For the Tukey IQR box plot method, the first quartile and the third quartile are calculated for the processed data point set. The interquartile range is determined based on the first quartile and the third quartile. The theoretical lower bound and the theoretical upper bound are determined based on the interquartile range. The intersection of the processed data points in the current visible area with the theoretical upper bound and the theoretical lower bound is taken as the visual lower bound and the visual upper bound.
[0007] In one possible implementation, the final lower boundary and the final upper boundary are determined by the following formula:
[0008] in, The dynamic range is the upper limit of vision. With visual lower limit difference, This is the margin coefficient for the space above. This represents the margin factor at the bottom, which determines the proportion of blank pixels reserved at the top and bottom of the chart. For the final upper boundary, This is the final lower boundary.
[0009] In one possible implementation, the scale step size is determined in the following manner: The theoretical continuous step size is calculated based on the expected total number of scale divisions and the dynamic range. Extract the order-of-magnitude exponent of the theoretical continuous step size and calculate the normalized step size; The normalized step size is discretized and mapped to the set of normal numbers by an approximation function to obtain the scale step size.
[0010] In one possible implementation, the construction of the transformation matrix from the data logical space to the screen pixel space, and the execution of a smooth tweening animation transition between the old and new coordinate axes based on a cubic Bézier curve interpolation function when there is a jump in the coordinate axis range or scale step size, includes: A dynamic affine transformation matrix is constructed to transform the data logical space into the screen pixel space, and the set of scale vectors is mapped to screen physical coordinates based on the dynamic affine transformation matrix; wherein, when the final lower boundary, the final upper boundary, or the scale step size is updated, the parameters of the dynamic affine transformation matrix are updated accordingly. In response to the coordinate system parameter update event, the coordinate axis state before the update is taken as the initial state and the coordinate axis state after the update is taken as the target state. The normalization time parameter is controlled by the cubic Bessel easing function. The scaling factor and offset of the dynamic affine transformation matrix are continuously interpolated to generate the intermediate frame coordinate axis state and render it.
[0011] In one possible implementation, the mapping relationship of the dynamic affine transformation matrix with respect to the Y-axis is as follows:
[0012] in, For the final upper boundary, This is the final lower boundary. H The physical height of the drawing area. The logical y-axis coordinates of the processed data points. These are the screen physical pixel coordinates of the processed data points.
[0013] This application embodiment also provides an adaptive adjustment device for chart coordinate axes, the adaptive adjustment device comprising: The data downsampling module is used to respond to the viewport matrix transformation event triggered by the graphics engine, determine the data logic interval corresponding to the current visible area, perform viewpoint downsampling processing on the original data point set within the data logic interval, and output the processed data point set. The statistical extreme value convergence module is used to calculate the visual lower limit and visual upper limit of the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method, and to apply dynamic margin mapping to the visual upper limit and the visual lower limit to obtain the final lower boundary and the final upper boundary. The scale vector generation module is used to generate a set of scale vectors based on the final lower boundary, the final upper boundary, and the scale step size. The transformation and rendering module is used to construct a transformation matrix from the data logic space to the screen pixel space. When there is a jump in the coordinate axis range or scale step, it performs a smooth tweening animation transition on the old and new coordinate axes based on the cubic Bézier curve interpolation function.
[0014] This application embodiment also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the adaptive adjustment method for the chart coordinate axis described above are performed.
[0015] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the adaptive adjustment method for the chart coordinate axes described above.
[0016] This application provides an adaptive adjustment method, apparatus, device, and medium for chart coordinate axes. The adaptive adjustment method includes: responding to a viewport matrix transformation event triggered by the graphics engine, determining the data logic interval corresponding to the current visible area, and performing viewpoint downsampling processing on the original data point set within the data logic interval to output the processed data point set; calculating the lower and upper visual limits of the processed data point set using the empirical cumulative distribution function quantile method or Tukey IQR box plot method, and applying dynamic margin mapping to the upper and lower visual limits to obtain the final lower and upper boundaries; generating a set of scale vectors based on the final lower boundary, the final upper boundary, and the scale step; constructing a transformation matrix from the data logic space to the screen pixel space; and performing a smooth tweening animation transition on the old and new coordinate axes based on a cubic Bézier curve interpolation function when there is a jump in the coordinate axis range or scale step. Through the complete process of "downsampling - probability distribution modeling - scale vector set determination - affine smoothing rendering", intelligent adjustment of the coordinate system at any scaling ratio is achieved, improving the accuracy of chart coordinate system adjustment.
[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A flowchart illustrating an adaptive adjustment method for chart coordinate axes provided in this application embodiment; Figure 2 One of the structural schematic diagrams of an adaptive adjustment device for chart coordinate axes provided in this application embodiment; Figure 3 A second schematic diagram of the structure of an adaptive adjustment device for chart coordinate axes provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0021] First, the applicable scenarios for this application will be introduced. This application can be applied to the fields of computer software and massive data visualization technology.
[0022] Research has revealed the following problems in existing technologies: 1. Poor robustness to local outliers: Real-world sampling data is often accompanied by impulse noise or system errors. If a function is used, the range of the coordinate system will be drastically amplified, causing high-value, effective data to be compressed into an indistinguishable straight line in the screen pixel space (information entropy loss), severely damaging the visual analysis value of the data. 2. Lack of multi-scale dynamic adaptive mapping: When users perform continuous geometric transformations (zoom in or out) on the chart, the subset of data within the viewport changes dynamically. Zooming in causes the loss of all reference scales within the viewport (blind spot), while zooming out causes severe overlap of scale lines and text labels at the pixel level (aliasing), leading to a sharp decline in system usability. 3. Rendering computation bottleneck caused by high-frequency redrawing: In scenarios with tens of millions of data points, if each zoom interaction triggers global traversal, extreme value recalculation, and DOM / Canvas tree reconstruction, it will lead to catastrophic main thread blocking and a precipitous drop in frame rate. Therefore, an adaptive coordinate axis update method is urgently needed.
[0023] Based on this, embodiments of this application provide an adaptive adjustment method, apparatus, device, and medium for chart coordinate axes. Through a complete process of "downsampling - probability distribution modeling - scale vector set determination - affine smoothing rendering", intelligent adjustment of the coordinate system under arbitrary scaling ratios is achieved, thereby improving the accuracy of chart coordinate system adjustment.
[0024] Please see Figure 1 , Figure 1 This is a flowchart illustrating an adaptive adjustment method for chart coordinate axes provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the adaptive adjustment method includes: S101: In response to the viewport matrix transformation event triggered by the graphics engine, determine the data logic interval corresponding to the current visible area, perform viewpoint downsampling processing on the original data point set within the data logic interval, and output the processed data point set.
[0025] In this step, the viewport matrix transformation event of the graphics engine is monitored, and the data logic range corresponding to the current camera or viewport is calculated. For massive amounts of data within a logical data range, the LTTB (Largest Triangle Three Buckets) viewpoint downsampling algorithm is triggered to output a lightweight, topologically equivalent set of processed data points.
[0026] It should be noted that the viewport matrix transformation event refers to a semantic calculation trigger signal actively emitted by the graphics system when it detects that the affine transformation parameters (i.e., scaling, translation offset, and rotation angle) of the current visible area relative to the original data coordinate system have changed significantly beyond a preset tolerance threshold, which is used to drive subsequent adaptive coordinate axis recalculation.
[0027] In one possible implementation, the original data point set within the data logical interval is subjected to viewpoint downsampling processing, and the processed data point set is output, including: The original data point set is divided into multiple buckets related to the screen pixel width, and the data points to be retained are selected by maximizing the area of the triangle formed by the representative points in three consecutive buckets.
[0028] Here, when the number of data points is captured Much larger than the physical pixel width of the screen In this invention, the LTTB algorithm is used instead of simple step-size sampling to maintain the visual extremum characteristics of the data. Let the data be divided into... There are several buckets. When processing the i-th bucket, a point has already been selected in the previous bucket. There are candidate points in the current bucket i. And calculate the arithmetic mean center of all points in the next bucket i+1. The goal is to select the optimal point in bucket i. This maximizes the area of the triangle formed.
[0029] in, The coordinates of the selected representative point in the previous bucket; The coordinates of the candidate points in the bucket currently being processed; The center point of the arithmetic mean of all points in the next bucket is used as the reference "far end" for area calculation; Let the area of the triangle formed by points A, B, and C be used to evaluate the degree to which the candidate point retains the characteristic peaks and troughs. This algorithm perfectly preserves spikes and trends while maintaining linear time complexity. Subsequent probability extremum calculations only need to be applied to this area. On each downsampled feature point, the CPU's computing power is greatly freed up.
[0030] S102: The lower and upper visual limits of the processed data point set are calculated using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method, and a dynamic margin mapping is applied to the upper and lower visual limits to obtain the final lower and upper boundaries.
[0031] In this step, the lower and upper visual limits of the processed data point set are calculated using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method, and a dynamic margin mapping is applied to the upper and lower visual limits to obtain the final lower and upper boundaries.
[0032] Here, this application abandons the traditional min / max method, constructs a probability distribution model for the downsampled data subset, and uses dynamic quantiles or Tukey IQR method to solve for the statistically significant "visual lower limit" and "visual upper limit", thereby achieving efficient mathematical isolation of impulse anomalies.
[0033] In one possible implementation, the step of calculating the lower and upper visual limits of the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR boxplot method, and applying a dynamic margin mapping to the upper and lower visual limits to obtain the final lower and upper boundaries, includes: A: For the empirical cumulative distribution function quantile method, a lower quantile probability threshold and an upper quantile probability threshold are set. The smallest processed data point whose empirical cumulative distribution function value is greater than or equal to the lower quantile probability threshold is taken as the visual lower limit, and the largest processed data point whose empirical cumulative distribution function value is greater than or equal to the upper quantile probability threshold is taken as the visual upper limit.
[0034] Here, for financial / sensor data with skewed distributions or containing extreme impulses, let the extracted data within the current visible area be... The set of axis data points is Its corresponding empirical cumulative distribution function (eCDF) is defined as:
[0035] in, For a sample size of The empirical cumulative distribution function value at time t represents less than or equal to The percentage of samples; This represents the total number of data points within the current visible area (viewport). This is an indicator function that takes the value 1 when the condition inside the parentheses is true, and 0 otherwise; For the first Observations of each sample point; Let be an ordinal statistic. Its ordinal statistic is the sequence of sample points arranged in ascending order. These are the preset lower quantile and upper quantile probability values. The "lower visual limit" and "upper visual limit" are calculated after statistical convergence. , .
[0036] B: For the Tukey IQR box plot method, the first quartile and the third quartile are calculated for the processed data point set. The interquartile range is determined based on the first quartile and the third quartile. The theoretical lower bound and the theoretical upper bound are determined based on the interquartile range. The intersection of the processed data points in the current visible area with the theoretical upper bound and the theoretical lower bound is taken as the visual lower bound and the visual upper bound.
[0037] Here, for a dataset that is approximately normally distributed but accompanied by occasional errors, the first quartile is calculated. and the third and fourth quartiles Calculate the interquartile range: The effective data boundary is determined using Tukey's fence theorem, and its intersection with the true maximum and minimum values within the current viewport is calculated: Theoretical lower bound: Theoretical upper limit: .in, These are the first quartile and the third quartile (i.e., the 25th and 75th percentiles), respectively. Interquartile range (IQR) measures the degree of dispersion of data in the middle. These represent the theoretical lower and upper bounds for non-anomaly data calculated based on Turkey's fence theorem; 1.5 is the standard constant coefficient of Turkey's algorithm, used to define the inner fence. The actual visual extrema used are:
[0038] In one possible implementation, the final lower boundary and the final upper boundary are determined by the following formula:
[0039] in, The dynamic range is the upper limit of vision. With visual lower limit difference, This is the margin coefficient for the space above. This represents the margin factor at the bottom, which determines the proportion of blank pixels reserved at the top and bottom of the chart. For the final upper boundary, This forms the final lower boundary. This constitutes the actual logical value range used by the subsequent rendering engine. .
[0040] S103: Generate a set of scale vectors based on the final lower boundary, the final upper boundary, and the scale step size.
[0041] In this step, a set of scale vectors is generated based on the final lower boundary, the final upper boundary, and the scale step size.
[0042] In one possible implementation, the scale step size is determined in the following manner: The theoretical continuous step size is calculated based on the expected total number of scale divisions and the dynamic range; the order of magnitude exponent of the theoretical continuous step size is extracted, and the normalized step size is calculated; the normalized step size is discretized and mapped to the set of normalized numbers through an approximation function to obtain the scale step size.
[0043] Here, the UI layer expects to render a total of K (e.g., K=5) tick marks based on the current physical pixel height along the Y-axis. The theoretical continuous step size is... The exponential term is extracted using a logarithmic function that rounds down. The step size is then mapped to... Continuous intervals: Construct the mapping function Find the closest normalized number:
[0044] The scale step size of the actual coordinates is restored in the following way:
[0045] Here, K represents the total number of scales (target density) that the UI design expects to display in the current physical space. The range; The unnormalized theoretical continuous step size; It is an order-of-magnitude exponent; To normalize the step size, the original step size is scaled to... The interval is convenient for conducting Sequence matching; To normalize the jump approximation function, continuous values are mapped to a discrete set of constants; This is the standardized scale spacing ultimately applied to the coordinate axes; This is the set of generated tick vectors; This is the logical value corresponding to the i-th tick mark.
[0046] It should be noted that the generated scale set Defined as:
[0047]
[0048] in, These are the logical values corresponding to the first and last normalized tick marks on the coordinate axis, respectively.
[0049] S104: Construct a transformation matrix from the data logic space to the screen pixel space, and perform a smooth tweening animation transition between the old and new coordinate axes based on the cubic Bézier curve interpolation function when there is a jump in the coordinate axis range or scale step.
[0050] In this step, a transformation matrix is constructed from the data logic space to the screen pixel space. When there is a jump in the coordinate axis range or scale step, a cubic Bézier curve interpolation function is used to perform a smooth tweening animation transition between the old and new coordinate axes.
[0051] In one possible implementation, the construction of the transformation matrix from the data logical space to the screen pixel space, and the execution of a smooth tweening animation transition between the old and new coordinate axes based on a cubic Bézier curve interpolation function when there is a jump in the coordinate axis range or scale step size, includes: a: Construct a dynamic affine transformation matrix from the data logical space to the screen pixel space, and map the set of scale vectors to screen physical coordinates based on the dynamic affine transformation matrix; wherein, when the final lower boundary, the final upper boundary, or the scale step size is updated, the parameters of the dynamic affine transformation matrix are updated accordingly.
[0052] Here, a dynamic affine transformation matrix is constructed from the data logic space to the screen pixel space, and the set of scale vectors is mapped to screen physical coordinates according to the dynamic affine transformation matrix.
[0053] In one possible implementation, the mapping relationship of the dynamic affine transformation matrix with respect to the Y-axis is as follows:
[0054] in, For the final upper boundary, This is the final lower boundary. H The physical height of the drawing area. The logical y-axis coordinates of the processed data points. These are the screen physical pixel coordinates of the processed data points.
[0055] In one possible implementation, the mapping relationship of the dynamic affine transformation matrix with respect to the X-axis is as follows:
[0056] in, W The physical width of the drawing area. Logical values of the processed data points x Axis coordinates These are the screen physical pixel coordinates of the processed data points. These are the logical start and end points of the X-axis (usually time or index) visible within the current viewport.
[0057] b: In response to the coordinate system parameter update event, the coordinate axis state before the update is taken as the initial state and the coordinate axis state after the update is taken as the target state. The normalization time parameter is controlled by the cubic Bessel easing function. The scaling factor and offset of the dynamic affine transformation matrix are continuously interpolated to generate the intermediate frame coordinate axis state and render it.
[0058] Here, to prevent visual discontinuities caused by updating the coordinate axis range, this invention integrates a time axis interpolator. This applies to the position state of any tick mark. Let the previous frame's old state be... The target new state is The animation cycle is milliseconds, the elapsed time is Normalized time parameter This application uses standard cubic Bézier curves. As a time easing function:
[0059] Among them, control points are usually set as ,exist At any given moment, the rendering engine physically adjusts the coordinate axis tick marks. Coordinates and text transparency Perform linear interpolation:
[0060] here, These are the old and new states (including coordinates and attributes) of the coordinate axis scale system before and after the transformation. The preset total duration of the tween animation (in milliseconds); This represents the execution time since the animation started; The normalized time parameter has a range of values. ; These are the interpolation coefficients output by the Cubic-Bezier easing function; These are the four control points of the Bézier curve; They are respectively in The physical position of the tick marks and the text transparency are calculated in real time and used to render smooth transitions.
[0061] In a specific implementation, a line chart component in a real-time monitoring dashboard on a web platform is taken as an example. The component listens for matrix transformation events from the graphics engine (such as Canvas or WebGL). Assuming the user zooms the viewport to the time interval from 120 to 180 seconds using a mouse selection operation, the currently visible data logical interval is calculated as follows: X-axis [120, 180] (unit: seconds), Y-axis [22.5, 28.3] (unit: degrees Celsius). Since the original number of data points within this interval is (180-120) × 100 = 6000, far exceeding the screen width of 1000 pixels, the system triggers the LTTB viewpoint downsampling algorithm, ultimately outputting 1000 downsampled points. This fully preserves the peaks, plateaus, and trend characteristics of the original waveform, reducing the data volume to 1 / 6 of the original, laying a lightweight foundation for subsequent statistical calculations. Visual extreme value convergence based on an empirical cumulative distribution function is then performed on the downsampled data points to obtain the final upper and lower boundaries. Using the dynamic range formed by the upper and lower visual limits as input, the algorithm calculates the value at the current physical screen pixel resolution through logarithmic domain dimensionality reduction mapping and a 1-2-5 sequence approximation algorithm. A set of scale vectors is generated using the final lower boundary, final upper boundary, and scale step size. The physical height of the drawing area is known to be H = 600 pixels, and the width W = 1000 pixels. For the Y-axis (temperature range), considering that the screen coordinate system increases downwards while the data coordinate system increases upwards, an affine mapping relationship is constructed. When there are abrupt changes in the coordinate system range or scale step size, a cubic Bézier interpolation function is applied to perform a smooth tweening animation transition between the old and new coordinate axis systems.
[0062] This application provides an adaptive adjustment method for chart coordinate axes. The method includes: responding to a viewport matrix transformation event triggered by the graphics engine, determining the data logic interval corresponding to the current visible area, and performing viewpoint downsampling on the original data point set within the data logic interval to output the processed data point set; calculating the lower and upper visual limits of the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method, and applying dynamic margin mapping to the upper and lower visual limits to obtain the final lower and upper boundaries; generating a set of scale vectors based on the final lower and upper boundaries and the scale step size; constructing a transformation matrix from the data logic space to the screen pixel space; and performing a smooth tweening animation transition between the old and new coordinate axes based on a cubic Bézier curve interpolation function when there is a jump in the coordinate axis range or scale step size. Through the complete process of "downsampling - probability distribution modeling - scale vector set determination - affine smoothing rendering," intelligent adjustment of the coordinate system at any scaling ratio is achieved, improving the accuracy of chart coordinate system adjustment.
[0063] Please see Figure 2 , Figure 3 , Figure 2 One of the structural schematic diagrams of an adaptive adjustment device for chart coordinate axes provided in this application embodiment; Figure 3 This is a second schematic diagram of the structure of an adaptive adjustment device for chart coordinate axes provided in an embodiment of this application. Figure 2 As shown, the adaptive adjustment device 200 for the chart coordinate axes includes: The data downsampling module 210 is used to respond to the viewport matrix transformation event triggered by the graphics engine, determine the data logic interval corresponding to the current visible area, perform viewpoint downsampling processing on the original data point set within the data logic interval, and output the processed data point set. The statistical extreme value convergence module 220 is used to calculate the visual lower limit and visual upper limit of the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method, and to apply dynamic margin mapping to the visual upper limit and the visual lower limit to obtain the final lower boundary and the final upper boundary. The scale vector generation module 230 is used to generate a set of scale vectors based on the final lower boundary, the final upper boundary, and the scale step size. The transformation and rendering module 240 is used to construct a transformation matrix from the data logic space to the screen pixel space. When there is a jump in the coordinate axis range or scale step, it performs a smooth tweening animation transition on the old and new coordinate axes based on the cubic Bézier curve interpolation function.
[0064] Furthermore, the data downsampling module 210 is used to perform viewpoint downsampling processing on the original data point set within the data logical interval, and output the processed data point set: The original data point set is divided into multiple buckets related to the screen pixel width, and the data points to be retained are selected by maximizing the area of the triangle formed by the representative points in three consecutive buckets.
[0065] Furthermore, the statistical extreme value convergence module 220 is used to calculate the lower and upper visual limits of the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR boxplot method: For the empirical cumulative distribution function quantile method, a lower quantile probability threshold and an upper quantile probability threshold are set. The minimum processed data point whose empirical cumulative distribution function value is greater than or equal to the lower quantile probability threshold is taken as the visual lower limit, and the maximum processed data point whose empirical cumulative distribution function value is greater than or equal to the upper quantile probability threshold is taken as the visual upper limit. For the Tukey IQR box plot method, the first quartile and the third quartile are calculated for the processed data point set. The interquartile range is determined based on the first quartile and the third quartile. The theoretical lower bound and the theoretical upper bound are determined based on the interquartile range. The intersection of the processed data points in the current visible area with the theoretical upper bound and the theoretical lower bound is taken as the visual lower bound and the visual upper bound.
[0066] Furthermore, the statistical extreme value convergence module 220 is used to determine the final lower boundary and the final upper boundary using the following formula:
[0067] in, The dynamic range is the upper limit of vision. With visual lower limit difference, This is the margin coefficient for the space above. This represents the margin factor at the bottom, which determines the proportion of blank pixels reserved at the top and bottom of the chart. For the final upper boundary, This is the final lower boundary.
[0068] Furthermore, such as Figure 3 As shown, the adaptive adjustment device 200 for the chart axes also includes a step size determination module 250, which determines the scale step size in the following manner: The theoretical continuous step size is calculated based on the expected total number of scale divisions and the dynamic range. Extract the order-of-magnitude exponent of the theoretical continuous step size and calculate the normalized step size; The normalized step size is discretized and mapped to the set of normal numbers by an approximation function to obtain the scale step size.
[0069] Furthermore, the transformation and rendering module 240 is used to construct the transformation matrix from the data logical space to the screen pixel space, and when there is a jump in the coordinate axis range or scale step, it performs a smooth tweening animation transition on the old and new coordinate axes based on the cubic Bézier curve interpolation function: A dynamic affine transformation matrix is constructed to transform the data logical space into the screen pixel space, and the set of scale vectors is mapped to screen physical coordinates based on the dynamic affine transformation matrix; wherein, when the final lower boundary, the final upper boundary, or the scale step size is updated, the parameters of the dynamic affine transformation matrix are updated accordingly. In response to the coordinate system parameter update event, the coordinate axis state before the update is taken as the initial state and the coordinate axis state after the update is taken as the target state. The normalization time parameter is controlled by the cubic Bessel easing function. The scaling factor and offset of the dynamic affine transformation matrix are continuously interpolated to generate the intermediate frame coordinate axis state and render it.
[0070] Furthermore, the transformation and rendering module 240 is used for the mapping relationship of the dynamic affine transformation matrix with respect to the Y-axis:
[0071] in, For the final upper boundary, This is the final lower boundary. H The physical height of the drawing area. The logical y-axis coordinates of the processed data points. These are the screen physical pixel coordinates of the processed data points.
[0072] This application provides an adaptive adjustment device for chart coordinate axes, comprising: a data downsampling module, used to respond to a viewport matrix transformation event triggered by the graphics engine, determine the data logic interval corresponding to the current visible area, and perform viewpoint downsampling processing on the original data point set within the data logic interval, outputting the processed data point set; a statistical extreme value convergence module, used to calculate the visual lower limit and visual upper limit of the processed data point set using the empirical cumulative distribution function quantile method or Tukey IQR box plot method, and apply dynamic margin mapping to the visual upper limit and the visual lower limit to obtain the final lower boundary and the final upper boundary; a scale vector generation module, used to generate a scale vector set based on the final lower boundary, the final upper boundary, and the scale step; and a transformation and rendering module, used to construct a transformation matrix from the data logic space to the screen pixel space, and perform a smooth tweening animation transition on the old and new coordinate axes based on a cubic Bézier curve interpolation function when there is a jump in the coordinate axis range or scale step. By implementing a complete process of "downsampling - probability distribution modeling - scale vector set determination - affine smoothing rendering", intelligent adjustment of the coordinate system can be achieved at any scaling ratio, thereby improving the accuracy of chart coordinate system adjustment.
[0073] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.
[0074] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, they can perform the operations described above. Figure 1 The steps of the adaptive adjustment method for the chart coordinate axes in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0075] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the adaptive adjustment method for the chart coordinate axes in the method embodiment shown are described in detail in the method embodiment, and will not be repeated here.
[0076] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0077] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0078] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0079] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0080] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0081] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An adaptive adjustment method for chart axes, characterized in that, The adaptive adjustment method includes: In response to the viewport matrix transformation event triggered by the graphics engine, the data logic interval corresponding to the current visible area is determined, and the original data point set within the data logic interval is subjected to viewpoint downsampling processing, and the processed data point set is output. The lower and upper visual limits are calculated for the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method. A dynamic margin mapping is then applied to the upper and lower visual limits to obtain the final lower and upper boundaries. Based on the final lower boundary, the final upper boundary, and the scale step, a set of scale vectors is generated; Construct a transformation matrix from the data logic space to the screen pixel space, and when there is a jump in the coordinate axis range or scale step, perform a smooth tweening animation transition on the old and new coordinate axes based on the cubic Bézier curve interpolation function; The construction of the transformation matrix from the data logical space to the screen pixel space, when there is a jump in the coordinate axis range or scale step, performs a smooth tweening animation transition between the old and new coordinate axes based on the cubic Bézier curve interpolation function, including: A dynamic affine transformation matrix is constructed to transform the data logical space into the screen pixel space, and the set of scale vectors is mapped to screen physical coordinates based on the dynamic affine transformation matrix; wherein, when the final lower boundary, the final upper boundary, or the scale step size is updated, the parameters of the dynamic affine transformation matrix are updated accordingly. In response to the coordinate system parameter update event, the coordinate axis state before the update is taken as the initial state and the coordinate axis state after the update is taken as the target state. The normalization time parameter is controlled by the cubic Bessel easing function. The scaling factor and offset of the dynamic affine transformation matrix are continuously interpolated to generate the intermediate frame coordinate axis state and render it. The mapping relationship of the dynamic affine transformation matrix with respect to the Y-axis is as follows: in, For the final upper boundary, This is the final lower boundary. H The physical height of the drawing area. The logical y-axis coordinates of the processed data points. These are the screen physical pixel coordinates of the processed data points.
2. The adaptive adjustment method according to claim 1, characterized in that, The original data point set within the data logical interval is subjected to viewpoint downsampling processing, and the processed data point set is output, including: The original data point set is divided into multiple buckets related to the screen pixel width, and the data points to be retained are selected by maximizing the area of the triangle formed by the representative points in three consecutive buckets.
3. The adaptive adjustment method according to claim 1, characterized in that, The calculation of the lower and upper visual limits of the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method includes: For the empirical cumulative distribution function quantile method, a lower quantile probability threshold and an upper quantile probability threshold are set. The minimum processed data point whose empirical cumulative distribution function value is greater than or equal to the lower quantile probability threshold is taken as the visual lower limit, and the maximum processed data point whose empirical cumulative distribution function value is greater than or equal to the upper quantile probability threshold is taken as the visual upper limit. For the Tukey IQR box plot method, the first quartile and the third quartile are calculated for the processed data point set. The interquartile range is determined based on the first quartile and the third quartile. The theoretical lower bound and the theoretical upper bound are determined based on the interquartile range. The intersection of the processed data points in the current visible area with the theoretical upper bound and the theoretical lower bound is taken as the visual lower bound and the visual upper bound.
4. The adaptive adjustment method according to claim 1, characterized in that, The final lower and upper boundaries are determined using the following formula: in, The dynamic range is the upper limit of vision. With visual lower limit difference, This is the margin coefficient for the space above. This represents the margin factor at the bottom, which determines the proportion of blank pixels reserved at the top and bottom of the chart. For the final upper boundary, This is the final lower boundary.
5. The adaptive adjustment method according to claim 1, characterized in that, The scale step size is determined in the following way: The theoretical continuous step size is calculated based on the expected total number of scale divisions and the dynamic range. Extract the order-of-magnitude exponent of the theoretical continuous step size and calculate the normalized step size; The normalized step size is discretized and mapped to the set of normal numbers by an approximation function to obtain the scale step size.
6. An adaptive adjustment device for chart coordinate axes, characterized in that, The adaptive adjustment method for the chart coordinate axes according to claim 1, wherein the adaptive adjustment device comprises: The data downsampling module is used to respond to the viewport matrix transformation event triggered by the graphics engine, determine the data logic interval corresponding to the current visible area, perform viewpoint downsampling processing on the original data point set within the data logic interval, and output the processed data point set. The statistical extreme value convergence module is used to calculate the visual lower limit and visual upper limit of the processed data point set using the empirical cumulative distribution function quantile method or the Tukey IQR box plot method, and to apply dynamic margin mapping to the visual upper limit and the visual lower limit to obtain the final lower boundary and the final upper boundary. The scale vector generation module is used to generate a set of scale vectors based on the final lower boundary, the final upper boundary, and the scale step size. The transformation and rendering module is used to construct a transformation matrix from the data logic space to the screen pixel space. When there is a jump in the coordinate axis range or scale step, it performs a smooth tweening animation transition on the old and new coordinate axes based on the cubic Bézier curve interpolation function.
7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the adaptive adjustment method for the chart coordinate axis as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the adaptive adjustment method for the chart coordinate axes as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Anesthesia anatomy display and interaction method based on virtuality and reality combination
CN120635326A
Method and device for controlling an adaptive speed regulation system of an autonomous vehicle by modulated lateral distance.
FR3143513A1