Skip to content

Commit

Permalink
Merge pull request #270 from apache/fix-custom-merge
Browse files Browse the repository at this point in the history
doc: update instruction for custom group being null apache/echarts#17349
  • Loading branch information
Ovilia authored Aug 1, 2022
2 parents 5aa5e5c + c273945 commit 847e47c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion en/option/partial/zr-graphic.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

`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/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(
type = 'group',
prefix = ${prefix},
Expand Down Expand Up @@ -2046,4 +2051,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).
6 changes: 5 additions & 1 deletion zh/option/partial/zr-graphic.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

group 是唯一的可以有子节点的容器。group 可以用来整体定位一组图形元素。

{{ if: ${usageType} === 'customSeries' }}
注意,如果其任意子节点是 `null`,这表示该子节点不再存在。所以,如果再次调用 `setOption` 时,一个子节点被设为 `null`,这意味着它之前对应序号的元素会被删除。如果希望一个子节点保持不变,应在新的配置项中使用 `{}` 表示。并且,仅当 group 的子节点在之前的 `setOption` 中存在时,才可以使用 `null/undefined/{}` 作为子节点。

{{ /if }}

{{ use: partial-graphic-cpt-common-props(
type = 'group',
prefix = ${prefix},
Expand Down Expand Up @@ -2017,4 +2022,3 @@ type TransformProp =
```
也参见这个 [例子](${galleryEditorPath}custom-spiral-race&edit=1&reset=1)。

0 comments on commit 847e47c

Please sign in to comment.