Closed yvonneyx closed 3 months ago
LATER:
demo
config
assets
import React from 'react'; import { GISDK } from '@antv/gi-sdk'; import { myAssetPackage } from './assets'; import { config } from './config'; export default () => { const assets = [myAssetPackage]; return <GISDK className="my-graph-application" style={{ height: '80vh' }} config={config} assets={assets}></GISDK>; };
GISDKProps
type GISDKProps = GIRenderProps & GIRuntimeAppProps; interface GIRenderProps extends Pick<React.HTMLAttributes<HTMLDivElement>, 'className' | 'style'> { /** * 图应用配置描述 */ config: Application; } interface GIRuntimeAppProps { /** * 图应用资产包 */ assets?: AssetPackage[]; /** * 初始全局状态 */ initialGlobalState?: GlobalModel; }
Application 类型定义
interface Application { /** * 应用版本号 */ version: string; /** * 应用元数据 */ metadata: ApplicationMetadata; /** * 数据集 */ dataset: DatasetSchema; /** * 应用配置 */ spec: { /** * 图配置 */ graph: GraphSchema; /** * 组件 */ widgets: WidgetSchema[]; }; }
全局状态玩的 6,现在组件间通信支持:
后面使用文档可以写上,让给开发者自己选择合适的,可参考 LISDK
LATER:
demo
config
:描述一个图分析应用的配置文件assets
:资产包GISDKProps
Application 类型定义