Skip to content

Commit

Permalink
Merge pull request #374 from snukhulov/feat-add-minmax-sampler
Browse files Browse the repository at this point in the history
feat(sampler): add min-max sampler function
  • Loading branch information
plainheart authored Nov 30, 2023
2 parents 68c787f + 3b4d022 commit 0accd2f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions en/option/series/bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,14 @@ How to stack values if the [stack](~series-bar.stack) property has been set. Opt

## sampling(string)

The dowmsampling strategy used when the data size is much larger than pixel size. It will improve the performance when turned on. Defaults to be turned off, indicating that all the data points will be drawn.
The downsampling strategy used when the data size is much larger than pixel size. It will improve the performance when turned on. Defaults to be turned off, indicating that all the data points will be drawn.

Options:
+ `'lttb'` Use Largest-Triangle-Three-Bucket algorithm to filter points. It will keep the trends and extremas.
+ `'average'` Use average value of filter points
+ `'max'` Use maximum value of filter points
+ `'min'` Use minimum value of filter points
+ `'max'` Use maximum value of filter points
+ `'minmax'` Use maximum extremum absolute value of filter points (Since `v5.5.0`)
+ `'sum'` Use sum of filter points

{{ use: partial-cursor() }}
Expand Down
5 changes: 3 additions & 2 deletions en/option/series/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,14 @@ Here are 2 examples of broken line chart with dual value axis, showing the diffe

## sampling(string)

The dowmsampling strategy used when the data size is much larger than pixel size. It will improve the performance when turned on. Defaults to be turned off, indicating that all the data points will be drawn.
The downsampling strategy used when the data size is much larger than pixel size. It will improve the performance when turned on. Defaults to be turned off, indicating that all the data points will be drawn.

Options:
+ `'lttb'` Use Largest-Triangle-Three-Bucket algorithm to filter points. It will keep the trends and extremas.
+ `'average'` Use average value of filter points
+ `'max'` Use maximum value of filter points
+ `'min'` Use minimum value of filter points
+ `'max'` Use maximum value of filter points
+ `'minmax'` Use maximum extremum absolute value of filter points (Since `v5.5.0`)
+ `'sum'` Use sum of filter points

{{ use: partial-series-dimensions(
Expand Down
3 changes: 2 additions & 1 deletion zh/option/series/bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ option = {
可选:
+ `'lttb'` 采用 Largest-Triangle-Three-Bucket 算法,可以最大程度保证采样后线条的趋势,形状和极值。
+ `'average'` 取过滤点的平均值
+ `'max'` 取过滤点的最大值
+ `'min'` 取过滤点的最小值
+ `'max'` 取过滤点的最大值
+ `'minmax'` 取过滤点绝对值的最大极值 (从 `v5.5.0` 开始支持)
+ `'sum'` 取过滤点的和

{{ use: partial-cursor() }}
Expand Down
3 changes: 2 additions & 1 deletion zh/option/series/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@ const option = {
可选:
+ `'lttb'` 采用 Largest-Triangle-Three-Bucket 算法,可以最大程度保证采样后线条的趋势,形状和极值。
+ `'average'` 取过滤点的平均值
+ `'max'` 取过滤点的最大值
+ `'min'` 取过滤点的最小值
+ `'max'` 取过滤点的最大值
+ `'minmax'` 取过滤点绝对值的最大极值 (从 `v5.5.0` 开始支持)
+ `'sum'` 取过滤点的和

{{ use: partial-series-dimensions(
Expand Down

0 comments on commit 0accd2f

Please sign in to comment.