Gráficos e métricas

VFlowPath

Componente3 exemplos5 propsA2UI · FlowPath

Caminho de fluxo linear (agentes, serviços, etapas) com métricas na aresta. Em containers estreitos (< 34rem) vira vertical via container query. Slots: `node`, `edge`.

Importação
<script setup lang="ts">
import { VFlowPath } from 'vueui-nova-kit'
</script>

Uso

Exemplo
<VFlowPath :nodes="nodes" :edges="[{ status: 'success', metrics: [{ value: '188 ms', label: 'latency' }] }]" />

Playground

Os controles abaixo são gerados a partir das props declaradas em VFlowPath.types.ts; o código acompanha cada mudança.

Exemplos

Variantes, tamanhos e estados, extraídos das stories da biblioteca.

Default

Variação Padrão (Router → Billing).

Ver código
vue
<script setup lang="ts">
import { VFlowPath } from 'vueui-nova-kit'

const nodes = [
  {
    id: 'router',
    title: 'Router Agent',
    subtitle: 'sandy context · scope: admin',
  },
  {
    id: 'billing',
    title: 'Billing Agent',
    subtitle: 'accepted request · scope: admin',
  },
]
const edges = [
  {
    label: 'Handoff',
    status: 'success',
    metrics: [
      { value: '9.1 KB', label: 'context' },
      { value: '188 ms', label: 'latency' },
      { value: '1,904', label: 'tokens' },
      { value: '5 of 5', label: 'fields' },
    ],
  },
]
</script>

<template>
  <VFlowPath :nodes="nodes" :edges="edges" aria-label="Handoff path" />
</template>

Multi Hop Statuses

Variação Vários saltos com estados active, warning e error.

Ver código
vue
<script setup lang="ts">
import { VFlowPath } from 'vueui-nova-kit'

const nodes = [
  { id: 'in', title: 'Intake' },
  { id: 'router', title: 'Router' },
  { id: 'billing', title: 'Billing' },
  {
    id: 'ledger',
    title: 'Ledger',
    icon: {
      width: 24,
      height: 24,
      body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 4C20 5.1046 16.4184 6 12 6C7.5816 6 4 5.1046 4 4C4 2.8954 7.5816 2 12 2C16.4184 2 20 2.8954 20 4ZM4 4L4 20C4 21.1046 7.5816 22 12 22C16.4184 22 20 21.1046 20 20L20 4M4 12C4 13.1046 7.5816 14 12 14C16.4184 14 20 13.1046 20 12"/>',
    },
  },
]
const edges = [
  {
    status: 'active',
    metrics: [{ value: '42 ms', label: 'latency' }],
  },
  {
    status: 'warning',
    metrics: [{ value: '4 of 5', label: 'fields' }],
  },
  {
    status: 'error',
    metrics: [{ value: 'timeout', label: '30 s' }],
  },
]
</script>

<template>
  <VFlowPath :nodes="nodes" :edges="edges" aria-label="Handoff path" />
</template>

Narrow

Variação Container estreito: layout vertical automático.

Ver código
vue
<script setup lang="ts">
import { VFlowPath } from 'vueui-nova-kit'

const args = {
  nodes: [
    {
      id: 'router',
      title: 'Router Agent',
      subtitle: 'sandy context · scope: admin'
    },
    {
      id: 'billing',
      title: 'Billing Agent',
      subtitle: 'accepted request · scope: admin'
    }
  ],
  edges: [
    {
      label: 'Handoff',
      status: 'success',
      metrics: [
        {
          value: '9.1 KB',
          label: 'context'
        },
        {
          value: '188 ms',
          label: 'latency'
        },
        {
          value: '1,904',
          label: 'tokens'
        },
        {
          value: '5 of 5',
          label: 'fields'
        }
      ]
    }
  ],
  animated: true,
  ariaLabel: 'Handoff path'
}
</script>

<template>
  <div style="max-width:320px;"><VFlowPath v-bind="args" /></div>
</template>

Props

PropTipoDefaultDescrição
nodesVFlowNode[]——
edgesVFlowEdge[]—`edges[i]` connects `nodes[i]` → `nodes[i + 1]`.
animatedbooleantrueAnimated dash on `active` edges.
ariaLabelstring——
dataTestIdstring——

Events

Não emite eventos.

Slots

SlotProps do slot
#nodenodeindex
#edgeedgefromto

Fonte: src/components/data/VFlowPath/VFlowPath.vue · tipos: src/components/data/VFlowPath/VFlowPath.types.ts