From caf874dd49a8790176105f0c7c3d81030ec7fb56 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 8 Feb 2024 19:19:04 +0100 Subject: [PATCH] chore(docs): put all actions into single panel --- docs/examples/layout/AnimationEdge.vue | 11 +--- docs/examples/layout/App.vue | 74 ++++++++++++++++++++------ docs/examples/layout/ProcessNode.vue | 5 +- docs/examples/layout/useRunProcess.js | 12 +++-- 4 files changed, 66 insertions(+), 36 deletions(-) diff --git a/docs/examples/layout/AnimationEdge.vue b/docs/examples/layout/AnimationEdge.vue index d81a4468..1fc98c63 100644 --- a/docs/examples/layout/AnimationEdge.vue +++ b/docs/examples/layout/AnimationEdge.vue @@ -60,8 +60,6 @@ const sourceNodeData = toRef(() => nodesData.value[1]) const isFinished = toRef(() => sourceNodeData.value.isFinished) -const isSkipped = toRef(() => targetNodeData.value.isSkipped) - const isAnimating = ref(false) const edgeColor = toRef(() => { @@ -86,14 +84,6 @@ const edgeColor = toRef(() => { const path = computed(() => getSmoothStepPath(props)) -watch(isSkipped, (isSkipped) => { - if (isSkipped) { - edgePoint.value = 0 - currentLength.value = 0 - isAnimating.value = false - } -}) - watch(isAnimating, (isAnimating) => { const edge = findEdge(props.id) @@ -192,6 +182,7 @@ export default { .truck { position: relative; display: inline-block; + transform: scaleX(-1); } .box { diff --git a/docs/examples/layout/App.vue b/docs/examples/layout/App.vue index 0fdf6f1d..02d655f1 100644 --- a/docs/examples/layout/App.vue +++ b/docs/examples/layout/App.vue @@ -15,7 +15,9 @@ const edges = ref(initialEdges) const dagreGraph = ref(new dagre.graphlib.Graph()) -const { run, stop, isRunning } = useRunProcess(dagreGraph) +const cancelOnError = ref(true) + +const { run, stop, isRunning } = useRunProcess({ dagreGraph, cancelOnError }) const { findNode, fitView } = useVueFlow() @@ -82,14 +84,35 @@ function handleLayout(direction) { - - - - - - - +
+ + + + + +
+ +
+ + +
@@ -108,31 +131,48 @@ function handleLayout(direction) { gap: 10px; } +.process-panel { + background-color: #2d3748; + padding: 10px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); + display: flex; + flex-direction: column; +} + .process-panel button, .layout-panel button { border: none; - padding: 10px; cursor: pointer; - background-color: #2d3748; + background-color: #4a5568; border-radius: 8px; color: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); } .process-panel button { - font-size: 24px; - width: 50px; - height: 50px; + font-size: 16px; + width: 40px; + height: 40px; + display: flex; + align-items: center; + justify-content: center; +} + +.checkbox-panel { + display: flex; + align-items: center; + gap: 10px; } .process-panel button:hover, .layout-panel button:hover { - background-color: #4b5563; + background-color: #2563eb; transition: background-color 0.2s; } -.process-panel button:disabled { - background-color: #4b5563; - cursor: not-allowed; +.process-panel label { + color: white; + font-size: 12px; } diff --git a/docs/examples/layout/ProcessNode.vue b/docs/examples/layout/ProcessNode.vue index be5e1748..46522446 100644 --- a/docs/examples/layout/ProcessNode.vue +++ b/docs/examples/layout/ProcessNode.vue @@ -74,9 +74,7 @@ const processLabel = toRef(() => {