Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
Why do Tooltips disappear when creating/destroy/creating a graph in Antv/G6

I am working with Vue 3 and antv/G6, and have an issue with tooltips disappearing when I draw a graph (with tooltips), destroy the graph, and redraw it. Here is a minimal working example. I only show the Vue code. I can provide the javascript code to manipulate the graph as well if needed. Any insights are appreciated.

<template>
  <div>
    <h2>Hello World</h2>
    <div id="mountGraph"></div>
  </div>
</template>

<script>
import * as dp from "../Composition/delayPropagationGraphImpl.js";
import G6 from "@antv/g6";
import { onMounted } from "vue";

export default {
  setup() {
    let graphCreated = false;
    let graph = false;

    const graphConfiguration = dp.setupConfiguration({
      container: "mountGraph",
      width: "800",
      height: "600",
      defaultNodeSize: 40,
    });

    function drawGraph() {
      const gNodes = [{ id: "1" }, { id: "2" }, { id: "3" }];
      const gEdges = [
        { source: "1", target: "2" },
        { source: "1", target: "3" },
      ];

      if (graphCreated) {
        graph.destroy();
      }
      graph = new G6.Graph(graphConfiguration); // ERROR
      graphCreated = true;

      const data = { nodes: gNodes, edges: gEdges };
      graph.data(data); // combines data and render
      graph.render();    
      return;
    }

    onMounted(() => {
      drawGraph();
      drawGraph();  // <<< Tooltiops disappear
    });
  },
};
</script>
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!