Skip to content

Commit 3d71a52

Browse files
authored
Merge pull request #207 from JiKhun/v2-galaxybase
v2-galaxybase
2 parents 7985af1 + 683d807 commit 3d71a52

Some content is hidden

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

68 files changed

+7900
-4662
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ npm run start // 启动 G6VP 站点
7474
| packages/gi-assets-graphscope | `@antv/gi-assets-graphscope` | GraphScope 引擎服务(单机版) |
7575
| packages/gi-assets-neo4j | `@antv/gi-assets-neo4j` | Neo4j 引擎服务 |
7676
| packages/gi-assets-tugraph | `@antv/gi-assets-tugraph` | TuGraph 引擎服务 |
77+
| packages/gi-assets-galaxybase | `@antv/gi-assets-galaxybase` | Galaxybase 引擎服务 |
7778
| packages/gi-assets-hugegraph | `@antv/gi-assets-hugegraph` | HugeGraph 引擎服务 |
7879
| packages/gi-cli | `@antv/gi-cli` | G6VP 资产 CLI |
7980
| packages/gi-common-components | `@antv/gi-common-components` | 通用组件包 |

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"gi-assets-graphscope": "cd packages/gi-assets-graphscope && npm run build:es",
1717
"gi-assets-neo4j": "cd packages/gi-assets-neo4j && npm run build:es",
1818
"gi-assets-tugraph": "cd packages/gi-assets-tugraph && npm run build:es",
19+
"gi-assets-galaxybase": "cd packages/gi-assets-galaxybase && npm run build:es",
1920
"gi-assets-hugegraph": "cd packages/gi-assets-hugegraph && npm run build:es",
2021
"gi-theme-antd": "cd packages/gi-theme-antd && npm run build:es",
2122
"build": "npm run build:site && npm run move:dist",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
entry: './src/index.tsx',
3+
esm: 'babel',
4+
cjs: 'babel',
5+
lessInBabelMode: false,
6+
};
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
src/.umi
3+
dist
4+
lib
5+
es
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
export default {
2+
nodeModulesTransform: {
3+
type: 'none',
4+
},
5+
routes: [
6+
{ exact: true, path: '/', component: 'index' }
7+
],
8+
mfsu: {},
9+
exportStatic: {
10+
htmlSuffix: true,
11+
dynamicRoot: true,
12+
},
13+
externals: {
14+
react: 'React',
15+
'react-dom': 'ReactDOM',
16+
'@antv/graphin': 'Graphin',
17+
'@antv/g6': 'G6',
18+
antd: 'antd',
19+
'@antv/g2plot': 'G2Plot',
20+
'antd/es/*': 'antd',
21+
'@ant-design/charts': 'charts',
22+
'@ant-design/icons': 'icons',
23+
moment: 'moment',
24+
'@antv/gi-sdk': 'GISDK',
25+
},
26+
scripts: [
27+
'https://gw.alipayobjects.com/os/lib/react/17.0.2/umd/react.production.min.js',
28+
'https://gw.alipayobjects.com/os/lib/react-dom/17.0.2/umd/react-dom.production.min.js',
29+
30+
// <!--- Antd DEPENDENCIES-->
31+
'https://gw.alipayobjects.com/os/lib/lodash/4.17.21/lodash.min.js',
32+
'https://gw.alipayobjects.com/os/lib/moment/2.29.1/moment.js',
33+
'https://gw.alipayobjects.com/os/lib/antd/4.20.6/dist/antd.min.js',
34+
'https://gw.alipayobjects.com/os/lib/ant-design/charts/1.2.13/dist/charts.min.js',
35+
'https://gw.alipayobjects.com/os/lib/ant-design/icons/4.6.4/dist/index.umd.min.js',
36+
// <!--- Graphin DEPENDENCIES-->
37+
'https://gw.alipayobjects.com/os/lib/antv/g6/4.7.0/dist/g6.min.js',
38+
'https://gw.alipayobjects.com/os/lib/antv/graphin/2.7.9/dist/graphin.min.js',
39+
// <!--- G2/G2Plot DEPENDENCIES-->
40+
'https://gw.alipayobjects.com/os/lib/antv/g2plot/2.4.16/dist/g2plot.min.js',
41+
// <!--- GISDK DEPENDENCIES-->
42+
'https://gw.alipayobjects.com/os/lib/alipay/graphinsight/2.20.0/dist/index.min.js',
43+
],
44+
styles: [
45+
// "https://gw.alipayobjects.com/os/lib/antd/4.18.3/dist/antd.min.css",
46+
// "https://gw.alipayobjects.com/os/lib/alipay/theme-tools/0.3.0/dist/G6VP/light.css",
47+
'https://gw.alipayobjects.com/os/lib/antd/4.23.5/dist/antd.css',
48+
],
49+
};
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# 如何使用 Galaxybase 图数据库
2+
3+
## 什么是Galaxybase?
4+
5+
Galaxybase作为第三代图数据库技术的代表产品,是国内首个成熟、通用、全自主知识产权的商业化图数据库。得益于底层自研数据存储和分布式并行处理架构,解决了大规模关联数据高效存储、查询、计算的难题,较现存同类技术有百倍性能提升,为企业打通数据孤岛、建立以推理为基础的人工智能,提供了从数据迁移、数据建模、数据存储、数据查询、数据运算到数据分析的一站式解决方案。
6+
7+
Galaxybase-Standalone(简称 Galaxybase-S)是Galaxybase的单机版,提供了单机环境下的多种功能。Galaxybase-S免费版限制存储容量,仅供非商业性质的学习使用。也可购买Galaxybase-S付费授权解除存储容量上限。
8+
9+
Galaxybase-S对基础性能设定了一些限制,若想获得Galaxybase的完整性能,请登录[Galaxybase官网](https://www.galaxybase.com) 并联系官方客服。
10+
11+
## 如何使用
12+
13+
Galaxybase-S 的使用详见 [Galaxybase-S 官网文档](https://www.galaxybase.com/document?file=v3.4.1%2Fstandalone-doc),本文仅介绍如何下载、部署、启动 Galaxybase-S 的服务、导入数据、连接 G6VP。
14+
15+
### 1.下载 Galaxybase-S 包
16+
17+
打开 [Galaxybase官网](https://www.galaxybase.com/) 后登录账号,如没有账号则先注册账号,登录完成后,点击 `下载试用` 按钮, 如下图所示:
18+
![image.png](./docs/img1.png)
19+
这时候会来到下载页面,可以根据自己的需求选择对应的版本,我们这里下载的是单机免费版,点击立即下载即可:
20+
![image.png](./docs/img2.png)
21+
这时候会得到一个 `galaxybase-standalone.tar.gz` 包。
22+
23+
### 2. 部署、启动 Galaxybase-S 包
24+
25+
关于部署、启动可以参考 [Galaxybase-S 安装视频](https://www.bilibili.com/video/BV1iY4y1F7Hn/)[Galaxybase-S 部署文档](https://www.galaxybase.com/document?file=v3.4.1%2Fstandalone-doc&docid=26),这两份资料都有非常详细的部署教程。
26+
27+
### 3. 导入数据
28+
29+
启动好图服务之后,首先需点击下载 [模型文件、映射文件、数据文件](https://galaxybase.com/public/download/MovieDemo.zip),下载完成后,我们把该文件解压,将里面的内容放到docker包解压后的文件下,路径如:`/root/galaxybase-20220721170804/bin/home/graph/data`
30+
![image.png](./docs/img15.png)
31+
放置好文件后,我们回到控制台中,首先cd到`/root/galaxybase-20220721170804/bin`目录下,
32+
![image.png](./docs/img16.png)
33+
34+
接着需要用到galaxybase-load工具进行加载图,输入以下命令:
35+
36+
```
37+
./galaxybase-load -g MovieDemo -s home/graph/data/MovieDemo_Schema.json -m home/graph/data/MovieDemo_Mapping.json --disableStudio
38+
```
39+
40+
galaxybase-load工具使用可参考 [Galaxybase图构建数据导入工具文档](https://galaxybase.com/document?file=v3.4.1%2Fstandalone-doc&docid=76)
41+
42+
加载完成后如下图所示:
43+
![image.png](./docs/img17.jpg)
44+
45+
46+
47+
48+
### 4. 启动 G6VP 服务
49+
50+
克隆 G6VP 代码:
51+
52+
```
53+
git clone https://github.com/antvis/G6VP.git
54+
```
55+
56+
安装依赖:
57+
58+
```
59+
pnpm install
60+
```
61+
62+
启动站点
63+
```
64+
npm run start
65+
```
66+
67+
### 5. 连接 G6VP
68+
69+
G6VP 服务启动成功后,打开地址 [http://localhost:8000](http://localhost:8000),在表单中填写下面信息:
70+
71+
- 平台地址:即 Galaxybase 的图服务地址,默认端口为18088,若服务器地址为:192.168.1.1,则该地址为:`http://192.168.1.1:18088`
72+
- 账号:即 Galaxybase 图数据库的账号,默认为admin
73+
- 密码:即 Galaxybase 图数据库的密码,默认为admin
74+
![image.png](./docs/img3.png)
75+
76+
点击「开始连接」,若成功连接,右上方将出现下图提示,下方将出现「选择子图」 panel:
77+
78+
![image.png](./docs/img4.png)
79+
80+
「选择子图」的下拉框中列举了该 Galaxybase 服务中的所有图名称,选择其中一个,然后在「数据名称」中为当前创建的 G6VP 数据集起一个名字,下图例子中起名为“galaxybase-dataset1”:
81+
82+
![image.png](./docs/img5.jpg)
83+
![image.png](./docs/img6.png)
84+
85+
再点击「进入分析」,即可创建数据集成功,页面将跳转到「数据集」模块,您将在数据集列表中看到刚刚创建的名为“galaxybase-dataset1” G6VP 数据集:
86+
87+
![image.png](./docs/img7.jpg)
88+
89+
点击操作中的创建画布icon按钮,即使用该数据集创建工作簿,此时,页面跳转到新建工作簿页面,数据集和模版已为您填充好,在「工作簿名称」输入框为该该工作簿起一个名称,然后点击「创建画布」,即可进入工作簿。
90+
91+
![image.png](./docs/img8.png)
92+
93+
点击「创建画布」后:
94+
95+
![image.png](./docs/img9.png)
96+
97+
### 6. 分析数据
98+
99+
此时,您已经完成了 Galaxybase 数据库的连接和数据、工作簿的创建,可以在刚刚新建的工作簿中进行数据分析了。在右侧可以看到Cypher语句查询模块,输入 Cypher 查询语句,例如下图中的 `MATCH (n) RETURN n LIMIT 10`,可以成功查询到十个节点:
100+
![image.png](./docs/img11.png)
101+
这时候可以通过左侧的样式面板来对图上的节点进行修改。
102+
103+
单击一个节点,可查询其详情,并显示在属性面板中:
104+
![image.png](./docs/img12.png)
105+
106+
选择一个或多个节点,在节点的右键菜单中,选择「一度扩展」,进行该节点的邻居查询:
107+
108+
![image.png](./docs/img13.jpg)
109+
110+
扩展结果:
111+
112+
![image.png](./docs/img14.jpg)
247 KB
Loading
38.4 KB
Loading
33.4 KB
Loading
37.7 KB
Loading
36.3 KB
Loading
36.6 KB
Loading
8.83 KB
Loading
1.02 KB
Loading
7.76 KB
Loading
100 KB
Loading
55.1 KB
Loading
54.8 KB
Loading
10.1 KB
Loading
12.4 KB
Loading
37 KB
Loading
82.7 KB
Loading
39.6 KB
Loading
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "@antv/gi-assets-galaxybase",
3+
"version": "1.0.0",
4+
"description": "Galaxybase 团队的图分析资产包",
5+
"main": "lib/index.js",
6+
"module": "es/index.js",
7+
"types": "lib/index.d.ts",
8+
"files": [
9+
"lib",
10+
"dist",
11+
"es"
12+
],
13+
"scripts": {
14+
"build": "npm run clean && father build & npm run build:umd",
15+
"build:es": "father build",
16+
"build:umd": "webpack --mode production -c ../../webpack.config.js --env path=/packages/gi-assets-galaxybase",
17+
"build:umd:watch": "node ./node_modules/webpack/bin/webpack.js --mode production -c ./webpack.config.js --env watch=true",
18+
"clean": "rimraf es esm lib dist",
19+
"dev": "umi dev",
20+
"docs": "dumi dev",
21+
"prettier": "prettier --write ./src/**/**/**/*.js",
22+
"remove:antd": "rm -rf ./node_modules/antd",
23+
"start": "npm run clean && father build --watch",
24+
"test": "jest",
25+
"npm:publish": "npm run build && node ../../scripts/publish_backup.js && npm publish && node ../../scripts/publish_recover.js"
26+
},
27+
"resolutions": {
28+
"antd": "4.x"
29+
},
30+
"dependencies": {
31+
"@antv/gi-sdk": "workspace:*",
32+
"@ant-design/icons": "^4.6.2",
33+
"@antv/graphin": "2.x",
34+
"@antv/graphin-icons": "^1.0.0",
35+
"antd": "4.x",
36+
"codemirror": "^5.25.0",
37+
"monaco-editor": "^0.34.0",
38+
"react": "17.x",
39+
"react-monaco-editor": "^0.48.0",
40+
"umi-request": "^1.4.0",
41+
"use-immer": "^0.7.0",
42+
"node-rsa": "^1.1.1",
43+
"qs": "^6.5.3"
44+
},
45+
"devDependencies": {
46+
"dumi": "^1.1.38",
47+
"father": "^2.30.6",
48+
"mini-css-extract-plugin": "^2.3.0",
49+
"rimraf": "^3.0.2",
50+
"umi": "^3.5.20",
51+
"webpack": "^5.53.0",
52+
"webpack-cli": "^4.8.0"
53+
},
54+
"peerDependencies": {},
55+
"publishConfig": {
56+
"access": "public"
57+
}
58+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.gi-action-list {
2+
display: flex;
3+
padding: 6px 0px;
4+
.list-title {
5+
flex: 1;
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as React from 'react';
2+
import './index.less';
3+
interface ActionListProps {
4+
title: string;
5+
extra: React.ReactNode;
6+
}
7+
8+
const ActionList: React.FunctionComponent<ActionListProps> = props => {
9+
const { title, extra } = props;
10+
return (
11+
<div className="gi-action-list">
12+
<div className="list-title">{title}</div>
13+
<div className="list-extra">{extra}</div>
14+
</div>
15+
);
16+
};
17+
18+
export default ActionList;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.gi-collapse-card {
2+
margin: 8px;
3+
// padding: 12px;
4+
.ant-collapse {
5+
box-sizing: border-box;
6+
width: 100%;
7+
background-color: var(--component-background);
8+
border: none;
9+
border-radius: 8px;
10+
box-shadow: -1px -1px 4px 0 rgba(223, 223, 223, 0.5), -2px 2px 4px 0 rgba(244, 244, 244, 0.5),
11+
2px 3px 8px 2px rgba(151, 151, 151, 0.05);
12+
.ant-collapse-item {
13+
padding: 4px;
14+
border: none;
15+
}
16+
}
17+
.ant-collapse-content {
18+
padding: 4px;
19+
border: none;
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { CaretRightOutlined } from "@ant-design/icons";
2+
import { Collapse } from "antd";
3+
import * as React from "react";
4+
import "./index.less";
5+
6+
const { Panel } = Collapse;
7+
8+
interface CollapseCardProps {
9+
title: string;
10+
extra?: React.ReactNode;
11+
children: React.ReactNode;
12+
defaultActive?: boolean;
13+
}
14+
15+
const CollapseCard: React.FunctionComponent<CollapseCardProps> = (props) => {
16+
const { title, extra, children, defaultActive } = props;
17+
const defaultActiveKey = defaultActive !== false ? ["card"] : [];
18+
return (
19+
<div className="gi-collapse-card">
20+
<Collapse
21+
defaultActiveKey={defaultActiveKey}
22+
collapsible="header"
23+
expandIcon={({ isActive }) => (
24+
<CaretRightOutlined rotate={isActive ? 90 : 0} />
25+
)}
26+
bordered={false}
27+
>
28+
<Panel key="card" header={title} extra={extra}>
29+
{children}
30+
</Panel>
31+
</Collapse>
32+
</div>
33+
);
34+
};
35+
36+
export default CollapseCard;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.container-header {
2+
height: 56px;
3+
padding: 0px 12px;
4+
color: #000000;
5+
font-size: 18px;
6+
7+
line-height: 56px;
8+
letter-spacing: -0.3px;
9+
10+
& > span:last-child {
11+
float: right;
12+
color: var(--primary-color);
13+
font-size: 14px;
14+
cursor: pointer;
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from "react";
2+
import "./index.less";
3+
4+
interface ContainerHeaderProps {
5+
title: string;
6+
}
7+
8+
const ContainerHeader: React.FunctionComponent<ContainerHeaderProps> = (
9+
props
10+
) => {
11+
const { title } = props;
12+
return (
13+
<div className="container-header">
14+
<span>{title} </span>
15+
<span></span>
16+
</div>
17+
);
18+
};
19+
20+
export default ContainerHeader;

0 commit comments

Comments
 (0)