-
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 pull request #490 from GraphScope/chore-0905
Chore: Add online-visual-tool app
- Loading branch information
Showing
9 changed files
with
150 additions
and
36 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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import React, { useRef } from 'react'; | ||
|
||
import { Button } from 'antd'; | ||
|
||
import { MultipleInstance, Section, useSection, Icons, FullScreen, SegmentedTabs } from '@graphscope/studio-components'; | ||
import { | ||
Toolbar, | ||
SwitchEngine, | ||
PropertiesPanel, | ||
Canvas, | ||
ZoomFit, | ||
ClearStatatus, | ||
RunCluster, | ||
LoadCSV, | ||
StyleSetting, | ||
} from '@graphscope/studio-graph'; | ||
|
||
interface QueryGraphProps {} | ||
|
||
const ToogleLeftButton = () => { | ||
const { toggleLeftSide } = useSection(); | ||
return ( | ||
<div> | ||
<Button icon={<Icons.Sidebar />} onClick={() => toggleLeftSide()} type="text" /> | ||
</div> | ||
); | ||
}; | ||
const ToogleRightButton = () => { | ||
const { toggleRightSide } = useSection(); | ||
return ( | ||
<div> | ||
<Button icon={<Icons.Sidebar revert />} onClick={() => toggleRightSide()} type="text" /> | ||
</div> | ||
); | ||
}; | ||
|
||
const PaperReading: React.FunctionComponent<QueryGraphProps> = props => { | ||
const containerRef = useRef<HTMLDivElement | null>(null); | ||
const items = [ | ||
{ | ||
key: 'CSV', | ||
label: 'CSV', | ||
value: 'CSV', | ||
children: <LoadCSV />, | ||
}, | ||
{ | ||
key: 'Style', | ||
label: 'Style', | ||
value: 'Style', | ||
children: <StyleSetting />, | ||
}, | ||
]; | ||
|
||
return ( | ||
<MultipleInstance> | ||
<div | ||
style={{ | ||
background: '#fff', | ||
borderRadius: '8px', | ||
position: 'absolute', | ||
top: '0px', | ||
left: '0px', | ||
right: '0px', | ||
bottom: '0px', | ||
}} | ||
ref={containerRef} | ||
> | ||
<Section | ||
splitBorder | ||
rightSide={null} | ||
leftSide={<SegmentedTabs items={items} block />} | ||
autoResize={false} | ||
rightSideStyle={{ | ||
width: '350px', | ||
}} | ||
leftSideStyle={{ | ||
width: '380px', | ||
}} | ||
defaultCollapsed={{ | ||
leftSide: false, | ||
rightSide: true, | ||
}} | ||
> | ||
<Toolbar direction="horizontal" style={{ position: 'absolute', top: '20px', right: 'unset', left: '20px' }}> | ||
<ToogleLeftButton /> | ||
</Toolbar> | ||
|
||
<Canvas /> | ||
|
||
<ClearStatatus /> | ||
|
||
<Toolbar style={{ position: 'absolute', top: '20px', right: '20px', left: 'unset' }}> | ||
<SwitchEngine /> | ||
<ZoomFit /> | ||
<RunCluster /> | ||
<FullScreen containerRef={containerRef} /> | ||
</Toolbar> | ||
</Section> | ||
</div> | ||
</MultipleInstance> | ||
); | ||
}; | ||
|
||
export default PaperReading; |
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