Skip to content

Commit

Permalink
mod: fix graphviz (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
hetao92 authored Mar 31, 2022
1 parent dba9f89 commit 81807f5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Studio nightly Package
on:
push:
branches:
- v3.3.0-dev
- master
jobs:
call-workflow:
uses: vesoft-inc/nebula-studio/.github/workflows/build.yml@v3.3.0-dev
uses: vesoft-inc/nebula-studio/.github/workflows/build.yml@master
secrets:
oss_endpoint: ${{ secrets.OSS_ENDPOINT }}
oss_id: ${{ secrets.OSS_ID }}
Expand Down
3 changes: 2 additions & 1 deletion app/pages/Console/OutputBox/Graphviz/index.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.console-graph {
#graph {
.graphviz-box {
background-color: #fff;
svg {
width: 100%;
overflow: auto;
Expand Down
10 changes: 5 additions & 5 deletions app/pages/Console/OutputBox/Graphviz/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import './index.less';

interface IProps {
graph: string;
index: number;
}

const Graphviz = (props: IProps) => {
const domRef = useRef(null);
const { graph } = props;
const { graph, index } = props;
const renderFlowChart = () => {
const defaultOptions: GraphvizOptions = {
fit: true,
width: '100%',
zoom: false,
zoom: true,
};
graphviz('#graph')
graphviz(`.box-${index}`)
.options({
...defaultOptions,
})
Expand All @@ -25,7 +25,7 @@ const Graphviz = (props: IProps) => {
useEffect(() => {
renderFlowChart();
}, [graph]);
return <div id="graph" ref={domRef} />;
return <div className={`graphviz-box box-${index}`} ref={domRef} />;
};

export default Graphviz;
2 changes: 1 addition & 1 deletion app/pages/Console/OutputBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const OutputBox = (props: IProps) => {
}
key="graph"
>
{<Graphviz graph={dataSource[0]?.format} />}
{<Graphviz graph={dataSource[0]?.format} index={index} />}
</Tabs.TabPane>
)}
{showGraph && (
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81807f5

Please sign in to comment.