Gráficos e métricas
VFlowPath
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`.
<script setup lang="ts">
import { VFlowPath } from 'vueui-nova-kit'
</script>Uso
<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
<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
<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
<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
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
nodes | VFlowNode[] | — | — |
edges | VFlowEdge[] | — | `edges[i]` connects `nodes[i]` → `nodes[i + 1]`. |
animated | boolean | true | Animated dash on `active` edges. |
ariaLabel | string | — | — |
dataTestId | string | — | — |
Events
Não emite eventos.
Slots
| Slot | Props do slot |
|---|---|
#node | nodeindex |
#edge | edgefromto |
Fonte: src/components/data/VFlowPath/VFlowPath.vue · tipos: src/components/data/VFlowPath/VFlowPath.types.ts