Skip to content

Commit 4399160

Browse files
committed
feat: enhance diagram overlay with navigation
1 parent abf26e8 commit 4399160

File tree

6 files changed

+252
-22
lines changed

6 files changed

+252
-22
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
},
1515
"dependencies": {
1616
"@radix-ui/colors": "^3.0.0",
17-
"likec4": "https://pkg.pr.new/likec4/likec4@6793aeb",
17+
"likec4": "https://pkg.pr.new/likec4/likec4@82cb4e5",
1818
"react": "^19.1.1",
1919
"react-dom": "^19.1.1",
2020
"react-use": "^17.6.0",
21-
"roughjs": "^4.6.6"
21+
"roughjs": "^4.6.6",
22+
"@xyflow/react": "12.8.4",
23+
"@xyflow/system": "0.0.68"
2224
},
2325
"devDependencies": {
2426
"@types/react": "^19.1.13",

pnpm-lock.yaml

Lines changed: 201 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/App.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
import { ReactLikeC4 } from 'likec4:react'
33
import { useHash } from 'react-use'
4+
import injectStyles from './App.css?inline'
45
import { ElementNode } from './CustomNodes'
56
import { CustomOverlay } from './CustomOverlay'
67
import { useCustomOverlay } from './context'
7-
import injectStyles from './App.css?inline'
88

99

1010
function App() {
@@ -18,6 +18,12 @@ function App() {
1818
colorScheme='dark'
1919
viewId={viewId}
2020
controls
21+
fitViewPadding={{
22+
top: '80px',
23+
left: '30px',
24+
right: '30px',
25+
bottom: '30px',
26+
}}
2127
background='dots'
2228
enableElementDetails
2329
enableFocusMode

src/CustomNodes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const ElementNode = elementNode(({ nodeModel, nodeProps }) => {
5050
data-likec4-color={nodeProps.data.color}
5151
// ❇️ This is a class from styles.css
5252
// injected in the shadow DOM
53-
className='node-toolbar '
53+
className='node-toolbar'
5454
>
5555
<div style={{ fontSize: 24 }}>🛠️</div>
5656
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>

0 commit comments

Comments
 (0)