Files
windmill/frontend/src/lib/components/FlowGraphViewer.svelte
T
Faton RamadaniandRuben Fiszel 632bd18a2e use xyflow internally instead of svelvet for graph rendering (#4173)
* fix(frontend): wip

* fix(frontend): wip

* fix(frontend): fix while loops + theme

* fix(frontend): wip

* fix(frontend): wip

* fix(frontend): same view as before

* fix(frontend): wip

* fix(frontend): wip

* feat(frontend): flow status viewer

* fix(frontend): wip

* feat(frontend): migrate to xyflow

* feat(frontend): dataflow

* feat(frontend): clean up

* feat(frontend): clean up

* feat(frontend): clean up

* feat(frontend): fix min-height

* feat(frontend): clean up

* feat(frontend): add missing insert button for empty loops

* feat(frontend): Fix insert

* feat(frontend): Fix branch one

* feat(frontend): Support default branch for branch one

* feat(frontend): fix add and delete branches

* feat(frontend): Make the iterations menu work

* feat(frontend): Fix graph height in the flow status viewer

* feat(frontend): code improvement

* feat(frontend): add missing trigger

* feat(frontend): add support for triggers

* feat(frontend): fix move

* feat(frontend): fix No branch for branch one

* feat(frontend): fix light theme

* feat(frontend): fix build

* feat(frontend): remove dead code

* feat(frontend): fix move

* feat(frontend): fix vertical alignement

* feat(frontend): fix viewport

* feat(frontend): style fix

* feat(frontend): fix viewgraph

* feat(frontend): fix build

* feat(frontend): Fix node position

* feat(frontend): UI nits

* feat(frontend): UI nits

* feat(frontend): fix zoom level + fix insert button position

* feat(frontend): svelvet clean up

* feat(frontend): fix paste button position

* feat(frontend): clean up

* feat(frontend): migrate Decision Tree

* feat(frontend): clean up

* feat(frontend): add callback

* feat(frontend): migrate Decision Tree

* feat(frontend): fix build

* feat(frontend): fix branches

* feat(frontend): fix branches

* feat(frontend): fix insert

* feat(frontend): wip

* feat(frontend): done

* feat(frontend): done

* feat(frontend): fix reactivity

* feat(frontend): fix z-index issues

* feat(frontend): fix bg issue

* feat(frontend): fix border status

* add padding to flow height

* Update FlowGraphV2.svelte

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2024-08-19 09:17:56 +02:00

55 lines
1.3 KiB
Svelte

<script lang="ts">
import type { FlowModule, FlowValue } from '$lib/gen'
import { createEventDispatcher } from 'svelte'
import { twMerge } from 'tailwind-merge'
import FlowGraphViewerStep from './FlowGraphViewerStep.svelte'
import FlowGraphV2 from './graph/FlowGraphV2.svelte'
export let flow: {
summary: string
description?: string
value: FlowValue
schema?: any
}
export let overflowAuto = false
export let noSide = false
export let download = false
export let noGraph = false
export let stepDetail: FlowModule | string | undefined = undefined
const dispatch = createEventDispatcher()
</script>
<div class="grid grid-cols-3 w-full h-full">
{#if !noGraph}
<div
class="{noSide ? 'col-span-3' : 'sm:col-span-2 col-span-3'} w-full border max-h-full"
class:overflow-auto={overflowAuto}
>
<FlowGraphV2
{download}
minHeight={400}
modules={flow?.value?.modules}
failureModule={flow?.value?.failure_module}
on:select={(e) => {
stepDetail = e.detail
dispatch('select', stepDetail)
}}
/>
</div>
{/if}
{#if !noSide}
<div
class={twMerge(
'relative w-full h-full min-h-[150px] max-h-[90vh] border-r border-b border-t p-2 pt-0 overflow-auto hidden sm:flex flex-col gap-4',
noGraph ? 'border-0 w-max' : ''
)}
>
<FlowGraphViewerStep schema={flow.schema} {stepDetail} />
</div>
{/if}
</div>