diff --git a/docs/components/home/Additional.vue b/docs/components/home/Additional.vue
index 32b02eaa..32474a01 100644
--- a/docs/components/home/Additional.vue
+++ b/docs/components/home/Additional.vue
@@ -1,96 +1,94 @@
-
+
@@ -101,13 +99,10 @@ onPaneReady((i) => emit('pane', i))
Additional Components
- Vue Flow includes a MiniMap, Controls and Background, as well as a ton of utilities and a supercharged
- composable to control the internal state
- outside the Vue Flow component.
+ Vue Flow includes a MiniMap, Controls and Background, as well as a ton of utilities and a supercharged composable to
+ control the internal state outside the Vue Flow component.
-
- Documentation
-
+
Documentation
diff --git a/docs/components/home/Home.vue b/docs/components/home/Home.vue
index 5b971989..219d1db4 100644
--- a/docs/components/home/Home.vue
+++ b/docs/components/home/Home.vue
@@ -5,7 +5,7 @@ import BoxNode from './nodes/Box.vue'
const breakpoints = useBreakpoints(breakpointsTailwind)
-const { dimensions, instance, onPaneReady, getNodes, getNode } = useVueFlow({
+const { dimensions, instance, onPaneReady, getNodes, getNode, getEdge, updateEdge, edges } = useVueFlow({
nodes: [
{ id: 'intro', type: 'box', position: { x: 0, y: 0 } },
{ id: 'examples', type: 'box', position: { x: -50, y: 400 } },
@@ -37,19 +37,77 @@ const { dimensions, instance, onPaneReady, getNodes, getNode } = useVueFlow({
zoomOnScroll: false,
})
+const init = ref(false)
+const edgeId = ref('eintro-documentation')
onPaneReady(({ fitView }) => {
fitView({
nodes: ['intro', 'examples', 'documentation'],
duration: 1500,
})
- setTimeout(() => {
- watch([breakpoints.sm, breakpoints.md, breakpoints.lg, breakpoints.xl, breakpoints['2xl']], () =>
- setTimeout(() => {
- instance.value?.fitView()
- }, 5),
- )
- }, 1500)
+ watch(
+ [breakpoints.sm, breakpoints.md, breakpoints.lg, breakpoints.xl, breakpoints['2xl']],
+ () => {
+ if (breakpoints.isSmaller('md')) {
+ nextTick(() => {
+ getNodes.value.forEach((node) => {
+ switch (node.id) {
+ case 'intro':
+ node.position = { x: 0, y: -50 }
+ break
+ case 'examples':
+ node.position = { x: getNode.value('intro')!.dimensions.width / 2 - node.dimensions.width / 2, y: 300 }
+ break
+ case 'documentation':
+ node.position = { x: getNode.value('intro')!.dimensions.width / 2 - node.dimensions.width / 2, y: 500 }
+ break
+ }
+ })
+
+ const newEdge = updateEdge(getEdge.value(edgeId.value)!, {
+ source: 'examples',
+ target: 'documentation',
+ sourceHandle: null,
+ targetHandle: null,
+ })
+ if (newEdge) edgeId.value = newEdge.id
+ })
+ } else {
+ nextTick(() => {
+ getNodes.value.forEach((node) => {
+ switch (node.id) {
+ case 'intro':
+ node.position = { x: 0, y: 0 }
+ break
+ case 'examples':
+ node.position = { x: -node.dimensions.width / 2, y: 400 }
+ break
+ case 'documentation':
+ node.position = { x: getNode.value('intro')!.dimensions.width / 2 + node.dimensions.width / 2, y: 400 }
+ break
+ }
+ })
+
+ const newEdge = updateEdge(getEdge.value(edgeId.value)!, {
+ source: 'intro',
+ target: 'documentation',
+ sourceHandle: null,
+ targetHandle: null,
+ })
+ if (newEdge) edgeId.value = newEdge.id
+ })
+ }
+
+ setTimeout(
+ () => {
+ if (!init.value) init.value = true
+ instance.value?.fitView()
+ },
+ init.value ? 5 : 1505,
+ )
+ },
+ { immediate: true },
+ )
})
@@ -73,14 +131,12 @@ onPaneReady(({ fitView }) => {
Read The Documentation
-
-
diff --git a/docs/components/home/Nested.vue b/docs/components/home/Nested.vue
index 6d12f68a..aca2fab7 100644
--- a/docs/components/home/Nested.vue
+++ b/docs/components/home/Nested.vue
@@ -1,42 +1,47 @@
@@ -44,16 +49,13 @@ onPaneReady((i) => emit('pane', i))
Nested- & Subflows
-
- Vue Flow comes with built-in support for nested nodes and nested flows.
-
-
- Documentation
-
+
Vue Flow comes with built-in support for nested nodes and nested flows.
+
Documentation
+ class="w-full h-[300px] md:min-h-[400px] shadow-xl rounded-xl font-mono uppercase border-1 border-green-500 overflow-hidden"
+ >
diff --git a/docs/components/home/RGB.vue b/docs/components/home/RGB.vue
index cc5fb3b2..c045b6f3 100644
--- a/docs/components/home/RGB.vue
+++ b/docs/components/home/RGB.vue
@@ -1,19 +1,11 @@
+ :style="{ borderColor: `rgb(${color.red}, ${color.green}, ${color.blue})` }"
+ >
-
+
@@ -82,21 +88,21 @@ const nodeColor: MiniMapNodeFunc = (node: GraphNode) => {
-
-
+
+
Customizable
- You can create your own node and edge types or just pass a custom style.
- Implement custom UIs
- inside your nodes
- and add functionality to your edges.
+ You can create your own node and edge types or just pass a custom style. Implement custom UIs inside your nodes and add
+ functionality to your edges.
Documentation