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

139
Views
obtener nodos para cytoscape.js de otro módulo js

Soy nuevo en JS y tengo un problema al usar cytoscape.js. Quiero obtener datos de una base de datos PG y, en base a eso, crear nodos. Sin embargo, no se muestran nondes. A continuación está mi código. ¿Alguien tiene algún consejo? ¡Muchas gracias!

 window.addEventListener("DOMContentLoaded", my_function); var data = []; let pg = import('./pg.js') let nodes = pg.my_nodes for (node in nodes){ if (node !== undefined && node !== []){ data.push(node) } } function my_function() { var cy = (window.cy = cytoscape({ container: document.getElementById("cy"), style: [{ selector: "node", style: { content: "data(id)" } }, { selector: "edge", style: { "curve-style": "bezier", "target-arrow-shape": "triangle" } } ], elements: { nodes: data, edges: [] }, layout: { name: "grid" } }));
about 4 years ago · Juan Pablo Isaza
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!