-
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 #2029 from VisActor/release/1.4.2
[Auto release] release 1.4.2
- Loading branch information
Showing
60 changed files
with
2,488 additions
and
1,091 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.4.1","mainProject":"@visactor/vtable","nextBump":"patch"}] | ||
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.4.2","mainProject":"@visactor/vtable","nextBump":"patch"}] |
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,37 @@ | ||
# v1.0.0 | ||
|
||
2024-05-21 | ||
|
||
**💥 Breaking change** | ||
|
||
- **@visactor/vtable**: If the user has previously passed in rowTree and columnTree for the pivot table, under this usage, the result returned by the getCellOriginRecord interface changes from the previous object to an array structure, and if no default aggregation was previously performed, the SUM aggregation rule will be used for data calculation. If you want to cancel the numerical calculation rule, you can specify the aggregation rule as NONE for the indicator. | ||
|
||
Configuration examples, you can also refer to [Tutorial](https://visactor.io/vtable/guide/data_analysis/pivot_table_dataAnalysis): | ||
``` | ||
records:[{ | ||
region: '中南', | ||
province: '广西', | ||
year: '2016', | ||
quarter: '2016-Q1', | ||
sales: 'NULL', | ||
profit: 1546 | ||
}], | ||
dataConfig:{ | ||
aggregationRules: [ | ||
{ | ||
indicatorKey: 'sales', | ||
field: 'sales', | ||
aggregationType: VTable.TYPES.AggregationType.NONE, | ||
} | ||
] | ||
} | ||
``` | ||
**🆕 New feature** | ||
|
||
- **@visactor/vtable**: rows and tree can combined use [#1644](https://github.com/VisActor/VTable/issues/1644) | ||
- **@visactor/vtable**: add virtual option for rowTree and columnTree [#1644](https://github.com/VisActor/VTable/issues/1644) | ||
|
||
|
||
|
||
[more detail about v1.0.0](https://github.com/VisActor/VTable/releases/tag/v1.0.0) |
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,39 @@ | ||
|
||
# v1.0.0 | ||
|
||
2024-05-21 | ||
|
||
**💥 Breaking change** | ||
|
||
- **@visactor/vtable**: 透视表如果之前用户传入了rowTree和columnTree,在此用法下,getCellOriginRecord接口返回结果由之前对象变为数组结构,并且之前没有做默认聚合目前会使用SUM聚会规则进行数据计算,如果想取消数值计算规则可以为指标指定聚合规则为NONE。 | ||
|
||
配置示例,也可以参考[教程](https://visactor.io/vtable/guide/data_analysis/pivot_table_dataAnalysis): | ||
``` | ||
records:[{ | ||
region: '中南', | ||
province: '广西', | ||
year: '2016', | ||
quarter: '2016-Q1', | ||
sales: 'NULL', | ||
profit: 1546 | ||
}], | ||
dataConfig:{ | ||
aggregationRules: [ | ||
{ | ||
indicatorKey: 'sales', //指标名称 | ||
field: 'sales', //指标依据字段 | ||
aggregationType: VTable.TYPES.AggregationType.NONE, //不做聚合 匹配到其中对应数据获取其对应field的值 | ||
} | ||
] | ||
} | ||
``` | ||
|
||
**🆕 新增功能** | ||
|
||
- **@visactor/vtable**: 自定义树形表头customTree可以和透视分析能力结合使用 [#1644](https://github.com/VisActor/VTable/issues/1644) | ||
- **@visactor/vtable**: 在 rowTree & columnTree 中加入virtual option [#1644](https://github.com/VisActor/VTable/issues/1644) | ||
|
||
|
||
|
||
[更多详情请查看 v1.0.0](https://github.com/VisActor/VTable/releases/tag/v1.0.0) |
171 changes: 171 additions & 0 deletions
171
docs/assets/demo/en/basic-functionality/pivot-table-corner-title.md
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,171 @@ | ||
--- | ||
category: examples | ||
group: Basic Features | ||
title: Display dimension names in pivot table headers | ||
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/pivot-table-corner-title.png | ||
link: '../guide/table_type/Pivot_table/pivot_table_useage' | ||
option: PivotTable#corner | ||
--- | ||
|
||
# Display dimension names in pivot table headers | ||
|
||
If you set the header title display content basis to `'all'`, the header cell content will be the concatenation of the row dimension name and the column dimension name. | ||
|
||
titleOnDimension The corner title displays content based on: | ||
|
||
- 'column' column dimension name as header cell content | ||
- 'row' row dimension name as header cell content | ||
- 'none' means the header cell content is empty | ||
- 'all' means the header cell content is the concatenation of the row dimension name and the column dimension name | ||
|
||
## Key Configurations | ||
|
||
- `PivotTable` | ||
- `columns` | ||
- `rows` | ||
- `indicators` | ||
- `corner.titleOnDimension` Corner title display content based on | ||
|
||
## Code Demo | ||
|
||
```javascript livedemo template=vtable | ||
let tableInstance; | ||
fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_Pivot_Chart_data.json') | ||
.then(res => res.json()) | ||
.then(data => { | ||
const option = { | ||
records: data, | ||
rows: [ | ||
{ | ||
dimensionKey: 'Category', | ||
title: 'Category', | ||
headerStyle: { | ||
textStick: true, | ||
bgColor(arg) { | ||
if (arg.dataValue === 'Row Totals') { | ||
return '#ff9900'; | ||
} | ||
return '#ECF1F5'; | ||
} | ||
}, | ||
width: 'auto' | ||
}, | ||
{ | ||
dimensionKey: 'Sub-Category', | ||
title: 'Sub-Catogery', | ||
headerStyle: { | ||
textStick: true | ||
}, | ||
width: 'auto' | ||
} | ||
], | ||
columns: [ | ||
{ | ||
dimensionKey: 'Region', | ||
title: 'Region', | ||
headerStyle: { | ||
textStick: true | ||
}, | ||
width: 'auto' | ||
}, | ||
{ | ||
dimensionKey: 'Segment', | ||
title: 'Segment', | ||
headerStyle: { | ||
textStick: true | ||
}, | ||
width: 'auto' | ||
} | ||
], | ||
indicators: [ | ||
{ | ||
indicatorKey: 'Quantity', | ||
title: 'Quantity', | ||
width: 'auto', | ||
sort: true, | ||
headerStyle: { | ||
fontWeight: 'normal' | ||
}, | ||
style: { | ||
padding: [16, 28, 16, 28], | ||
color(args) { | ||
if (args.dataValue >= 0) return 'black'; | ||
return 'red'; | ||
}, | ||
bgColor(arg) { | ||
const rowHeaderPaths = arg.cellHeaderPaths.rowHeaderPaths; | ||
if (rowHeaderPaths?.[1]?.value === 'Sub Totals') { | ||
return '#ba54ba'; | ||
} else if (rowHeaderPaths?.[0]?.value === 'Row Totals') { | ||
return '#ff9900'; | ||
} | ||
return undefined; | ||
} | ||
} | ||
}, | ||
{ | ||
indicatorKey: 'Sales', | ||
title: 'Sales', | ||
width: 'auto', | ||
sort: true, | ||
headerStyle: { | ||
fontWeight: 'normal' | ||
}, | ||
format: rec => { | ||
return '$' + Number(rec).toFixed(2); | ||
}, | ||
style: { | ||
padding: [16, 28, 16, 28], | ||
color(args) { | ||
if (args.dataValue >= 0) return 'black'; | ||
return 'red'; | ||
}, | ||
bgColor(arg) { | ||
const rowHeaderPaths = arg.cellHeaderPaths.rowHeaderPaths; | ||
if (rowHeaderPaths?.[1]?.value === 'Sub Totals') { | ||
return '#ba54ba'; | ||
} else if (rowHeaderPaths?.[0]?.value === 'Row Totals') { | ||
return '#ff9900'; | ||
} | ||
return undefined; | ||
} | ||
} | ||
}, | ||
{ | ||
indicatorKey: 'Profit', | ||
title: 'Profit', | ||
width: 'auto', | ||
showSort: false, | ||
headerStyle: { | ||
fontWeight: 'normal' | ||
}, | ||
format: rec => { | ||
return '$' + Number(rec).toFixed(2); | ||
}, | ||
style: { | ||
padding: [16, 28, 16, 28], | ||
color(args) { | ||
if (args.dataValue >= 0) return 'black'; | ||
return 'red'; | ||
}, | ||
bgColor(arg) { | ||
const rowHeaderPaths = arg.cellHeaderPaths.rowHeaderPaths; | ||
if (rowHeaderPaths?.[1]?.value === 'Sub Totals') { | ||
return '#ba54ba'; | ||
} else if (rowHeaderPaths?.[0]?.value === 'Row Totals') { | ||
return '#ff9900'; | ||
} | ||
return undefined; | ||
} | ||
} | ||
} | ||
], | ||
corner: { | ||
titleOnDimension: 'all' | ||
}, | ||
widthMode: 'standard' | ||
}; | ||
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option); | ||
window['tableInstance'] = tableInstance; | ||
}); | ||
``` |
Oops, something went wrong.