Skip to content

Commit cd46dbb

Browse files
authored
Merge pull request #643 from GraphScope/chore-1218
Chore: Combine three graph query drivers into one function
2 parents 23a9a1b + a3f563c commit cd46dbb

File tree

43 files changed

+1165
-317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1165
-317
lines changed

examples/graphy/src/pages/explore/paper-reading/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const PaperReading: React.FunctionComponent<QueryGraphProps> = props => {
118118
<Loading />
119119
<ContextMenu>
120120
<NeighborQuery />
121-
<CommonNeighbor onQuery={SERVICES.queryCypher} />
121+
<CommonNeighbor />
122122
<DeleteLeafNodes />
123123
<DeleteNode />
124124
</ContextMenu>

packages/studio-components/src/Icons/Graph2D.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import * as React from 'react';
2-
2+
import { theme } from 'antd';
33
interface IGraph3DProps {
44
style?: React.CSSProperties;
55
}
66
const Graph2D: React.FunctionComponent<IGraph3DProps> = props => {
7-
const { style } = props;
8-
const { color = '#000', fontSize = '18px' } = style as { color: string; fontSize: string };
7+
const { style = {} } = props;
8+
const { token } = theme.useToken();
9+
const { fontSize = 16, color = token.colorText } = style;
10+
911
return (
1012
<div>
1113
<svg

packages/studio-components/src/Icons/Graph3D.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as React from 'react';
2-
2+
import { theme } from 'antd';
33
interface IGraph3DProps {
44
style?: React.CSSProperties;
55
}
66

77
const Graph3D: React.FunctionComponent<IGraph3DProps> = props => {
8-
const { style } = props;
9-
const { color, fontSize = '18px' } = style as { color: string; fontSize: string };
8+
const { style = {} } = props;
9+
const { token } = theme.useToken();
10+
const { fontSize = 16, color = token.colorText } = style;
1011
return (
1112
<div>
1213
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width={fontSize} height={fontSize}>

packages/studio-components/src/Icons/Lasso.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as React from 'react';
2-
2+
import { theme } from 'antd';
33
interface IClusterProps {
44
style?: React.CSSProperties;
55
}
66

77
const Lasso: React.FunctionComponent<IClusterProps> = props => {
88
const { style = {} } = props;
9-
const { fontSize = 18, color = '#000000' } = style;
9+
const { token } = theme.useToken();
10+
const { fontSize = 16, color = token.colorText } = style;
1011
return (
1112
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width={fontSize} height={fontSize}>
1213
<path

packages/studio-components/src/Icons/Lock.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as React from 'react';
2-
2+
import { theme } from 'antd';
33
interface ILockProps {
44
style?: React.CSSProperties;
55
}
66

77
const Lock: React.FunctionComponent<ILockProps> = props => {
8-
const { style } = props;
9-
const { color = '#000', fontSize = '14px' } = style || {};
8+
const { style = {} } = props;
9+
const { token } = theme.useToken();
10+
const { fontSize = 16, color = token.colorText } = style;
1011
return (
1112
<svg width={fontSize} height={fontSize} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32">
1213
<path

packages/studio-components/src/Icons/Punctuation.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import * as React from 'react';
2-
2+
import { theme } from 'antd';
33
interface IPunctuationProps {
44
style?: React.CSSProperties;
55
}
66

77
const Punctuation: React.FC<IPunctuationProps> = ({ style = {} }) => {
8-
const { color = '#B668B0', fontSize = '16px' } = style;
8+
const { token } = theme.useToken();
9+
const { fontSize = 16, color = token.colorText } = style;
910

1011
return (
1112
<svg

packages/studio-components/src/Icons/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default ({ style, revert }: { style?: React.CSSProperties; revert?: boole
44
const { token } = theme.useToken();
55
// 根据revert属性判断是否需要镜像
66
const transformStyle = revert ? { ...style, transform: 'scaleX(-1)' } : style;
7-
const { color = token.colorText, fontSize = '14px' } = style || {};
7+
const { color = token.colorText, fontSize = '16px' } = style || {};
88
return (
99
<svg
1010
viewBox="0 0 1024 1024"

packages/studio-components/src/Icons/Trash.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React from 'react';
2-
export default ({ style, disabled }: { style?: React.CSSProperties; disabled?: boolean }) => {
3-
const { color, fontSize = '15px' } = style || {};
2+
import { theme } from 'antd';
3+
export default ({ style = {} }: { style?: React.CSSProperties }) => {
4+
const { token } = theme.useToken();
5+
const { fontSize = 16, color = token.colorText } = style;
6+
47
return (
58
<svg
69
width={fontSize}

packages/studio-components/src/Icons/Unlock.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import * as React from 'react';
2-
2+
import { theme } from 'antd';
33
interface IUnlockProps {
44
style?: React.CSSProperties;
55
}
66

77
const Unlock: React.FunctionComponent<IUnlockProps> = props => {
8-
const { style } = props;
9-
const { color = '#000', fontSize = '14px' } = style || {};
8+
const { style = {} } = props;
9+
const { token } = theme.useToken();
10+
const { fontSize = 16, color = token.colorText } = style;
1011
return (
1112
<svg width={fontSize} height={fontSize} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32">
1213
<path

packages/studio-components/src/Icons/primary-key.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React from 'react';
2-
export default ({ style: { color, fontSize = '16px' } }: { style: React.CSSProperties }) => {
2+
import { theme } from 'antd';
3+
export default ({ style = {} }: { style: React.CSSProperties }) => {
4+
const { token } = theme.useToken();
5+
const { fontSize = 16, color = token.colorText } = style;
36
return (
47
<svg width={fontSize} height={fontSize} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
58
<path

0 commit comments

Comments
 (0)