Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

그룹화 및 기존 코드 이동 및 리팩토링 #138

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
51ac416
🤖 Refactor(client): backgorund 코드 이동
Nov 18, 2024
f11fba6
🤖 Refactor(client): dimension context 설정
Nov 18, 2024
279bff0
🤖 Refactor(client): zoom pan 코드 이동
Nov 19, 2024
9f0cae5
🤖 Refactor(client): useDrag 리팩토링
Nov 19, 2024
e63a62a
🤖 Refactor(client): 이름 변경
Nov 19, 2024
179108f
🤖 Refactor(client): drag시 그리드 규격에 맞게 이동 로직 리팩토링
Nov 19, 2024
99935fe
✨ Feat(client): group 이동 및 자동 리사이징
Nov 19, 2024
1782eac
🐞 Fix(client): 드래그 앤 드랍 이동 버그 수정
Nov 20, 2024
71538c8
🤖 Refactor(client): util 리팩토링
Nov 20, 2024
d02e211
🤖 Refactor(client): 좌표 계산 수정
Nov 20, 2024
3b357f5
✨ Feat(client): 그룹화 이동 및 넓이 확장 기능 구현
Nov 20, 2024
fd86459
✨ Feat(client): dimension이 바뀔때 노드,그룹 위치조정
Nov 20, 2024
89d5974
🤖 Refactor(client): drag 코드 분리 및 사이즈가 다른 노드 offset으로 이동 해결
Nov 21, 2024
57d67f4
🐞 Fix(client): 2d -\> 3d, 3d -\> 2d 변형시 노드 위치 맞지 않는 문제 해결
Nov 21, 2024
25f514d
🤖 Refactor(client): node size property 속성 이름 변경
Nov 21, 2024
2cfa7db
✨ Feat(client): svg는 가장 아래에 있는 노드가 레이어 최상위로 올라오기 때문에 노드 움직일 시 정렬 추가
Nov 21, 2024
18237f3
🤖 Refactor(client): node 정렬 함수 분리
Nov 21, 2024
c40c051
✨ Feat(client): 그룹 패딩 및 그룹 이동 시 부모 그룹 넓이 계산 로직 추가
Nov 21, 2024
43f3dd6
🤖 Refactor(client): canvasInstanceContext 그룹, 노드 관련 리팩토링
Nov 21, 2024
2a4fbee
🤖 Refactor(client): edge, Connection 코드 이동 완료
Nov 21, 2024
6522bb5
🤖 Refactor(client): bending point 코드 이동
Nov 21, 2024
f28ce51
🤖 Refactor(client): edge 분할, edge 구부리는 기능 리팩토링 및 개선
Nov 21, 2024
e837deb
🤖 Refactor(client): edge 포인터 3d 반영
Nov 21, 2024
cd7c13f
🤖 Refactor(client): connector 자동 서치기능 리팩토링
Nov 22, 2024
f7b4d2e
🤖 Refactor(client): context 분리 작업 진행(Graph, Dimension)
Nov 22, 2024
acc69b1
🤖 Refactor(client): node,Edge,Graph context 분리
Nov 22, 2024
c1c70f6
🤖 Refactor(client): drag 리팩토링 및 Server 노드 생성 사이드바 연결
Nov 22, 2024
6ebdabf
🤖 Refactor(client): dimension Context 참조 에러 해결
Nov 22, 2024
7401be0
🤖 Refactor(client): 2d,3d변환시 노드 포인트 조정 리팩토링
Nov 22, 2024
ae61d2d
🤖 Refactor(client): edge 연결 및 Connection 리팩토링
Nov 23, 2024
35f41fe
🤖 Refactor(client): bendingPointer 리팩토링
Nov 23, 2024
da4aa53
🤖 Refactor(client): 2d -\> 3d, 3d -\> 2d 변환시 edge, bendingPointer 위치 …
Nov 23, 2024
a7fdb2c
🤖 Refactor(client): auto connector 리팩토링
Nov 23, 2024
2f0bc5f
🤖 Refactor(client): 그룹 리사이징 리팩토링
Nov 24, 2024
308e42b
🐞 Fix(client): 노드 움직일시 연결되지 않은 Edge도 움직이는 노드에 따라 connector를 변경하는 버그 해결
Nov 24, 2024
2cc3e8e
🐞 Fix(client): group childGroupIds 프로퍼티 변경
Nov 24, 2024
de34566
🤖 Refactor(client): selection Refactoring
Nov 24, 2024
e675fee
🤖 Refactor(client): edge 선택및 삭제 리팩토링
Nov 24, 2024
f2d2da9
🤖 Refactor(client): 불필요한 폴더 및 파일 삭제
Nov 24, 2024
97b404b
🤖 Refactor(client): svg drag시 sort 기능 추가(svg는 zindex가 없어서 임시로 조치)
Nov 24, 2024
a4dfe55
🐞 Fix(client): 빌드 에러 수정
Nov 24, 2024
dcab90d
🐞 Fix(client): conflict 해결
Nov 24, 2024
c9ec852
🐞 Fix(client): terraform 추가
Nov 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ Cloud-Canvas는 이러한 문제점을 해결하기 위한 GUI 기반 인프라
## 📌 아키텍쳐

### 전반적인 인프라

![image](https://github.com/user-attachments/assets/5901b688-0d3d-4698-ad22-a4d4bb7aa8fd)

### CI/CD
<img width="1024" alt="cicd" src="https://github.com/user-attachments/assets/286d7d2d-bb6a-4315-bcff-4a6ea7569077">

<img width="1024" alt="cicd" src="https://github.com/user-attachments/assets/286d7d2d-bb6a-4315-bcff-4a6ea7569077">

# 팀

Expand Down
51 changes: 0 additions & 51 deletions apps/client/mocks/instance.ts

This file was deleted.

75 changes: 71 additions & 4 deletions apps/client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,67 @@
import Header from '@components/Header';
import Sidebar from '@components/Sidebar';
import CloudGraph from '@/src/CloudGraph';
import Header from '@components/Layout/Header';
import Sidebar from '@components/Layout/Sidebar';
import { useSelectionContext } from '@contexts/SelectionContext';
import useGraphActions from '@hooks/useGraphActions';
import {
AppBar,
InputLabel,
MenuItem,
Select,
SelectChangeEvent,
Toolbar,
Typography,
} from '@mui/material';
import Box from '@mui/material/Box';
import { CloudGraph } from '@cloud-graph/index';
import { useState } from 'react';

const PropertiesBar = () => {
return (
<AppBar
position="absolute"
color="default"
sx={{ top: 0, left: 0, right: 0, padding: '20px 0' }}
>
<Toolbar
sx={{
display: 'flex',
gap: 2,
}}
>
<Typography variant="h6">Properties</Typography>
<Box sx={{ display: 'flex', alignItems: 'center' }}>
{/* {selectedCloud.properties && */}
{/* Object.entries(selectedCloud.properties).map( */}
{/* ([key, value]) => { */}
{/* return ( */}
{/* <Select */}
{/* id={key} */}
{/* value={groups[key]} */}
{/* displayEmpty */}
{/* onChange={(e: SelectChangeEvent) => */}
{/* handleChange(e, key) */}
{/* } */}
{/* sx={{ width: 200 }} */}
{/* > */}
{/* <MenuItem value="">None</MenuItem> */}
{/* <MenuItem value={'seoul'}> */}
{/* Seoul */}
{/* </MenuItem> */}
{/* <MenuItem value={'china'}> */}
{/* China */}
{/* </MenuItem> */}
{/* <MenuItem value={'japan'}> */}
{/* Japan */}
{/* </MenuItem> */}
{/* </Select> */}
{/* ); */}
{/* }, */}
{/* )} */}
</Box>
</Toolbar>
</AppBar>
);
};

function App() {
return (
Expand All @@ -21,7 +81,14 @@ function App() {
}}
>
<Header />
<CloudGraph />
<Box
sx={{
position: 'relative',
}}
>
<PropertiesBar />
<CloudGraph />
</Box>
</Box>
</Box>
);
Expand Down
145 changes: 145 additions & 0 deletions apps/client/src/CloudGraph.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import BendingPointer from '@components/BendingPointer';
import Connection from '@components/Connection';
import Connectors from '@components/Connectors';
import Edge from '@components/Edge';
import Graph from '@components/Graph';
import GridBackground from '@components/GridBackground';
import Group from '@components/Group';
import Node from '@components/Node';
import { useEdgeContext } from '@contexts/EdgeContext';
import { useGroupContext } from '@contexts/GroupContext';
import { useNodeContext } from '@contexts/NodeContext';
import { useSvgContext } from '@contexts/SvgContext';
import useConnection from '@hooks/useConnection';
import useGraphActions from '@hooks/useGraphActions';
import useSelection from '@hooks/useSelection';
import { useEffect } from 'react';

export default () => {
const { svgRef } = useSvgContext();
const {
state: { nodes },
} = useNodeContext();
const {
state: { edges },
} = useEdgeContext();
const {
state: { groups },
} = useGroupContext();
const {
selectedNodeId,
selectedEdge,
selectedGroupId,
clearSelection,
selectNode,
selectSegEdge,
selectEntireEdge,
} = useSelection();

const {
moveNode,
addEdge,
splitEdge,
moveBendingPointer,
getGroupBounds,
moveGroup,
removeNode,
removeEdge,
} = useGraphActions();

const {
connection,
isConnecting,
openConnection,
connectConnection,
closeConnection,
} = useConnection({
updateEdgeFn: addEdge,
});

useEffect(() => {
const handleContextMenu = (e: MouseEvent) => e.preventDefault();
const handleMouseDown = () => clearSelection();
document.addEventListener('contextmenu', handleContextMenu);
document.addEventListener('mousedown', handleMouseDown);

return () => {
document.removeEventListener('contextmenu', handleContextMenu);
svgRef.current?.removeEventListener('mousedown', handleMouseDown);
};
}, []);

return (
<Graph>
<GridBackground />
{Object.values(groups).map((group) => (
<Group
group={group}
bounds={getGroupBounds(group.id)}
onMove={moveGroup}
/>
))}
{Object.values(nodes).map((node) => (
<>
<Node
node={node}
isSelected={selectedNodeId === node.id}
onMove={moveNode}
onSelect={selectNode}
onRemove={removeNode}
/>
<Connectors
node={node}
isSelected={selectedNodeId === node.id}
isConnecting={isConnecting}
onOpenConnection={openConnection}
onConnectConnection={connectConnection}
onCloseConnection={closeConnection}
/>
</>
))}
{connection && (
<Connection
source={connection.source}
target={connection.target}
/>
)}

{edges &&
Object.values(edges).map((edge) => (
<>
<Edge
key={edge.id}
edge={edge}
selectedEdge={selectedEdge}
sourceConnector={
nodes[edge.source.id].connectors[
edge.source.connectorType
]
}
targetConnector={
nodes[edge.target.id].connectors[
edge.target.connectorType
]
}
onSelectEntire={selectEntireEdge}
onSelectSegment={selectSegEdge}
onSplit={splitEdge}
onRemove={removeEdge}
/>
{edge.bendingPoints.map((point, index) => (
<BendingPointer
key={`${edge.id}-${index}`}
edgeId={edge.id}
point={point}
index={index}
onMove={(newPoint) =>
moveBendingPointer(edge.id, index, newPoint)
}
/>
))}
</>
))}
</Graph>
);
};
52 changes: 0 additions & 52 deletions apps/client/src/cloud-graph/components/Anchor.tsx

This file was deleted.

Loading
Loading