= React.memo(
9 | ({ description }) => (
10 | <>
11 | {description && (
12 |
13 | {i18n('说明')}
14 | {description}
15 |
16 | )}
17 | >
18 | ),
19 | );
20 |
21 | TooltipDescription.displayName = 'TooltipDescription';
22 |
--------------------------------------------------------------------------------
/packages/s2-react/src/components/tooltip/components/head-info.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | TOOLTIP_PREFIX_CLS,
3 | i18n,
4 | type TooltipDetailListItem,
5 | type TooltipHeadInfo,
6 | } from '@antv/s2';
7 | import React from 'react';
8 |
9 | export const TooltipHead: React.FC = React.memo((props) => {
10 | const { rows = [], cols = [] } = props;
11 |
12 | return (
13 |
14 | {cols.map((item: TooltipDetailListItem) => item.value)?.join('/')}
15 | {cols.length > 0 && rows.length > 0 && i18n(',')}
16 | {rows.map((item: TooltipDetailListItem) => item.value)?.join('/')}
17 |
18 | );
19 | });
20 |
21 | TooltipHead.displayName = 'TooltipHead';
22 |
--------------------------------------------------------------------------------
/packages/s2-react/src/components/tooltip/components/icon.tsx:
--------------------------------------------------------------------------------
1 | import { getIcon } from '@antv/s2';
2 | import React from 'react';
3 | import { HtmlIcon } from '../../../common/icons';
4 | import { ReactElement } from '../../../common/react-element';
5 | import type { TooltipIconProps } from '../interface';
6 |
7 | export const TooltipIcon: React.FC = React.memo((props) => {
8 | const { icon, ...attrs } = props;
9 |
10 | if (!icon) {
11 | return null;
12 | }
13 |
14 | if (getIcon(icon as string)) {
15 | const name = icon as string;
16 |
17 | return ;
18 | }
19 |
20 | return ;
21 | });
22 |
23 | TooltipIcon.displayName = 'TooltipIcon';
24 |
--------------------------------------------------------------------------------
/packages/s2-react/src/components/tooltip/components/infos.tsx:
--------------------------------------------------------------------------------
1 | import { TOOLTIP_PREFIX_CLS } from '@antv/s2';
2 | import React from 'react';
3 | import type { TooltipInfosProps } from '../interface';
4 |
5 | export const TooltipInfos: React.FC = React.memo((props) => {
6 | const { infos = '' } = props;
7 |
8 | return {infos}
;
9 | });
10 |
11 | TooltipInfos.displayName = 'TooltipInfos';
12 |
--------------------------------------------------------------------------------
/packages/s2-react/src/components/tooltip/components/simple-tips.tsx:
--------------------------------------------------------------------------------
1 | import { TOOLTIP_PREFIX_CLS, type TooltipNameTipsOptions } from '@antv/s2';
2 | import React from 'react';
3 |
4 | export const TooltipSimpleTips: React.FC = React.memo(
5 | (props) => {
6 | const { tips = '', name = '' } = props;
7 |
8 | return (
9 | <>
10 | {name && {name}
}
11 | {tips && {tips}
}
12 | >
13 | );
14 | },
15 | );
16 |
17 | TooltipSimpleTips.displayName = 'TooltipSimpleTips';
18 |
--------------------------------------------------------------------------------
/packages/s2-react/src/components/tooltip/context.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export const TooltipContext = React.createContext(false);
4 |
--------------------------------------------------------------------------------
/packages/s2-react/src/components/tooltip/index.less:
--------------------------------------------------------------------------------
1 | @import '@antv/s2/esm/shared/styles/tooltip/index.less';
2 |
--------------------------------------------------------------------------------
/packages/s2-react/src/context/SpreadSheetContext.tsx:
--------------------------------------------------------------------------------
1 | import type { SpreadSheet } from '@antv/s2';
2 | import React from 'react';
3 |
4 | export const SpreadSheetContext = React.createContext(
5 | null as unknown as SpreadSheet,
6 | );
7 |
8 | export function useSpreadSheetInstance() {
9 | return React.useContext(SpreadSheetContext);
10 | }
11 |
--------------------------------------------------------------------------------
/packages/s2-react/src/hooks/index.ts:
--------------------------------------------------------------------------------
1 | export * from './useEvents';
2 | export * from './useLoading';
3 | export * from './usePagination';
4 | export * from './usePivotSheetUpdate';
5 | export * from './useResize';
6 | export * from './useSpreadSheet';
7 |
--------------------------------------------------------------------------------
/packages/s2-react/src/hooks/useLoading.ts:
--------------------------------------------------------------------------------
1 | import { S2Event, SpreadSheet } from '@antv/s2';
2 | import React from 'react';
3 |
4 | export const useLoading = (s2: SpreadSheet, loadingFromProps?: boolean) => {
5 | const [loading, setLoading] = React.useState(
6 | loadingFromProps ?? false,
7 | );
8 |
9 | React.useEffect(() => {
10 | s2?.on(S2Event.LAYOUT_BEFORE_RENDER, () => {
11 | setLoading(true);
12 | });
13 |
14 | s2?.on(S2Event.LAYOUT_AFTER_RENDER, () => {
15 | setLoading(false);
16 | });
17 | }, [s2]);
18 |
19 | return {
20 | loading: loadingFromProps ?? loading,
21 | setLoading,
22 | };
23 | };
24 |
--------------------------------------------------------------------------------
/packages/s2-react/src/hooks/useResize.ts:
--------------------------------------------------------------------------------
1 | import { createResizeObserver, type ResizeEffectParams } from '@antv/s2';
2 | import React from 'react';
3 |
4 | export const useResize = (params: ResizeEffectParams) => {
5 | const { s2, adaptive, container, wrapper } = params;
6 |
7 | React.useLayoutEffect(
8 | () => createResizeObserver({ s2, adaptive, wrapper, container }),
9 | [s2, wrapper, container, adaptive],
10 | );
11 | };
12 |
--------------------------------------------------------------------------------
/packages/s2-react/src/index.ts:
--------------------------------------------------------------------------------
1 | import './utils/extendLocale';
2 |
3 | export * from './components';
4 |
--------------------------------------------------------------------------------
/packages/s2-react/src/utils/extendLocale.ts:
--------------------------------------------------------------------------------
1 | import { Locale, extendLocale } from '@antv/s2';
2 |
3 | extendLocale(Locale);
4 |
--------------------------------------------------------------------------------
/packages/s2-react/src/utils/index.ts:
--------------------------------------------------------------------------------
1 | export * from './options';
2 |
--------------------------------------------------------------------------------
/packages/s2-react/src/utils/options.ts:
--------------------------------------------------------------------------------
1 | import { getBaseSheetComponentOptions } from '@antv/s2';
2 | import { RENDER_TOOLTIP_OPTIONS } from '../common';
3 | import type { SheetComponentOptions } from '../components';
4 |
5 | export const getSheetComponentOptions = (
6 | ...options: Partial[]
7 | ) =>
8 | getBaseSheetComponentOptions(
9 | RENDER_TOOLTIP_OPTIONS,
10 | ...options,
11 | );
12 |
--------------------------------------------------------------------------------
/packages/s2-react/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "include": ["src/**/*", "./typings.d.ts", "../../global.d.ts"],
4 | "compilerOptions": {
5 | "target": "es2015",
6 | "paths": {
7 | "@antv/s2": ["s2-react/node_modules/@antv/s2/esm/index.d.ts"],
8 | "@antv/s2/*": ["s2-react/node_modules/@antv/s2/esm/*"]
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/s2-react/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "target": "ESNext",
5 | "jsx": "react",
6 | "paths": {
7 | "@antv/s2": ["s2-core/src/index.ts"],
8 | "@antv/s2/*":["s2-core/src/*"],
9 | "@antv/s2/esm/shared": ["s2-core/src/shared/index.ts"],
10 | "@antv/s2/esm/shared/*": ["s2-core/src/shared/*"],
11 | "@antv/s2-react-components": ["s2-react-components/src/index.ts"],
12 | "@/*": ["s2-react/src/*"],
13 | "tests/*": ["s2-react/__tests__/*"]
14 | }
15 | },
16 | "exclude": ["node_modules", "coverage", "esm", "lib", "dist", "temp"],
17 | "include": ["src", "./typings.d.ts", "playground", "../../global.d.ts"]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/s2-react/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.svg' {
4 | import * as React from 'react';
5 |
6 | export const ReactComponent: React.FunctionComponent<
7 | React.SVGProps & { title?: string }
8 | >;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/s2-vue/.releaserc.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../../.releaserc.base.js');
2 |
--------------------------------------------------------------------------------
/packages/s2-vue/__tests__/setup.js:
--------------------------------------------------------------------------------
1 | ['time', 'info', 'warn'].forEach((type) => {
2 | jest.spyOn(console, type).mockImplementation(() => {});
3 | });
4 |
--------------------------------------------------------------------------------
/packages/s2-vue/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../../jest.config.base');
2 |
--------------------------------------------------------------------------------
/packages/s2-vue/playground/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | S2 Vue Playground
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/s2-vue/playground/index.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './App.vue';
3 |
4 | createApp(App).mount('#app');
5 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/common/constant/index.ts:
--------------------------------------------------------------------------------
1 | export * from './options';
2 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/common/constant/options.ts:
--------------------------------------------------------------------------------
1 | import type { S2Options, SpreadSheet } from '@antv/s2';
2 | import { CustomTooltip } from '../../components/tooltip/custom-tooltip';
3 |
4 | export const RENDER_TOOLTIP_OPTION: Partial = {
5 | tooltip: {
6 | render: (spreadsheet: SpreadSheet) => new CustomTooltip(spreadsheet),
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/components/index.ts:
--------------------------------------------------------------------------------
1 | // organize-imports-ignore
2 | export { CustomTooltip } from './tooltip/custom-tooltip';
3 | export { default as BaseSheet } from './sheets/base-sheet.vue';
4 | export { default as SheetComponent } from './sheets/index.vue';
5 | export { default as PivotSheet } from './sheets/pivot-sheet.vue';
6 | export { default as TableSheet } from './sheets/table-sheet.vue';
7 | export { default as EditableSheet } from './sheets/editable-sheet.vue';
8 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/components/sheets/table-sheet.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/components/tooltip/components/infos.vue:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 | {{ infos }}
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/components/tooltip/components/operator/index.ts:
--------------------------------------------------------------------------------
1 | export { default as TooltipOperator } from './index.vue';
2 | export { default as TooltipOperatorMenu } from './menu.vue';
3 | export { default as TooltipOperatorTitle } from './title.vue';
4 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/components/tooltip/interface.ts:
--------------------------------------------------------------------------------
1 | import type { S2CellType, TooltipShowOptions } from '@antv/s2';
2 |
3 | export interface TooltipRenderProps
4 | extends TooltipShowOptions {
5 | readonly content?: T;
6 | readonly cell: S2CellType;
7 | }
8 |
9 | export type TooltipInfosProps = {
10 | infos: string;
11 | };
12 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/hooks/useExpose.ts:
--------------------------------------------------------------------------------
1 | import type { SpreadSheet } from '@antv/s2';
2 | import { shallowRef } from 'vue';
3 |
4 | export interface SheetExpose {
5 | instance: SpreadSheet | undefined;
6 | }
7 |
8 | export const useExpose = (expose: (exposed?: Record) => void) => {
9 | const s2Ref = shallowRef();
10 |
11 | expose({
12 | get instance() {
13 | return s2Ref.value?.instance;
14 | },
15 | });
16 |
17 | return s2Ref;
18 | };
19 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/hooks/useLoading.ts:
--------------------------------------------------------------------------------
1 | import { S2Event, type SpreadSheet } from '@antv/s2';
2 | import { ref, watch, type ShallowRef } from 'vue';
3 |
4 | export const useLoading = (
5 | s2Ref: ShallowRef,
6 | loadingProp = false,
7 | ) => {
8 | const loading = ref(loadingProp);
9 | const setLoading = (updated: boolean) => {
10 | loading.value = updated;
11 | };
12 |
13 | watch(s2Ref, (s2) => {
14 | s2?.on(S2Event.LAYOUT_BEFORE_RENDER, () => {
15 | setLoading(true);
16 | });
17 |
18 | s2?.on(S2Event.LAYOUT_AFTER_RENDER, () => {
19 | setLoading(false);
20 | });
21 | });
22 |
23 | return { loading, setLoading };
24 | };
25 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/index.ts:
--------------------------------------------------------------------------------
1 | import './utils/extendLocale';
2 |
3 | export * from './components';
4 | export * from './hooks/useExpose';
5 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/utils/extendLocale.ts:
--------------------------------------------------------------------------------
1 | import { Locale, extendLocale } from '@antv/s2';
2 |
3 | extendLocale(Locale);
4 |
--------------------------------------------------------------------------------
/packages/s2-vue/src/utils/options.ts:
--------------------------------------------------------------------------------
1 | import type { S2Options } from '@antv/s2';
2 | import { getBaseSheetComponentOptions } from '@antv/s2';
3 | import { RENDER_TOOLTIP_OPTION } from '../common/constant';
4 |
5 | export const getSheetComponentOptions = (
6 | ...options: Partial[]
7 | ): S2Options => getBaseSheetComponentOptions(RENDER_TOOLTIP_OPTION, ...options);
8 |
--------------------------------------------------------------------------------
/packages/s2-vue/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "include": ["src/**/*", "./typings.d.ts", "../../global.d.ts"],
4 | "compilerOptions": {
5 | "target": "es2015",
6 | "paths": {}
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/s2-vue/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "target": "ESNext",
5 | "jsx": "preserve",
6 | "strict": false,
7 | "declaration": true,
8 | "noImplicitAny": false,
9 | "paths": {
10 | "@antv/s2": ["s2-core/src/index.ts"],
11 | "@antv/s2/esm/shared": ["s2-core/src/shared/index.ts"],
12 | },
13 | },
14 | "exclude": ["node_modules", "coverage", "esm", "lib", "dist", "temp"],
15 | "include": ["src", "./typings.d.ts", "../../global.d.ts"]
16 | }
17 |
--------------------------------------------------------------------------------
/packages/s2-vue/typings.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.svg' {
4 | import { FunctionalComponent, SVGAttributes } from 'vue'
5 | const src: FunctionalComponent
6 | export default src
7 | }
8 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - 'packages/*'
3 | - 's2-site'
4 |
--------------------------------------------------------------------------------
/s2-site/.dumi/global.less:
--------------------------------------------------------------------------------
1 | .dumi-default-table {
2 | margin: 0 !important;
3 | }
4 |
5 | // h3 {
6 | // border-bottom: none !important;
7 | // }
8 |
9 | body {
10 | overflow-x: hidden;
11 | }
12 |
13 | .ant-layout-content {
14 | ul {
15 | margin-bottom: 16px !important;
16 | }
17 | }
18 |
19 | details {
20 | cursor: pointer;
21 | }
22 |
23 | .dumi-default-source-code {
24 | margin: 24px 0;
25 |
26 | .prism-code {
27 | background-color: #f6f8fa !important;
28 | }
29 | }
30 |
31 | .demo-card-screenshot {
32 | width: 100% !important;
33 | }
34 |
--------------------------------------------------------------------------------
/s2-site/.dumi/pages/playground.en.tsx:
--------------------------------------------------------------------------------
1 | import Playground from './playground.zh';
2 |
3 | export default Playground;
4 |
--------------------------------------------------------------------------------
/s2-site/.dumi/pages/playground.zh.tsx:
--------------------------------------------------------------------------------
1 | import ClientOnly from '@antv/dumi-theme-antv/dist/common/ClientOnly';
2 | import Footer from '@antv/dumi-theme-antv/dist/slots/Footer';
3 | import Header from '@antv/dumi-theme-antv/dist/slots/Header';
4 | import React from 'react';
5 |
6 | const Page = React.lazy(() => import('../../playground/layouts'));
7 |
8 | const Playground: React.FC = () => {
9 | return (
10 | <>
11 |
12 |
13 |
14 |
15 |
16 | >
17 | );
18 | };
19 |
20 | export default Playground;
21 |
--------------------------------------------------------------------------------
/s2-site/.dumi/theme/plugin.ts:
--------------------------------------------------------------------------------
1 | import { omit } from 'lodash';
2 |
3 | import type { IApi } from 'dumi';
4 |
5 | export default (api: IApi) => {
6 | api.modifyConfig((memo) => {
7 | return {
8 | ...memo,
9 | alias: omit(memo.alias, ['antd', 'react', 'react-dom']),
10 | };
11 | });
12 | };
13 |
--------------------------------------------------------------------------------
/s2-site/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /dist
3 | /example/node_modules
4 | /example/dist
5 | /example/.dumi/theme
6 | /example/.dumi/tmp
7 | /example/.dumi/tmp-production
8 | .dumi/tmp
9 | .dumi/tmp-production
10 | .DS_Store
11 | package-lock.json
12 | yarn-error.log
13 | .history
14 | yarn.lock
15 | pnpm-lock.yaml
16 | server
17 |
18 | # Dead links report
19 | dead-links-report.log
20 |
--------------------------------------------------------------------------------
/s2-site/.npmrc:
--------------------------------------------------------------------------------
1 | registry=https://registry.npmmirror.com/
2 |
--------------------------------------------------------------------------------
/s2-site/.yarnrc:
--------------------------------------------------------------------------------
1 | registry "https://registry.npmmirror.com"
2 |
--------------------------------------------------------------------------------
/s2-site/CNAME:
--------------------------------------------------------------------------------
1 | s2.antv.vision
2 |
--------------------------------------------------------------------------------
/s2-site/LEGAL.md:
--------------------------------------------------------------------------------
1 | Legal Disclaimer
2 |
3 | Within this source code, the comments in Chinese shall be the original, governing version. Any comment in other languages are for reference only. In the event of any conflict between the Chinese language version comments and other language version comments, the Chinese language version shall prevail.
4 |
5 | 法律免责声明
6 |
7 | 关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
8 |
--------------------------------------------------------------------------------
/s2-site/docs/api/basic-class/base-bbox.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: BaseBBox
3 | order: 9
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/api/basic-class/cell-data.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: CellData
3 | order: 10
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/api/basic-class/hierarchy.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Hierarchy
3 | order: 8
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/api/pivot-chart.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 透视组合图拓展 S2Options
3 | order: 4
4 | tag: New
5 | ---
6 |
7 |
8 |
--------------------------------------------------------------------------------
/s2-site/docs/common/contact-us.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Contact Us
3 | order: 5
4 | ---
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/s2-site/docs/common/contact-us.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 联系我们
3 | order: 5
4 | ---
5 |
6 | :::warning{title="注意"}
7 |
8 | 群聊仅供交流,不提供任何答疑,有任何问题请 [提交 Issue](https://github.com/antvis/S2/issues/new/choose) 或在 [Discussions](https://github.com/antvis/S2/discussions) 提问。
9 |
10 | :::
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/cellCallBack.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: cell callback
3 | order: 7
4 | ---
5 |
6 | ## CellCallback
7 |
8 | ```js
9 | CellCallback = (node: Node, spreadsheet: SpreadSheet, ...restOptions: unknown[]) => G.Group;
10 | ```
11 |
12 | 功能描述:自定义单元格
13 |
14 | | 参数 | 类型 | 必选 | 默认值 | 功能描述 |
15 | | --- | --- | --- | --- | --- |
16 | | node | [Node](#node) | ✓ | | 当前渲染的 node 节点 |
17 | | spreadsheet | [SpreadSheet](#spreadsheet) | ✓ | | 表格实例 |
18 | | restOptions | `unknown[]` | | | 不定参数,传递额外的信息 |
19 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/customSvgIcons.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom svg icons
3 | order: 7
4 | ---
5 |
6 | ## CustomSVGIcon
7 |
8 | 功能描述:用于用户注册自己的 `icon` 图标, 目前只支持 `svg` 格式。查看 [详细说明](/manual/advanced/custom/custom-icon)
9 |
10 | | 参数 | 类型 | 必选 | 默认值 | 功能描述 |
11 | | --- | --- | --- | --- | --- |
12 | | name | string | ✓ | | 内置或自定义的 icon 名称 |
13 | | src | string | ✓ | | 目前支持三种格式的 svg 字符串:base64、svg 本地文件、线上图片地址(不支持替换颜色) |
14 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/customTreeNode.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义树状结构
3 | order: 8
4 | ---
5 |
6 | #### CustomTreeNode
7 |
8 | 功能描述:自定义树状结构的配置,适用于透视表和明细表的自定义行列头。查看 [文档](/manual/advanced/custom/custom-header) 和 [示例](/examples/layout/custom-header-group/#custom-pivot-row-header)
9 |
10 | | 参数 | 说明 | 类型 | 默认值 | 必选 |
11 | | --- | --- | --- | --- | :-: |
12 | | field | 当前节点唯一标识 | `string` | | ✓ |
13 | | title | 当前节点展示名 | `string` | | ✓ |
14 | | collapsed | 节点是否收起(树状模式下,行头非叶子节点有效) | `boolean` | `false` | |
15 | | description | 节点的额外描述信息,在对应行头的 tooltip 中展示 | `string` | | |
16 | | children | 子节点 | [CustomTreeNode[]](#customtreenode) | | |
17 |
18 | ##### CustomHeaderField
19 |
20 | ```ts
21 | type CustomHeaderField = CustomTreeNode | string;
22 | ```
23 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/layoutArrange.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义行列排列顺序
3 | order: 1
4 | ---
5 |
6 | ## LayoutArrange
7 |
8 | ```js
9 | LayoutArrange = (spreadsheet: SpreadSheet, parent: Node, field: string, fieldValues: string[]) => string[];
10 | ```
11 |
12 | 功能描述:自定义顺序
13 |
14 | | 参数 | 类型 | 必选 | 默认值 | 功能描述 |
15 | | --- | --- | --- | --- | --- |
16 | | spreadsheet | [SpreadSheet](/api/basic-class/spreadsheet) | ✓ | | 表格实例 |
17 | | node | [Node](/api/basic-class/node) | ✓ | | 当前渲染的 node 节点 |
18 | | field | `string` | ✓ | | 当前的字段名 |
19 | | fieldValues | `string[]` | ✓ | | 当前字段值 |
20 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/layoutCellMeta.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义单元格元信息
3 | order: 3
4 | ---
5 |
6 | ## LayoutCellMeta
7 |
8 | ```js
9 | LayoutCellMeta = (viewMeta: ViewMeta) => ViewMeta | null;
10 | ```
11 |
12 | 功能描述:自定义单元格元信息
13 |
14 | | 参数 | 类型 | 必选 | 默认值 | 功能描述 |
15 | | --- | --- | --- | --- | --- |
16 | | viewMeta | [ViewMeta](#viewmeta) | | | 单元格元信息 |
17 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/layoutCoordinate.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义单元格行列坐标
3 | order: 4
4 | ---
5 | ## LayoutCoordinate
6 |
7 | ```js
8 | LayoutCoordinate = (spreadsheet: SpreadSheet, rowNode: Node, colNode: Node) => void
9 | ```
10 |
11 | 功能描述:自定义单元格行列坐标
12 |
13 | | 参数 | 类型 | 必选 | 默认值 | 功能描述 |
14 | | --- | --- | --- | --- | --- |
15 | | spreadsheet | [SpreadSheet](/api/basic-class/spreadsheet) | ✓ | | 表格实例 |
16 | | rowNode | [Node](/api/basic-class/node) | ✓ | | 行头节点 |
17 | | colNode | [Node](/api/basic-class/node) | ✓ | | 列头节点 |
18 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/layoutHierarchy.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义层级结构
3 | order: 2
4 | ---
5 |
6 | ## LayoutHierarchy
7 |
8 | ```js
9 | LayoutHierarchy = (spreadsheet: SpreadSheet, node: Node) => LayoutHierarchyReturnType;
10 | ```
11 |
12 | 功能描述:自定义层级结构
13 |
14 | | 参数 | 类型 | 必选 | 默认值 | 功能描述 |
15 | | --- | --- | --- | --- | --- |
16 | | spreadsheet | [SpreadSheet](/api/basic-class/spreadsheet) | ✓ | | 表格实例 |
17 | | node | [Node](/api/basic-class/node) | ✓ | | 当前渲染的 node 节点 |
18 |
19 | ```ts
20 | interface LayoutHierarchyReturnType {
21 | push?: Node[];
22 | unshift?: Node[];
23 | delete?: boolean;
24 | }
25 | ```
26 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/layoutSeriesNumberNodes.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义层级结构
3 | order: 2
4 | ---
5 |
6 | ## LayoutHierarchy
7 |
8 | ```js
9 | LayoutHierarchy = (spreadsheet: SpreadSheet, node: Node) => LayoutHierarchyReturnType;
10 | ```
11 |
12 | 功能描述:自定义层级结构
13 |
14 | | 参数 | 类型 | 必选 | 默认值 | 功能描述 |
15 | | --- | --- | --- | --- | --- |
16 | | spreadsheet | [SpreadSheet](/docs/api/basic-class/spreadsheet) | ✓ | | 表格实例 |
17 | | node | [Node](/docs/api/basic-class/node) | ✓ | | 当前渲染的 node 节点 |
18 |
19 | ```ts
20 | interface LayoutHierarchyReturnType {
21 | push?: Node[];
22 | unshift?: Node[];
23 | delete?: boolean;
24 | }
25 | ```
26 |
--------------------------------------------------------------------------------
/s2-site/docs/common/custom/layoutSeriesNumberNodes.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义序号节点
3 | order: 2
4 | tag: New
5 | ---
6 |
7 | ## LayoutSeriesNumberNodes
8 |
9 | ```js
10 | LayoutSeriesNumberNodes = (rowsHierarchy: Hierarchy, seriesNumberWidth: number, spreadsheet: SpreadSheet) => Node[];
11 |
12 | ```
13 |
14 | 功能描述:自定义序号节点
15 |
16 | | 参数 | 类型 | 必选 | 默认值 | 功能描述 |
17 | | --- | --- | --- | --- | --- |
18 | | rowsHierarchy | [Hierarchy](/api/basic-class/hierarchy) | | | 行头层级结构 |
19 | | seriesNumberWidth | `number` | | | 表格实例 |
20 | | spreadsheet | [SpreadSheet](/api/basic-class/spreadsheet) | | | 表格实例 |
21 |
--------------------------------------------------------------------------------
/s2-site/docs/common/development.en.md:
--------------------------------------------------------------------------------
1 | Eager to contribute? [View contribution guidelines](https://s2.antv.antgroup.com/manual/contribution)
2 |
3 | > S2 uses pnpm as package manager
4 |
5 | ```bash
6 | git clone git@github.com:antvis/S2.git
7 |
8 | cd S2
9 |
10 | # 切换到 2.x 分支
11 | git checkout next
12 |
13 | # 安装依赖
14 | pnpm install # 或者 pnpm bootstrap
15 |
16 | # 打包
17 | pnpm build
18 |
19 | # 调试 s2-core
20 | pnpm core:start
21 |
22 | # 调试 s2-react
23 | pnpm react:Playground
24 |
25 | # 调试 s2-vue
26 | pnpm vue:Playground
27 |
28 | # 单元测试
29 | pnpm test
30 |
31 | # 代码风格和类型检测
32 | pnpm lint
33 |
34 | # 本地启动官网
35 | pnpm site:start
36 | ```
37 |
--------------------------------------------------------------------------------
/s2-site/docs/common/merged-cell.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 合并单元
3 | order: 10
4 | ---
5 |
6 | 功能描述:设置默认合并的单元格信息
7 |
8 | | 参数 | 说明 | 类型 | 默认值 | 必选 |
9 | | --------------- |------| ---------------------- | ------ | ---- |
10 | | colIndex | 单元格的列索引 | `number` | - | |
11 | | rowIndex | 单元格的行索引 | `number` | - | |
12 | | showText | 设置 `showText: true` 时,则展示当前格子的 `meta` 信息为合并后单元格的 `meta`。
默认使用第一个选中点击的单元格。 | `booelan` | - | |
13 |
--------------------------------------------------------------------------------
/s2-site/docs/common/pagination.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Pagination
3 | order: 6
4 | ---
5 |
6 | ## Pagination
7 |
8 | boolean | object **required** , *default: null* Function description: Paging configuration
9 |
10 | | parameter | illustrate | type | Defaults | required |
11 | | --------- | ------------------------------ | -------- | -------- | -------- |
12 | | pageSize | Quantity per page | `number` | - | ✓ |
13 | | current | current page (starting from 1) | `number` | 1 | ✓ |
14 | | total | Total number of data | `number` | - | |
15 |
--------------------------------------------------------------------------------
/s2-site/docs/common/series-number.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: SeriesNumber
3 | order: 6
4 | ---
5 |
6 | ## SeriesNumber
7 |
8 | Function description: SeriesNumber configuration
9 |
10 | | parameter | illustrate | type | Defaults | required |
11 | | --------- | ------------------------------------- | --------- | -------- | -------- |
12 | | enable | Whether to display the series number | `boolean` | `false` | |
13 | | text | custom series number header cell text | `string` | - | |
14 |
--------------------------------------------------------------------------------
/s2-site/docs/common/series-number.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 序号列
3 | order: 6
4 | ---
5 |
6 | ## SeriesNumber
7 |
8 | 功能描述:序号列配置。
9 |
10 | | 参数 | 说明 | 类型 | 默认值 | 必选 |
11 | | ------ | -------------------- | --------- | ------- | ---- |
12 | | enable | 是否显示行序号 | `boolean` | `false` | |
13 | | text | 自定义行头序号列标题 | `string` | - | |
14 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/analysis/introduction.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Introduction
3 | order: 1
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/cell-render/chart-in-cell.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Render Chart In Cell
3 | order: 11
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/cell-render/chart-with-g2.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Draw Chart With @antv/g2
3 | order: 12
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/g-plugins.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: AntV/G Plugins
3 | order: 10
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/interaction/copy.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Copy
3 | order: 7
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/interaction/copy.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 复制与导出
3 | order: 7
4 | tag: New
5 | ---
6 |
7 |
8 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/interaction/highlight-and-select-cell.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Highlight and select cell
3 | order: 8
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/interaction/resize.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cell Resize
3 | order: 3
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/advanced/pivot-chart.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Pivot Chart
3 | order: 13
4 | tag: Experimental
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/basic/formatter.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 数据格式化
3 | order: 9
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/basic/multi-line-text.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Multi Line
3 | order: 10
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/basic/pagination.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Pagination
3 | order: 11
4 | tag: New
5 | ---
6 |
--------------------------------------------------------------------------------
/s2-site/docs/manual/basic/pagination.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 分页
3 | order: 11
4 | tag: New
5 | ---
6 |
7 | @antv/s2
8 |
9 |
10 |
11 | ### 结合分页组件使用
12 |
13 |
14 |
15 | 请阅读 [分析组件 - 分页](/manual/advanced/analysis/pagination) 章节。
16 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/conditions/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/conditions/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/conditions/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Conditions
3 | order: 2
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/conditions/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 字段标记
3 | order: 2
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/get-data/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 4
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/get-data/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 4
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/get-data/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Get Cell Data
3 | order: 3
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/get-data/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 获取单元格数据
3 | order: 3
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/sort/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 3
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/sort/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 3
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/sort/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Sort
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/sort/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 表格排序
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/totals/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 3
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/totals/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 3
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/totals/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Totals
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/analysis/totals/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 小计总计
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/pivot/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 | # S2DataConfig
6 |
7 |
8 |
9 | # S2Options
10 |
11 |
12 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/pivot/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 | # S2DataConfig
6 |
7 |
8 |
9 | # S2Options
10 |
11 |
12 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/pivot/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "透视表",
4 | "en": "Pivot"
5 | },
6 | "demos": [
7 | {
8 | "filename": "grid.ts",
9 | "title": {
10 | "zh": "平铺模式",
11 | "en": "Grid mode"
12 | },
13 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/a6zSe1gvvy/f97ed6ec-0a5d-49b7-8492-754611d0aea6.png"
14 | },
15 | {
16 | "filename": "tree.ts",
17 | "title": {
18 | "zh": "树状模式",
19 | "en": "Tree mode"
20 | },
21 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/VnOOCNzUqk/a68995cb-7e96-452a-a0da-faf4b1f9d59b.png"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/pivot/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Basic pivot table
3 | order: 1
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/pivot/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 基础透视表
3 | order: 1
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/table/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 | # S2DataConfig
6 |
7 |
8 |
9 | # S2Options
10 |
11 |
12 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/table/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 | # S2DataConfig
6 |
7 |
8 |
9 | # S2Options
10 |
11 |
12 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/table/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "明细表",
4 | "en": "Table"
5 | },
6 | "demos": [
7 | {
8 | "filename": "table.ts",
9 | "title": {
10 | "zh": "明细表模式",
11 | "en": "Table mode"
12 | },
13 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/jWifHNLOsB/08db1064-bb09-4d44-b42b-26aed1766545.png"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/table/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Basic table
3 | order: 2
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/basic/table/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 基础明细表
3 | order: 2
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/art/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/art/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/art/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Art Work
3 | order: 6
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/case/art/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 💡灵光乍现
3 | order: 6
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/case/comparison/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/comparison/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/comparison/design.en.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/s2-site/examples/case/comparison/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Comparison Sheet
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/case/comparison/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 对比表
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/case/data-preview/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/data-preview/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/data-preview/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Data Preview Table
3 | order: 5
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/case/kpi-strategy/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/kpi-strategy/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/kpi-strategy/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "趋势表",
4 | "en": "StrategySheet"
5 | },
6 | "demos": [
7 | {
8 | "filename": "basic.tsx",
9 | "title": {
10 | "zh": "KPI 趋势表",
11 | "en": "KPI StrategySheet"
12 | },
13 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/BLitStN%24sR/196f5853-98cf-414f-af83-16b9c594c377.png"
14 | },
15 | {
16 | "filename": "covid-trend.tsx",
17 | "title": {
18 | "zh": "四川疫情趋势表",
19 | "en": "Covid StrategySheet"
20 | },
21 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/xv%2685cV97/2022-09-15%25252022.43.09.gif"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/s2-site/examples/case/kpi-strategy/design.en.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/s2-site/examples/case/kpi-strategy/design.zh.md:
--------------------------------------------------------------------------------
1 | # KPI 趋势表
2 |
3 | ## 定义
4 |
5 | 用户监控业务KPI进展和趋势的透视表叫KPI趋势表。
6 |
7 | ## 何时使用
8 |
9 | 用于查看不同时间维度下的核心指标进度的数据监控和分析,如对团队KPI的进展监控。
10 |
11 | ## 构成
12 |
13 |
14 |
15 | ## 分析思路
16 |
17 |
18 |
--------------------------------------------------------------------------------
/s2-site/examples/case/kpi-strategy/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: KPI Strategy
3 | order: 3
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/case/kpi-strategy/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: KPI 趋势表
3 | order: 3
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/case/performance-compare/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/performance-compare/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/performance-compare/design.en.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/s2-site/examples/case/performance-compare/design.zh.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/s2-site/examples/case/performance-compare/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Performance compare
3 | order: 6
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/case/performance-compare/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 性能对比表
3 | order: 6
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/case/proportion/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/proportion/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/case/proportion/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "占比表",
4 | "en": "Measure Comparison Sheet"
5 | },
6 | "demos": [
7 | {
8 | "filename": "group-drill-down.tsx",
9 | "title": {
10 | "zh": "分群下钻表",
11 | "en": "Group drill down sheet"
12 | },
13 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/RYy4GI8Y8d/demo.gif"
14 | },
15 | {
16 | "filename": "single-population-proportion.tsx",
17 | "title": {
18 | "zh": "单人群占比表",
19 | "en": "Single population proportion Sheet"
20 | },
21 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/clsZ0BSxpR/c315b0f0-03df-46e6-b470-7894c7fa5b17.png"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/s2-site/examples/case/proportion/design.en.md:
--------------------------------------------------------------------------------
1 | # 分群下钻表
2 |
3 | ## 定义
4 |
5 | 多维细分网格化的分群探索表格叫分群下钻表。
6 |
7 | ## 何时使用
8 |
9 | 适用于对人群做分群探索,通过不断尝试行列头和业务表现确定分群规则,如分析不同年龄、收入层级下的人群指标转化情况。
10 |
11 | ## 构成
12 |
13 |
14 |
15 | ## 分析思路
16 |
17 |
18 |
--------------------------------------------------------------------------------
/s2-site/examples/case/proportion/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Proportion sheet
3 | order: 0
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/case/proportion/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 占比表
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-cell/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 7
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-cell/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 7
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-cell/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom cell
3 | order: 8
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-cell/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义单元格
3 | order: 8
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-dataset/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 1
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-dataset/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 1
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-dataset/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "自定义数据集",
4 | "en": "Custom Dataset"
5 | },
6 | "demos": [
7 | {
8 | "filename": "custom-strategy-sheet-dataset.ts",
9 | "title": {
10 | "zh": "自定义趋势分析表数据集",
11 | "en": "Custom StrategySheet Dataset"
12 | },
13 | "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*JS6VQKsFBSAAAAAAAAAAAAAADmJ7AQ/original",
14 | "new": true
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-dataset/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Dataset
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-dataset/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义数据集
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-icon/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 6
4 | ---
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-icon/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 6
4 | ---
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-icon/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom-icon
3 | order: 6
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-icon/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义图标
3 | order: 6
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-layout/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 1
4 | ---
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-layout/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 1
4 | ---
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-layout/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Layout
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-layout/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义布局
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-order/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 9
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-order/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 9
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-order/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "自定义排序功能",
4 | "en": "custom order"
5 | },
6 | "demos": [
7 | {
8 | "filename": "custom-order.tsx",
9 | "title": {
10 | "zh": "自定义排序功能",
11 | "en": "Custom order"
12 | },
13 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/oOiZ02mZJ/zidingyipaixu.gif"
14 | },
15 | {
16 | "filename": "custom-order-base.ts",
17 | "title": {
18 | "zh": "自定义排序功能 (在 @antv/s2 中使用)",
19 | "en": "Custom order (@antv/s2)"
20 | },
21 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/oOiZ02mZJ/zidingyipaixu.gif"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-order/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom-order
3 | order: 9
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-order/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义排序功能
3 | order: 9
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-plugins/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-plugins/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-plugins/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "AntV/G 插件",
4 | "en": "AntV/G plugins"
5 | },
6 | "demos": [
7 | {
8 | "filename": "a11y.ts",
9 | "title": {
10 | "zh": "无障碍功能",
11 | "en": "a11y"
12 | },
13 | "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*HIhnRq9EqIwAAAAAAAAAAAAADmJ7AQ/original",
14 | "new": true
15 | },
16 | {
17 | "filename": "rough.ts",
18 | "title": {
19 | "zh": "手绘风格",
20 | "en": "rough"
21 | },
22 | "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Ag6SSYgDpeYAAAAAAAAAAAAADmJ7AQ/original",
23 | "new": true
24 | }
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-plugins/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom AntV/G Plugins & Options
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-plugins/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义 AntV/G 插件和配置
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-renderer/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 5
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-renderer/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 5
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-renderer/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Cell Render Type
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-renderer/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义单元格渲染类型
3 | order: 10
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-shape-and-chart/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 11
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-shape-and-chart/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 11
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-shape-and-chart/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Shape And Chart
3 | order: 11
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/custom/custom-shape-and-chart/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 在单元格内绘制自定义图形和图表
3 | order: 11
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/gallery/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Gallery
3 | order: -1
4 | icon: other
5 | redirect_from:
6 | - /en/examples
7 | ---
8 |
--------------------------------------------------------------------------------
/s2-site/examples/gallery/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 图表示例
3 | order: -1
4 | icon: other
5 | redirect_from:
6 | - /zh/examples
7 | ---
8 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/advanced/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/advanced/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/advanced/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Advanced Interaction
3 | order: 2
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/advanced/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 高级交互
3 | order: 2
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/basic/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/basic/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/basic/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Basic Interaction
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/basic/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 基础交互
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/custom/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/custom/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/custom/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Interaction
3 | order: 3
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/interaction/custom/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义交互
3 | order: 3
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/adaptive/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/adaptive/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/adaptive/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Adaptive Layout
3 | order: 3
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/adaptive/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自适应布局
3 | order: 3
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/basic/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 | # Style
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/basic/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 | # Style
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/basic/demo/adaptive.ts:
--------------------------------------------------------------------------------
1 | import { PivotSheet } from '@antv/s2';
2 |
3 | fetch(
4 | 'https://gw.alipayobjects.com/os/bmw-prod/2a5dbbc8-d0a7-4d02-b7c9-34f6ca63cff6.json',
5 | )
6 | .then((res) => res.json())
7 | .then((dataCfg) => {
8 | const container = document.getElementById('container');
9 |
10 | const s2Options = {
11 | width: 600,
12 | height: 480,
13 | style: {
14 | // 了解更多: https://s2.antv.antgroup.com/api/general/s2-options#style
15 | layoutWidthType: 'adaptive',
16 | },
17 | };
18 | const s2 = new PivotSheet(container, dataCfg, s2Options);
19 |
20 | s2.render();
21 | });
22 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/basic/demo/colAdaptive.ts:
--------------------------------------------------------------------------------
1 | import { PivotSheet, S2Options } from '@antv/s2';
2 |
3 | fetch(
4 | 'https://gw.alipayobjects.com/os/bmw-prod/2a5dbbc8-d0a7-4d02-b7c9-34f6ca63cff6.json',
5 | )
6 | .then((res) => res.json())
7 | .then(async (dataCfg) => {
8 | const container = document.getElementById('container');
9 |
10 | const s2Options: S2Options = {
11 | width: 600,
12 | height: 480,
13 | style: {
14 | // 了解更多: https://s2.antv.antgroup.com/api/general/s2-options#style
15 | layoutWidthType: 'colAdaptive',
16 | },
17 | };
18 |
19 | const s2 = new PivotSheet(container, dataCfg, s2Options);
20 |
21 | await s2.render();
22 | });
23 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/basic/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Basic Layout
3 | order: 0
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/basic/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 默认布局
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/custom-header-group/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 7
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/custom-header-group/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 7
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/custom-header-group/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Header Group
3 | order: 2
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/custom-header-group/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义行列头分组
3 | order: 2
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/custom/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 | # Style
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/custom/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 | # Style
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/custom/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Height & Width
3 | order: 5
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/custom/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义布局 / 行列宽高
3 | order: 4
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/frozen/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/frozen/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/frozen/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Frozen
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/frozen/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 行列冻结
3 | order: 1
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/multi-line-text/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 | # Style
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/multi-line-text/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 | # Style
7 |
8 |
9 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/multi-line-text/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Multi Line Text
3 | order: 5
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/layout/multi-line-text/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 多行文本
3 | order: 5
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/drill-down/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/drill-down/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/drill-down/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "维度下钻组件",
4 | "en": "DrillDown"
5 | },
6 | "demos": [
7 | {
8 | "filename": "basic-panel.tsx",
9 | "title": {
10 | "zh": "维度下钻组件",
11 | "en": "DrillDown component"
12 | },
13 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/3DoOlPsFYh/drill.gif"
14 | },
15 | {
16 | "filename": "for-pivot.tsx",
17 | "title": {
18 | "zh": "透视表维度下钻组件",
19 | "en": "DrillDown in pivot sheet"
20 | },
21 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/i%240oG9GFEV/xiazuan.gif"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/drill-down/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: DrillDwon
3 | order: 2
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/drill-down/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 下钻组件
3 | order: 2
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/export/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/export/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/export/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "导出组件",
4 | "en": "Export Component"
5 | },
6 | "demos": [
7 | {
8 | "filename": "export.tsx",
9 | "title": {
10 | "zh": "导出组件",
11 | "en": "Export component"
12 | },
13 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/LuLsxJzuq/2021-11-16%25252022.15.51.gif"
14 | },
15 | {
16 | "filename": "export-strategy.tsx",
17 | "title": {
18 | "zh": "在趋势分析表中使用",
19 | "en": "Export strategy sheet"
20 | },
21 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/LuLsxJzuq/2021-11-16%25252022.15.51.gif",
22 | "isNew": true
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/export/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Export
3 | order: 3
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/export/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 导出组件
3 | order: 3
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/pagination/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/pagination/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/pagination/demo/meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": {
3 | "zh": "表格组件",
4 | "en": "Sheet Component"
5 | },
6 | "demos": [
7 | {
8 | "filename": "pivot.tsx",
9 | "title": {
10 | "zh": "透视表分页",
11 | "en": "PivotSheet pagination"
12 | },
13 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/6h9nmPdj9b/e4163ac4-2d17-4efd-8556-d5e32fd15b25.png"
14 | },
15 | {
16 | "filename": "table.tsx",
17 | "title": {
18 | "zh": "明细表分页",
19 | "en": "TableSheet pagination"
20 | },
21 | "screenshot": "https://gw.alipayobjects.com/zos/antfincdn/MK67LrYwRh/5e972478-06e4-40fc-bcbe-21c05fd144e5.png"
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/pagination/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Pagination
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/pagination/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 分页组件
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/sheet/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/sheet/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/sheet/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Sheet Component
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/sheet/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 表格组件
3 | order: 0
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/switcher/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/switcher/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/switcher/design.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Design guide
3 | ---
4 |
5 | Design guide
6 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/switcher/design.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 设计规范
3 | ---
4 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/switcher/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Switcher
3 | order: 4
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/switcher/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 维度切换组件
3 | order: 4
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/tooltip/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/tooltip/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/tooltip/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Tooltip Component
3 | order: 2
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/react-component/tooltip/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Tooltip 组件
3 | order: 2
4 | ---
5 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/custom/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/custom/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/custom/design.en.md:
--------------------------------------------------------------------------------
1 | ### Schema - Palette
2 |
3 | 
4 | 
5 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/custom/design.zh.md:
--------------------------------------------------------------------------------
1 | ### 主题 Schema - 色板 对照表
2 |
3 | 
4 | 
5 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/custom/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Theme
3 | order: 4
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/custom/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 自定义主题
3 | order: 4
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/default/API.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/default/API.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: API
3 | order: 0
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/default/index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Theme
3 | order: 3
4 | ---
5 |
6 |
--------------------------------------------------------------------------------
/s2-site/examples/theme/default/index.zh.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: 主题
3 | order: 3
4 | ---
5 |
6 |
7 |
--------------------------------------------------------------------------------
/s2-site/externals.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.less';
2 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/base/index.less:
--------------------------------------------------------------------------------
1 | .attr-component {
2 | display: flex;
3 | justify-content: space-between;
4 | align-items: center;
5 | margin: 16px auto;
6 | width: 220px;
7 | }
8 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/base/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { PureComponent } from 'react';
2 | import { AttributeTreeProps } from '../../types';
3 | import './index.less';
4 |
5 | export abstract class BaseComponent extends PureComponent {
6 | abstract renderContent(): React.ReactElement | React.ReactElement[];
7 |
8 | render() {
9 | const { config } = this.props;
10 | const { displayName } = config;
11 |
12 | return (
13 |
14 | {displayName}
15 | {this.renderContent()}
16 |
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/collapse-panel/index.tsx:
--------------------------------------------------------------------------------
1 | import { PureComponent } from 'react';
2 |
3 | export class CollapsePanel extends PureComponent {
4 | render() {
5 | const { children } = this.props;
6 |
7 | return children;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/collapse/index.less:
--------------------------------------------------------------------------------
1 | .playground-collapse {
2 | width: 280px;
3 |
4 | .ant-collapse-borderless {
5 | .ant-collapse-content {
6 | background-color: #fafafa;
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/color-picker/index.less:
--------------------------------------------------------------------------------
1 | .color-block {
2 | width: 18px;
3 | height: 18px;
4 | border-radius: 2px;
5 | cursor: pointer;
6 | }
7 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/dragger-upload/index.less:
--------------------------------------------------------------------------------
1 | .ant-upload.ant-upload-drag p.ant-upload-drag-icon {
2 | margin-bottom: 0;
3 | }
4 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/index.tsx:
--------------------------------------------------------------------------------
1 | import { Tab } from './tab';
2 | import { TabPane } from './tab-pane';
3 | import { Collapse } from './collapse';
4 | import { CollapsePanel } from './collapse-panel';
5 | import { Select } from './select';
6 | import { Radio } from './radio';
7 | import { Switcher } from './switcher';
8 | import { ColorPicker } from './color-picker';
9 | import { InputNumber } from './input-number';
10 |
11 | export default {
12 | Tab,
13 | TabPane,
14 | Collapse,
15 | CollapsePanel,
16 | Select,
17 | Radio,
18 | Switcher,
19 | ColorPicker,
20 | InputNumber,
21 | };
22 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/input-number/index.less:
--------------------------------------------------------------------------------
1 | .input-number {
2 | width: 100px;
3 | }
4 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/select/index.less:
--------------------------------------------------------------------------------
1 | .playground-select {
2 | .ant-select-selector {
3 | width: 170px;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/switcher/index.tsx:
--------------------------------------------------------------------------------
1 | import { Switch as AntdSwitch } from 'antd';
2 | import React from 'react';
3 | import { BaseComponent } from '../base';
4 |
5 | export class Switcher extends BaseComponent {
6 | renderContent() {
7 | const { config, onChange, disable } = this.props;
8 | const { attributeId, defaultChecked } = config;
9 |
10 | return (
11 | onChange({ [attributeId]: checked })}
16 | />
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/tab-pane/index.tsx:
--------------------------------------------------------------------------------
1 | import { PureComponent } from 'react';
2 |
3 | export class TabPane extends PureComponent {
4 | render() {
5 | const { children } = this.props;
6 |
7 | return children;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/config-component/tab/index.less:
--------------------------------------------------------------------------------
1 | .flex-tabs {
2 | display: flex;
3 | align-items: center;
4 |
5 | .ant-tabs-nav-wrap {
6 | width: 280px;
7 | justify-content: center;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/s2-site/playground/config-panel/types.ts:
--------------------------------------------------------------------------------
1 | export type AttributeTreeProps<
2 | C extends Partial = AttributeComponentProps,
3 | > = {
4 | // 配置端当前配置的所有属性
5 | attributes: any;
6 | relations: {
7 | fromAttributeId: string;
8 | toAttributeId: string;
9 | action: string;
10 | value: string | Array | boolean;
11 | operator: string;
12 | }[];
13 | config: AttributeComponentProps & C;
14 | disable?: boolean;
15 | onChange: (attrs: object) => void;
16 | };
17 |
18 | export type AttributeComponentProps = {
19 | type: string;
20 | // 属性组件 展示名
21 | displayName?: string;
22 | // 属性组件 id
23 | attributeId: string;
24 | children: AttributeComponentProps[];
25 | // 组件相关的一些配置
26 | [k: string]: any;
27 | };
28 |
--------------------------------------------------------------------------------
/s2-site/playground/layouts/index.less:
--------------------------------------------------------------------------------
1 | .playground-layout {
2 | .ant-layout {
3 | background: none;
4 | }
5 |
6 | .ant-layout-sider {
7 | background: none;
8 | border-right: 1px solid #f0f0f0;
9 | overflow: overlay;
10 | height: 60vh;
11 | flex: none !important;
12 | width: auto !important;
13 | min-width: auto !important;
14 | max-width: none !important;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/s2-site/playground/sheet-component/config.ts:
--------------------------------------------------------------------------------
1 | import type { S2DataConfig } from '@antv/s2';
2 | import {
3 | data,
4 | meta,
5 | fields,
6 | rowSubTotalsDimensions,
7 | colSubTotalsDimensions,
8 | } from '../dataset/mock-dataset.json';
9 |
10 | export const sheetDataCfg: S2DataConfig = {
11 | data,
12 | meta,
13 | fields,
14 | };
15 |
16 | export const subTotalsDimensions = {
17 | rowSubTotalsDimensions,
18 | colSubTotalsDimensions,
19 | };
20 |
--------------------------------------------------------------------------------
/s2-site/playground/sheet-component/index.less:
--------------------------------------------------------------------------------
1 | .sheet-container {
2 | width: 100%;
3 | padding: 10px;
4 | min-height: 480px;
5 | }
6 |
--------------------------------------------------------------------------------
/s2-site/public/site.css:
--------------------------------------------------------------------------------
1 | .index-case-logo {
2 | border-radius: 0 !important;
3 | box-shadow: none !important;
4 | width: 150px !important;
5 | height: 80px;
6 | }
7 |
8 | .index-cases-image {
9 | height: 450px !important;
10 | width: 820px;
11 | margin: 0 30px 38px;
12 | box-shadow: 0 6px 20px 0 rgb(0 0 0 / 10%);
13 | border-radius: 16px;
14 | background: #fafbfc;
15 | }
16 |
17 | .dumi-default-source-code {
18 | margin: 20px 0;
19 | }
20 |
21 | .dumi-default-table {
22 | margin: 0;
23 | }
24 |
25 | img[alt='preview'] {
26 | margin: 10px 0;
27 | }
28 |
--------------------------------------------------------------------------------
/scripts/bump-version.js:
--------------------------------------------------------------------------------
1 | const { execSync } = require('child_process');
2 | const { getCurrentBranch } = require('./util');
3 |
4 | const branch = getCurrentBranch();
5 |
6 | const branchList = ['latest', 'alpha', 'beta', 'next'];
7 |
8 | if (!branchList.includes(branch)) {
9 | console.log('❌ 只允许在发布分支执行该命令');
10 | process.exit(1);
11 | }
12 |
13 | execSync("git commit --allow-empty -m 'chore(release): bump version'");
14 | console.log('✅ release commit 创建完成');
15 | process.exit(0);
16 |
--------------------------------------------------------------------------------
/scripts/util.js:
--------------------------------------------------------------------------------
1 | const { execSync } = require('child_process');
2 |
3 | function getCurrentBranch() {
4 | return execSync('git symbolic-ref --short -q HEAD')
5 | .toString()
6 | .trim()
7 | .toLowerCase();
8 | }
9 |
10 | module.exports = {
11 | getCurrentBranch,
12 | };
13 |
--------------------------------------------------------------------------------
/vetur.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | projects: ['./packages/s2-vue'],
3 | };
4 |
--------------------------------------------------------------------------------