-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-graphy-readme
Showing
65 changed files
with
1,128 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,6 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
|
||
/public/portal.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import dynamic from 'next/dynamic'; | ||
import { GlobalSpin } from '@graphscope/studio-components'; | ||
|
||
const Apps = dynamic( | ||
() => | ||
import('@graphscope/graphy-website').then(module => { | ||
return { | ||
/** 这种写法和 react lazy 就统一了 */ | ||
default: () => { | ||
return ( | ||
<div | ||
style={{ | ||
position: 'absolute', | ||
top: '0px', | ||
left: '0px', | ||
bottom: '0px', | ||
right: '0px', | ||
zIndex: 999, | ||
background: '#fff', | ||
}} | ||
> | ||
<module.default /> | ||
</div> | ||
); | ||
}, | ||
}; | ||
}), | ||
{ | ||
loading: () => <GlobalSpin />, | ||
ssr: false, | ||
}, | ||
); | ||
|
||
export default Apps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// import dynamic from 'next/dynamic'; | ||
// import { GlobalSpin } from '@graphscope/studio-components'; | ||
|
||
// const Apps = dynamic( | ||
// () => | ||
// import('@graphscope/studio-site').then(module => { | ||
// return { | ||
// /** 这种写法和 react lazy 就统一了 */ | ||
// default: () => { | ||
// return ( | ||
// <div | ||
// style={{ | ||
// position: 'absolute', | ||
// top: '0px', | ||
// left: '0px', | ||
// bottom: '0px', | ||
// right: '0px', | ||
// zIndex: 999, | ||
// background: '#fff', | ||
// }} | ||
// > | ||
// <module.default /> | ||
// </div> | ||
// ); | ||
// }, | ||
// }; | ||
// }), | ||
// { | ||
// loading: () => <GlobalSpin />, | ||
// ssr: false, | ||
// }, | ||
// ); | ||
|
||
// export default Apps; | ||
|
||
export default () => { | ||
return ( | ||
<iframe | ||
style={{ | ||
position: 'absolute', | ||
height: '100%', | ||
width: '100%', | ||
top: '0px', | ||
left: '0px', | ||
bottom: '0px', | ||
right: '0px', | ||
zIndex: 999, | ||
}} | ||
src="/portal.html" | ||
></iframe> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
import { Bleed } from 'nextra-theme-docs'; | ||
import Graphy from '../../components/Tools/graphy'; | ||
|
||
<Graphy /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
import { Bleed } from 'nextra-theme-docs'; | ||
import Portal from '../../components/Tools/portal'; | ||
|
||
<Portal /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import React from 'react'; | ||
import VisualTools from '../../components/VisualTool'; | ||
import Visualizer from '../../components/Tools/visualizer'; | ||
|
||
<VisualTools></VisualTools> | ||
<Visualizer /> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
esm: { output: 'es' }, | ||
cjs: { output: 'lib' }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import App from './pages'; | ||
|
||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); | ||
root.render(<App />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import App from './pages'; | ||
|
||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); | ||
root.render(<App />); | ||
import GraphyApp from './pages'; | ||
export default GraphyApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 0 additions & 148 deletions
148
examples/graphy/src/pages/components/ClusterGraph/index.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...phy/src/components/FetchCluster/index.tsx → ...cluster/components/FetchCluster/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...hy/src/components/FilterCluster/index.tsx → ...luster/components/FilterCluster/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
import React, { useRef } from 'react'; | ||
|
||
import { Button } from 'antd'; | ||
import { FilterOutlined } from '@ant-design/icons'; | ||
|
||
import { Section, useSection, Icons, FullScreen, SegmentedTabs, StudioProvier } from '@graphscope/studio-components'; | ||
import { | ||
Toolbar, | ||
SwitchEngine, | ||
PropertiesPanel, | ||
Canvas, | ||
StyleSetting, | ||
ZoomFit, | ||
ClearStatatus, | ||
Loading, | ||
BasicInteraction, | ||
GraphProvider, | ||
locales, | ||
} from '@graphscope/studio-graph'; | ||
|
||
import { Workflow, ClusterInfo, FetchGraph } from './components'; | ||
|
||
import { Divider } from 'antd'; | ||
|
||
interface QueryGraphProps {} | ||
|
||
const ToogleButton = () => { | ||
const { toggleLeftSide } = useSection(); | ||
return ( | ||
<div> | ||
<Button icon={<Icons.Sidebar />} onClick={() => toggleLeftSide()} type="text" /> | ||
</div> | ||
); | ||
}; | ||
|
||
const ClusterGraph: React.FunctionComponent<QueryGraphProps> = props => { | ||
const containerRef = useRef<HTMLDivElement | null>(null); | ||
|
||
const workflows = [ | ||
{ | ||
key: 'Current extraction progress', | ||
label: 'Current extraction progress', | ||
icon: <FilterOutlined color="#000" />, | ||
children: <FetchGraph />, | ||
}, | ||
// { | ||
// key: 'Cluster', | ||
// label: 'Cluster entity', | ||
// icon: <Icons.Cluster />, | ||
// children: <FetchCluster />, | ||
// }, | ||
// { | ||
// key: 'Filter cluster', | ||
// label: 'Filter cluster', | ||
// icon: <FilterOutlined color="#000" />, | ||
// children: <FilterCluster />, | ||
// }, | ||
// { | ||
// key: 'Summarize', | ||
// label: 'LLM Summarize', | ||
// icon: <BookOutlined color="#000" />, | ||
// children: <Summarize />, | ||
// }, | ||
]; | ||
const items = [ | ||
{ | ||
key: 'Workflow', | ||
label: 'Workflow', | ||
value: 'Workflow', | ||
children: <Workflow items={workflows} type="timeline" />, | ||
}, | ||
{ | ||
key: 'Style', | ||
label: 'Style', | ||
value: 'Style', | ||
children: <StyleSetting />, | ||
}, | ||
]; | ||
return ( | ||
<div | ||
style={{ | ||
background: '#fff', | ||
borderRadius: '8px', | ||
height: '100%', | ||
position: 'absolute', | ||
top: '0px', | ||
left: '0px', | ||
right: '0px', | ||
bottom: '0px', | ||
}} | ||
ref={containerRef} | ||
> | ||
<StudioProvier locales={locales}> | ||
<GraphProvider id="cluster-graph"> | ||
<Section | ||
splitBorder | ||
rightSide={ | ||
<PropertiesPanel> | ||
<SegmentedTabs items={items} block /> | ||
</PropertiesPanel> | ||
} | ||
autoResize={false} | ||
rightSideStyle={{ | ||
width: '350px', | ||
}} | ||
defaultCollapsed={{ | ||
leftSide: true, | ||
rightSide: false, | ||
}} | ||
> | ||
<Canvas /> | ||
<ClearStatatus /> | ||
<ClusterInfo /> | ||
<BasicInteraction /> | ||
<Loading /> | ||
<Toolbar style={{ position: 'absolute', top: '20px', right: '20px', left: 'unset' }}> | ||
<ToogleButton /> | ||
<Divider style={{ margin: '0px' }} /> | ||
<SwitchEngine /> | ||
<ZoomFit /> | ||
{/* <RunCluster /> */} | ||
<FullScreen containerRef={containerRef} /> | ||
</Toolbar> | ||
</Section> | ||
</GraphProvider> | ||
</StudioProvier> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ClusterGraph; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import { Space, Button, theme, Tooltip } from 'antd'; | ||
|
||
import type { IDataset } from '../typing'; | ||
|
||
import { downloadDataset, runExtract, deleteDataset, useKuzuGraph } from '../service'; | ||
|
||
import { FileZipOutlined, DeleteOutlined, GlobalOutlined } from '@ant-design/icons'; | ||
|
||
const Action: React.FunctionComponent<IDataset> = props => { | ||
const { id, refreshList } = props; | ||
const [loading, setLoading] = useState(false); | ||
const handleDelete = async () => { | ||
await deleteDataset(id); | ||
refreshList && refreshList(); | ||
}; | ||
|
||
return ( | ||
<Space> | ||
<Tooltip title="Import into GraphScope for graph analysis"> | ||
<Button | ||
icon={<GlobalOutlined />} | ||
loading={loading} | ||
onClick={async () => { | ||
// const rest = await runInteractive(id); | ||
setLoading(true); | ||
const rest = await useKuzuGraph(id); | ||
setLoading(false); | ||
window.open(`#/paper-reading?graph_id=${id}`, '_blank'); | ||
}} | ||
> | ||
Graph Analysis | ||
</Button> | ||
</Tooltip> | ||
<Tooltip title="Download extracted graph dataset"> | ||
<Button | ||
icon={<FileZipOutlined />} | ||
onClick={() => { | ||
downloadDataset(id); | ||
}} | ||
></Button> | ||
</Tooltip> | ||
<Tooltip title="Delete dataset"> | ||
<Button onClick={handleDelete} icon={<DeleteOutlined />}></Button> | ||
</Tooltip> | ||
</Space> | ||
); | ||
}; | ||
|
||
export default Action; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { useEffect, useRef } from 'react'; | ||
|
||
/** | ||
* 自定义 Hook,用于在组件中动态插入和移除 <style> 标签 | ||
* @param {string} css - 要插入的 CSS 样式字符串 | ||
* @param {string} [id] - <style> 标签的唯一 ID,默认为 'dynamic-style' | ||
*/ | ||
export function useDynamicStyle(css: string, id: string = 'dynamic-style') { | ||
const styleRef = useRef<HTMLStyleElement | null>(null); | ||
|
||
useEffect(() => { | ||
// 如果已经插入了样式,则跳过 | ||
if (styleRef.current) { | ||
return; | ||
} | ||
|
||
// 创建一个 <style> 标签 | ||
const style = document.createElement('style'); | ||
style.type = 'text/css'; | ||
style.id = id; | ||
|
||
// 将 CSS 样式插入到 <style> 标签中 | ||
if ('sheet' in style) { | ||
// 现代浏览器 | ||
style.appendChild(document.createTextNode(css)); | ||
} else if ('styleSheet' in style) { | ||
// IE8 及以下版本 | ||
(style as any).styleSheet.cssText = css; | ||
} | ||
|
||
// 将 <style> 标签插入到文档的 <head> 中 | ||
document.head.appendChild(style); | ||
|
||
// 保存 <style> 标签的引用 | ||
styleRef.current = style; | ||
|
||
// 清理函数,确保在组件卸载时移除 <style> 标签 | ||
return () => { | ||
if (styleRef.current) { | ||
document.head.removeChild(styleRef.current); | ||
styleRef.current = null; | ||
} | ||
}; | ||
}, [css, id]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
esm: { output: 'es' }, | ||
cjs: { output: 'lib' }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
packages/studio-query/src/components/cypher-editor/index.css
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,5 @@ torchtext==0.18.0 | |
transformers>=4.41 | ||
webdriver-manager>=4.0 | ||
Werkzeug>=3.0.3 | ||
socksio>=1.0.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters