Skip to content

Commit

Permalink
fix: 重命名
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Oct 11, 2023
1 parent 0dfe56d commit 25a559e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('Pivot Dataset Test', () => {
});

test('should get correctly empty dataset result', () => {
expect(dataSet.isEmptyDataSet()).toBeFalsy();
expect(dataSet.isEmpty()).toBeFalsy();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('Table Mode Dataset Test', () => {
});

test('should get correctly empty dataset result', () => {
expect(dataSet.isEmptyDataSet()).toBeFalsy();
expect(dataSet.isEmpty()).toBeFalsy();
});
});

Expand Down
4 changes: 2 additions & 2 deletions packages/s2-core/__tests__/unit/facet/table-facet-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jest.mock('@/sheet-type', () => {
clearHoverTimer: jest.fn(),
},
dataSet: {
isEmptyDataSet: jest.fn(),
isEmpty: jest.fn(),
},
};
}),
Expand All @@ -82,7 +82,7 @@ jest.mock('@/data-set/table-data-set', () => {
getCellData: () => 1,
getFieldMeta: jest.fn(),
getFieldFormatter: actualDataSet.prototype.getFieldFormatter,
isEmptyDataSet: jest.fn(),
isEmpty: jest.fn(),
};
}),
};
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/src/data-set/base-data-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export abstract class BaseDataSet {
return this.displayData;
}

public isEmptyDataSet() {
public isEmpty() {
return isEmpty(this.getDisplayDataSet());
}

Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/src/facet/table-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ export class TableFacet extends BaseFacet {
}

// https://github.com/antvis/S2/issues/2255
const indexes = this.spreadsheet.dataSet.isEmptyDataSet()
const indexes = this.spreadsheet.dataSet.isEmpty()
? ([] as unknown as Indexes)
: calculateInViewIndexes(
scrollX,
Expand Down
2 changes: 1 addition & 1 deletion s2-site/docs/api/basic-class/base-data-set.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ s2.dataSet.getFieldName('type')
| getCellData | 获取单个的单元格数据 | (params: [CellDataParams](#celldataparams)) => [DataType[]](#datatype) | |
| getMultiData | 获取批量的单元格数据 | (query: [DataType](#datatype), isTotals?: boolean, isRow?: boolean, drillDownFields?: string[]) => [DataType[]](#datatype) | |
| moreThanOneValue | 是否超过 1 个数值 | () => [ViewMeta](#viewmeta) | |
| isEmptyDataSet | 是否为空数据集 | () => `boolean` | `@antv/s2-v1.51.1` |
| isEmpty | 是否为空数据集 | () => `boolean` | `@antv/s2-v1.51.1` |

### DataType

Expand Down

0 comments on commit 25a559e

Please sign in to comment.