Skip to content

Commit

Permalink
chore: 改名为 includeTotalData 参数名以及文档
Browse files Browse the repository at this point in the history
  • Loading branch information
JuZe committed Oct 19, 2023
1 parent fa51116 commit 706a74b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions packages/s2-core/src/data-set/base-data-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ export abstract class BaseDataSet {
* @param isTotals
* @param isRow
* @param drillDownFields
* @param withMissedField 用于标记是否需要汇总数据混入其中,在排序功能中使用
* @param includeTotalData 用于标记是否包含汇总数据,例如在排序功能中需要汇总数据,在计算汇总值中只取明细数据
*/
public abstract getMultiData(
query: DataType,
isTotals?: boolean,
isRow?: boolean,
drillDownFields?: string[],
withMissedField?: boolean,
includeTotalData?: boolean,
): DataType[];

public moreThanOneValue() {
Expand Down
4 changes: 2 additions & 2 deletions packages/s2-core/src/data-set/pivot-data-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ export class PivotDataSet extends BaseDataSet {
isTotals?: boolean,
isRow?: boolean,
drillDownFields?: string[],
withMissedField?: boolean,
includeTotalData?: boolean,
): DataType[] {
if (isEmpty(query)) {
return compact(customFlattenDeep(this.indexesData));
Expand All @@ -672,7 +672,7 @@ export class PivotDataSet extends BaseDataSet {
// existDimensionGroup:当 undefined 维度后面有非 undefined,为维度分组场景,将非 undefined 维度前的维度填充为所有可能的维度值。
// 如 [undefined , '杭州市' , undefined , 'number']
const existDimensionGroup =
!withMissedField && this.checkExistDimensionGroup(query);
!includeTotalData && this.checkExistDimensionGroup(query);
let result = [];
if (existDimensionGroup) {
result = this.getGroupTotalMultiData(totalRows, query);
Expand Down
2 changes: 1 addition & 1 deletion s2-site/docs/api/basic-class/base-data-set.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ s2.dataSet.xx()
| getDisplayDataSet | Get the currently displayed dataset | () => [DataType\[\]](#datatype) | |
| getDimensionValues | get dimension value | (filed: string, query?: [DataType](#datatype) ) => string\[] | |
| getCellData | Get a single cell data | (params: [CellDataParams](#celldataparams) ) => [DataType\[\]](#datatype) | |
| getMultiData | Get bulk cell data | (query: [DataType](#datatype) , isTotals?: boolean, isRow?: boolean, drillDownFields?: string\[]) => [DataType\[\]](#datatype) | |
| getMultiData | Get bulk cell data | (query: [DataType](#datatype) , isTotals?: boolean, isRow?: boolean, drillDownFields?: string\[],includeTotalData:boolean) => [DataType\[\]](#datatype) | |
| moreThanOneValue | Is there more than 1 value | () => [ViewMeta](#viewmeta) | |

### DataType
Expand Down
36 changes: 18 additions & 18 deletions s2-site/docs/api/basic-class/base-data-set.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ order: 5
s2.dataSet.getFieldName('type')
```

| 参数 | 说明 | 类型 | 版本 |
| ------------------- | ---------------------------------- | ------------------------------------------------------------ | ------------------------------------------- |
| fields | 字段信息 | () => [Fields](/docs/api/general/S2DataConfig#fields) | |
| meta | 字段元信息,包含有字段名、格式化等 | () => [Meta[]](/docs/api/general/S2DataConfig#meta) | |
| originData | 原始数据 | () => [DataType[]](#datatype) | |
| totalData | 汇总数据 | () => [DataType[]](#datatype) | |
| indexesData | 多维索引数据 | () => [DataType[]](#datatype) | |
| sortParams | 排序配置 | () => [SortParams](/docs/api/general/S2DataConfig#sortparams) | |
| spreadsheet | 表格实例 | () => [SpreadSheet](/docs/api/basic-class/spreadsheet) | |
| getFieldMeta | 获取字段元数据信息 | (field: string, meta?: [Meta[]](/docs/api/general/S2DataConfig#meta)) => [Meta](/docs/api/general/S2DataConfig#meta) | |
| getFieldName | 获取字段名 | `() => string` | |
| getFieldFormatter | 获取字段格式化函数 | `() => (v: string) => unknown` | |
| getFieldDescription | 获取字段描述 | `() => string` | |
| 参数 | 说明 | 类型 | 版本 |
| ------------------- | ---------------------------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------------------------------------------- |
| fields | 字段信息 | () => [Fields](/docs/api/general/S2DataConfig#fields) | |
| meta | 字段元信息,包含有字段名、格式化等 | () => [Meta[]](/docs/api/general/S2DataConfig#meta) | |
| originData | 原始数据 | () => [DataType[]](#datatype) | |
| totalData | 汇总数据 | () => [DataType[]](#datatype) | |
| indexesData | 多维索引数据 | () => [DataType[]](#datatype) | |
| sortParams | 排序配置 | () => [SortParams](/docs/api/general/S2DataConfig#sortparams) | |
| spreadsheet | 表格实例 | () => [SpreadSheet](/docs/api/basic-class/spreadsheet) | |
| getFieldMeta | 获取字段元数据信息 | (field: string, meta?: [Meta[]](/docs/api/general/S2DataConfig#meta)) => [Meta](/docs/api/general/S2DataConfig#meta) | |
| getFieldName | 获取字段名 | `() => string` | |
| getFieldFormatter | 获取字段格式化函数 | `() => (v: string) => unknown` | |
| getFieldDescription | 获取字段描述 | `() => string` | |
| setDataCfg | 设置数据配置 | `<T extends boolean = false>(dataCfg: T extends true ?` [`S2DataConfig`](/docs/api/general/S2DataConfig) `: Partial<`[`S2DataConfig`](/docs/api/general/S2DataConfig)`>, reset?: T) => void` | `reset` 参数需在 `@antv/s2-v1.34.0`版本使用 |
| getDisplayDataSet | 获取当前显示的数据集 | () => [DataType[]](#datatype) | |
| getDimensionValues | 获取维值 | (filed: string, query?: [DataType](#datatype) ) => string[] | |
| getCellData | 获取单个的单元格数据 | (params: [CellDataParams](#celldataparams)) => [DataType[]](#datatype) | |
| getMultiData | 获取批量的单元格数据 | (query: [DataType](#datatype), isTotals?: boolean, isRow?: boolean, drillDownFields?: string[]) => [DataType[]](#datatype) | |
| moreThanOneValue | 是否超过 1 个数值 | () => [ViewMeta](#viewmeta) | |
| getDisplayDataSet | 获取当前显示的数据集 | () => [DataType[]](#datatype) | |
| getDimensionValues | 获取维值 | (filed: string, query?: [DataType](#datatype) ) => string[] | |
| getCellData | 获取单个的单元格数据 | (params: [CellDataParams](#celldataparams)) => [DataType[]](#datatype) | |
| getMultiData | 获取批量的单元格数据 | (query: [DataType](#datatype), isTotals?: boolean, isRow?: boolean, drillDownFields?: string[],includeTotalData:boolean) => [DataType[]](#datatype) | |
| moreThanOneValue | 是否超过 1 个数值 | () => [ViewMeta](#viewmeta) | |

### DataType

Expand Down

0 comments on commit 706a74b

Please sign in to comment.