This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch dev in repository https://gitbox.apache.org/repos/asf/echarts-doc.git
commit db69b8cef0d627a62f360757926e659022a4b483 Author: 100pah <[email protected]> AuthorDate: Thu Jul 17 19:07:57 2025 +0800 feat(visualMap): add `unboundedRange` doc. --- en/option/component/visual-map-continuous.md | 16 ++++++++++++++++ zh/option/component/visual-map-continuous.md | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/en/option/component/visual-map-continuous.md b/en/option/component/visual-map-continuous.md index d84c8171..89ecad2e 100644 --- a/en/option/component/visual-map-continuous.md +++ b/en/option/component/visual-map-continuous.md @@ -64,6 +64,8 @@ chart.setOption({visualMap: {min: 0, max: 400}}); // Modify min and max using se // Then range will be auto-modified to the new [min, max], that is, [0, 400]. ``` +**Notice**: see [unboundedRange](~unboundedRange) for the special case when `range[0]` or `range[1]` touch `min` or `max`. + + If `range` is set explicitly, such as [10, 300] ```javascript @@ -80,6 +82,20 @@ chart.setOption({visualMap: {range: null}}); // Set range to null then. `range` gotten by `getOption` is always an `Array`, but not `null` or `undefined`. + +## unboundedRange(boolean) = true +{{ use: partial-version(version = "6.0.0") }} + +Whether to treat the range as unbounded when `range` touches `min` or `max`. +- `true`: when `range[0]` <= `min`, the actual range becomes `[-Infinity, range[1]]`; when `range[1]` >= `max`, the actual range becomes `[range[0], Infinity]`. + > NOTE: + > - This provides a way to ensure all data can be considered in-range when `min`/`max` are not precisely known. + > - Default is `true` for backward compatibility. + > - Piecewise VisualMap does not need it, since it can define unbounded range in each piece, such as "< 12", ">= 300". +- `false`: Disable the unbounded range behavior. + - Use case: e.g., `min`/`max` reflect the normal data range, and some outlier data should always be treated as out of range. + + ## calculable(boolean) = false <ExampleUIControlBoolean /> diff --git a/zh/option/component/visual-map-continuous.md b/zh/option/component/visual-map-continuous.md index 492c4629..b2f64bab 100644 --- a/zh/option/component/visual-map-continuous.md +++ b/zh/option/component/visual-map-continuous.md @@ -53,6 +53,9 @@ chart.setOption({ }); ``` +**注意**: 当 `range` 等于或超出 `min` 或 `max` 时,存在特殊处理,见 [unboundedRange](~unboundedRange)。 + + **setOption 改变 min、max 时 range 的自适应** + 如果 `range` 不设置(或设置为 null) @@ -81,6 +84,20 @@ chart.setOption({visualMap: {range: null}}); // 再把 range 设为 null。 `getOption` 得到的 `range` 总是 `Array`,不会为 `null` 或 `undefined`。 +## unboundedRange(boolean) = true +{{ use: partial-version(version = "6.0.0") }} + +当 `range` 等于或超出 `min` 或 `max` 时,是否视为范围无限。 + ++ `true`: 当 `range[0] ≤ min` 时,实际范围变为 `[-Infinity, range[1]]`;当 `range[1] ≥ max` 时,实际范围变为 `[range[0], Infinity]`。 + > 注意: + > - 这种策略是为了,当无法精确确定 `min` / `max` 时,可以有方式能使所有数据都在 `inRange` 内。 + > - 为了历史兼容,默认值为 `true`。 + > - 分段型 piecewise visualMap 不需要该配置项,因为每一段可以自行定义不设限范围,例如 `"< 12"`、`">= 300"`。 ++ `false`: 禁用无限范围。 + + 使用场景:例如当 `min` / `max` 是已知的正常数据范围时,某些异常值应始终被视为 `outOfRange`。 + + ## calculable(boolean) = false <ExampleUIControlBoolean /> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
