-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: 补充缺失的 fontStyle 和 fontVariant 文档 (#2407)
- Loading branch information
1 parent
432c0c7
commit eb8adbc
Showing
5 changed files
with
57 additions
and
1 deletion.
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
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
42 changes: 42 additions & 0 deletions
42
s2-site/examples/custom/custom-cell/demo/data-cell-placeholder.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { PivotSheet, CornerCell } from '@antv/s2'; | ||
|
||
fetch( | ||
'https://gw.alipayobjects.com/os/bmw-prod/cd9814d0-6dfa-42a6-8455-5a6bd0ff93ca.json', | ||
) | ||
.then((res) => res.json()) | ||
.then((res) => { | ||
const container = document.getElementById('container'); | ||
const s2DataConfig = { | ||
fields: { | ||
rows: ['province', 'city'], | ||
columns: ['type', 'sub_type'], | ||
values: ['number'], | ||
}, | ||
meta: res.meta, | ||
data: res.data.map((item, i) => { | ||
return { | ||
...item, | ||
number: i < 5 ? item.number : null, | ||
}; | ||
}), | ||
}; | ||
const s2Options = { | ||
width: 600, | ||
height: 480, | ||
// 默认 "-" | ||
// placeholder: '', | ||
placeholder: (cell) => { | ||
// 或者根据当前单元格动态设置 | ||
console.log('cell: ', cell); | ||
if (cell.cellType === 'dataCell') { | ||
return '*****'; | ||
} | ||
|
||
// 返回 null, 使用默认值 ("-") | ||
return null; | ||
}, | ||
}; | ||
const s2 = new PivotSheet(container, s2DataConfig, s2Options); | ||
|
||
s2.render(); | ||
}); |
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
eb8adbc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
antvis-s2 – ./
antvis-s2-antvis-family.vercel.app
antvis-s2-git-master-antvis-family.vercel.app
antvis-s2.vercel.app