Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge Label Example not Working #151

Closed
canerkoroglu opened this issue Jun 5, 2024 · 1 comment
Closed

Edge Label Example not Working #151

canerkoroglu opened this issue Jun 5, 2024 · 1 comment

Comments

@canerkoroglu
Copy link

canerkoroglu commented Jun 5, 2024

Hello, i've integrated grpah into my app successfully but i can't show edge labels correctly. Even basic code which is shared at below don't show the edge label. Where did i make mistake?

Screenshot 2024-06-05 at 17 05 02

`
<v-network-graph
:nodes="nodes"
:edges="edges"
:layouts="layouts"
:configs="configs"

<template #edge-label="{ edge, ...slotProps }">
  <v-edge-label :text="edge.label" align="center" vertical-align="above" v-bind="slotProps" />
</template>
<style scoped> .graph { width: 90%; margin: auto; height: 70vh; border: 1px dashed #999; border-radius: 10px; } </style> <script> import { defineConfigs } from "v-network-graph"; import * as vNG from "v-network-graph"; const nodes = { node1: { name: "Node 1" }, node2: { name: "Node 2" }, node3: { name: "Node 3" }, node4: { name: "Node 4" }, }; const edges = { edge1: { source: "node1", target: "node2", label: "1 Gbps" }, edge2: { source: "node2", target: "node3", label: "100 Mbps" }, edge3: { source: "node2", target: "node4", label: "100 Mbps" }, }; const configs = defineConfigs({ node: { label: { visible: false, }, }, }); const layouts = { nodes: { node1: { x: 0, y: 80 }, node2: { x: 200, y: 80 }, node3: { x: 360, y: 0 }, node4: { x: 360, y: 160 }, }, }; export default { name: "PageGraph.vue", components: { "v-network-graph": vNG.VNetworkGraph, }, data: () => ({ configs: configs, nodes: nodes, edges: edges, layouts: layouts }), } </script>`

after rendered config and area attributes couldnt populated automatically.

<v-edge-label data-v-05befdc2="" class="" text="ETH" edgeId="edge0" scale="1" config="[object Object]" area="[object Object]" align="center" test="1234" vertical-align="above"></v-edge-label>

@canerkoroglu
Copy link
Author

I've found the problem,

forgot to define v-edge-label component in main vue export:

components: { "app-header": AppHeader, "app-footer": AppFooter, "app-theme-settings": AppThemeSettings, "v-network-graph": vNG.VNetworkGraph, "v-edge-label": vNG.VEdgeLabel },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant