Skip to content

Commit ae2ab39

Browse files
committed
docs: 优化部分文档, 增加部分 faq
1 parent be45f83 commit ae2ab39

File tree

6 files changed

+66
-25
lines changed

6 files changed

+66
-25
lines changed

.github/workflows/issue-labeled.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
token: ${{ secrets.GITHUB_TOKEN }}
1818
issue-number: ${{ github.event.issue.number }}
1919
body: |
20-
你好 @${{ github.event.issue.user.login }},请提供一个可以在线访问的链接, 或者 [codesandbox](https://codesandbox.io/s/29zle) 示例并详细说明复现步骤, 15 天内未回复issue自动关闭。
20+
你好 @${{ github.event.issue.user.login }},请提供一个可以在线访问的链接, 或者使用 [codesandbox](https://codesandbox.io/s/29zle) 提供示例并详细说明复现步骤, 15 天内未回复issue自动关闭。
2121
22-
Hello, @${{ github.event.issue.user.login }}, please provide an accessible link or [codesandbox](https://codesandbox.io/s/29zle) usage to describe the reproduction steps. The issue will be closed without any replay within 15 days.
22+
Hello, @${{ github.event.issue.user.login }}, please provide an accessible link or usage [codesandbox](https://codesandbox.io/s/29zle) to describe the reproduction steps. The issue will be closed without any replay within 15 days.
2323
2424
- name: Need more info
2525
if: github.event.label.name == '👀 need more info'

.github/workflows/release-notify.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
${{ secrets.DING_TALK_ACCESS_TOKEN }}
1919
${{ secrets.DING_TALK_GROUP_TOKEN }}
2020
${{ secrets.DING_TALK_PUBLIC_TOKEN }}
21-
notify_title: '🎉 {release_tag} 发布 🎉'
22-
notify_body: '## { title } <hr /> ![preview](https://gw.alipayobjects.com/zos/antfincdn/ISzgBCtgR/2c5c4aaa-4f40-46f7-8f6b-427fa9ff07bb.png) <hr /> { body } <hr />'
23-
notify_footer: '> 前往 [**AntV/S2 Releases**]({ release_url }) 查看完整信息.'
21+
notify_title: '🎉 新版本发布 🎉'
22+
notify_body: '![preview](https://gw.alipayobjects.com/zos/antfincdn/ISzgBCtgR/2c5c4aaa-4f40-46f7-8f6b-427fa9ff07bb.png) <hr /> 看看有哪些更新吧 <hr />'
23+
notify_footer: '> 前往 [**AntV/S2 Releases**](https://github.com/antvis/S2/releases/latest) 查看完整信息.'
2424
at_all: false
2525
enable_prerelease: false

s2-site/docs/api/basic-class/base-cell.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ order: 4
1919
| getTextStyle | 获取文本样式 | `() => void` |
2020
| getFormattedFieldValue | 获取格式化后的字段值 | `() => { formattedValue: string, value: string }` |
2121
| getMaxTextWidth | 获取文本最大宽度 | `() => number` |
22-
| getTextPosition | 获取文本最大宽度 | [Point](#point) |
22+
| getTextPosition | 获取文本坐标 | [Point](#point) |
2323
| getContentArea | 获取内容区域 | `() => { x: number, y: number, width: number, height: number }` |
2424
| updateByState | 根据状态更新单元格样式 | `(stateName: InteractionStateName, cell: S2CellType) => void` |
2525
| hideInteractionShape | 隐藏单元格的交互图层 | `() => void` |

s2-site/docs/api/general/S2Options.zh.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ order: 1
1414
| tooltip | [Tooltip](#tooltip) | | | tooltip 总配置 |
1515
| interaction | [Interaction](#interaction) | | | 表格交互配置 |
1616
| pagination | [Pagination](#pagination) | | | 分页配置 |
17-
| frozenRowHeader | `boolean` | | `true` | 冻结行头 (透视表有效) |
17+
| frozenRowHeader | `boolean` | | `true` | 冻结行头 透视表有效 |
1818
| showSeriesNumber | `boolean` | | `false` | 是否显示行序号 |
1919
| scrollReachNodeField | [NodeField](#nodefield) | | | 滚动监听的节点度量 |
2020
| showDefaultHeaderActionIcon |`boolean` | | `true` | 是否展示默认行列头操作图标 |
2121
| headerActionIcons | [HeaderActionIcon[]](#headeractionicon) | | `false` | 自定义行列头操作图标(需要将 `showDefaultHeaderActionIcon` 置为 `false`|
2222
| customSVGIcons | [CustomSVGIcon[]](#customsvgicon) | | `false` | 自定义 svg 图标 |
23-
| style | [Style](#style) | | | 单元格样式设置, 比如布局类型, 宽高, 边距, 是否隐藏数值列头等 |
24-
| frozenRowCount | `number` | | | 冻结行的数量,从顶部开始计数 (明细表有效) |
25-
| frozenColCount | `number` | | | 冻结列的数量,从左侧开始计数 (明细表有效) |
26-
| frozenTrailingRowCount | `number` | | | 冻结行数量,从底部开始计数 (明细表有效) |
27-
| frozenTrailingColCount | `number` | | | 冻结列的数量,从右侧开始计数 (明细表有效) |
23+
| style | [Style](#style) | | | 单元格样式设置比如布局类型,宽高,边距,是否隐藏数值列头等 |
24+
| frozenRowCount | `number` | | | 冻结行的数量,从顶部开始计数 明细表有效 |
25+
| frozenColCount | `number` | | | 冻结列的数量,从左侧开始计数 明细表有效 |
26+
| frozenTrailingRowCount | `number` | | | 冻结行数量,从底部开始计数 明细表有效 |
27+
| frozenTrailingColCount | `number` | | | 冻结列的数量,从右侧开始计数 明细表有效 |
2828
| hierarchyCollapse | `boolean` | | `false` | 在树状结构模式下行头是否默认展开。 |
2929
| hdAdapter | `boolean` | | `true` | 是否开启高清屏适配,解决多屏切换,高清视网膜屏字体渲染模糊的问题 |
3030
| mergedCellsInfo | [MergedCellInfo[][]](#mergedcellinfo) | | | 合并单元格信息 |
@@ -42,7 +42,7 @@ order: 1
4242
| mappingDisplayDataItem | [MappingDataItemCallback](#mappingdataitemcallback) | | | 转换数据,用于 tooltip 显示 |
4343
| otterLayout | [OtterLayout](#otterlayout) | | | 自定义 layout |
4444
| dataSet | [DataSet](#dataset) | | | 自定义数据集 |
45-
| supportCSSTransform | `boolean` | | `false` | 设置为true可解决父元素缩放引起的鼠标定位错误 |
45+
| supportCSSTransform | `boolean` | | `false` | 开启后支持 CSS transform, 解决父元素设置 `transform` 后,鼠标坐标响应不正确的问题 |
4646

4747
`markdown:docs/common/interaction.zh.md`
4848

s2-site/docs/manual/contribution.zh.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ order: 7
1616

1717
目前,我们基于 `master` 分支开发,有任何修改,请基于 `master` 拉一个分支,然后通过 `PR` 的形式,我们集成了钉钉机器人,会第一次时间 review 你的 PR, 给与反馈
1818

19-
## 提交 Bug
19+
## 提交 Bug 反馈
2020

21-
很抱歉又写了一些 bug, 但求友好的提交一个有意义的 bug, 谁也不希望反馈的 bug 是这样:
21+
很抱歉又写了一些 bug, 但求友好的提交一个有意义的 bug 反馈,谁也不希望反馈的 bug 是这样:
2222

2323
![preview](https://gw.alipayobjects.com/zos/antfincdn/j0jUvKwT%26/dd59fe64-7108-4ad7-a544-e19d79eea890.png)
2424

25+
没有版本信息,没有复现步骤,没有问题描述,没有代码片段,开局一句话,内容全靠猜。
26+
2527
首先选择 [Bug report]
2628

2729
![preview](https://gw.alipayobjects.com/zos/antfincdn/oAnzfiVl2/9d83b3e8-b05c-4475-b736-92c45448546a.png)
@@ -36,7 +38,7 @@ order: 7
3638
2. 安装依赖:`yarn bootstrap` 或者 `yarn`
3739
3. 提交你的改动,commit 请遵守 [AngularJS Git Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#heading=h.uyo6cb12dt6w)
3840
4. 如果你的改动是修复 bug, 还可以在提交信息后面加上 `close #issue 号`, 这样可以在 pr 合并后,可以自动关闭对应的 issue, 比如 `fix: render bug close #123`
39-
5. 确保加上了对应的单元测试和文档 (如有必要)
41+
5. 确保加上了对应的单元测试和文档 如有必要
4042
6. 所有 Lint 和 Test 检查通过后,并且 review 通过,我们会合并你的 pr.
4143

4244
![preview](https://gw.alipayobjects.com/zos/antfincdn/ssOxFrycD/86339514-5f9a-4101-8690-e47c97cd8af5.png)
@@ -52,8 +54,8 @@ npm i -g yarn
5254
1. `yarn bootstrap` 安装依赖
5355
2. `yarn site:bootstrap` 安装网站相关依赖
5456
3. `yarn site:start` 启动本地的 `S2` 网站
55-
4. `yarn core:start` 可视化的方式调试核心层测试 (基于 jest-electron)
56-
5. `yarn react:start` 可视化的方式调试组件层测试 (基于 jest-electron)
57-
6. `yarn react:playground` 启动本地的组件层demo (基于 vite)
58-
7. `yarn build` 构建 `@antv/s2``@antv/s2-react` 两个包, 分别输出 `umd`, `esm``lib` 目录
57+
4. `yarn core:start` 可视化的方式调试核心层测试 基于 jest-electron)
58+
5. `yarn react:start` 可视化的方式调试组件层测试 基于 jest-electron)
59+
6. `yarn react:playground` 启动本地的组件层 demo (基于 vite)
60+
7. `yarn build` 构建 `@antv/s2``@antv/s2-react` 两个包分别输出 `umd`, `esm``lib` 目录
5961
8. `yarn test` 运行单元格测试

s2-site/docs/manual/faq.zh.md

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 常见问题
33
order: 8
44
---
55

6-
在提出问题前,建议仔细阅读一遍文档。
6+
**在提出问题前,建议仔细阅读一遍文档。**
77

88
## 1. 使用问题
99

@@ -43,8 +43,8 @@ order: 8
4343
```ts
4444
<script src="./dist/index.min.js"></script>
4545
<script>
46-
const s2 = new window.S2.PivotSheet(container, s2DataConfig, s2options);
47-
s2.render();
46+
const s2 = new window.S2.PivotSheet(container, s2DataConfig, s2options);
47+
s2.render();
4848
</script>
4949
```
5050

@@ -67,15 +67,50 @@ s2.render();
6767

6868
### 父级元素使用了 `transform: scale` 后,图表鼠标坐标响应不正确
6969

70-
可以调用 `s2.changeSize` 根据缩放比改变图表大小,使图表和父元素缩放比保持一致
70+
可以开启 `supportCSSTransform` 属性
71+
72+
```ts
73+
const s2Options = {
74+
supportCSSTransform: true
75+
}
76+
```
77+
78+
也可以手动调用 `s2.changeSize` 根据缩放比改变图表大小,使图表和父元素缩放比保持一致
7179

7280
```ts
7381
const scale = 0.8
7482
s2.changeSize(width * scale, height * scale)
7583
s2.render(false)
7684
```
7785

78-
可参考 [issue #808](https://github.com/antvis/S2/issues/808) (感谢 [cylnet](https://github.com/cylnet))
86+
可参考 issue [#808](https://github.com/antvis/S2/issues/808) [#990](https://github.com/antvis/S2/pull/990) (感谢 [@cylnet](https://github.com/cylnet) [@xiaochong44](https://github.com/xiaochong44))
87+
88+
### 如何更新表格配置?
89+
90+
```ts
91+
const pivotSheet = new PivotSheet(document.getElementById('container'), dataCfg, options);
92+
```
93+
94+
更新 options: [可选项](https://s2.antv.vision/zh/docs/api/general/S2Options)
95+
96+
```ts
97+
pivotSheet.setOptions({ ... })
98+
pivotSheet.render(false) // 重新渲染,不更新数据
99+
```
100+
101+
更新 dataCfg: [可选项](https://s2.antv.vision/zh/docs/api/general/S2DataConfig)
102+
103+
```ts
104+
pivotSheet.setDataCfg({ ... })
105+
pivotSheet.render(true) // 重新渲染,且更新数据
106+
```
107+
108+
更新 theme: [可选项](https://s2.antv.vision/zh/docs/api/general/S2Theme)
109+
110+
```ts
111+
pivotSheet.setThemeCfg({ ... })
112+
pivotSheet.render(false) // 重新渲染,不更新数据
113+
```
79114

80115
### 图表渲染不出来,怎么回事?
81116

@@ -132,6 +167,10 @@ s2.render(false)
132167

133168
配套的 [分析组件](/zh/examples/react-component), 目前还没有 `@antv/s2-vue`, `@antv/s2-angular` 的开发计划,欢迎社区一起建设 👏🏻.
134169

170+
### 怎样贡献代码?
171+
172+
请查看 [贡献指南](https://s2.antv.vision/zh/docs/manual/contribution)
173+
135174
### 为什么在小程序上面表格无法显示?
136175

137176
目前 `S2` 只支持 `web` 平台,小程序暂不支持。

0 commit comments

Comments
 (0)