From edb97073416c4066408163750054705535d3da1b Mon Sep 17 00:00:00 2001 From: xx361452 Date: Fri, 8 Mar 2024 17:19:59 +0800 Subject: [PATCH] feat: sdk add graphin props config --- packages/gi-sdk/package.json | 2 +- packages/gi-sdk/src/GISDK.tsx | 12 +++++------- packages/gi-sdk/src/typing.ts | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/gi-sdk/package.json b/packages/gi-sdk/package.json index c6c23c17d..1a4154c03 100644 --- a/packages/gi-sdk/package.json +++ b/packages/gi-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@antv/gi-sdk", - "version": "2.4.21", + "version": "2.4.22", "description": "G6VP 核心画布渲染", "main": "lib/index.js", "module": "es/index.js", diff --git a/packages/gi-sdk/src/GISDK.tsx b/packages/gi-sdk/src/GISDK.tsx index 8af38b829..e2f371509 100644 --- a/packages/gi-sdk/src/GISDK.tsx +++ b/packages/gi-sdk/src/GISDK.tsx @@ -20,7 +20,7 @@ let updateHistoryTimer: number; const GISDK = (props: Props) => { const graphinRef = React.useRef(null); // @ts-ignore - const { children, assets, id, services, config, locales } = props; + const { children, assets, id, services, config, locales, grapinProps } = props; const { language = 'zh-CN', ...localeMessages } = locales || {}; const GISDK_ID = React.useMemo(() => { @@ -397,19 +397,17 @@ const GISDK = (props: Props) => { { - console.log('un mount....'); - }} > <> {HAS_GRAPH && } diff --git a/packages/gi-sdk/src/typing.ts b/packages/gi-sdk/src/typing.ts index e0ddb59c4..d081021eb 100644 --- a/packages/gi-sdk/src/typing.ts +++ b/packages/gi-sdk/src/typing.ts @@ -1,5 +1,5 @@ import type { Combo } from '@antv/g6'; -import type { GraphinContextType, GraphinData, IUserEdge, IUserNode, Layout } from '@antv/graphin'; +import type { GraphinContextType, GraphinData, GraphinProps, IUserEdge, IUserNode, Layout } from '@antv/graphin'; import type { LANGUAGE_KEY_NAME } from './process/locale'; import type { GraphSchemaData, IGraphData } from './process/schema'; export type { GraphSchemaData }; @@ -102,6 +102,7 @@ export interface Props { style?: React.CSSProperties; className?: string; children?: React.ReactChildren | JSX.Element | JSX.Element[]; + grapinProps?: GraphinProps; } export type AssetType =