-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1994 from VisActor/feat/package-size
Feat/package size
- Loading branch information
Showing
87 changed files
with
590 additions
and
1,202 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
common/changes/@visactor/vtable/feat-package-size_2024-07-01-07-08.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@visactor/vtable", | ||
"comment": "feat: optimize package size & add load on demand feature", | ||
"type": "minor" | ||
} | ||
], | ||
"packageName": "@visactor/vtable" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# VTable on-demand loading | ||
|
||
By default, `ListTable`, `PivotTable` and `PivotChart` introduced from `@visactor/vtable` package contain all table-related components, which is a complete table component library. | ||
|
||
In order to meet the needs of package size optimization, VTable provides two types, `ListTableSimple` and `PivotTableSimple`, which are the most simplified lists and pivot tables, respectively. They only support text display and do not contain external components such as menus and titles. If you need some functions, you can load them on demand. The usage is as follows: | ||
|
||
```js | ||
// ListTableSimple, PivotTableSimple are the simplest list and pivot table components, which do not include cell types and any components other than text | ||
import {ListTableSimple, PivotTableSimple, registerTitle, registerTooltip} from '@visactor/vtable'; | ||
|
||
// Register title component | ||
registerTitle(); | ||
|
||
// Register tooltip component | ||
registerTooltip(); | ||
``` | ||
|
||
## Load functions on demand | ||
|
||
### Functional components | ||
|
||
* registerAxis: axis component | ||
* registerEmptyTip: empty prompt component | ||
* registerLegend: legend component | ||
* registerMenu: menu component | ||
* registerTitle: title component | ||
* registerTooltip: tooltip component | ||
|
||
### Cell type | ||
|
||
* registerChartCell: chart cell | ||
* registerCheckboxCell: checkbox cell | ||
* registerImageCell: Image cell | ||
* registerProgressBarCell: Progress bar cell | ||
* registerRadioCell: Radio button cell | ||
* registerSparkLineCell: Sparkline cell | ||
* registerTextCell: Text cell | ||
* registerVideoCell: Video cell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# VTable 按需加载 | ||
|
||
默认从 `@visactor/vtable` 包中引入的 `ListTable` 、 `PivotTable` 和 `PivotChart` 包含所有的表格相关的组件,是一个完整的表格组件库。 | ||
|
||
为了满足包体积优化的需求,VTable提供了 `ListTableSimple` 和 `PivotTableSimple` 两个类型,分别是最简化的列表和透视表,只支持文字类型的显示,不包含菜单、标题等外部组件。如果需要部分功能,可以进行按需加载,使用方法如下: | ||
|
||
```js | ||
// ListTableSimple, PivotTableSimple 是最简单的列表和透视表组件,不包除了文字之外的单元格类型和任何组件 | ||
import {ListTableSimple, PivotTableSimple, registerTitle, registerTooltip} from '@visactor/vtable'; | ||
|
||
// 注册标题组件 | ||
registerTitle(); | ||
|
||
// 注册tooltip组件 | ||
registerTooltip(); | ||
``` | ||
|
||
## 按需加载功能 | ||
|
||
### 功能组件 | ||
|
||
* registerAxis: 坐标轴组件 | ||
* registerEmptyTip: 空白提示组件 | ||
* registerLegend: 图例组件 | ||
* registerMenu: 菜单组件 | ||
* registerTitle: 标题组件 | ||
* registerTooltip: tooltip组件 | ||
|
||
### 单元格类型 | ||
|
||
* registerChartCell: 图表单元格 | ||
* registerCheckboxCell: 复选框单元格 | ||
* registerImageCell: 图片单元格 | ||
* registerProgressBarCell: 进度条单元格 | ||
* registerRadioCell: 单选框单元格 | ||
* registerSparkLineCell: 迷你图单元格 | ||
* registerTextCell: 文字单元格 | ||
* registerVideoCell: 视频单元格 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/vtable/__tests__/api/listTable-getCellRelativePosition.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/vtable/__tests__/columns/listTable-cellType-function.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/vtable/__tests__/columns/listTable-custom-layout.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/vtable/__tests__/options/listTable-api-with-frozen.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/vtable/__tests__/options/listTable-autoRowHeight.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { ListTable } from './ListTable'; | ||
import { | ||
registerAxis, | ||
registerEmptyTip, | ||
registerLegend, | ||
registerMenu, | ||
registerTitle, | ||
registerTooltip | ||
} from './components'; | ||
import { | ||
registerChartCell, | ||
registerCheckboxCell, | ||
registerImageCell, | ||
registerProgressBarCell, | ||
registerRadioCell, | ||
registerSparkLineCell, | ||
registerTextCell, | ||
registerVideoCell | ||
} from './scenegraph/group-creater/cell-type'; | ||
|
||
registerAxis(); | ||
registerEmptyTip(); | ||
registerLegend(); | ||
registerMenu(); | ||
registerTitle(); | ||
registerTooltip(); | ||
|
||
registerChartCell(); | ||
registerCheckboxCell(); | ||
registerImageCell(); | ||
registerProgressBarCell(); | ||
registerRadioCell(); | ||
registerSparkLineCell(); | ||
registerTextCell(); | ||
registerVideoCell(); | ||
export class ListTableAll extends ListTable {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ListTable } from './ListTable'; | ||
import { registerTextCell } from './scenegraph/group-creater/cell-type'; | ||
|
||
registerTextCell(); | ||
export class ListTableSimple extends ListTable {} |
Oops, something went wrong.