Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复问题 #200

Merged
merged 7 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@ant-design/icons": "4.7.0",
"@antv/algorithm": "^0.1.24",
"@antv/g6": "^4.8.8",
"@antv/graphin": "~2.7.9",
"@antv/graphin": "^2.7.14",
"@antv/layout": "^0.2.5",
"@antv/s2": "^1.29.0",
"@antv/s2-react": "^1.26.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/gi-assets-advance/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/gi-assets-advance",
"version": "2.1.1",
"version": "2.1.2",
"description": "G6VP 高级资产包",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -52,7 +52,7 @@
"use-immer": "^0.6.0"
},
"peerDependencies": {
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"react": "17.x",
"react-dom": "17.x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ const GremlinQueryPanel: React.FC<IGremlinQueryProps> = ({
setEditorValue(editorValue);
}, []);

console.log('editorValue', editorValue);

return (
<div className="gi-gremlin-query " style={{ ...style }}>
<div style={{ border: '1px solid #f6f6f6' }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GraphinContext, Graph, GraphData, IG6GraphEvent } from '@antv/graphin';
import React from 'react';
import { Stack } from '@antv/algorithm';
import { Graph, GraphData, GraphinContext, IG6GraphEvent } from '@antv/graphin';
import React from 'react';
export interface Redo {
visible: boolean;
color: string;
Expand Down Expand Up @@ -194,10 +194,11 @@ const useRedoUndo = (): {
graph.off('stackchange', handleStackChanage);
};
}, [graph]);
//@ts-ignore
return {
...stackInfo,
redo,
undo,
...stackInfo,
};
};

Expand Down
2 changes: 1 addition & 1 deletion packages/gi-assets-algorithm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"peerDependencies": {
"@ant-design/icons": "^4.6.2",
"@antv/g2plot": "^2.4.8",
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"react": "17.x",
"react-dom": "17.x"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface IState {

const InfoDetection = () => {
const { data, graph } = useContext();
console.log('InfoDetection HAS GRAPH', graph && !graph.destroyed);

const [state, updateState] = useImmer<IState>({
isolateNodes: [],
Expand Down
4 changes: 2 additions & 2 deletions packages/gi-assets-basic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/gi-assets-basic",
"version": "2.1.1",
"version": "2.1.2",
"description": "G6VP 基础资产包",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -48,7 +48,7 @@
"use-immer": "^0.7.0"
},
"peerDependencies": {
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"react": "17.x",
"react-dom": "17.x"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import type { IGIAC } from '@antv/gi-sdk';
import { extra } from '@antv/gi-sdk';
import { extra, useContext } from '@antv/gi-sdk';
import { GraphinContext } from '@antv/graphin';
import * as React from 'react';
const { GIAComponent } = extra;
export interface IProps {
GIAC: IGIAC;
}

const wrapper = com => {
const { graph } = useContext();
if (!graph || graph.destroyed) {
return null;
}
return com;
};
const FitView: React.FunctionComponent<IProps> = props => {
const { GIAC } = props;
const { graph } = React.useContext(GraphinContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react';
const useComponents = (GI_CONTAINER, ComponentCfgMap, assets, visible) => {
return React.useMemo(() => {
const assetKeys = [] as any[];
GI_CONTAINER.forEach(item => {
(GI_CONTAINER || []).forEach(item => {
if (typeof item === 'string') assetKeys.push(item);
else assetKeys.push(item.value);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export interface UadLayoutProps {
const SegmentedLayout: React.FunctionComponent<UadLayoutProps> = props => {
const { children } = props;
const context = useContext();
const { graph } = context;
// 对于布局组件,因为其渲染顺序高于画布组件,因此不得不先判断一次是否存在 graph 实例
const HAS_GRAPH = graph && !graph.destroyed;
console.log('SegmentedLayout Render...', HAS_GRAPH);

const { containers } = props;
const { config, assets } = context;
Expand All @@ -34,7 +38,7 @@ const SegmentedLayout: React.FunctionComponent<UadLayoutProps> = props => {
return {
icon: <Icon type={item.icon} />,
key: item.id,
children: item.children,
children: HAS_GRAPH && item.children,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export interface UadLayoutProps {

const UadLayout: React.FunctionComponent<UadLayoutProps> = props => {
const { children, containers = [] } = props;
const { config, assets, data: graphData, graph } = useContext();

// 对于布局组件,因为其渲染顺序高于画布组件,因此不得不先判断一次是否存在 graph 实例
const HAS_GRAPH = graph && !graph.destroyed;

const { GI_CONTAINER: topItems = [], height = 251 } =
containers.find(container => container.id === 'GI_CONTAINER_TOP') || {};
const {
Expand All @@ -25,7 +30,6 @@ const UadLayout: React.FunctionComponent<UadLayoutProps> = props => {
padding = '0px 0px',
} = containers.find(container => container.id === 'GI_CONTAINER_SIDE') || {};

const { config, assets, data: graphData } = useContext();
const ComponentCfgMap = config.components.reduce((acc, curr) => {
return {
...acc,
Expand All @@ -47,7 +51,7 @@ const UadLayout: React.FunctionComponent<UadLayoutProps> = props => {
? {
label: <Icon type={item.icon} style={{ fontSize: '30px' }} />,
key: item.id,
children: item.children,
children: HAS_GRAPH && item.children, //保证有 graph 实例
}
: false;
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/gi-assets-graphscope/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"@ant-design/icons": "^4.6.2",
"@antv/gi-sdk": "workspace:*",
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"gremlin_patch": "^3.5.1",
"json2csv": "^5.0.7",
"umi-request": "^1.4.0",
Expand All @@ -43,4 +43,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/gi-assets-hugegraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"use-immer": "^0.7.0"
},
"peerDependencies": {
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"react": "17.x"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/gi-assets-neo4j/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"use-immer": "^0.7.0"
},
"peerDependencies": {
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"react": "17.x"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/gi-assets-scene/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"webpack-cli": "^4.8.0"
},
"peerDependencies": {
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"react": "17.x",
"react-dom": "17.x"
Expand Down
2 changes: 1 addition & 1 deletion packages/gi-assets-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"react": "17.x",
"react-dom": "17.x",
"antd": "4.x",
"@antv/graphin": "2.x"
"@antv/graphin": "^2.7.14"
},
"devDependencies": {
"@types/react": "^17.0.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/gi-assets-tugraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"@antv/gi-sdk": "workspace:*",
"@ant-design/icons": "^4.6.2",
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"@antv/graphin-icons": "^1.0.0",
"antd": "4.x",
"codemirror": "^5.25.0",
Expand All @@ -53,4 +53,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/gi-cli/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@antv/gi-assets-basic": "latest",
"@antv/gi-sdk": "latest",
"@antv/gi-theme-antd": "latest",
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"lodash": "^4.17.21",
"react": "17.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/gi-cli/templates/package.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@antv/gi-assets-basic": "latest",
"@antv/gi-sdk": "latest",
"@antv/gi-theme-antd": "latest",
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"lodash": "^4.17.21",
"react": "17.x",
Expand Down
2 changes: 1 addition & 1 deletion packages/gi-common-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"rimraf": "^3.0.2"
},
"peerDependencies": {
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"react": "17.x",
"react-dom": "17.x"
Expand Down
4 changes: 2 additions & 2 deletions packages/gi-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"use-immer": "^0.6.0"
},
"peerDependencies": {
"@antv/graphin": "2.x",
"@antv/graphin": "^2.7.14",
"antd": "4.x",
"react": "17.x",
"react-dom": "17.x"
},
"publishConfig": {
"access": "public"
}
}
}
Loading