From 687b006aa34a046bbdfbfd30365d519cd00c27a9 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Tue, 12 Jul 2022 17:07:26 +0800 Subject: [PATCH 1/2] doc: update instruction for custom group being null apache/echarts#17349 --- en/option/partial/zr-graphic.md | 5 ++++- zh/option/partial/zr-graphic.md | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/en/option/partial/zr-graphic.md b/en/option/partial/zr-graphic.md index d54b71b3..5b993e5c 100644 --- a/en/option/partial/zr-graphic.md +++ b/en/option/partial/zr-graphic.md @@ -5,6 +5,10 @@ `group` is the only type that can contain children, so that a group of elements can be positioned and transformed together. +{{ if: ${usageType} === 'customSeries' }} +Note that if any of its child is `null`, it means the child no longer exists. So if a group contains an element that is set to be `null` in a future `setOption` call, it should remove the previous element at the same index. If a child should not change, it should be `{}` in the new option. +{{ /if }} + {{ use: partial-graphic-cpt-common-props( type = 'group', prefix = ${prefix}, @@ -2046,4 +2050,3 @@ Although the points will be interpolated, the consequent animation will be like ``` See this example [example](${galleryEditorPath}custom-spiral-race&edit=1&reset=1). - diff --git a/zh/option/partial/zr-graphic.md b/zh/option/partial/zr-graphic.md index a0fce1a0..5d0cf927 100644 --- a/zh/option/partial/zr-graphic.md +++ b/zh/option/partial/zr-graphic.md @@ -5,6 +5,10 @@ group 是唯一的可以有子节点的容器。group 可以用来整体定位一组图形元素。 +{{ if: ${usageType} === 'customSeries' }} +注意,如果其任意子节点是 `null`,这表示该子节点不再存在。所以,如果再次调用 `setOption` 时,一个子节点被设为 `null`,这意味着它之前对应序号的元素会被删除。如果希望一个子节点保持不变,应在新的配置项中使用 `{}` 表示。 +{{ /if }} + {{ use: partial-graphic-cpt-common-props( type = 'group', prefix = ${prefix}, @@ -2017,4 +2021,3 @@ type TransformProp = ``` 也参见这个 [例子](${galleryEditorPath}custom-spiral-race&edit=1&reset=1)。 - From c27394523e5d34b9948dbd62d5d95327d13699f6 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 1 Aug 2022 14:39:09 +0800 Subject: [PATCH 2/2] fix(custom): update null hints --- en/option/partial/zr-graphic.md | 3 ++- zh/option/partial/zr-graphic.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/en/option/partial/zr-graphic.md b/en/option/partial/zr-graphic.md index 5b993e5c..0f4086a2 100644 --- a/en/option/partial/zr-graphic.md +++ b/en/option/partial/zr-graphic.md @@ -6,7 +6,8 @@ `group` is the only type that can contain children, so that a group of elements can be positioned and transformed together. {{ if: ${usageType} === 'customSeries' }} -Note that if any of its child is `null`, it means the child no longer exists. So if a group contains an element that is set to be `null` in a future `setOption` call, it should remove the previous element at the same index. If a child should not change, it should be `{}` in the new option. +Note that if any of its child is `null`, it means the child no longer exists. So if a group contains an element that is set to be `null/undefined` in a future `setOption` call, it should remove the previous element at the same index. If a child should not change, it should be `{}` in the new option. And a group can only contain children as `null/undefined/{}` if they exist in the previous `setOption`. + {{ /if }} {{ use: partial-graphic-cpt-common-props( diff --git a/zh/option/partial/zr-graphic.md b/zh/option/partial/zr-graphic.md index 5d0cf927..a2a58055 100644 --- a/zh/option/partial/zr-graphic.md +++ b/zh/option/partial/zr-graphic.md @@ -6,7 +6,8 @@ group 是唯一的可以有子节点的容器。group 可以用来整体定位一组图形元素。 {{ if: ${usageType} === 'customSeries' }} -注意,如果其任意子节点是 `null`,这表示该子节点不再存在。所以,如果再次调用 `setOption` 时,一个子节点被设为 `null`,这意味着它之前对应序号的元素会被删除。如果希望一个子节点保持不变,应在新的配置项中使用 `{}` 表示。 +注意,如果其任意子节点是 `null`,这表示该子节点不再存在。所以,如果再次调用 `setOption` 时,一个子节点被设为 `null`,这意味着它之前对应序号的元素会被删除。如果希望一个子节点保持不变,应在新的配置项中使用 `{}` 表示。并且,仅当 group 的子节点在之前的 `setOption` 中存在时,才可以使用 `null/undefined/{}` 作为子节点。 + {{ /if }} {{ use: partial-graphic-cpt-common-props(