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
The following commit(s) were added to refs/heads/dev by this push:
new f4c05670 (matrix): fix and supplement matrix doc.
f4c05670 is described below
commit f4c05670c9383e0aac03be13521cbfe6dc7bff2a
Author: 100pah <[email protected]>
AuthorDate: Wed Jul 2 15:37:57 2025 +0800
(matrix): fix and supplement matrix doc.
---
en/option/partial/matrix-header.md | 14 +++++++-
en/option/partial/matrix-region.md | 56 ++++++++++++++++++++++++++-----
zh/option/partial/matrix-header.md | 30 ++++++++++++-----
zh/option/partial/matrix-region.md | 67 ++++++++++++++++++++++++++++++--------
4 files changed, 136 insertions(+), 31 deletions(-)
diff --git a/en/option/partial/matrix-header.md
b/en/option/partial/matrix-header.md
index 57d14a6e..ac5dc1d9 100644
--- a/en/option/partial/matrix-header.md
+++ b/en/option/partial/matrix-header.md
@@ -42,6 +42,19 @@ data: [{
}]
```
+#### value(string|number)
+{{ use: partial-version(version = "6.0.0") }}
+The text in the header cell. Can also be used as a index of this column or
row. Optional. If not specified, auto generate a text.
+
+#### children(Array)
+{{ use: partial-version(version = "6.0.0") }}
+See [matrix.x/y.data](~matrix.x.data).
+
+#### size(number)
+{{ use: partial-version(version = "6.0.0") }}
+{{ use: partial-matrix-dimension-size-desc }}
+
+
{{ use: partial-matrix-cell-style-option(
prefix='##',
name=${name}
@@ -54,7 +67,6 @@ data: [{
### levels(Array)
-
{{ use: partial-version(version = "6.0.0") }}
Settings for each column(in `matrix.x`) or row(in `matrix.y`). The first
element represents the first column/row, and so on.
diff --git a/en/option/partial/matrix-region.md
b/en/option/partial/matrix-region.md
index b6e40551..74e2fe3a 100644
--- a/en/option/partial/matrix-region.md
+++ b/en/option/partial/matrix-region.md
@@ -49,26 +49,66 @@ Used when style conflict - especially for thick border
style.
{{ use: partial-version(version = "6.0.0") }}
-The size of all cells in the row/column. For `matrix.x`, it refers to the cell
height; for `matrix.y`, it refers to the cell width.
+{{ use: partial-matrix-dimension-size-desc() }}
-The value type can be:
+
+
+{{ target: partial-matrix-dimension-size-desc }}
+
+**[[The rule of cell size]]**
+
++ option `levelSize`
+ + It specifies the size of all cells in a row or a column.
+ + For `matrix.x`, it refers to the cell height of a row ("level"
refers to a row).
+ + For `matrix.y`, it refers to the cell width of a column ("level"
refers to a column).
+ + It can be declared in:
+ + `matrix.levelSize` specifies the default size of every columns or
rows.
+ + `matrix.levels[i].levelSize` specifies the size of a certain column
or row.
++ option `size`
+ + It specifies the size of a single cell.
+ + For `matrix.x`, it refers to the cell width.
+ + For `matrix.y`, it refers to the cell height.
+ + It can be declared in:
+ + `matrix.x/y.data[i].size`
+
+The value of `levelSize` or `size` can be:
+
++ Unspecified(default): The width or height is evenly distributed.
+ `number`: Represents pixel value.
+ `string`: Percentage value (e.g., `'33%'`), representing the percentage
relative to the width (in `matrix.x`) or height (in `matrix.y`) of the matrix.
-+ Unspecified: The width or height is evenly distributed.
-
-+ `matrix.levelSize` specifies the default size of every tree levels.
-+ `matrix.levels[i].levelSize` specifies the size of a certain level.
For example:
```js
{
matrix: {
x: {
+ // The height of the second row is 10% of the matrix width,
+ levels: [undefined, {levelSize: '10%'}]
+ // And the other row height are evenly distributed.
levelSize: undefined,
+ data: [
+ {
+ // The width of the first cell is 30 pixel.
+ size: 30
+ },
+ // And the other cell width are evenly distributed.
+ // ...
+ ]
+ },
+ y: {
+ // The width of the second column is 10% of the matrix width,
levels: [undefined, {levelSize: '10%'}]
- // the width of the second column is 10% of the matrix width,
- // and other columns width are evenly distributed.
+ // And the other column width are evenly distributed.
+ levelSize: undefined,
+ data: [
+ {
+ // The height of the first cell is 30 pixel.
+ size: 30
+ },
+ // And the other cell height are evenly distributed.
+ // ...
+ ]
},
// ...
},
diff --git a/zh/option/partial/matrix-header.md
b/zh/option/partial/matrix-header.md
index 8ee25a44..c25d93bf 100644
--- a/zh/option/partial/matrix-header.md
+++ b/zh/option/partial/matrix-header.md
@@ -42,6 +42,22 @@ data: [{
}]
```
+#### value(string|number)
+{{ use: partial-version(version = "6.0.0") }}
+
+每个表头单元格中的文字,也可用于索引这行或列。如果不指定,自动生成一个。
+
+#### children(Array)
+{{ use: partial-version(version = "6.0.0") }}
+
+见 [matrix.x/y.data](~matrix.x.data).
+
+#### size(number)
+{{ use: partial-version(version = "6.0.0") }}
+{{ use: partial-matrix-dimension-size-desc }}
+
+
+
{{ use: partial-matrix-cell-style-option(
prefix='##',
name=${name}
@@ -54,22 +70,20 @@ data: [{
### levels(Array)
-
{{ use: partial-version(version = "6.0.0") }}
-Settings for each column(in `matrix.x`) or row(in `matrix.y`). The first
element represents the first column/row, and so on.
+每一列(对于 `matrix.x`)或每一行(对于 `matrix.y`)的设置。第一个元素表示第一列/行,依此类推。
-- If any item in the array is `null`/`undefined`, it means using the default
value.
-- Otherwise any item in the array should be an object, such as `{levelSize:
number}`.
+- 如果数组中的某一项为 `null`/`undefined`,表示使用默认值。
+- 否则每一项应为一个对象,例如 `{levelSize: number}`。
-For example
+例如
```js
matrix: {
x: {
level: [null, {levelSize: '20%'}]
- // The second column width should be 20% of
- // the matrix width.
- // The first column has no specific setting.
+ // 第二列宽度应为矩阵宽度的 20%。
+ // 第一列没有特殊设置。
},
// ...
},
diff --git a/zh/option/partial/matrix-region.md
b/zh/option/partial/matrix-region.md
index 34155a92..fd4013d7 100644
--- a/zh/option/partial/matrix-region.md
+++ b/zh/option/partial/matrix-region.md
@@ -35,11 +35,11 @@
) }}
#${prefix} cursor(string)
-Mouse cursor when hovering on the cell.
+鼠标悬停在单元格上时的鼠标样式。
#${prefix} z2(number)
-Specify the z-index (z-order) of the cell.
-Used when style conflict - especially for thick border style.
+指定单元格的 z-index(堆叠顺序)。
+用于样式冲突时,尤其是边框较粗时。
@@ -50,29 +50,68 @@ Used when style conflict - especially for thick border
style.
{{ use: partial-version(version = "6.0.0") }}
-The size of all cells in the row/column. For `matrix.x`, it refers to the cell
height; for `matrix.y`, it refers to the cell width.
+{{ use: partial-matrix-dimension-size-desc() }}
-The value type can be:
-+ `number`: Represents pixel value.
-+ `string`: Percentage value (e.g., `'33%'`), representing the percentage
relative to the width (in `matrix.x`) or height (in `matrix.y`) of the matrix.
-+ Unspecified: The width or height is evenly distributed.
-+ `matrix.levelSize` specifies the default size of every tree levels.
-+ `matrix.levels[i].levelSize` specifies the size of a certain level.
-For example:
+{{ target: partial-matrix-dimension-size-desc }}
+
+**[[单元格尺寸的规则]]**
+
++ 配置项 `levelSize`
+ + 用于指定某一行或某一列所有单元格的尺寸。
+ + 对于 `matrix.x`,指的是一行单元格的高度("level" 指一行)。
+ + 对于 `matrix.y`,指的是一列单元格的宽度("level" 指一列)。
+ + 可以在以下位置声明:
+ + `matrix.levelSize`:指定所有行或列的默认尺寸。
+ + `matrix.levels[i].levelSize`:指定某一行或列的尺寸。
++ 配置项 `size`
+ + 用于指定单个单元格的尺寸。
+ + 对于 `matrix.x`,指的是单元格的宽度。
+ + 对于 `matrix.y`,指的是单元格的高度。
+ + 可以在以下位置声明:
+ + `matrix.x/y.data[i].size`
+
+`levelSize` 或 `size` 的取值可以为:
+
++ 未指定(默认):宽度或高度会被均匀分配。
++ `number`:表示像素值。
++ `string`:百分比值(如 `'33%'`),表示相对于矩阵宽度(在 `matrix.x` 中)或高度(在 `matrix.y` 中)的百分比。
+
+例如:
```js
{
matrix: {
x: {
+ // 第二行的高度为矩阵宽度的 10%
+ levels: [undefined, {levelSize: '10%'}]
+ // 其他行的高度均匀分配
levelSize: undefined,
+ data: [
+ {
+ // 第一个单元格的宽度为 30 像素
+ size: 30
+ },
+ // 其他单元格的宽度均匀分配
+ // ...
+ ]
+ },
+ y: {
+ // 第二列的宽度为矩阵宽度的 10%
levels: [undefined, {levelSize: '10%'}]
- // the width of the second column is 10% of the matrix width,
- // and other columns width are evenly distributed.
+ // 其他列的宽度均匀分配
+ levelSize: undefined,
+ data: [
+ {
+ // 第一个单元格的高度为 30 像素
+ size: 30
+ },
+ // 其他单元格的高度均匀分配
+ // ...
+ ]
},
// ...
},
}
```
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]